-
Notifications
You must be signed in to change notification settings - Fork 3
Enhance decommission with date picker, notes, and audit trail #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
danielbowne
wants to merge
9
commits into
main
Choose a base branch
from
feature/313-enhance-decommission
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…313) Add custom date selection and optional notes when decommissioning a FISMA system, and display a full audit trail for already-decommissioned systems with the ability to retroactively edit decommission details. - Add decommissioned_by and decommissioned_notes fields to FismaSystemType - Add date picker (native HTML date input) and notes textarea to decommission form, hidden until checkbox is checked - Send decommissioned_date and notes in DELETE request body - Display audit trail (date, user name, notes) for decommissioned systems - Resolve decommissioned_by UUID to user fullname via /users endpoint - Add "Edit Decommission Details" for retroactive date/notes updates - Add optional title prop to ConfirmDialog for contextual dialog headers - Expose fetchFismaSystems through context so table refreshes after decommission without requiring manual page reload - Validate decommission date: reject future dates, require valid format - Cap notes at 500 characters with live character counter
Parse date input as UTC midnight (YYYY-MM-DDT00:00:00.000Z) instead of local timezone to ensure consistent date storage and display across timezones. Prevents dates from shifting by ±1 day depending on user's timezone offset.
…alidation - Always send notes field (as string or null) so empty notes clear backend value - Add cleanup/cancellation to user lookup useEffect to prevent race condition when modal closes or switches systems mid-fetch - Fix onBlur validation using stale state by reading e.currentTarget.value instead of decommissionDate state variable
Apply eslint --fix to match CI prettier rules - arrow function with block statement for multi-line validation call.
Backend Go struct with omitempty expects field to be omitted when empty, not sent as null. Also add console.error logging and 400 error handling to show actual backend error messages instead of redirecting to sign-in.
Prevent crash when error.response is undefined. Add console logging to debug table refresh failures after decommission.
Backend returns { data: { system } } but code was using res.data
directly instead of res.data.data. This caused a malformed object
to be passed to the table, throwing an error that showed as
'Decommission error: undefined undefined' in console.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #313
Changes
Types & data model (
types.ts,emptySystem.ts)decommissioned_byanddecommissioned_notesfields toFismaSystemTypeConfirmDialog (
ConfirmDialog.tsx)titleprop so callers can set contextual dialog headers (defaults to "Unsaved Changes")EditSystemModal (
EditSystemModal.tsx)decommissioned_dateandnotesin DELETE request body (Axios{ data: ... }syntax)/usersendpoint), and notesFismaTable (
FismaTable.tsx)Context (
Context.ts,Title.tsx)fetchFismaSystemsthrough outlet context so child components can trigger table refreshTest plan
decommissioned_dateas ISO string, nonotesfield