Abstract out Vulnerability Report filter query string logic to a `query_path_sync` component
Summary
Currently the Vulnerability Report Filters rely on the simple_filter.vue
component as a mixin to handle the syncing of the filters with the URL parameters and vice versa, which is not what it was originally intended for and leads to confusing abstraction. It is recommended that we do not use mixins, but instead used scopes (as seen with local_storage_sync.vue). Thus, we should create a query_path_sync.vue
component that handles all the URL parameter syncing with the filters (suggested initially in this conversation)
Additionally, there are no Vue components that currently handle path parameters in GitLab (all the other filters are currently handled in HAML/on the backend, so the ones we create should be generic enough to be potentially reused for other parts of the application
Improvements
- easier filter management and creation
Risks
- if done incorrectly, filters will not work as expected
- potentially it may not be useful depending on the outcome of Design: MVC: Advanced filtering on the Vulnerab... (#342079 - closed), though it could be argued that we would still need a way to sync the query parameters with this new design
Involved components
All of the Vulnerability Report Filters