From 86a2351316d6684e2592247930d9800219a0eea2 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 30 May 2023 17:23:22 -0700 Subject: [PATCH 1/3] IO-2233 Check for null and if stripped string is size 0 send null instead --- server/cdk/cdk-job-export.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server/cdk/cdk-job-export.js b/server/cdk/cdk-job-export.js index 674b33836..37f386876 100644 --- a/server/cdk/cdk-job-export.js +++ b/server/cdk/cdk-job-export.js @@ -728,9 +728,15 @@ async function InsertDmsVehicle(socket) { deliveryDate: moment() // .tz(socket.JobData.bodyshop.timezone) .format("YYYYMMDD"), - licensePlateNo: String(socket.JobData.plate_no) - .replace(/([^\w]|_)/g, "") - .toUpperCase(), + licensePlateNo: + socket.JobData.plate_no === null + ? null + : String(socket.JobData.plate_no).replace(/([^\w]|_)/g, "") + .length === 0 + ? null + : String(socket.JobData.plate_no) + .replace(/([^\w]|_)/g, "") + .toUpperCase(), make: socket.txEnvelope.dms_make, modelAbrev: socket.txEnvelope.dms_model, modelYear: socket.JobData.v_model_yr, From 38a13bd08227f27fed59485baa01caf9ef032750 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 30 May 2023 20:14:33 -0700 Subject: [PATCH 2/3] IO-2299 RBAC for Voiding File --- .../jobs-detail-header-actions.component.jsx | 95 ++++++++++--------- .../components/rbac-wrapper/rbac-defaults.js | 2 + .../shop-info/shop-info.rbac.component.jsx | 18 +++- client/src/translations/en_us/common.json | 3 +- client/src/translations/es/common.json | 3 +- client/src/translations/fr/common.json | 3 +- 6 files changed, 72 insertions(+), 52 deletions(-) diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx index 879fb7426..48118f1c0 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx @@ -29,6 +29,7 @@ import AddToProduction from "./jobs-detail-header-actions.addtoproduction.util"; import JobsDetaiLheaderCsi from "./jobs-detail-header-actions.csi.component"; import DuplicateJob from "./jobs-detail-header-actions.duplicate.util"; import JobsDetailHeaderActionsExportcustdataComponent from "./jobs-detail-header-actions.exportcustdata.component"; +import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -461,54 +462,56 @@ export function JobsDetailHeaderActions({ )} {!jobRO && job.converted && ( - - e.stopPropagation()} - onConfirm={async () => { - //delete the job. - const result = await voidJob({ - variables: { - jobId: job.id, - job: { - status: bodyshop.md_ro_statuses.default_void, - voided: true, - scheduled_in: null, - scheduled_completion: null, - inproduction: false, - }, - note: [ - { - jobid: job.id, - created_by: currentUser.email, - audit: true, - text: t("jobs.labels.voidnote"), + + + e.stopPropagation()} + onConfirm={async () => { + //delete the job. + const result = await voidJob({ + variables: { + jobId: job.id, + job: { + status: bodyshop.md_ro_statuses.default_void, + voided: true, + scheduled_in: null, + scheduled_completion: null, + inproduction: false, }, - ], - }, - }); + note: [ + { + jobid: job.id, + created_by: currentUser.email, + audit: true, + text: t("jobs.labels.voidnote"), + }, + ], + }, + }); - if (!!!result.errors) { - notification["success"]({ - message: t("jobs.successes.voided"), - }); - //go back to jobs list. - history.push(`/manage/`); - } else { - notification["error"]({ - message: t("jobs.errors.voiding", { - error: JSON.stringify(result.errors), - }), - }); - } - }} - getPopupContainer={(trigger) => trigger.parentNode} - > - {t("menus.jobsactions.void")} - - + if (!!!result.errors) { + notification["success"]({ + message: t("jobs.successes.voided"), + }); + //go back to jobs list. + history.push(`/manage/`); + } else { + notification["error"]({ + message: t("jobs.errors.voiding", { + error: JSON.stringify(result.errors), + }), + }); + } + }} + getPopupContainer={(trigger) => trigger.parentNode} + > + {t("menus.jobsactions.void")} + + + )} ); diff --git a/client/src/components/rbac-wrapper/rbac-defaults.js b/client/src/components/rbac-wrapper/rbac-defaults.js index 1c2a779c4..24a564872 100644 --- a/client/src/components/rbac-wrapper/rbac-defaults.js +++ b/client/src/components/rbac-wrapper/rbac-defaults.js @@ -26,6 +26,8 @@ const ret = { "jobs:partsqueue": 4, "jobs:checklist-view": 2, "jobs:list-ready": 1, + "jobs:void": 5, + "bills:enter": 2, "bills:view": 2, "bills:list": 2, diff --git a/client/src/components/shop-info/shop-info.rbac.component.jsx b/client/src/components/shop-info/shop-info.rbac.component.jsx index 291369255..fe4f80f31 100644 --- a/client/src/components/shop-info/shop-info.rbac.component.jsx +++ b/client/src/components/shop-info/shop-info.rbac.component.jsx @@ -1,12 +1,12 @@ +import { useTreatments } from "@splitsoftware/splitio-react"; import { Form, InputNumber } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; -import LayoutFormRow from "../layout-form-row/layout-form-row.component"; -import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component"; -import { useTreatments } from "@splitsoftware/splitio-react"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import LayoutFormRow from "../layout-form-row/layout-form-row.component"; +import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); @@ -316,6 +316,18 @@ export function ShopInfoRbacComponent({ form, bodyshop }) { > + + + List Active", "list-all": "Jobs -> List All", "list-ready": "Jobs -> List Ready", - "partsqueue": "Jobs -> Parts Queue" + "partsqueue": "Jobs -> Parts Queue", + "void": "Jobs -> Void" }, "owners": { "detail": "Owners -> Detail", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 0ead918b2..ff3efbd30 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -405,7 +405,8 @@ "list-active": "", "list-all": "", "list-ready": "", - "partsqueue": "" + "partsqueue": "", + "void": "" }, "owners": { "detail": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 040080a88..c8fc9ee4a 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -405,7 +405,8 @@ "list-active": "", "list-all": "", "list-ready": "", - "partsqueue": "" + "partsqueue": "", + "void": "" }, "owners": { "detail": "", From d73b1d22200432d7c7828d44a755cbb8c2d93097 Mon Sep 17 00:00:00 2001 From: swtmply Date: Thu, 1 Jun 2023 02:34:18 +0800 Subject: [PATCH 3/3] IO-2281 Added striped table colors --- client/src/App/App.styles.scss | 8 ++++++++ .../production-list-table.component.jsx | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/client/src/App/App.styles.scss b/client/src/App/App.styles.scss index 2ed11cbc6..b57e94677 100644 --- a/client/src/App/App.styles.scss +++ b/client/src/App/App.styles.scss @@ -156,3 +156,11 @@ td.ant-table-column-sort { background-color: transparent; } + +.ant-table-tbody > tr.ant-table-row:nth-child(2n) > td { + background-color: #f4f4f4; +} + +.rowWithColor > td { + background-color: var(--bgColor) !important; +} diff --git a/client/src/components/production-list-table/production-list-table.component.jsx b/client/src/components/production-list-table/production-list-table.component.jsx index 746d956ab..1585c6480 100644 --- a/client/src/components/production-list-table/production-list-table.component.jsx +++ b/client/src/components/production-list-table/production-list-table.component.jsx @@ -246,11 +246,21 @@ export function ProductionListTable({ (x) => x.status === record.status ); - if (!color) return null; + if (!color) { + if (index % 2 === 0) + return { + style: { + backgroundColor: `rgb(236, 236, 236)`, + }, + }; + + return null; + } return { + className: "rowWithColor", style: { - backgroundColor: `rgb(${color.color.r},${color.color.g},${color.color.b},${color.color.a})`, + "--bgColor": `rgb(${color.color.r},${color.color.g},${color.color.b},${color.color.a})`, }, }; },