Skip to content

Replace edit system modal with system detail page (#322)#324

Merged
danielbowne merged 5 commits intomainfrom
322-replace-edit-system-modal-with-system-detail-page
Feb 12, 2026
Merged

Replace edit system modal with system detail page (#322)#324
danielbowne merged 5 commits intomainfrom
322-replace-edit-system-modal-with-system-detail-page

Conversation

@danielbowne
Copy link
Collaborator

Summary

  • Replaces the EditSystemModal dialog with a full-page routed view at /systems/:fismasystemid with card-based layout (System Identity, System Status, Organization, Contacts)
  • Adds read-only mode (default) with admin-only edit toggle; system name column in table becomes a clickable link for all users
  • Ports enhanced decommission features (date picker, notes, audit trail) to the new detail page with proper UUID-to-name resolution for decommissioned_by
  • Retains EditSystemModal for "Add FISMA System" create mode only
  • Upgrades @cmsgov/design-system from v10.1.2 to v13.2.0
  • Extracts shared decommission utilities (getTodayISO, truncateNotes, MAX_NOTES_LENGTH) to src/utils/decommission.ts
  • Fixes: breadcrumb underscore replacement, UTC date validation, stale closure in name resolution, memory leak in retry fetch, consistent error handling, NaN guard for invalid system IDs
  • Adds retry fetch for individual system on page refresh (handles decommissioned systems not in default active-only list)

Test plan

  • Navigate to dashboard, click a system name — detail page loads in read-only mode
  • Breadcrumbs show "Dashboard > Systems > [System Name]"
  • Non-admin users do NOT see Edit button
  • Admin: click Edit — fields become editable, Save/Cancel appear, layout matches read mode
  • Edit a field, click Save — snackbar shows success, stays in edit mode
  • Edit a field, click Cancel — confirm dialog appears if unsaved changes
  • Decommission checkbox (active system) — date picker + notes form appears, confirm dialog on submit
  • Edit Decommission Details (decommissioned system) — update date/notes, confirm dialog
  • "Decommissioned By" shows human-readable name, not UUID
  • Page refresh on /systems/:id works (including decommissioned systems)
  • Invalid system ID (e.g. /systems/abc) shows "Invalid system ID" error
  • Admin menu "Add FISMA System" still opens the create modal
  • Table edit icon navigates to detail page with ?edit=true

Add routed system detail page at /systems/:fismasystemid with read-only
and edit modes using card-based layout. System name column in table is
now a clickable link, admin edit icon navigates to detail page. Create
mode remains in existing modal. Upgrade @cmsgov/design-system to v13.
…resh

- Align edit view layout to match read view (System Status card above
  Organization, Contacts card standalone)
- Show Active/Decommissioned chip in System Identity header for both views
- Resolve decommissioned_by UUID to human-readable name in both read and
  edit modes, not just edit mode
- Fix user API response path (res.data.data.fullname) in both
  SystemDetailPage and EditSystemModal
- Set decommissioned_by name immediately from userInfo after decommission
  action instead of waiting for separate API roundtrip
- Add retry fetch for individual system on page refresh when system is
  decommissioned and not in default active-only list
- Add bottom margin for spacing before footer
- Add cancellation cleanup to retry fetch effect to prevent memory leak
  on unmount
- Remove stale closure comparison in decommissionedByName effect
- Add NaN guard for invalid systemId URL parameter
- Fix UTC date validation: use setUTCHours for consistent timezone
  comparison
- Extract shared getTodayISO, truncateNotes, MAX_NOTES_LENGTH to
  src/utils/decommission.ts (DRY)
- Replace magic number 500/100 with named constants
- Standardize error handling in handleSave to match handleDecommission
  (add 403, 404 checks)
- Fix breadcrumb underscore replacement to handle all occurrences and
  numeric segments
Copy link
Collaborator

@eschwein-usds eschwein-usds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved

@danielbowne danielbowne merged commit d08555e into main Feb 12, 2026
3 checks passed
@danielbowne danielbowne deleted the 322-replace-edit-system-modal-with-system-detail-page branch February 12, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants