Print showed blank A/B/C/D fill-in lines for every CHOICE question instead
of the real options — the detail page never fetched option data at all
(GET /exams/:id?i=questions, no nested options), and the print template
hardcoded the blanks regardless. Now requests
?i=questions,questions.options and prints the real option text, falling
back to blank lines only when a question genuinely has none on record.
Also fixed the print-time cutting-point guard: it compared raw point sum
to cutting point regardless of evaluationMethod, wrongly blocking valid
low-point-sum PERCENTAGE papers from printing. Now branches the same way
RecordResultModal's grading preview already does, and surfaces the
matching backend validation error (paper_cannot_reach_cutting_point) added
server-side for the same reason.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Three bugs compounded into a button that looked unwired:
- cuttingPoint carried a native HTML required attribute while sitting on
the hidden Settings tab (Mantine keeps inactive tab panels mounted with
display:none). The browser blocked form submission entirely, silently
- no toast, no error, nothing. Replaced required with withAsterisk and
moved validation into JS.
- Manual required-field validation never checked type/form/adminMethod/
evalMethod/cuttingPoint at all, so even without the native block above
a half-filled Settings tab would silently no-op. Validation now covers
every required field on both tabs and switches to whichever tab has
the problem.
- Filling only the English Direction field (leaving Amharic blank) passed
frontend validation but the backend hard-rejects it, producing a 400
with a confusing error. Frontend now requires both-or-neither, matching
the same rule already applied to MCQ options.
Also translates the previously hardcoded validation message in both
locales.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Options editor used a single toggle-based bilingual field (BilingualInput)
that swapped English/Amharic in place via a tiny, easy-to-miss button.
Authors were filling English only and never noticing Amharic was empty.
- QuestionOptionsEditor: show separate always-visible English/Amharic
TextInputs per option instead of the toggle field.
- BilingualInput (shared): for other callers still using the toggle,
add a tooltip and a red dot indicator when the hidden language is
empty, so the gap is visible without switching.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Backend now supports MCQ options + a separate answer-key table
(PUT /questions/:id/options). Frontend side of that, authoring only —
no candidate exam-taking UI.
- Question type gains options?: QuestionOption[] (no correctness field —
the API never returns one, matching the backend's split-table design)
- New question-api hooks: getQuestionWithOptions, setQuestionOptions
- New QuestionOptionsEditor component (separate file, not inlined into
QuestionPage) — add/remove/reorder options, mark correct, bilingual text
- Wired into the question edit form, shown only for an existing CHOICE
question (options attach to an id, matching the backend's replace
endpoint)
- en/am i18n strings for the new editor
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Record Result (POST /results) and the detail-modal Save (PUT /results/:id)
had no RequirePermission gate, unlike every other action on this page —
both routes are backend-guarded (RECORD_EXAM_RESULT, or
RECORD_EXAM_RESULT|MODERATE_EXAM_RESULT for the update), the buttons just
never mirrored it client-side.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Added RequirePermission component to manage access based on user permissions.
- Integrated permission checks in MySeaRecordsPage, SeafarerRegistrationPage, VesselRegistrationPage, WaiverPage, and PortalLayout.
- Updated router to enforce permissions for specific routes.
- Introduced PORTAL_PERMISSIONS and LICENSE_PERMISSIONS constants for consistent permission management.
- Enhanced usePermissions hook to fetch permissions from the server and determine access rights.
- Refactored UI components to conditionally render based on user permissions, improving security and user experience.
Resolved by unifying on the lib/data AdvancedTable (PR #10) as the canonical
table component: kept its API plus teammate i18n/feature work, kept the
folder-per-table structure (index.tsx + columns.tsx + actions.tsx) across all
27 tables, removed the parallel lib/table implementation, and fixed
pre-existing compile breaks in ExamDetailPage/QuestionAssigner/RecordResultModal.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat(waiver): implement waiver page with application tracking and letter download feature
feat(ui): introduce AdvancedTable component for enhanced table functionality across the application
chore: update package-lock.json to remove unnecessary dependencies
- Added useLocalized hook to provide a stable function for retrieving bilingual values based on the current language.
- Updated various components across the portal and backoffice to utilize the new useLocalized hook for consistent bilingual label rendering.
- Refactored localized function in licensing.helpers to handle empty Amharic strings correctly.
- Enhanced localization handling in LicenseApplicationPage, ProfilePage, and other components to ensure proper language switching.
- Integrated i18n for seafarer registry page, including translations for various UI elements and statuses.
- Updated SeafarerDetailDrawer and StatusModal components to utilize translation hooks.
- Enhanced user feedback messages for status updates and errors.
- Added new translations for Amharic and English locales, covering seafarer statuses, drawer labels, modal content, and table headers.
localization for backoffice
- Added `useDateDisplayer` hook and `dateDisplayer` function to format dates consistently based on the user's language.
- Updated multiple components and pages in both backoffice and portal applications to utilize the new date display functionality, ensuring proper formatting for dates in lists, tables, and detail views.
- Introduced Ethiopian date formatting for Amharic language support.
- Refactored date handling in components such as ExamAppealsPage, ResultPage, SeafarerRegistryPage, and others to improve localization and user experience.
fix(layouts): import baseApi in BackofficeLayout and PortalLayout for API state management
refactor(auth): remove clearCurrentProfile call on logout and improve cookie removal logic
chore(auth-storage): enhance cookie management with secure and sameSite attributes, and streamline cleanup process