diff --git a/_reference/productionBoardNotes.md b/_reference/productionBoardNotes.md index 31bf2b4dc..96ea0d46f 100644 --- a/_reference/productionBoardNotes.md +++ b/_reference/productionBoardNotes.md @@ -31,3 +31,11 @@ These allow users to turn fields on or off, turning them all off will show the card in the most minimal form + +### Statistics + +- The statistics section allows users to see accumulations of both jobs on the board, and jobs in production. +- you can click a statistic to turn it on and off, and drag and drop the statistics to rearrange them + +### Filters +- Allows you to set, and persist filters for estimators and insurance companies diff --git a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx index 4febb86c0..632480a12 100644 --- a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx +++ b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx @@ -343,14 +343,7 @@ export default function ProductionBoardCard({ technician, card, bodyshop, cardSe const headerContent = (
- + {metadata?.suspended && } {metadata?.iouparent && ( ({ ) }); -const ProductionListColumnAlert = ({ record, insertAuditTrail }) => { +const ProductionListColumnAlert = ({ id, productionVars, refetch, insertAuditTrail }) => { const [updateAlert] = useMutation(UPDATE_JOB); const handleAlertToggle = useCallback(() => { logImEXEvent("production_toggle_alert"); - const newAlertState = !!record.production_vars?.alert ? !record.production_vars.alert : true; + const newAlertState = !!productionVars?.alert ? !productionVars?.alert : true; + const finalProductionVars = { + ...productionVars, + alert: newAlertState + }; updateAlert({ variables: { - jobId: record.id, + jobId: id, job: { - production_vars: { - ...record.production_vars, - alert: newAlertState - } + production_vars: finalProductionVars } } }).catch((err) => { @@ -45,17 +46,17 @@ const ProductionListColumnAlert = ({ record, insertAuditTrail }) => { }); insertAuditTrail({ - jobid: record.id, + jobid: id, operation: AuditTrailMapping.alertToggle(newAlertState), type: "alertToggle" }); - if (record.refetch) record.refetch(); - }, [updateAlert, insertAuditTrail, record]); + if (refetch) refetch(); + }, [updateAlert, insertAuditTrail, id, productionVars, refetch]); - if (!record.production_vars?.alert) return null; - - return