Repository navigation
Closed
Labels
admin-toolsAdmin interface and management toolsAdmin interface and management toolsenhancementNew feature or requestNew feature or requestformsForm handling, validation, and user inputForm handling, validation, and user inputpriority:highHigh priority - should be addressed soonHigh priority - should be addressed soonready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agent
Description
Current implementation plan — 2026-10-15
Part of #558. This section supersedes the obsolete inline-column and approvedEditSchema implementation notes below.
A committee member correcting an Approved HAP/CAP Submission must be able to edit the supplement types and regimens originally supplied by the Member. Propagation, lighting and CO₂ already exist in the details editor; this gap is normalized supplements.
- Load and render the existing normalized supplement rows, with the same applicability and validation rules as the Member form.
- Support adding, changing and removing supplement rows, including clearing all. Define omitted input versus explicit empty input so unrelated details edits cannot erase supplements.
- Extend the approved-details lifecycle operation rather than bypassing it in the route. A supplement-only change is a valid edit.
- Require the existing committee authorization and reason; retain the prohibition on editing one's own Submission.
- Commit details, supplement replacement and the single reason-bearing admin audit entry together. A failure anywhere leaves all three unchanged; successful retry creates one committed edit.
- Keep Species, points, Witness and approval state unchanged; details edits send no notification and trigger no standings recomputation (ADR-0003).
- Verify add/edit/clear, omitted input, supplement-only edits, unauthorized requests, forbidden points/Species fields and failure/rollback/retry with focused tests. Confirm saved values by reopening the editor; the completed report in Complete Program-aware Submission reports for HAP and CAP #559 will also display them.
Blocked by: None. Coordinate with the Member-save transaction work already in progress, without assuming that uncommitted work is on the default branch.
Original issue (historical context)
Description
The post-approval editor (/admin/submissions/:id/edit-approved) is missing the supplements fields that are present in the main submission form.
Missing Fields
Supplement Type (multi-select):
- Dosing Pump
- Manual Addition
- Root Tabs
- Liquid Fertilizer
- Dry Fertilizer
Supplement Regimen (text input):
- Description of supplement dosing schedule
Context
These fields are:
- Already in the database (
supplement_type,supplement_regimencolumns) - Already displayed in the main BAP form for Plant/Coral submissions
- Already parsed and displayed in the edit form rendering code (lines 1022-1023 in
src/routes/admin.ts) - Only relevant for Plant/Coral species (
hasSupplements()helper)
Implementation Notes
- Add to Details tab in
src/views/admin/editApprovedSubmission.pug - Wrap in
if hasSupplementsconditional (already passed to template) - Convert comma-separated string back to multi-select format for display
- Include in the
approvedEditSchemavalidation (already accepts these as optional strings)
Related Files
src/views/admin/editApprovedSubmission.pug- Template to updatesrc/routes/admin.ts:1022-1023- Already parses these fieldssrc/forms/approvedEdit.ts:25-26- Schema already includes these fieldssrc/views/bapForm/form.pug:152-170- Reference implementation in main form
Testing
- Edit an approved Plant or Coral submission
- Verify supplement fields appear in Details tab
- Verify fields can be edited and saved
- Verify changes are recorded in edit log
Metadata
Metadata
Assignees
Labels
admin-toolsAdmin interface and management toolsAdmin interface and management toolsenhancementNew feature or requestNew feature or requestformsForm handling, validation, and user inputForm handling, validation, and user inputpriority:highHigh priority - should be addressed soonHigh priority - should be addressed soonready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agent
Activity
Edit supplements in the Edit Approved Submission dialog (#158)
Edit supplements in the Edit Approved Submission dialog (#158) (#569)