diff --git a/client/src/components/error-boundary/error-boundary.component.jsx b/client/src/components/error-boundary/error-boundary.component.jsx index 13525d7fe..2cad0fbff 100644 --- a/client/src/components/error-boundary/error-boundary.component.jsx +++ b/client/src/components/error-boundary/error-boundary.component.jsx @@ -75,6 +75,22 @@ class ErrorBoundary extends React.Component { render() { const { t } = this.props; const { error, info } = this.state; + + const collapseItems = error + ? [ + { + key: "errors", + label: t("general.labels.errors"), + children: ( +
+ {error.message || "Unknown error"} +
{error.stack || "No stack trace available"}
+
+ ) + } + ] + : []; + if (this.state.hasErrored === true) { logImEXEvent("error_boundary_rendered", { error, info }); @@ -122,14 +138,7 @@ class ErrorBoundary extends React.Component { /> - - -
- {this.state.error.message} -
-
{this.state.error.stack}
-
-
+
diff --git a/client/src/components/job-close-ro-guard/job-close-ro-guard.container.jsx b/client/src/components/job-close-ro-guard/job-close-ro-guard.container.jsx index 6beffacb3..b1df44677 100644 --- a/client/src/components/job-close-ro-guard/job-close-ro-guard.container.jsx +++ b/client/src/components/job-close-ro-guard/job-close-ro-guard.container.jsx @@ -16,7 +16,6 @@ import InstanceRenderManager from "../../utils/instanceRenderMgr"; import JobCloseRoGuardTtLifecycle from "./job-close-ro-guard.tt-lifecycle"; const mapStateToProps = createStructuredSelector({ - //currentUser: selectCurrentUser bodyshop: selectBodyshop, jobRO: selectJobReadOnly }); @@ -40,34 +39,13 @@ export function JobCloseRoGuardContainer({ job, jobRO, bodyshop, form }) { if (!bodyshop?.md_ro_guard?.enabled) return null; - return ( - <> - {warnings.length > 0 && ( - - - {t("jobs.labels.roguardwarnings")} - - } - > - - - )} - - - + // Define collapse items for both panels + const collapseItems = [ + { + key: "roguard", + label: t("jobs.labels.roguard"), + children: ( + <> @@ -85,7 +63,6 @@ export function JobCloseRoGuardContainer({ job, jobRO, bodyshop, form }) { {InstanceRenderManager({ rome: ( - {/* */} ) @@ -214,16 +191,50 @@ export function JobCloseRoGuardContainer({ job, jobRO, bodyshop, form }) { > } type="password" placeholder="Password" disabled={jobRO} /> - + + ), + forceRender: true // Preserve the forceRender prop from the original + }, + { + key: "performance", + label: t("jobs.labels.performance"), + children: ( + + + + + + ) + } + ]; - - - - - - - - + return ( + <> + {warnings.length > 0 && ( + + + {t("jobs.labels.roguardwarnings")} + + } + > + + + )} + + ); } diff --git a/client/src/components/job-totals-table/job-totals-table.component.jsx b/client/src/components/job-totals-table/job-totals-table.component.jsx index e475ef5fd..5ffeab91d 100644 --- a/client/src/components/job-totals-table/job-totals-table.component.jsx +++ b/client/src/components/job-totals-table/job-totals-table.component.jsx @@ -27,7 +27,7 @@ const colSpan = { export function JobsTotalsTableComponent({ jobRO, currentUser, job }) { const { t } = useTranslation(); - if (!!!job.job_totals) { + if (!job.job_totals) { return ( } /> @@ -35,6 +35,29 @@ export function JobsTotalsTableComponent({ jobRO, currentUser, job }) { ); } + // Define collapse items + const collapseItems = [ + { + key: "json-tree-totals", + label: "JSON Tree Totals", + children: ( +
+
+            {JSON.stringify(
+              {
+                CIECA: job.cieca_ttl && job.cieca_ttl.data,
+                CIECASTL: job.cieca_stl && job.cieca_stl.data,
+                ImEXCalc: job.job_totals
+              },
+              null,
+              2
+            )}
+          
+
+ ) + } + ]; + return (
@@ -68,23 +91,7 @@ export function JobsTotalsTableComponent({ jobRO, currentUser, job }) { - - -
-
-                          {JSON.stringify(
-                            {
-                              CIECA: job.cieca_ttl && job.cieca_ttl.data,
-                              CIECASTL: job.cieca_stl && job.cieca_stl.data,
-                              ImEXCalc: job.job_totals
-                            },
-                            null,
-                            2
-                          )}
-                        
-
-
-
+
)} diff --git a/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx b/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx index b34aba2b4..d16de8554 100644 --- a/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx +++ b/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx @@ -20,7 +20,6 @@ import JobsMarkPstExempt from "../jobs-mark-pst-exempt/jobs-mark-pst-exempt.comp import LayoutFormRow from "../layout-form-row/layout-form-row.component"; const mapStateToProps = createStructuredSelector({ - //currentUser: selectCurrentUser bodyshop: selectBodyshop }); const mapDispatchToProps = (dispatch) => ({ @@ -39,162 +38,175 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) { } }; - return ( -
- - - - - - - - - - - - - - - - - - - - - - - {t("jobs.fields.ins_ct_ln")} - - + // Define collapse items for all three panels + const collapseItems = [ + { + key: "insurance", + label: t("menus.jobsdetail.insurance"), + children: ( + + + + + + + + + + + + + + + + + + + + + {t("jobs.fields.ins_ct_ln")} + + + } + name="ins_ct_ln" + > + + + + + + PhoneItemFormatterValidation(getFieldValue, "ins_ph1")]} + > + + + - - - - - - PhoneItemFormatterValidation(getFieldValue, "ins_ph1")]} - > - - - - - - - - - - - - - - - - {t("jobs.fields.est_ct_fn")} - - + ]} + > + + + + + + + + + + sausage + + + {t("jobs.fields.est_ct_fn")} + + + } + name="est_ct_fn" + > + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ]} + > + + + + + + + + + + + + + + + + ), + forceRender: true + }, + { + key: "claim", + label: t("menus.jobsdetail.claimdetail"), + children: ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ), + forceRender: true + }, + { + key: "financial", + label: t("menus.jobsdetail.financials"), + children: ( + <> {InstanceRenderManager({ imex: @@ -315,8 +327,15 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) { - - + + ), + forceRender: true + } + ]; + + return ( +
+ {InstanceRenderManager({ rome: ( diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.labor.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.labor.component.jsx index b7a2dc861..d57321b6a 100644 --- a/client/src/components/jobs-detail-rates/jobs-detail-rates.labor.component.jsx +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.labor.component.jsx @@ -13,597 +13,605 @@ const mapStateToProps = createStructuredSelector({ export function JobsDetailRatesLabor({ jobRO, expanded, required = true, form }) { const { t } = useTranslation(); - return ( - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - ); + // Define collapse items + const collapseItems = [ + { + key: "cieca_pfl", + label: t("jobs.labels.cieca_pfl"), + children: ( + <> + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + ), + forceRender: true + } + ]; + + return ; } export default connect(mapStateToProps, null)(JobsDetailRatesLabor); diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.materials.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.materials.component.jsx index 2f7144022..dab228741 100644 --- a/client/src/components/jobs-detail-rates/jobs-detail-rates.materials.component.jsx +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.materials.component.jsx @@ -13,154 +13,162 @@ const mapStateToProps = createStructuredSelector({ export function JobsDetailRatesMaterials({ jobRO, expanded, required = true, form }) { const { t } = useTranslation(); - return ( - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - ); + // Define collapse items + const collapseItems = [ + { + key: "materials", + label: t("jobs.fields.materials.materials"), + children: ( + <> + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + ), + forceRender: true + } + ]; + + return ; } export default connect(mapStateToProps, null)(JobsDetailRatesMaterials); diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.other.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.other.component.jsx index f9788d08a..b8efd23cc 100644 --- a/client/src/components/jobs-detail-rates/jobs-detail-rates.other.component.jsx +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.other.component.jsx @@ -13,9 +13,12 @@ const mapStateToProps = createStructuredSelector({ export function JobsDetailRatesOther({ jobRO, expanded, required = true, form }) { const { t } = useTranslation(); - return ( - - + // Define collapse items + const collapseItems = [ + { + key: "cieca_pfo", + label: t("jobs.labels.cieca_pfo"), + children: ( - - - - ); + ), + forceRender: true + } + ]; + + return ; } export default connect(mapStateToProps, null)(JobsDetailRatesOther); diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.parts.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.parts.component.jsx index 39ac6946a..d3475126e 100644 --- a/client/src/components/jobs-detail-rates/jobs-detail-rates.parts.component.jsx +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.parts.component.jsx @@ -14,1006 +14,1110 @@ const mapStateToProps = createStructuredSelector({ export function JobsDetailRatesParts({ jobRO, expanded, required = true, form }) { const { t } = useTranslation(); - return ( - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {() => { - return ( - - - - ); - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {InstanceRenderManager({ imex: true, rome: false }) ? ( - <> - - - - - - {" "} - - ) : null} - - - - {InstanceRenderManager({ imex: true, rome: false }) ? ( - + // Define collapse items + const collapseItems = [ + { + key: "rates", + label: t("jobs.labels.parts_tax_rates"), + children: ( + <> + + - ) : null} - - - - - - - ); + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {InstanceRenderManager({ imex: true, rome: false }) ? ( + <> + + + + + + + + ) : null} + + + + {InstanceRenderManager({ imex: true, rome: false }) ? ( + + + + ) : null} + + + + + + ), + forceRender: true + } + ]; + + return ; } export default connect(mapStateToProps, null)(JobsDetailRatesParts); diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.taxes.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.taxes.component.jsx index 95d68b1f2..6aa7ff4ba 100644 --- a/client/src/components/jobs-detail-rates/jobs-detail-rates.taxes.component.jsx +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.taxes.component.jsx @@ -11,6 +11,9 @@ const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop }); +//If the panel doesn’t expand correctly due to the key mismatch, update the Collapse line to: +// + export function JobsDetailRatesTaxes({ jobRO, expanded, bodyshop, required = true, form }) { const { t } = useTranslation(); const formItems = []; @@ -47,13 +50,18 @@ export function JobsDetailRatesTaxes({ jobRO, expanded, bodyshop, required = tru ); } - return ( - - - {formItems} - - - ); + + // Define collapse items + const collapseItems = [ + { + key: "cieca_pft", + label: t("jobs.labels.cieca_pft"), + children: <>{formItems}, + forceRender: true + } + ]; + + return ; } export default connect(mapStateToProps, null)(JobsDetailRatesTaxes); diff --git a/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx b/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx index 13941cd08..e9c80daa8 100644 --- a/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx +++ b/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx @@ -36,6 +36,7 @@ export function ScheduleCalendarWrapperComponent({ const search = queryString.parse(useLocation().search); const history = useNavigate(); const { t } = useTranslation(); + const handleEventPropStyles = (event, start, end, isSelected) => { return { ...(event.color && !((search.view || defaultView) === "agenda") @@ -51,37 +52,41 @@ export function ScheduleCalendarWrapperComponent({ const selectedDate = new Date(date || dayjs(search.date) || Date.now()); + // Convert Collapse to use items prop + const collapseItems = [ + { + key: "1", + label: {t("appointments.labels.severalerrorsfound")}, + children: ( + + {problemJobs.map((problem) => ( + ]} + values={{ + ro_number: problem.ro_number, + code: problem.code + }} + /> + } + /> + ))} + + ) + } + ]; + return ( <> {HasFeatureAccess({ featureName: "smartscheduling", bodyshop }) && problemJobs && (problemJobs.length > 2 ? ( - - {t("appointments.labels.severalerrorsfound")}} - > - - {problemJobs.map((problem) => ( - ]} - values={{ - ro_number: problem.ro_number, - code: problem.code - }} - /> - } - /> - ))} - - - + ) : ( {problemJobs.map((problem) => ( @@ -119,7 +124,6 @@ export function ScheduleCalendarWrapperComponent({ history({ search: queryString.stringify(search) }); }} step={15} - // timeslots={1} showMultiDayTimes localizer={localizer} min={bodyshop.schedule_start_time ? new Date(bodyshop.schedule_start_time) : new Date("2020-01-01T06:00:00")}