From 15bf129b6ead37dfdb3c11749dc1cdce83fc1b8a Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 10 May 2021 16:51:33 -0700 Subject: [PATCH] IO-1066 IO-1073 Minor UI fixes. --- bodyshop_translations.babel | 21 ++++++++ .../form-date-picker.component.jsx | 8 ++- .../job-totals-table.component.jsx | 51 ++++++++++--------- .../job-totals.table.labor.component.jsx | 6 +-- .../parts-order-modal.component.jsx | 2 +- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + client/src/utils/TemplateConstants.js | 8 +++ 9 files changed, 70 insertions(+), 29 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index fe2aab811..f29e1a38f 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -28970,6 +28970,27 @@ + + thank_you_ro + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + thirdpartypayer false diff --git a/client/src/components/form-date-picker/form-date-picker.component.jsx b/client/src/components/form-date-picker/form-date-picker.component.jsx index ae2ee746e..f485debfe 100644 --- a/client/src/components/form-date-picker/form-date-picker.component.jsx +++ b/client/src/components/form-date-picker/form-date-picker.component.jsx @@ -5,7 +5,10 @@ import React, { forwardRef } from "react"; const dateFormat = "MM/DD/YYYY"; -const FormDatePicker = ({ value, onChange, onBlur, ...restProps }, ref) => { +const FormDatePicker = ( + { value, onChange, onBlur, onlyFuture, ...restProps }, + ref +) => { const handleChange = (newDate) => { if (value !== newDate && onChange) { onChange(newDate); @@ -28,6 +31,9 @@ const FormDatePicker = ({ value, onChange, onBlur, ...restProps }, ref) => { format={dateFormat} onBlur={onBlur} disabledTime + {...(onlyFuture && { + disabledDate: (d) => moment().subtract(1, "day").isAfter(d), + })} {...restProps} /> 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 d021fbecd..ecfd6bccc 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 @@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectJobReadOnly } from "../../redux/application/application.selectors"; +import { selectCurrentUser } from "../../redux/user/user.selectors"; import JobCalculateTotals from "../job-calculate-totals/job-calculate-totals.component"; import "./job-totals-table.styles.scss"; import JobTotalsTableLabor from "./job-totals.table.labor.component"; @@ -14,7 +15,7 @@ import JobTotalsTableParts from "./job-totals.table.parts.component"; import JobTotalsTableTotals from "./job-totals.table.totals.component"; const mapStateToProps = createStructuredSelector({ - //currentUser: selectCurrentUser + currentUser: selectCurrentUser, jobRO: selectJobReadOnly, }); @@ -23,7 +24,7 @@ const colSpan = { lg: { span: 12 }, }; -export function JobsTotalsTableComponent({ jobRO, job }) { +export function JobsTotalsTableComponent({ jobRO, currentUser, job }) { const { t } = useTranslation(); if (!!!job.job_totals) { @@ -66,28 +67,30 @@ export function JobsTotalsTableComponent({ jobRO, 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
-                        )}
-                      
-
-
-
-
- + {currentUser.email.includes("@imex.") && ( + + + + + +
+
+                          {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/job-totals-table/job-totals.table.labor.component.jsx b/client/src/components/job-totals-table/job-totals.table.labor.component.jsx index deecf7404..76c897ea7 100644 --- a/client/src/components/job-totals-table/job-totals.table.labor.component.jsx +++ b/client/src/components/job-totals-table/job-totals.table.labor.component.jsx @@ -110,7 +110,7 @@ export default function JobTotalsTableLabor({ job }) { {( job.job_totals.rates.mapa.hours + job.job_totals.rates.mash.hours - ).toFixed(2)} + ).toFixed(1)} @@ -126,7 +126,7 @@ export default function JobTotalsTableLabor({ job }) { - {job.job_totals.rates.mapa.hours.toFixed(2)} + {job.job_totals.rates.mapa.hours.toFixed(1)} {Dinero(job.job_totals.rates.mapa.total).toFormat()} @@ -140,7 +140,7 @@ export default function JobTotalsTableLabor({ job }) { - {job.job_totals.rates.mash.hours.toFixed(2)} + {job.job_totals.rates.mash.hours.toFixed(1)} {Dinero(job.job_totals.rates.mash.total).toFormat()} diff --git a/client/src/components/parts-order-modal/parts-order-modal.component.jsx b/client/src/components/parts-order-modal/parts-order-modal.component.jsx index c3c51aae4..81c289d95 100644 --- a/client/src/components/parts-order-modal/parts-order-modal.component.jsx +++ b/client/src/components/parts-order-modal/parts-order-modal.component.jsx @@ -51,7 +51,7 @@ export default function PartsOrderModalComponent({ ]} label={t("parts_orders.fields.deliver_by")} > - + {job && job.special_coverage_policy && ( diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 371c52990..e9b0f701b 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1731,6 +1731,7 @@ "qc_sheet": "Quality Control Sheet", "ro_with_description": "RO Summary with Descriptions", "supplement_request": "Supplement Request", + "thank_you_ro": "Thank You Letter", "thirdpartypayer": "Third Party Payer", "vehicle_check_in": "Vehicle Intake", "vehicle_delivery_check": "Vehicle Delivery Checklist", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 682501867..b5324b7d6 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1731,6 +1731,7 @@ "qc_sheet": "", "ro_with_description": "", "supplement_request": "", + "thank_you_ro": "", "thirdpartypayer": "", "vehicle_check_in": "", "vehicle_delivery_check": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index a9c15d48c..ddbc4deb9 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1731,6 +1731,7 @@ "qc_sheet": "", "ro_with_description": "", "supplement_request": "", + "thank_you_ro": "", "thirdpartypayer": "", "vehicle_check_in": "", "vehicle_delivery_check": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 7f8c7b8ed..72fb5952a 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -288,6 +288,14 @@ export const TemplateList = (type, context) => { disabled: false, group: "ro", }, + thank_you_ro: { + title: i18n.t("printcenter.jobs.thank_you_ro"), + description: "Thank You Letter by RO", + key: "thank_you_ro", + subject: i18n.t("printcenter.jobs.thank_you_ro"), + disabled: false, + group: "post", + }, } : {}), ...(!type || type === "job_special"