mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-09 04:48:18 +00:00
CHANGES
This commit is contained in:
@@ -131,12 +131,12 @@ export function ForwarderDocumentReview({
|
||||
const { clearance, customerDocs, canUpload, pending, adHoc, status } = flow;
|
||||
const docNoun = bookingDocNoun(booking);
|
||||
const reviewOpen = clearance.documentsOpen ?? canUpload;
|
||||
// A phased (agent-cleared) booking advances through the clearance wizard —
|
||||
// approving the last document moves it on by itself, and the server refuses
|
||||
// the plain finalize. Only a non-phased booking finalizes from here.
|
||||
// An agent-cleared booking normally advances through the clearance wizard,
|
||||
// but finalizing is still allowed once every document is approved: the
|
||||
// remaining steps are closed as not applicable, for an agent that files
|
||||
// with customs off the platform. The wizard stays the expected path.
|
||||
const phased = Boolean(clearance.phase);
|
||||
const canFinalize =
|
||||
!phased && status === "DOCUMENTS_UNDER_REVIEW" && clearance.allApproved;
|
||||
const canFinalize = status === "DOCUMENTS_UNDER_REVIEW" && clearance.allApproved;
|
||||
const finalized = [
|
||||
"CLEARANCE_READY",
|
||||
"OPERATION_REQUEST_PENDING",
|
||||
@@ -449,16 +449,22 @@ export function ForwarderDocumentReview({
|
||||
Submit documents
|
||||
</Button>
|
||||
) : null}
|
||||
{!finalized && !phased ? (
|
||||
{!finalized ? (
|
||||
<Button
|
||||
color="edr-green"
|
||||
radius="md"
|
||||
variant={phased ? "light" : "filled"}
|
||||
leftSection={<ShieldCheck size={16} />}
|
||||
onClick={() => finalize.mutate()}
|
||||
loading={finalize.isPending}
|
||||
disabled={!canFinalize}
|
||||
title={
|
||||
phased
|
||||
? "Closes the clearance now and marks the remaining steps as not applicable"
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
Finalize clearance
|
||||
{phased ? "Finalize without remaining steps" : "Finalize clearance"}
|
||||
</Button>
|
||||
) : null}
|
||||
</Group>
|
||||
|
||||
Reference in New Issue
Block a user