mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-07 17:45:43 +00:00
Enhance exam selection by displaying certification rank in options and remove admission number input from scheduling modal
This commit is contained in:
@@ -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] ?? "-";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user