mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-29 14:08:12 +00:00
Add applicant name handling for SEAFARER_REGISTRATION and update translations
This commit is contained in:
@@ -89,6 +89,18 @@ const ALL_STATUSES: LicenseStatus[] = [
|
||||
"REJECTED",
|
||||
];
|
||||
|
||||
/**
|
||||
* Seafarer registrations are person-centric — there is no `companyName`, so
|
||||
* the queue's "company" column falls back to the applicant name captured in
|
||||
* the registration form.
|
||||
*/
|
||||
function applicantOrCompanyName(app: LicenseApplication): string | undefined {
|
||||
if (app.licenseType?.key !== "SEAFARER_REGISTRATION") return app.companyName ?? undefined;
|
||||
const applicantName = (app.formData?.account as Record<string, unknown> | undefined)
|
||||
?.applicantName;
|
||||
return typeof applicantName === "string" && applicantName ? applicantName : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* The officer work pool.
|
||||
*
|
||||
@@ -383,10 +395,15 @@ export function LicenseQueuePage() {
|
||||
),
|
||||
},
|
||||
{
|
||||
header: sortableHeader(t("queue.company", "Company"), "companyName"),
|
||||
header: sortableHeader(
|
||||
typeCode === "SEAFARER_REGISTRATION"
|
||||
? t("queue.applicant", "Applicant")
|
||||
: t("queue.company", "Company"),
|
||||
"companyName",
|
||||
),
|
||||
label: t("queue.company", "Company"),
|
||||
cell: ({ row }) => (
|
||||
<Text size="sm">{row.original.companyName ?? "—"}</Text>
|
||||
<Text size="sm">{applicantOrCompanyName(row.original) ?? "—"}</Text>
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -477,6 +494,7 @@ export function LicenseQueuePage() {
|
||||
allSelected,
|
||||
items,
|
||||
claiming,
|
||||
typeCode,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user