From 58a66b3a238bb1bec4f61b9e928f50bb2c812f5f Mon Sep 17 00:00:00 2001 From: Hagernesh Date: Thu, 9 Jul 2026 15:14:44 +0000 Subject: [PATCH] fix(warehouses): retire per-booking Load and Dispatch buttons Wagon loading happens in the train flow and dispatch at the train level, which already advances inventory - the per-row buttons duplicated that and confused operators. - WarehouseInventoryTable (import dispatch queue + warehouse pages): suppress the 'load'/'dispatch' next-action buttons and drop the extra per-row Dispatch on READY_FOR_PICKUP rows (Store stays) - Export Dispatch Queue: drop the per-row Dispatch button and its Actions column; the bulk Dispatch All / Dispatch Selected controls remain Co-Authored-By: Claude Opus 4.8 (1M context) --- .../warehouses/ReceiveInventoryModal.tsx | 14 -------- .../warehouses/WarehouseInventoryTable.tsx | 36 ++++++++----------- 2 files changed, 15 insertions(+), 35 deletions(-) diff --git a/apps/edr-freight-web/backoffice/src/components/warehouses/ReceiveInventoryModal.tsx b/apps/edr-freight-web/backoffice/src/components/warehouses/ReceiveInventoryModal.tsx index d2540751e..a1b91decb 100644 --- a/apps/edr-freight-web/backoffice/src/components/warehouses/ReceiveInventoryModal.tsx +++ b/apps/edr-freight-web/backoffice/src/components/warehouses/ReceiveInventoryModal.tsx @@ -1697,7 +1697,6 @@ function LoadedExportTab({ Weight Route Status - {dispatchable && Actions} @@ -1739,19 +1738,6 @@ function LoadedExportTab({ {r.status} - {dispatchable && ( - - - - )} ))} diff --git a/apps/edr-freight-web/backoffice/src/components/warehouses/WarehouseInventoryTable.tsx b/apps/edr-freight-web/backoffice/src/components/warehouses/WarehouseInventoryTable.tsx index 63292b0af..51650b459 100644 --- a/apps/edr-freight-web/backoffice/src/components/warehouses/WarehouseInventoryTable.tsx +++ b/apps/edr-freight-web/backoffice/src/components/warehouses/WarehouseInventoryTable.tsx @@ -160,7 +160,12 @@ export function WarehouseInventoryTable({ {items.map((item) => { const kind = itemKind(item); const busy = busyId === item.id; - const nextAction = getNextInventoryAction(item); + // Per-booking Load and Dispatch are retired: wagon loading happens in + // the train flow and dispatch at the train level (which already + // advances inventory). Only the remaining lifecycle actions render. + const rawNextAction = getNextInventoryAction(item); + const nextAction = + rawNextAction === 'load' || rawNextAction === 'dispatch' ? null : rawNextAction; const canGenerateHandover = item.inspectionStatus === 'PASSED' && Boolean(item.bookingId) && @@ -232,26 +237,15 @@ export function WarehouseInventoryTable({ )} {item.status === 'READY_FOR_PICKUP' && ( - <> - - - + )} {item.status !== 'DISPATCHED' && (