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:

  1. Issues and MRs not being a default scope
  2. 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)

  1. checkbox_filter.vue - Replace scope computed property with getters.currentScope.
  2. radio_filter.vue - Replace scope computed property with getters.currentScope.
  3. results_filter.vue - Replace usage of urlQuery.scope with getters.currentScope in showConfidentialityFilter computed property.
  4. results_filter.vue - Replace usage of urlQuery.scope with getters.currentScope in showStatusFilter computed property.
  5. actions.js - Replace usage of urlQuery.scope with getters.currentScope in fetchSidebarCount action.

cc/ @tbulva @terrichu @changzhengliu

Edited by Zack Cuddy