Add create flow for security scan profiles

What does this MR do and why?

Adds a Create new profile entry point to the group Security Configuration → Manage profiles drawer. Clicking the button beneath the profile list swaps in the same form used for editing, pre-filled with all allowed triggers on, and calls securityScanProfileCreate on save. On success the drawer refetches the list, exits create mode, selects the newly created profile, and toasts Created "<name>".

The form's Save changes button now stays disabled until the profile has a name and at least one enabled trigger, so users can't submit an incomplete profile. References

Screenshots or screen recordings

Before After

New mode not exist

image.png

Error msg

How to set up and validate locally

  1. Enable the feature flag on a Rails console: Feature.enable(:custom_scan_profiles_ui).
  2. Open the group's Security Configuration page and click Manage profiles on the Secret Detection row. A Create new profile button sits below the profile list, aligned with the list rows.
  3. Click Create new profile. The drawer shrinks, the list is replaced by an empty form titled Create secret detection profile. All three trigger toggles start on. Save changes is disabled because the name is empty.
  4. Fill in the name; Save changes becomes enabled. Toggle off every trigger; the button disables again. Toggle at least one back on to re-enable it.
  5. Click Save changes. Observe a skeleton in the small drawer, then the drawer widens with the list showing the new profile pre-selected. Toast reads Created "<name>".
  6. Cancel path: click Create new profile again, then click Cancel or the drawer's X, or press Esc. The form closes and the read-only list returns; no mutation runs.
  7. Error path: To test mutation error handling, open the browser's network tab, click Disable for all, and in devtools override the response so securityScanProfileCreate.errors contains a string. Confirm a danger alert appears in the drawer with the generic disabling 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

Merge request reports

Loading
Loading