Draft: Search tabs fix resetting params on tab change
What does this MR do?
Related to #262066 (closed)
Found while testing !52018 (merged) in staging. This fixes two issues found:
- Reset Filter link was not working as expected (it directs users to Snippets)
- Some URL params are being kept when changing tabs that should be cleared
How to test
Test setup required:
- Enable Advanced Search in GDK and in Admin Settings
- Index all projects (or a single test project)
unsupported params
- add random params to the end of the search query URL (ex - https://gdk.test:3000/search?search=test&snippets=false&repository_ref=&scope=merge_requests&group_id=24¶m_will_be_removed=1)
- change tabs, verify the random params is not present in the URL
params specific to a tab
- run an issues search with a status or confidentiality filter set (ex - http://gdk.test:3000/search?search=test&snippets=false&repository_ref=&scope=issues&group_id=24&state=closed)
- change tabs to code, verify that the state or confidential param is not present in the URL
resetting filters
- run a merge requests search with a status filter set (ex - http://gdk.test:3000/search?search=test&snippets=false&repository_ref=&scope=merge_requests&group_id=24&state=merged)
- hit the reset link in the filter sidebar and verify that the state param is not present in the URL
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines - [-] Style guides
- [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Terri Chu