pelagia-portal/App/app/(portal)
Claude (auto-fix) 61345dd7b7 feat(po): prompt to save as draft when leaving with unsaved changes
Both the PO create and edit screens now guard against accidental loss of
in-progress data. While a form has unsaved changes:

- in-app link clicks and the edit screen's Cancel button are intercepted,
  showing a dialog offering Save as Draft / Discard changes / Stay on page
- hard unloads (reload, tab close, external navigation) trigger the browser's
  native warning via beforeunload

"Save as Draft" reuses the existing draft-save action; validation errors are
surfaced in the dialog so the user can recover or discard. Dirty state is
tracked from any field edit, line-item change, or attachment change.

Adds useUnsavedChanges hook + UnsavedChangesDialog component and unit tests.

Fixes #18

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 05:17:32 +05:30
..
admin fix(profile+vendors): profile reachable for all roles incl SSO; submitter vendor creation 2026-06-08 18:53:33 +05:30
approvals fix(inventory): add items to inventory on PO approval, not on closure 2026-06-19 03:15:56 +05:30
dashboard refactor: revert cost centre to vessels only, remove vessel-site link 2026-05-30 18:14:24 +05:30
history refactor: revert cost centre to vessels only, remove vessel-site link 2026-05-30 18:14:24 +05:30
inventory fix(profile+vendors): profile reachable for all roles incl SSO; submitter vendor creation 2026-06-08 18:53:33 +05:30
my-orders fix(my-orders): correct closed PO filters for manager and submitter 2026-06-19 03:34:21 +05:30
payments feat(payments): compulsory payment date when Accounts records payment 2026-06-10 08:59:25 +05:30
po feat(po): prompt to save as draft when leaving with unsaved changes 2026-06-19 05:17:32 +05:30
profile fix(profile+vendors): profile reachable for all roles incl SSO; submitter vendor creation 2026-06-08 18:53:33 +05:30
layout.tsx chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30