mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 01:20:55 +00:00
fix transi permit file upload
This commit is contained in:
@@ -101,6 +101,26 @@ export function transitPermitFileLabel(code: string, index?: number): string {
|
||||
return code;
|
||||
}
|
||||
|
||||
export const LEGACY_EXPORT_TRANSPORT_CODE = "export_transport_document";
|
||||
|
||||
export function isExportTransportFileCode(code: string | null | undefined): boolean {
|
||||
if (!code) return false;
|
||||
const lower = code.toLowerCase();
|
||||
return (
|
||||
lower === LEGACY_EXPORT_TRANSPORT_CODE ||
|
||||
lower.startsWith(`${LEGACY_EXPORT_TRANSPORT_CODE}_`)
|
||||
);
|
||||
}
|
||||
|
||||
export function exportTransportFileLabel(code: string, index?: number): string {
|
||||
const lower = code.toLowerCase();
|
||||
if (lower === LEGACY_EXPORT_TRANSPORT_CODE) return "Transit Permit";
|
||||
if (lower.startsWith(`${LEGACY_EXPORT_TRANSPORT_CODE}_`)) {
|
||||
return index != null ? `Transit permit ${index + 1}` : "Transit Permit";
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
export function catalogEntriesForTradeDirection(
|
||||
tradeDirection: string,
|
||||
): ClearanceWorkflowFileCatalogEntry[] {
|
||||
|
||||
Reference in New Issue
Block a user