Frontend: Security inventory: add filters to URL parameters
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
What?
The group => Secure => Security inventory page has a filtered search bar at the top where you can:
- search for projects by name (plain text)
- filter by tool coverage (scanner enabled/not enabled/failed)
- filter by the number of vulnerabilities with a certain severity (less than/equal to/greater than some number)
- coming soon: filter by security attributes (is one of/is none of)
However, only the plain text search gets added to the URL params. We should add the filters to the URL params too.
How?
Add a Vue Router and take inspiration from the issues list's filtered search bar, which uses this.$router.push({ query: this.urlParams }); to turn search bar tokens like these:
-
Assigneeis one ofAngelita Zieme, Alishia Littel -
Authoris not one ofAlec Bergnaum, Alishia Littel
... into URL params like these:
http://gdk.test:3000/groups/gitlab-org/-/issues
?sort=created_date
&state=opened
&or%5Bassignee_username%5D%5B%5D=amina_boyer
&or%5Bassignee_username%5D%5B%5D=elza
¬%5Bauthor_username%5D%5B%5D=dionne
¬%5Bauthor_username%5D%5B%5D=elza
&first_page_size=20
... using a convertToUrlParams utility function.
note: %5B is a URL-encoded [; %5D is a URL-encoded ]
Similar pattern used in
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/assets/javascripts/compliance_dashboard/components/projects_report/report.vue
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/issues/service_desk/components/service_desk_list_app.vue
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/issues/dashboard/components/issues_dashboard_app.vue
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/work_items/pages/work_items_list_app.vue
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/merge_requests/list/components/merge_requests_list_app.vue
Edited by 🤖 GitLab Bot 🤖