summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/search/sidebar/components/scope_navigation.vue
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/assets/javascripts/search/sidebar/components/scope_navigation.vue
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
downloadgitlab-ce-71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e.tar.gz
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/assets/javascripts/search/sidebar/components/scope_navigation.vue')
-rw-r--r--app/assets/javascripts/search/sidebar/components/scope_navigation.vue5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/assets/javascripts/search/sidebar/components/scope_navigation.vue b/app/assets/javascripts/search/sidebar/components/scope_navigation.vue
index 3c280a5d696..5863381e2ef 100644
--- a/app/assets/javascripts/search/sidebar/components/scope_navigation.vue
+++ b/app/assets/javascripts/search/sidebar/components/scope_navigation.vue
@@ -5,6 +5,7 @@ import { s__ } from '~/locale';
import Tracking from '~/tracking';
import { NAV_LINK_DEFAULT_CLASSES, NAV_LINK_COUNT_DEFAULT_CLASSES } from '../constants';
import { formatSearchResultCount } from '../../store/utils';
+import { slugifyWithUnderscore } from '../../../lib/utils/text_utility';
export default {
name: 'ScopeNavigation',
@@ -46,6 +47,9 @@ export default {
isActive(scope, index) {
return this.urlQuery.scope ? this.urlQuery.scope === scope : index === 0;
},
+ qaSelectorValue(item) {
+ return `${slugifyWithUnderscore(item.label)}_tab`;
+ },
},
NAV_LINK_DEFAULT_CLASSES,
NAV_LINK_COUNT_DEFAULT_CLASSES,
@@ -62,6 +66,7 @@ export default {
class="gl-mb-1"
:href="item.link"
:active="isActive(scope, index)"
+ :data-qa-selector="qaSelectorValue(item)"
@click="handleClick(scope)"
><span>{{ item.label }}</span
><span v-if="item.count" :class="countClasses(isActive(scope, index))">