diff --git a/apps/backoffice/src/app/features/exam/pages/ExamPage/index.tsx b/apps/backoffice/src/app/features/exam/pages/ExamPage/index.tsx index e0adfa5ab..b515509d8 100644 --- a/apps/backoffice/src/app/features/exam/pages/ExamPage/index.tsx +++ b/apps/backoffice/src/app/features/exam/pages/ExamPage/index.tsx @@ -24,6 +24,7 @@ import { import { notify, useErrorHandler, AdvancedTable, useServerTable, ModalFooter, AmharicDatePicker } from "@ema-platform/ui"; import { LICENSE_PERMISSIONS, RequirePermission } from "@ema-platform/auth"; import { useGetCertificationsQuery } from "../../../certification/api/certification-api"; +import { RANK_KEY_OPTIONS } from "../../../certification/types/certification"; import { useGetExamsQuery, useCreateExamMutation, @@ -383,9 +384,18 @@ export function ExamPage() { const [statusOpened, { open: openStatus, close: closeStatus }] = useDisclosure(false); + // Rank in the label: an exam inherits its STCW rank from the certification + // it is created under (Certification.rankKey), so the officer sees which + // rank a sitting will serve at the moment they pick the subject. const certOptions = certifications .filter((c) => c.isActive) - .map((c) => ({ value: c.id, label: c.name[locale] })); + .map((c) => { + const rank = RANK_KEY_OPTIONS.find((r) => r.value === c.rankKey)?.label; + return { + value: c.id, + label: rank ? `${c.name[locale]} — ${rank}` : c.name[locale], + }; + }); const getCertName = (id: string) => certifications.find((c) => c.id === id)?.name?.[locale] ?? "-"; diff --git a/apps/backoffice/src/app/features/license-review/components/ScheduleExamModal.tsx b/apps/backoffice/src/app/features/license-review/components/ScheduleExamModal.tsx index b68de8778..641ffc864 100644 --- a/apps/backoffice/src/app/features/license-review/components/ScheduleExamModal.tsx +++ b/apps/backoffice/src/app/features/license-review/components/ScheduleExamModal.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { Alert, Button, Modal, Select, Stack, Text, TextInput } from '@mantine/core'; +import { Alert, Button, Modal, Select, Stack, Text } from '@mantine/core'; import { IconCalendarEvent } from '@tabler/icons-react'; import { useTranslation } from 'react-i18next'; import { ModalFooter } from '@ema-platform/ui'; @@ -11,11 +11,7 @@ interface Props { applicantName: string; loading: boolean; onClose: () => void; - onConfirm: (payload: { - examId: string; - admissionNumber?: string; - examDate?: string; - }) => void; + onConfirm: (payload: { examId: string; examDate?: string }) => void; } /** @@ -38,7 +34,6 @@ export function ScheduleExamModal({ const { t } = useTranslation(); const { data: exams, isLoading } = useGetEligibleExamsQuery(applicationId, { skip: !opened }); const [examId, setExamId] = useState(null); - const [admissionNumber, setAdmissionNumber] = useState(''); const options = (exams ?? []).map((exam) => ({ value: exam.id, @@ -52,7 +47,6 @@ export function ScheduleExamModal({ if (!examId) return; onConfirm({ examId, - admissionNumber: admissionNumber.trim() || undefined, examDate: selected?.date ? String(selected.date) : undefined, }); } @@ -92,15 +86,12 @@ export function ScheduleExamModal({ /> )} - + {t( 'review.scheduleExam.admissionHint', - 'Leave blank to let the system issue one.', + 'An admission number is issued automatically when the candidate is seated.', )} - value={admissionNumber} - onChange={(e) => setAdmissionNumber(e.currentTarget.value)} - /> +