From 8700e9a9ae0f1875150458b2545367b85b4431bf Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Sat, 30 Jul 2022 14:42:31 -0700 Subject: [PATCH 1/4] Resolve production board loading issue for MAXWR. --- .../production-list-table.component.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 a42ed413d..6595476d5 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 @@ -238,10 +238,8 @@ export function ProductionListTable({ sticky pagination={false} size="small" - className="production-list-table" - onRow={ - Production_List_Status_Colors.treatment === "on" && - ((record, index) => { + {...(Production_List_Status_Colors.treatment === "on" && { + onRow: (record, index) => { if (!bodyshop.md_ro_statuses.production_colors) return null; const color = bodyshop.md_ro_statuses.production_colors.find( @@ -255,8 +253,8 @@ export function ProductionListTable({ backgroundColor: `rgb(${color.color.r},${color.color.g},${color.color.b},${color.color.a})`, }, }; - }) - } + }, + })} components={{ header: { cell: ResizeableTitle, From faef05a95b5c9643626e36f712be5f55966f1dff Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 2 Aug 2022 11:11:01 -0700 Subject: [PATCH 2/4] Updated antd package to fix drawer issues. --- client/package.json | 2 +- client/yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/package.json b/client/package.json index bda074119..c6eda0caa 100644 --- a/client/package.json +++ b/client/package.json @@ -15,7 +15,7 @@ "@stripe/react-stripe-js": "^1.9.0", "@stripe/stripe-js": "^1.32.0", "@tanem/react-nprogress": "^5.0.8", - "antd": "^4.21.7", + "antd": "^4.22.3", "apollo-link-logger": "^2.0.0", "axios": "^0.27.2", "craco-less": "^1.20.0", diff --git a/client/yarn.lock b/client/yarn.lock index ff5e87882..5a8eb4654 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -3228,10 +3228,10 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -antd@^4.21.7: - version "4.22.0" - resolved "https://registry.yarnpkg.com/antd/-/antd-4.22.0.tgz#fef6aa2de347718bca4820b73c22e1cac843dd66" - integrity sha512-ZKEfRF+wT21PVWrd1NKG7CQNUtiGOt35OV+ZKumazvubLUXHyFnJvueaN7vgcbcBmexFXC6TZvIL+TXWxa0zzg== +antd@^4.22.3: + version "4.22.3" + resolved "https://registry.yarnpkg.com/antd/-/antd-4.22.3.tgz#c6d4ced17e9c21b55c6234595d962c5f9d6768db" + integrity sha512-Nay1tO+G5Z9szmshK9TinOWclJnxOtSe7cr15EX64NGkZZyRoHX2xXOFQoYtBt4qfVfFvLf97m9on7fwgy1Svg== dependencies: "@ant-design/colors" "^6.0.0" "@ant-design/icons" "^4.7.0" @@ -3247,7 +3247,7 @@ antd@^4.21.7: rc-checkbox "~2.3.0" rc-collapse "~3.3.0" rc-dialog "~8.9.0" - rc-drawer "~5.0.0-alpha.7" + rc-drawer "~5.1.0-alpha.1" rc-dropdown "~4.0.0" rc-field-form "~1.27.0" rc-image "~5.7.0" @@ -11420,10 +11420,10 @@ rc-dialog@~8.9.0: rc-motion "^2.3.0" rc-util "^5.21.0" -rc-drawer@~5.0.0-alpha.7: - version "5.0.0-alpha.7" - resolved "https://registry.yarnpkg.com/rc-drawer/-/rc-drawer-5.0.0-alpha.7.tgz#c0491780559a77f64df3c687caf56a7b6a180f6f" - integrity sha512-3AXWO7VTCz//Ys66iF+b9FsKfvcmdKaR0wFwNHNL3Vw+YeMji5WfC3wE4snEAqCqUrR2Cw2wsihK+gPt4qbpZA== +rc-drawer@~5.1.0-alpha.1: + version "5.1.0-alpha.3" + resolved "https://registry.yarnpkg.com/rc-drawer/-/rc-drawer-5.1.0-alpha.3.tgz#a516131bd36f36b886c00ece027837050cbd3c68" + integrity sha512-8SR6VD3ms0KhfwGa0KIhCUr/3p8iIuxIqo8cqizZzQKUjSGU0IcB/fteDV3IVRGMqVHhSSQp4hzvYfZsOI+kOA== dependencies: "@babel/runtime" "^7.10.1" classnames "^2.2.6" From b03d729af61b6fd8bed2db3adaaa68533f5b6d51 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 2 Aug 2022 11:18:36 -0700 Subject: [PATCH 3/4] Add null check to owner display. --- .../owner-name-display.component.jsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/client/src/components/owner-name-display/owner-name-display.component.jsx b/client/src/components/owner-name-display/owner-name-display.component.jsx index a7e59067d..da7965739 100644 --- a/client/src/components/owner-name-display/owner-name-display.component.jsx +++ b/client/src/components/owner-name-display/owner-name-display.component.jsx @@ -12,24 +12,24 @@ export default connect(mapStateToProps, mapDispatchToProps)(OwnerNameDisplay); export function OwnerNameDisplay({ bodyshop, ownerObject }) { const emptyTest = - ownerObject.ownr_fn + ownerObject.ownr_ln + ownerObject.ownr_co_nm; + ownerObject?.ownr_fn + ownerObject?.ownr_ln + ownerObject?.ownr_co_nm; if (!emptyTest || emptyTest === "null" || emptyTest.trim() === "") return "N/A"; if (bodyshop.last_name_first) - return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${ - ownerObject.ownr_co_nm || "" + return `${ownerObject?.ownr_ln || ""}, ${ownerObject?.ownr_fn || ""} ${ + ownerObject?.ownr_co_nm || "" }`.trim(); - return `${ownerObject.ownr_fn || ""} ${ownerObject.ownr_ln || ""} ${ + return `${ownerObject?.ownr_fn || ""} ${ownerObject?.ownr_ln || ""} ${ ownerObject.ownr_co_nm || "" }`.trim(); } export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) { const emptyTest = - ownerObject.ownr_fn + ownerObject.ownr_ln + ownerObject.ownr_co_nm; + ownerObject?.ownr_fn + ownerObject?.ownr_ln + ownerObject?.ownr_co_nm; if (!emptyTest || emptyTest === "null" || emptyTest.trim() === "") return "N/A"; @@ -37,11 +37,11 @@ export function OwnerNameDisplayFunction(ownerObject, forceFirstLast = false) { const rdxStore = store.getState(); if (rdxStore.user.bodyshop.last_name_first && !forceFirstLast) - return `${ownerObject.ownr_ln || ""}, ${ownerObject.ownr_fn || ""} ${ - ownerObject.ownr_co_nm || "" + return `${ownerObject?.ownr_ln || ""}, ${ownerObject?.ownr_fn || ""} ${ + ownerObject?.ownr_co_nm || "" }`.trim(); - return `${ownerObject.ownr_fn || ""} ${ownerObject.ownr_ln || ""} ${ - ownerObject.ownr_co_nm || "" + return `${ownerObject?.ownr_fn || ""} ${ownerObject?.ownr_ln || ""} ${ + ownerObject?.ownr_co_nm || "" }`.trim(); } From 85caf828ea835d916745b04dfe845101139b0f0f Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 3 Aug 2022 13:27:45 -0700 Subject: [PATCH 4/4] IO-2008 Split local media into images and other as per cloudinary for better other support. --- ...jobs-documents-local-gallery.container.jsx | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx b/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx index f58c8025c..5b8722d3d 100644 --- a/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx +++ b/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx @@ -1,4 +1,4 @@ -import { SyncOutlined } from "@ant-design/icons"; +import { SyncOutlined, FileExcelFilled } from "@ant-design/icons"; import { Button, Card, Space } from "antd"; import React, { useEffect } from "react"; import Gallery from "react-grid-gallery"; @@ -58,6 +58,24 @@ export function JobsDocumentsLocalGallery({ } }, [job, invoice_number, getJobMedia, getBillMedia]); + const jobMedia = + allMedia && allMedia[job.id] + ? allMedia[job.id].reduce( + (acc, val) => { + if ( + val.type && + val.type.mime && + val.type.mime.startsWith("image") + ) { + acc.images.push(val); + } else { + acc.other.push(val); + } + return acc; + }, + { images: [], other: [] } + ) + : { images: [], other: [] }; return (