mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 19:12:50 +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,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -790,6 +790,7 @@ export const am: Translations = {
|
||||
compact: 'ጥብቅ',
|
||||
number: 'ማመልከቻ ቁ.',
|
||||
company: 'ኩባንያ',
|
||||
applicant: 'አመልካች',
|
||||
tin: 'ቲን',
|
||||
submitted: 'የቀረበበት',
|
||||
sla: 'ዕድሜ / የጊዜ ገደብ',
|
||||
|
||||
@@ -791,6 +791,7 @@ export const en = {
|
||||
compact: 'Compact',
|
||||
number: 'App #',
|
||||
company: 'Company',
|
||||
applicant: 'Applicant',
|
||||
tin: 'TIN',
|
||||
submitted: 'Submitted',
|
||||
sla: 'Age / SLA',
|
||||
|
||||
Reference in New Issue
Block a user