From a72a7948fe42defd89d8e8cfdc902a137d6f1066 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 17 Oct 2024 15:22:05 -0700 Subject: [PATCH] IO-2987 Non Production Board Status - Status Changes Signed-off-by: Allan Carr --- ...oduction-list-columns.status.component.jsx | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/client/src/components/production-list-columns/production-list-columns.status.component.jsx b/client/src/components/production-list-columns/production-list-columns.status.component.jsx index 23dc378ef..820f7f80a 100644 --- a/client/src/components/production-list-columns/production-list-columns.status.component.jsx +++ b/client/src/components/production-list-columns/production-list-columns.status.component.jsx @@ -21,25 +21,26 @@ export function ProductionListColumnStatus({ record, bodyshop, insertAuditTrail const [loading, setLoading] = useState(false); const handleSetStatus = async (e) => { - logImEXEvent("production_change_status"); - // e.stopPropagation(); - setLoading(true); - const { key } = e; - await updateJob({ - variables: { - jobId: record.id, - job: { - status: key + if (bodyshop.md_ro_statuses.production_statuses.includes(record.status) && !bodyshop.md_ro_statuses.post_production_statuses.includes(record.status)) { + logImEXEvent("production_change_status"); + // e.stopPropagation(); + setLoading(true); + const { key } = e; + await updateJob({ + variables: { + jobId: record.id, + job: { + status: key + } } - } - }); - insertAuditTrail({ - jobid: record.id, - operation: AuditTrailMapping.jobstatuschange(key), - type: "jobstatuschange" - }); - - setLoading(false); + }); + insertAuditTrail({ + jobid: record.id, + operation: AuditTrailMapping.jobstatuschange(key), + type: "jobstatuschange" + }); + setLoading(false); + } }; const menu = {