Global Search - Use SSoT for Active Search Scope
What / Why
Follow up for thread: !112244 (comment 1297897564)
This bug isn't actually exposed unless !112244 (merged) is merged.
In the past we would look at the query.scope
to determine which scope we were searching. This powers things like the Status and Confidentiality filters. As well as the logic for async fetching the counts of the tabs.
However, recently we have introduced the navigationJson
that is effectively managing the available scopes as well as which one that is active (via the active: true
and currentScope
getter).
concern: This is causing an inconsistency in how we manage the active scope depending on what component you are using. We need to use a SSoT for the current scope logic and I believe that should be getters.currentScope
and NOT query.scope
due to scope no longer being required in the URL.
As of right now this isn't causing any issues when no scope is provided due to:
- Issues and MRs not being a default scope
- The count logic simply overwrites the current scope's count with the same count so you don't notice. However, it is firing an additional API call.
Proposal
note: getters.currentScope
is a method added in !112244 (merged)
-
checkbox_filter.vue
- Replacescope
computed property withgetters.currentScope
. -
radio_filter.vue
- Replacescope
computed property withgetters.currentScope
. -
results_filter.vue
- Replace usage ofurlQuery.scope
withgetters.currentScope
inshowConfidentialityFilter
computed property. -
results_filter.vue
- Replace usage ofurlQuery.scope
withgetters.currentScope
inshowStatusFilter
computed property. -
actions.js
- Replace usage ofurlQuery.scope
withgetters.currentScope
infetchSidebarCount
action.