Loading
Add delete flow for security scan profiles
What does this MR do and why?
Adds a delete action to the group Security Configuration → Manage profiles drawer, behind the custom_secret_detection_profiles_ui feature flag. Custom scan profiles gain a trash icon in the drawer's detail pane; clicking it opens a confirmation modal, and confirming runs securityScanProfileDelete, refetches the profile list, and shows a toast with the deleted profile's name. GitLab-managed profiles show the icon disabled with a tooltip explaining why.
References
- issue: [Frontend] Scan profile drawer: view, create, e... (#624191 - closed)
- parent work item: Advanced Configuration Profiles for Security Sc... (gitlab-org#20193)
- Design:
security-inventory-profiles
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Enable the feature flag on a Rails console:
Feature.enable(:custom_secret_detection_profiles_ui). - Seed at least one Custom Secret Detection scan profile in the target group (via GraphQL
securityScanProfileCreate- see !247227 (merged) for setup). - On the group's Security Configuration page, click Manage profiles on the
Secret Detectionrow. The drawer opens with the profile list on the left and a detail pane on the right. - Select the custom profile. The trash icon in the detail header is enabled; hovering reveals the Delete tooltip.
- Click it. The modal title reads Delete "<name>", the body reads
You are about to delete "<name>". Are you sure you want to proceed?, and the primary action reads Delete profile in thedangervariant. - Click Delete profile. The profile disappears from the list, another profile is auto-selected, and a toast reads
Deleted "<name>". - Select a GitLab-managed profile (for example, the default). The trash icon is disabled; hovering reveals the tooltip
GitLab-managed profiles can't be deleted.. - Cancel path: on any custom profile, open the modal and click Cancel or dismiss with the X. The modal closes with no mutation and no toast.
- Error path: open the browser's network tab, click Delete icon, and in devtools override the response so
securityScanProfileDelete.errorscontains a string. Confirm a danger alert appears in the top of the drawer with readingFailed to delete "<name>".message and no success toast is shown.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Chen Charnolevsky