From 3b07055d5a8691d854f2dbe1ca09adf5e5b3d034 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 25 Nov 2025 17:36:50 -0500 Subject: [PATCH] feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration / RRScratch2 / Polish --- .../dms-allocations-summary.component.jsx | 9 ++++- .../rr-dms-allocations-summary.component.jsx | 39 +++++++++++-------- .../dms-post-form/cdklike-dms-post-form.jsx | 9 ++++- .../dms-post-form/rr-dms-post-form.jsx | 9 ++++- client/src/pages/dms/dms.container.jsx | 13 ++++++- 5 files changed, 56 insertions(+), 23 deletions(-) diff --git a/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx b/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx index 06764b3d7..0c6784158 100644 --- a/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx +++ b/client/src/components/dms-allocations-summary/dms-allocations-summary.component.jsx @@ -24,10 +24,11 @@ export default connect(mapStateToProps, mapDispatchToProps)(DmsAllocationsSummar * @param bodyshop * @param jobId * @param title + * @param minHeight * @returns {JSX.Element} * @constructor */ -export function DmsAllocationsSummary({ mode, socket, bodyshop, jobId, title }) { +export function DmsAllocationsSummary({ mode, socket, bodyshop, jobId, title, minHeight }) { const { t } = useTranslation(); const [allocationsSummary, setAllocationsSummary] = useState([]); @@ -97,6 +98,8 @@ export function DmsAllocationsSummary({ mode, socket, bodyshop, jobId, title }) return ( @@ -124,12 +127,14 @@ export function DmsAllocationsSummary({ mode, socket, bodyshop, jobId, title }) { totalSale: Dinero(), totalCost: Dinero() } ) || { totalSale: Dinero(), totalCost: Dinero() }; + const hasNonZeroSaleTotal = totals.totalSale.getAmount() !== 0; + return ( {t("general.labels.totals")} - {totals.totalSale.toFormat()} + {hasNonZeroSaleTotal ? totals.totalSale.toFormat() : null} diff --git a/client/src/components/dms-allocations-summary/rr-dms-allocations-summary.component.jsx b/client/src/components/dms-allocations-summary/rr-dms-allocations-summary.component.jsx index 96ad3f9a3..9cb7ce45f 100644 --- a/client/src/components/dms-allocations-summary/rr-dms-allocations-summary.component.jsx +++ b/client/src/components/dms-allocations-summary/rr-dms-allocations-summary.component.jsx @@ -50,7 +50,7 @@ function normalizeJobAllocations(ack) { * is now done on the backend via buildRogogFromAllocations/buildRolaborFromRogog. * This component just renders the preview from `ack.rogg` / `ack.rolabor`. */ -export function RrAllocationsSummary({ socket, bodyshop, jobId, title }) { +export function RrAllocationsSummary({ socket, bodyshop, jobId, title, minHeight }) { const { t } = useTranslation(); const [roggPreview, setRoggPreview] = useState(null); const [rolaborPreview, setRolaborPreview] = useState(null); @@ -234,21 +234,26 @@ export function RrAllocationsSummary({ socket, bodyshop, jobId, title }) { } return ""; }} - summary={() => ( - - - {t("general.labels.totals")} - - - - - - - - {roggTotals.totalCustPrice} - {roggTotals.totalDlrCost} - - )} + summary={() => { + const hasCustTotal = Number(roggTotals.totalCustPrice) !== 0; + const hasCostTotal = Number(roggTotals.totalDlrCost) !== 0; + + return ( + + + {t("general.labels.totals")} + + + + + + + + {hasCustTotal ? roggTotals.totalCustPrice : null} + {hasCostTotal ? roggTotals.totalDlrCost : null} + + ); + }} /> ) @@ -276,6 +281,8 @@ export function RrAllocationsSummary({ socket, bodyshop, jobId, title }) { return ( diff --git a/client/src/components/dms-post-form/cdklike-dms-post-form.jsx b/client/src/components/dms-post-form/cdklike-dms-post-form.jsx index 7fae733cd..4fb634428 100644 --- a/client/src/components/dms-post-form/cdklike-dms-post-form.jsx +++ b/client/src/components/dms-post-form/cdklike-dms-post-form.jsx @@ -38,10 +38,11 @@ import { DMS_MAP } from "../../utils/dmsUtils"; * @param job * @param logsRef * @param mode + * @param minHeight * @returns {JSX.Element} * @constructor */ -export default function CdkLikePostForm({ bodyshop, socket, job, logsRef, mode }) { +export default function CdkLikePostForm({ bodyshop, socket, job, logsRef, mode, minHeight }) { const [form] = Form.useForm(); const { t } = useTranslation(); const [, /*unused*/ setTick] = useState(0); // handy if you need a forceUpdate later @@ -122,7 +123,11 @@ export default function CdkLikePostForm({ bodyshop, socket, job, logsRef, mode } : { totalSale: Dinero(), totalCost: Dinero() }; return ( - +
+ ({ insertAuditTrail: ({ jobid, operation, type }) => dispatch(insertAuditTrail({ jobid, operation, type })) }); +const SUMMARY_MIN_HEIGHT = 545; + export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer); const DMS_SOCKET_EVENTS = { @@ -390,6 +392,7 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse {!isRrMode ? ( @@ -407,6 +410,7 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse /> ) : ( @@ -425,7 +429,14 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse - +