Skip to content

feat(ui): add warning before editing agent#108

Open
clutester wants to merge 3 commits into
mitre:masterfrom
clutester:feat/ui-agent-warning
Open

feat(ui): add warning before editing agent#108
clutester wants to merge 3 commits into
mitre:masterfrom
clutester:feat/ui-agent-warning

Conversation

@clutester
Copy link
Copy Markdown
Contributor

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."

  1. 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.

  2. 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.

  • New feature (non-breaking change which adds functionality)

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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-warning styling to edited fields (contact/group/sleep/watchdog).
  • Show a window.confirm prompt before saving when any tracked fields changed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/agents/DetailsModal.vue
Comment thread src/components/agents/DetailsModal.vue Outdated
Comment thread src/components/agents/DetailsModal.vue
clutester and others added 2 commits May 11, 2026 09:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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