Clean up BASE_FILTERS and move them into the helper that uses them
In ee/app/assets/javascripts/security_dashboard/store/modules/filters/constants.js
, there is a BASE_FILTERS
object:
This object is used only by ee/app/assets/javascripts/security_dashboard/helpers.js
for the allOption
property in each of the filter config objects:
We should move each entry in BASE_FILTERS
directly into the filter config objects. There's no need for them to be in a separate file, in a separate object.
How to verify:
-
Verify that
ee/app/assets/javascripts/security_dashboard/store/modules/filters/constants.js
no longer has aBASE_FILTERS
. -
Verify that
ee/app/assets/javascripts/security_dashboard/helpers.js
no longer imports fromconstants.js
, and that each filter object's name has a string rather than a variable name (except for scanner filter, which uses a const declared in the same file). -
Verify that for the project report (https://gitlab.com/gitlab-org/gitlab/-/security/vulnerability_report/?severity=all), clicking on the "All items" dropdown item for each filter will remove that filter's query param from the querystring (or not add it if it's not present). Because "All items" is the default when no query param exists for a filter, there's no need to save "all items" to the querystring when it's selected. The exception is the status filter, which defaults to "needs triage" and "confirmed", so it needs to add
state=all
to the querystring when "All items" is clicked. -
Verify the above for the group report: https://gitlab.com/gitlab-org/gitlab/-/security/vulnerability_report
-
Verify the above for the instance report: https://gitlab.com/-/security/vulnerabilities