Add alerts for empty policies
What does this MR do and why?
Add alerts for empty policies
- policies need to either have actions or settings
- create alert warning user of when they ony have settings
- create alert when a user has an empty policy and disable the save button
Changelog: changed
EE: true
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
NOTE: these screenshots were done with a different feature flag, so there is only one setting
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Enable a feature flag that adds settings
echo "Feature.enable(:scan_result_any_merge_request)" | rails c
- Upload a GitLab Ultimate license
- Navigate to a project/group => Secure => Policies => New policy => Scan Result Policy
- Type in a name and select
Any merge request
type - Remove the action section either by the remove button (may not exist yet) or navigate to yaml mode and remove the
actions:
object from the yaml - Ensure some of the settings are checked
- Verify there is an alert (variant: warning) above the buttons at the bottom.
- Verify the
Configure with merge request
button is enabled - Uncheck all of the settings
- Verify there is an alert (variant: danger) above the buttons at the bottom.
- Verify the
Configure with merge request
button is disabled
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #429248 (closed)
Edited by Alexander Turinske