mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-29 12:58:15 +00:00
Adding more functionalities for all the license types
This commit is contained in:
@@ -18,7 +18,13 @@ const BASE_API_URL =
|
||||
* attach them to, and nothing can be lost if the browser closes mid-wizard.
|
||||
*/
|
||||
export async function uploadDocument(params: {
|
||||
ownerType: 'APPLICATION' | 'APPLICATION_STAFF' | 'INSPECTION' | 'LICENSE';
|
||||
ownerType:
|
||||
| 'APPLICATION'
|
||||
| 'APPLICATION_STAFF'
|
||||
| 'INSPECTION'
|
||||
| 'LICENSE'
|
||||
| 'SEA_SERVICE_RECORD'
|
||||
| 'MEDICAL_CERTIFICATE';
|
||||
ownerId: string;
|
||||
documentKey: string;
|
||||
file: File;
|
||||
@@ -210,6 +216,14 @@ export interface WizardStep {
|
||||
export function buildWizardSteps(
|
||||
sections: FormSectionConfig[],
|
||||
formData: Record<string, Record<string, unknown>>,
|
||||
options?: {
|
||||
/**
|
||||
* Whether this licence type has staff-role requirements at all. Types
|
||||
* without any (seafarer registration) skip the Staff step entirely
|
||||
* instead of showing an empty page.
|
||||
*/
|
||||
hasStaff?: boolean;
|
||||
},
|
||||
): WizardStep[] {
|
||||
const visible = [...sections]
|
||||
.filter((section) => conditionHolds(section.showWhen, formData))
|
||||
@@ -259,7 +273,9 @@ export function buildWizardSteps(
|
||||
|
||||
return [
|
||||
...formSteps,
|
||||
{ key: 'staff', label: 'Staff', kind: 'staff', sections: [] },
|
||||
...(options?.hasStaff === false
|
||||
? []
|
||||
: [{ key: 'staff', label: 'Staff', kind: 'staff', sections: [] } as WizardStep]),
|
||||
{ key: 'documents', label: 'Documents', kind: 'documents', sections: [] },
|
||||
{ key: 'review', label: 'Review', kind: 'review', sections: reviewSections },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user