Add indeterminate state in bulk checkbox if > 0 but < all on Vulnerability Report

Problem to solve

The Vulnerability Report doesn't match Pajamas guidelines when it comes to the bulk checkbox state. We should align with other tables in GitLab for consistency and setting user expectations.

We should be using an indeterminate state in the bulk checkbox if one or more (but less than all) vulnerabilities are selected on the Vulnerability Report. If all on the page (or across the matching filters) are selected, then the bulk checkbox should be in the checked state.

Current Expected
Screen_Shot_2022-01-17_at_10.21.32_AM image

If the user clicks on the bulk checkbox while in the indeterminate state, it should select all. The bulk checkbox then goes into the checked state. Clicking again will unselect all (and clear the bulk checkbox).

Implementation plan

  • Add indeterminate state to "select all" checkbox in ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_report/vulnerability_list.vue
  • Add indeterminate state to "select all" checkbox in ee/app/assets/javascripts/security_dashboard/components/shared/vulnerability_list.vue, if it still exists. This component is deprecated, but is currently used by the GraphQL version of the vulnerability list on the pipeline security tab, and is behind a feature flag.

/cc @matt_wilson @andyvolpe @dftian

Edited by Becka Lippert