pelagia-portal/App/components
Hardik e481eb0a15
All checks were successful
PR checks / checks (pull_request) Successful in 50s
PR checks / integration (pull_request) Successful in 31s
feat(po): allow attachments in any state except rejected/cancelled
Broadens the feature-flagged attachment affordance (same flag,
NEXT_PUBLIC_CLOSED_PO_ATTACHMENTS_ENABLED) from CLOSED-only to **any PO state
except REJECTED / CANCELLED**, for the same roles: the PO's own submitter plus
Accounts / Manager / SuperUser.

- lib/permissions.ts: canAddClosedPoAttachment → canAddPoAttachment(role,
  status, { isSubmitter }); allows the submitter + ACCOUNTS/MANAGER/SUPERUSER
  in any non-voided state. REJECTED/CANCELLED are always refused.
- uploadPoDocuments: voided POs are refused regardless of the flag; with the
  flag on, uploads are restricted to those roles in any live state (the normal
  create/receipt actors qualify, so those flows keep working); with the flag
  off, the legacy behaviour stands (closed POs immutable).
- po-detail.tsx: the Attachments card now shows the uploader for any non-voided
  state when permitted (not just CLOSED).
- Renamed ClosedPoAttachmentUploader → PoAttachmentUploader and the test file
  to po-attachment-permissions.test.ts (flag-on matrix now covers live states +
  rejected/cancelled refusal). Docs updated (feature-flags, .env.example,
  CLAUDE.md).

Full unit + integration suites green; tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 01:42:13 +05:30
..
dashboard chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
inventory chore: restructure repo — flatten App/pelagia-portal to App, rename Prototype→Wireframe and Spec→Design 2026-05-18 23:18:58 +05:30
layout refactor(po): admin-managed Project Codes instead of a static list 2026-06-26 02:52:03 +05:30
po feat(po): allow attachments in any state except rejected/cancelled 2026-06-28 01:42:13 +05:30
reports fix(reports): chart series all rendered one colour (RSC boundary bug) 2026-06-24 12:31:40 +05:30
ui feat(po): make vendor field a searchable combobox 2026-06-24 05:16:57 +05:30
env-banner.tsx feat(app): env-gated banner (EnvBanner) for non-prod environments 2026-06-19 11:56:34 +05:30