Add warning modal when a DAST profile has unsaved changes

Problem to Solve

From: #351476 (comment 995826126)

With the new edit side panel, you can edit a profile and during editing, click select scanner profile which will close the sidebar and you lose your edits. Would this be a good opportunity to bring in a cancellation confirmation dialogue? I'm not sure if this is a case that the user would want to confirm they want to lose their changes considering the form is shorter. I noticed the same when you start the form to enable DAST CI/CD configuration and then click on one of the navigation items. I would definitely consider adding a confirmation dialogue here since they could be adding new profiles at the same time and could lose a lot of work!

Proposal

Add a modal warning users when they have unsaved changes.

  • The modal should be displayed wherever site profiles or scanner profiles can be created or edited
    • On-demand scan configuration page
    • DAST CI/CD configuration page
    • DAST profile library (replace existing modal)

🎨 Design file (Figma)

DAST_config_-enabled-edit_scan-_unsaved_changes_warning

Edited by Derek Ferguson