mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 02:58:11 +00:00
feat: add warehouse gate times editor modal for import trucks
Enable per-truck editing of warehouse gate arrival/departure times (arrivedAt/departedAt) via modal on Import Trucks page. Accessible via row action menu for EDR-haulage trucks. Includes backend endpoint POST /last-mile/:id/warehouse-gate-times and frontend modal with DateTimePicker inputs. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,7 @@ import ListControls from "@/components/common/ListControls";
|
||||
import RuleEngineListFooter from "@/components/ruleEngine/RuleEngineListFooter";
|
||||
import { InspectionReportModal } from "@/components/warehouses/InspectionReportModal";
|
||||
import { TruckDetentionModal } from "@/components/operations/TruckDetentionModal";
|
||||
import { WarehouseGateTimesModal } from "@/components/operations/WarehouseGateTimesModal";
|
||||
import { extractDownloadErrorMessage, formatNumber } from "@/components/warehouses/options";
|
||||
import { openPdfBlob } from "@/components/warehouses/pdf";
|
||||
import { useListControls } from "@/hooks/useListControls";
|
||||
@@ -119,6 +120,7 @@ function TruckRows({ group }: { group: BookingGroup }) {
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [inspectId, setInspectId] = useState<string | null>(null);
|
||||
const [detentionOpen, setDetentionOpen] = useState(false);
|
||||
const [gateTimesOpen, setGateTimesOpen] = useState(false);
|
||||
|
||||
const edrQuery = useQuery({
|
||||
queryKey: ["booking-edr-trucks", group.bookingId],
|
||||
@@ -366,6 +368,13 @@ function TruckRows({ group }: { group: BookingGroup }) {
|
||||
>
|
||||
Detention times…
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
leftSection={<FileText size={14} />}
|
||||
disabled={!lastMileId}
|
||||
onClick={() => setGateTimesOpen(true)}
|
||||
>
|
||||
Warehouse gate times…
|
||||
</Menu.Item>
|
||||
</>
|
||||
)}
|
||||
</Menu.Dropdown>
|
||||
@@ -380,11 +389,18 @@ function TruckRows({ group }: { group: BookingGroup }) {
|
||||
inventoryId={inspectId}
|
||||
/>
|
||||
{isEdr && (
|
||||
<TruckDetentionModal
|
||||
opened={detentionOpen}
|
||||
onClose={() => setDetentionOpen(false)}
|
||||
record={lastMileRecordQuery.data ?? null}
|
||||
/>
|
||||
<>
|
||||
<TruckDetentionModal
|
||||
opened={detentionOpen}
|
||||
onClose={() => setDetentionOpen(false)}
|
||||
record={lastMileRecordQuery.data ?? null}
|
||||
/>
|
||||
<WarehouseGateTimesModal
|
||||
opened={gateTimesOpen}
|
||||
onClose={() => setGateTimesOpen(false)}
|
||||
record={lastMileRecordQuery.data ?? null}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user