From 33c282051bf892c15fb87d3c487df569770e9acc Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Mon, 8 Apr 2024 22:25:07 -0400 Subject: [PATCH] Fix Formatting issues Signed-off-by: Dave Richer --- client/src/App/App.jsx | 30 +- .../bills-list-table.component.jsx | 126 +++--- .../components/header/header.component.jsx | 389 +++++++++--------- .../job-lines-expander.component.jsx | 142 +++---- .../job-detail-lines/job-lines.component.jsx | 29 +- .../job-search-select.component.jsx | 69 ++-- .../job-totals.table.totals.component.jsx | 3 +- .../jobs-detail-header-actions.component.jsx | 339 +++++++-------- .../jobs-list-paginated.component.jsx | 60 +-- .../jobs-list/jobs-list.component.jsx | 91 ++-- .../parts-order-list-table.component.jsx | 196 ++++----- .../task-list/task-list.component.jsx | 325 ++++++++------- .../task-list/task-list.container.jsx | 146 +++---- .../task-upsert-modal.component.jsx | 176 ++++---- .../task-upsert-modal.container.jsx | 229 +++++------ client/src/graphql/bills.queries.js | 2 +- client/src/graphql/jobs.queries.js | 36 +- client/src/graphql/tasks.queries.js | 126 +++--- .../jobs-detail.page.component.jsx | 264 ++++++------ .../pages/manage/manage.page.component.jsx | 302 +++++++------- .../src/pages/tasks/allTasksPageContainer.jsx | 65 ++- .../src/pages/tasks/myTasksPageContainer.jsx | 41 +- client/src/pages/tasks/taskPageTypes.jsx | 4 +- .../src/pages/tasks/tasks.page.component.jsx | 33 +- client/src/redux/modals/modals.reducer.js | 2 +- client/src/translations/en_us/common.json | 88 ++-- client/src/translations/es/common.json | 86 ++-- client/src/translations/fr/common.json | 86 ++-- client/src/utils/AuditTrailMappings.js | 58 +-- client/src/utils/undefinedtonull.js | 2 +- package-lock.json | 16 + package.json | 1 + server/email/generateTemplate.js | 29 +- server/email/sendemail.js | 34 +- 34 files changed, 1805 insertions(+), 1820 deletions(-) diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx index 56a3e5f19..50bde585a 100644 --- a/client/src/App/App.jsx +++ b/client/src/App/App.jsx @@ -147,23 +147,19 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline /> } > - { - import.meta.env.PRODUCT_FRUITS_DISABLED !== 'true' && ( - - ) - } + ({ - setBillEnterContext: (context) => dispatch(setModalContext({ - context: context, - modal: "billEnter" - })), - setReconciliationContext: (context) => dispatch(setModalContext({ - context: context, - modal: "reconciliation" - })), - setTaskUpsertContext: (context) => dispatch(setModalContext({context, modal: 'taskUpsert'})), + setBillEnterContext: (context) => + dispatch( + setModalContext({ + context: context, + modal: "billEnter" + }) + ), + setReconciliationContext: (context) => + dispatch( + setModalContext({ + context: context, + modal: "reconciliation" + }) + ), + setTaskUpsertContext: (context) => dispatch(setModalContext({ context, modal: "taskUpsert" })) }); export function BillsListTableComponent({ - bodyshop, - jobRO, - job, - billsQuery, - handleOnRowClick, - setBillEnterContext, - setReconciliationContext, - setTaskUpsertContext, - }) { - const {t} = useTranslation(); + bodyshop, + jobRO, + job, + billsQuery, + handleOnRowClick, + setBillEnterContext, + setReconciliationContext, + setTaskUpsertContext +}) { + const { t } = useTranslation(); const [state, setState] = useState({ sortedInfo: {} @@ -54,27 +60,29 @@ export function BillsListTableComponent({ const Templates = TemplateList("bill"); const bills = billsQuery.data ? billsQuery.data.bills : []; - const {refetch} = billsQuery; - + const { refetch } = billsQuery; const recordActions = (record, showView = false) => ( {showView && ( )} - - + )} @@ -129,7 +137,7 @@ export function BillsListTableComponent({ key: "is_credit_memo", sorter: (a, b) => a.is_credit_memo - b.is_credit_memo, sortOrder: state.sortedInfo.columnKey === "is_credit_memo" && state.sortedInfo.order, - render: (text, record) => + render: (text, record) => }, { title: t("bills.fields.exported"), @@ -137,7 +145,7 @@ export function BillsListTableComponent({ key: "exported", sorter: (a, b) => a.exported - b.exported, sortOrder: state.sortedInfo.columnKey === "exported" && state.sortedInfo.order, - render: (text, record) => + render: (text, record) => }, { title: t("general.labels.actions"), @@ -148,18 +156,18 @@ export function BillsListTableComponent({ ]; const handleTableChange = (pagination, filters, sorter) => { - setState({...state, filteredInfo: filters, sortedInfo: sorter}); + setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); }; const filteredBills = bills ? searchText === "" ? bills : bills.filter( - (b) => - (b.invoice_number || "").toLowerCase().includes(searchText.toLowerCase()) || - (b.vendor.name || "").toLowerCase().includes(searchText.toLowerCase()) || - (b.total || "").toString().toLowerCase().includes(searchText.toLowerCase()) - ) + (b) => + (b.invoice_number || "").toLowerCase().includes(searchText.toLowerCase()) || + (b.vendor.name || "").toLowerCase().includes(searchText.toLowerCase()) || + (b.total || "").toString().toLowerCase().includes(searchText.toLowerCase()) + ) : []; return ( @@ -168,14 +176,14 @@ export function BillsListTableComponent({ extra={ {job && job.converted ? ( <> - - - + + - - + + @@ -283,10 +277,10 @@ export function JobsDetailPage({ return (
- - - - + + + +
- - - - + + + + history({search: `?tab=${key}`})} - tabBarStyle={{fontWeight: "bold", borderBottom: "10px"}} + onChange={(key) => history({ search: `?tab=${key}` })} + tabBarStyle={{ fontWeight: "bold", borderBottom: "10px" }} items={[ { key: "general", - icon: , + icon: , label: t("menus.jobsdetail.general"), forceRender: true, - children: + children: }, { key: "repairdata", - icon: , + icon: , label: t("menus.jobsdetail.repairdata"), forceRender: true, - children: + children: }, { key: "rates", - icon: , + icon: , label: t("menus.jobsdetail.rates"), forceRender: true, - children: + children: }, { key: "totals", - icon: , + icon: , label: t("menus.jobsdetail.totals"), - children: + children: }, { key: "partssublet", - icon: , - label: HasFeatureAccess({featureName: "bills", bodyshop}) + icon: , + label: HasFeatureAccess({ featureName: "bills", bodyshop }) ? t("menus.jobsdetail.partssublet") : t("menus.jobsdetail.parts"), - children: + children: }, ...(InstanceRenderManager({ imex: true, rome: true, - promanager: HasFeatureAccess({featureName: "timetickets", bodyshop}) + promanager: HasFeatureAccess({ featureName: "timetickets", bodyshop }) }) ? [ - { - key: "labor", - icon: , - label: t("menus.jobsdetail.labor"), - children: - } - ] + { + key: "labor", + icon: , + label: t("menus.jobsdetail.labor"), + children: + } + ] : []), { key: "lifecycle", - icon: , + icon: , label: t("menus.jobsdetail.lifecycle"), - children: + children: }, { key: "dates", - icon: , + icon: , label: t("menus.jobsdetail.dates"), forceRender: true, - children: + children: }, ...(InstanceRenderManager({ imex: true, rome: true, - promanager: HasFeatureAccess({featureName: "media", bodyshop}) + promanager: HasFeatureAccess({ featureName: "media", bodyshop }) }) ? [ - { - key: "documents", - icon: , - label: t("jobs.labels.documents"), - children: bodyshop.uselocalmediaserver ? ( - - ) : ( - - ) - } - ] + { + key: "documents", + icon: , + label: t("jobs.labels.documents"), + children: bodyshop.uselocalmediaserver ? ( + + ) : ( + + ) + } + ] : []), { key: "notes", - icon: , + icon: , label: t("jobs.labels.notes"), - children: + children: }, { key: "audit", - icon: , + icon: , label: t("jobs.labels.audit"), - children: + children: }, { - key: 'tasks', - icon: , - label: - {t("jobs.labels.tasks")}{job.tasks_aggregate.aggregate.count > 0 && - } - , - children: - }, + key: "tasks", + icon: , + label: ( + + {t("jobs.labels.tasks")} + {job.tasks_aggregate.aggregate.count > 0 && } + + ), + children: ( + + ) + } ]} /> @@ -424,7 +426,7 @@ export function JobsDetailPage({ export default connect(mapStateToProps, mapDispatchToProps)(JobsDetailPage); const transformJobToForm = (job) => { - const transformedJob = {...job}; + const transformedJob = { ...job }; transformedJob.parts_tax_rates = Object.keys(transformedJob.parts_tax_rates).reduce((acc, parttype) => { acc[parttype] = Object.keys(transformedJob.parts_tax_rates[parttype]).reduce((innerAcc, key) => { diff --git a/client/src/pages/manage/manage.page.component.jsx b/client/src/pages/manage/manage.page.component.jsx index 476642332..d0f5ffeb4 100644 --- a/client/src/pages/manage/manage.page.component.jsx +++ b/client/src/pages/manage/manage.page.component.jsx @@ -1,10 +1,10 @@ -import {Button, Collapse, FloatButton, Layout, Space, Spin, Tag} from "antd"; +import { Button, Collapse, FloatButton, Layout, Space, Spin, Tag } from "antd"; // import preval from "preval.macro"; -import React, {lazy, Suspense, useEffect, useState} from "react"; -import {useTranslation} from "react-i18next"; -import {connect} from "react-redux"; -import {Link, Route, Routes} from "react-router-dom"; -import {createStructuredSelector} from "reselect"; +import React, { lazy, Suspense, useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { Link, Route, Routes } from "react-router-dom"; +import { createStructuredSelector } from "reselect"; import BreadCrumbs from "../../components/breadcrumbs/breadcrumbs.component"; import ChatAffixContainer from "../../components/chat-affix/chat-affix.container"; import ConflictComponent from "../../components/conflict/conflict.component"; @@ -17,26 +17,21 @@ import TestComponent from "../../components/_test/test.page"; import HeaderContainer from "../../components/header/header.container"; import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component"; import PartnerPingComponent from "../../components/partner-ping/partner-ping.component"; -import PrintCenterModalContainer - from "../../components/print-center-modal/print-center-modal.container"; +import PrintCenterModalContainer from "../../components/print-center-modal/print-center-modal.container"; import ShopSubStatusComponent from "../../components/shop-sub-status/shop-sub-status.component"; -import {requestForToken} from "../../firebase/firebase.utils"; -import {selectBodyshop, selectInstanceConflict} from "../../redux/user/user.selectors"; +import { requestForToken } from "../../firebase/firebase.utils"; +import { selectBodyshop, selectInstanceConflict } from "../../redux/user/user.selectors"; import UpdateAlert from "../../components/update-alert/update-alert.component"; -import {setJoyRideFinished} from "../../redux/application/application.actions.js"; -import { - selectEnableJoyRide, - selectJoyRideSteps -} from "../../redux/application/application.selectors.js"; +import { setJoyRideFinished } from "../../redux/application/application.actions.js"; +import { selectEnableJoyRide, selectJoyRideSteps } from "../../redux/application/application.selectors.js"; import InstanceRenderManager from "../../utils/instanceRenderMgr.js"; import "./manage.page.styles.scss"; - const JobsPage = lazy(() => import("../jobs/jobs.page")); -const CardPaymentModalContainer = lazy(() => - import("../../components/card-payment-modal/card-payment-modal.container.") +const CardPaymentModalContainer = lazy( + () => import("../../components/card-payment-modal/card-payment-modal.container.") ); const JobsDetailPage = lazy(() => import("../jobs-detail/jobs-detail.page.container")); @@ -64,8 +59,8 @@ const JobCostingModal = lazy(() => import("../../components/job-costing-modal/jo const ReportCenterModal = lazy(() => import("../../components/report-center-modal/report-center-modal.container")); const BillEnterModalContainer = lazy(() => import("../../components/bill-enter-modal/bill-enter-modal.container")); const TimeTicketModalContainer = lazy(() => import("../../components/time-ticket-modal/time-ticket-modal.container")); -const TimeTicketModalTask = lazy(() => - import("../../components/time-ticket-task-modal/time-ticket-task-modal.container") +const TimeTicketModalTask = lazy( + () => import("../../components/time-ticket-task-modal/time-ticket-task-modal.container") ); const PaymentModalContainer = lazy(() => import("../../components/payment-modal/payment-modal.container")); const ProductionListPage = lazy(() => import("../production-list/production-list.container")); @@ -106,7 +101,7 @@ const MyTasksPage = lazy(() => import("../tasks/myTasksPageContainer.jsx")); const AllTasksPage = lazy(() => import("../tasks/allTasksPageContainer.jsx")); const TaskUpsertModalContainer = lazy(() => import("../../components/task-upsert-modal/task-upsert-modal.container")); -const {Content, Footer} = Layout; +const { Content, Footer } = Layout; const mapStateToProps = createStructuredSelector({ conflict: selectInstanceConflict, @@ -119,8 +114,8 @@ const mapDispatchToProps = (dispatch) => ({ setJoyRideFinished: (steps) => dispatch(setJoyRideFinished(steps)) }); -export function Manage({conflict, bodyshop, enableJoyRide, joyRideSteps, setJoyRideFinished}) { - const {t} = useTranslation(); +export function Manage({ conflict, bodyshop, enableJoyRide, joyRideSteps, setJoyRideFinished }) { + const { t } = useTranslation(); const [chatVisible] = useState(false); const [tours, setTours] = useState([]); @@ -156,264 +151,266 @@ export function Manage({conflict, bodyshop, enableJoyRide, joyRideSteps, setJoyR /> } > - + - - - - - - - - - - + + + + + + + + + + - }/> - }/> + } /> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - - } + }> + + + } /> }> - - } + }> + + + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> @@ -426,16 +423,16 @@ export function Manage({conflict, bodyshop, enableJoyRide, joyRideSteps, setJoyR }> - + }> + } /> }> - + }> + } /> @@ -443,8 +440,8 @@ export function Manage({conflict, bodyshop, enableJoyRide, joyRideSteps, setJoyR }> - + }> + } /> @@ -452,56 +449,56 @@ export function Manage({conflict, bodyshop, enableJoyRide, joyRideSteps, setJoyR }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> @@ -509,65 +506,65 @@ export function Manage({conflict, bodyshop, enableJoyRide, joyRideSteps, setJoyR }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> - }/> + } /> }> - + }> + } /> }> - + }> + } /> }> - + }> + } /> @@ -577,16 +574,16 @@ export function Manage({conflict, bodyshop, enableJoyRide, joyRideSteps, setJoyR let PageContent; - if (conflict) PageContent = ; - else if (bodyshop && bodyshop.sub_status !== "active") PageContent = ; + if (conflict) PageContent = ; + else if (bodyshop && bodyshop.sub_status !== "active") PageContent = ; else PageContent = AppRouteTable; return ( <> - - - - + + + + - - } showDialog> + + } showDialog> {PageContent} - +