Summary
ReplacementSelectionModal retains selectedReplacementId after the modal closes.
Required change
Reset the selected replacement when the modal closes and when the target performance scale changes. The delete action must require a replacement selected during the current modal session.
Rationale
The parent keeps the modal component mounted. Closing it sets scaleToDelete to null, but the component state persists. When an administrator opens the modal again, the next delete request can submit the prior replacement ID.
Affected area
src/app/admin/performance/components/ReplacementSelectionModal.tsx
src/app/admin/performance/page.tsx
Acceptance criteria
- Canceling the modal clears
selectedReplacementId.
- A successful replacement clears
selectedReplacementId.
- Opening the modal for a different performance scale starts with no replacement selected.
- The Delete and Replace button remains disabled until the administrator selects a replacement in the current session.
Backlinks
Summary
ReplacementSelectionModalretainsselectedReplacementIdafter the modal closes.Required change
Reset the selected replacement when the modal closes and when the target performance scale changes. The delete action must require a replacement selected during the current modal session.
Rationale
The parent keeps the modal component mounted. Closing it sets
scaleToDeletetonull, but the component state persists. When an administrator opens the modal again, the next delete request can submit the prior replacement ID.Affected area
src/app/admin/performance/components/ReplacementSelectionModal.tsxsrc/app/admin/performance/page.tsxAcceptance criteria
selectedReplacementId.selectedReplacementId.Backlinks