Refactor clearance terminology to document approval across services and UI components

This commit is contained in:
Marshal
2026-07-20 07:46:38 +00:00
committed by Hagernesh
parent b67aa813f9
commit 0727de0f4d
10 changed files with 40 additions and 27 deletions

View File

@@ -135,12 +135,14 @@ export function ClearanceReviewSection({
const finalizeMutation = useMutation({
mutationFn: () => bookingsService.finalizeClearance(bookingId),
onSuccess: () => {
toast.success("Clearance finalized");
toast.success("Document approval finalized");
refresh();
},
onError: (e) =>
toast.error(
e instanceof Error ? e.message : "Could not finalize clearance",
e instanceof Error
? e.message
: "Could not finalize document approval",
),
});
@@ -366,7 +368,7 @@ export function ClearanceReviewSection({
<Alert color="red" radius="md" icon={<AlertCircle size={16} />}>
{finalizeMutation.error instanceof Error
? finalizeMutation.error.message
: "Could not finalize clearance."}
: "Could not finalize document approval."}
</Alert>
)}
@@ -445,7 +447,7 @@ export function ClearanceReviewSection({
loading={finalizeMutation.isPending}
onClick={() => finalizeMutation.mutate()}
>
Finalize clearance
Finalize document approval
</Button>
</Group>
</Paper>

View File

@@ -68,7 +68,7 @@ export interface ContractClearanceReviewSectionProps {
queriesLocked?: boolean;
/**
* ONE_TIME customs contracts use the phased milestone workflow. Hides the
* legacy "Finalize clearance" shortcut; booking readiness follows delivery
* legacy "Finalize document approval" shortcut; booking readiness follows delivery
* order (import) or export release.
*/
phasedCustoms?: boolean;
@@ -393,7 +393,7 @@ export function ContractClearanceReviewSection({
<Alert color="red" radius="md" icon={<AlertCircle size={16} />}>
{finalizeClearance.error instanceof Error
? finalizeClearance.error.message
: "Could not finalize clearance."}
: "Could not finalize document approval."}
</Alert>
)}
@@ -482,7 +482,7 @@ export function ContractClearanceReviewSection({
})
}
>
Finalize clearance
Finalize document approval
</Button>
</Group>
</Paper>

View File

@@ -160,7 +160,8 @@ export default function BuildTrainModal({ opened, onClose, onBuilt }: BuildTrain
onChange={(value) => setImportTrainNumber(value ?? "")}
searchable
clearable
nothingFoundMessage="No free run numbers — add more in Dropdown Settings"
nothingFoundMessage={importNumbers.emptyMessage}
error={importNumbers.settingMissing ? importNumbers.emptyMessage : undefined}
/>
</Group>
<Select

View File

@@ -105,7 +105,8 @@ const EditTrainDetailsModal = ({ train, onClose }: EditTrainDetailsModalProps) =
}}
searchable
clearable
nothingFoundMessage="No free run numbers — add more in Dropdown Settings"
nothingFoundMessage={importNumbers.emptyMessage}
error={importNumbers.settingMissing ? importNumbers.emptyMessage : undefined}
radius="md"
/>
<TextInput