Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-31 21:10:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-31 21:10:31 +0300
commite9885f7a36065b9b45a35feb6c427c7742a906a4 (patch)
treebffa88df5eadcdf282eb0904a925b7c3cec13027 /app/assets/javascripts/search/sidebar
parentfab00cd7efb84b369dfb45cabb797f7feace4b66 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/search/sidebar')
-rw-r--r--app/assets/javascripts/search/sidebar/components/app.vue23
-rw-r--r--app/assets/javascripts/search/sidebar/components/scope_legacy_navigation.vue (renamed from app/assets/javascripts/search/sidebar/components/scope_navigation.vue)2
-rw-r--r--app/assets/javascripts/search/sidebar/components/scope_sidebar_navigation.vue (renamed from app/assets/javascripts/search/sidebar/components/scope_new_navigation.vue)2
3 files changed, 15 insertions, 12 deletions
diff --git a/app/assets/javascripts/search/sidebar/components/app.vue b/app/assets/javascripts/search/sidebar/components/app.vue
index 317145d4cd1..7046a57058d 100644
--- a/app/assets/javascripts/search/sidebar/components/app.vue
+++ b/app/assets/javascripts/search/sidebar/components/app.vue
@@ -1,7 +1,7 @@
<script>
import { mapState, mapGetters } from 'vuex';
-import ScopeNavigation from '~/search/sidebar/components/scope_navigation.vue';
-import ScopeNewNavigation from '~/search/sidebar/components/scope_new_navigation.vue';
+import ScopeLegacyNavigation from '~/search/sidebar/components/scope_legacy_navigation.vue';
+import ScopeSidebarNavigation from '~/search/sidebar/components/scope_sidebar_navigation.vue';
import SidebarPortal from '~/super_sidebar/components/sidebar_portal.vue';
import { SCOPE_ISSUES, SCOPE_MERGE_REQUESTS, SCOPE_BLOB } from '../constants';
import ResultsFilters from './results_filters.vue';
@@ -11,13 +11,14 @@ export default {
name: 'GlobalSearchSidebar',
components: {
ResultsFilters,
- ScopeNavigation,
- ScopeNewNavigation,
+ ScopeLegacyNavigation,
+ ScopeSidebarNavigation,
LanguageFilter,
SidebarPortal,
},
computed: {
- ...mapState(['urlQuery', 'useNewNavigation']),
+ // useSidebarNavigation refers to whether the new left sidebar navigation is enabled
+ ...mapState(['useSidebarNavigation']),
...mapGetters(['currentScope']),
showIssueAndMergeFilters() {
return this.currentScope === SCOPE_ISSUES || this.currentScope === SCOPE_MERGE_REQUESTS;
@@ -25,7 +26,9 @@ export default {
showBlobFilter() {
return this.currentScope === SCOPE_BLOB;
},
- showOldNavigation() {
+ showScopeNavigation() {
+ // showLegacyNavigation refers to whether the scope navigation should be shown
+ // while the legacy navigation is being used and there are no search results the scope navigation has to be hidden
return Boolean(this.currentScope);
},
},
@@ -33,18 +36,18 @@ export default {
</script>
<template>
- <section v-if="useNewNavigation">
+ <section v-if="useSidebarNavigation">
<sidebar-portal>
- <scope-new-navigation />
+ <scope-sidebar-navigation />
<results-filters v-if="showIssueAndMergeFilters" />
<language-filter v-if="showBlobFilter" />
</sidebar-portal>
</section>
<section
- v-else
+ v-else-if="showScopeNavigation"
class="search-sidebar gl-display-flex gl-flex-direction-column gl-md-mr-5 gl-mb-6 gl-mt-5"
>
- <scope-navigation />
+ <scope-legacy-navigation />
<results-filters v-if="showIssueAndMergeFilters" />
<language-filter v-if="showBlobFilter" />
</section>
diff --git a/app/assets/javascripts/search/sidebar/components/scope_navigation.vue b/app/assets/javascripts/search/sidebar/components/scope_legacy_navigation.vue
index fc41baee831..e682369d60b 100644
--- a/app/assets/javascripts/search/sidebar/components/scope_navigation.vue
+++ b/app/assets/javascripts/search/sidebar/components/scope_legacy_navigation.vue
@@ -8,7 +8,7 @@ import { NAV_LINK_DEFAULT_CLASSES, NAV_LINK_COUNT_DEFAULT_CLASSES } from '../con
import { slugifyWithUnderscore } from '../../../lib/utils/text_utility';
export default {
- name: 'ScopeNavigation',
+ name: 'ScopeLegacyNavigation',
i18n: {
countOverLimitLabel: s__('GlobalSearch|Result count is over limit.'),
},
diff --git a/app/assets/javascripts/search/sidebar/components/scope_new_navigation.vue b/app/assets/javascripts/search/sidebar/components/scope_sidebar_navigation.vue
index 86b7cc577a6..3707e152e47 100644
--- a/app/assets/javascripts/search/sidebar/components/scope_new_navigation.vue
+++ b/app/assets/javascripts/search/sidebar/components/scope_sidebar_navigation.vue
@@ -6,7 +6,7 @@ import NavItem from '~/super_sidebar/components/nav_item.vue';
import { NAV_LINK_DEFAULT_CLASSES, NAV_LINK_COUNT_DEFAULT_CLASSES } from '../constants';
export default {
- name: 'ScopeNewNavigation',
+ name: 'ScopeSidebarNavigation',
i18n: {
countOverLimitLabel: s__('GlobalSearch|Result count is over limit.'),
},