Keep scanner card selected when choosing a profile

What does this MR do and why?

Keep scanner card selected when choosing a profile

This fixes a regression introduced by
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/252954
Clicking on an option in the scan profile dropdown
should not deselect the scanner card

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/624190
Changelog: fixed
EE: true

References

Screenshots or screen recordings

Before 🐛 After 😌

How to set up and validate locally

  1. git checkout 624190-keep-card-selected-on-profile-choice
  2. have a GitLab Ultimate licence, and have read_security_scan_profiles permission for a top-level group

reach the select scanners step

  1. go to a group => Secure => Security configuration => Scanners tab
  2. click Enable scanners
  3. on the first step of the wizard, choose the advanced approach rather than the default quick approach, so it does not skip straight to review
  4. check that you land on Select scanners, Step 3 of 4, with header row Select all scanners

verify the fix

  1. select a scanner card by clicking anywhere on it - the cards start unselected, and a card's Configuration profile dropdown stays disabled until its card is selected
  2. open that card's Configuration profile dropdown and click on an option in the dropdown
  3. check that:
    • the card is still selected, with its checkbox still checked
    • the Configuration profile dropdown is still enabled
    • the dropdown panel closes normally
    • the Select all scanners count does not go down — it should still reflect the cards that are checked
  4. check that clicking the card outside the dropdown still toggles it, so the guard covers only the dropdown:
    • clicking the card title or description should deselect the card, and clicking again should reselect it

to run tests

yarn jest ee/spec/frontend/security_configuration/components/enable_scanners_wizard/select_scanners_spec.js

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.

Related to #624190

Edited by Miranda Fluharty

Merge request reports

Loading
Loading