Skip to content

Improve vulnerability filter component logic

Daniel Tian requested to merge 210327-improve-vulnerability-filter-logic into master

What does this MR do?

On the security dashboard, there are filters that will filter the list of vulnerabilities:

ksnip_20201104-153905

These filters have a parent first_class_vulnerability_filters.vue component that has a list of filters:

ksnip_20201104-154036

Previously, this parent component did all the heavy lifting, and each filter only emitted an event when an option in it was clicked:

chart

This meant that each filter needed to follow the same format and behavior:

ksnip_20201104-155241

However, now we need to add new filters that have different behavior:

Scanner filter Activity filter
ksnip_20201104-155527 ksnip_20201104-160817

To make it easier to create filters with different behavior from the standard filter, this MR moves most of the logic from teh parent component into the filter itself:

chart2

This lets us create new filters with custom behavior, because each filter's behavior is now self-contained rather than relying on a parent component to handle it. An example of a custom filter can be seen in this MR: !46540 (merged)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Relates to #229661 (closed)

Edited by Lindsay Kerr

Merge request reports