Skip to content

Add common FilterDropdown component to vulnerability report

Daniel Tian requested to merge 383346-common-vulnerability-filter-component into master

What does this MR do and why?

We are refactoring the filters on the vulnerability report. Each filter needs a label, a GlDropdown with header text, and the same text format in the dropdown's button. Additionally, most of our filters show a plain and simple dropdown list, and only a few filters need special rendering.

@dpisek pointed out in the reviews of the refactored filters that there's a lot of repeated code between them. This MR introduces a FilterDropdown component that takes the common stuff mentioned above and puts them into one reusable component that all the filters can use. The severity filter has also been modified to use it.

ksnip_20221122-235105

How to set up and validate locally

  1. Enable the refactor_vulnerability_filters feature flag.
  2. Go to any vulnerability report.
  3. Verify that the severity filter uses the FilterDropdown component:
ksnip_20221122-235204
  1. Verify that the severity filter works properly.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #383346 (closed)

Edited by Daniel Tian

Merge request reports