feat(ui): add warning before editing agent#108
Open
clutester wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a two-stage “edit warning” UX to the Agents Details modal to reduce accidental global agent-configuration changes by (1) highlighting modified fields and (2) prompting for confirmation on Save when changes are detected.
Changes:
- Snapshot original agent state on selection and compute per-field “dirty” status.
- Apply Bulma
is-warningstyling to edited fields (contact/group/sleep/watchdog). - Show a
window.confirmprompt before saving when any tracked fields changed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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
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.
Description
This PR implements a two-stage warning system when editing existing agents in the DetailsModal.vue component. The goal is to prevent accidental global configuration changes without introducing "notification fatigue."
Visual Indicators: Individual input fields (group, sleep_min, sleep_max, watchdog, and contact) now dynamically apply the Bulma is-warning class (yellow border) if their value differs from the original state when the modal was opened.
Final Confirmation: Upon clicking "Save," if any changes are detected, a browser confirmation dialog appears stating: "Changes to agents affect all Caldera users! Are you sure you want to save these changes?"
Related JIRA Ticket
VIRTS-4660
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Verified that changing an agent property triggers the yellow is-warning highlight.
Verified that clicking "Save" with changes triggers the window.confirm pop-up.
Verified that clicking "Cancel" on the pop-up prevents the API call.
Verified that after a successful save, the "dirty" state resets and highlights disappear.
Checklist: