diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-18 15:10:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-18 15:10:56 +0300 |
commit | 3aab29eacb2d35d90d93ed005b6fc825955b4d23 (patch) | |
tree | 22d27e78673df7e098ca2084f4773d3173aa4e75 /app/assets/javascripts/search | |
parent | 664bf56eaaaff7a377f3272676b7e27fa12aa143 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/search')
3 files changed, 24 insertions, 1 deletions
diff --git a/app/assets/javascripts/search/sidebar/components/archived_filter/data.js b/app/assets/javascripts/search/sidebar/components/archived_filter/data.js index 7a3dc8ad96b..de73ca57adb 100644 --- a/app/assets/javascripts/search/sidebar/components/archived_filter/data.js +++ b/app/assets/javascripts/search/sidebar/components/archived_filter/data.js @@ -10,6 +10,7 @@ const scopes = { ISSUES: 'issues', MERGE_REQUESTS: 'merge_requests', NOTES: 'notes', + BLOBS: 'blobs', }; const filterParam = 'include_archived'; diff --git a/app/assets/javascripts/search/sidebar/components/blobs_filters.vue b/app/assets/javascripts/search/sidebar/components/blobs_filters.vue index 5f4d6fbd56c..ac36ae6b366 100644 --- a/app/assets/javascripts/search/sidebar/components/blobs_filters.vue +++ b/app/assets/javascripts/search/sidebar/components/blobs_filters.vue @@ -1,5 +1,10 @@ <script> +// eslint-disable-next-line no-restricted-imports +import { mapGetters, mapState } from 'vuex'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; +import { HR_DEFAULT_CLASSES } from '../constants'; import LanguageFilter from './language_filter/index.vue'; +import ArchivedFilter from './archived_filter/index.vue'; import FiltersTemplate from './filters_template.vue'; export default { @@ -7,6 +12,21 @@ export default { components: { LanguageFilter, FiltersTemplate, + ArchivedFilter, + }, + mixins: [glFeatureFlagsMixin()], + computed: { + ...mapGetters(['currentScope']), + ...mapState(['useSidebarNavigation', 'searchType']), + showArchivedFilter() { + return this.glFeatures.searchBlobsHideArchivedProjects; + }, + showDivider() { + return !this.useSidebarNavigation && this.showArchivedFilter; + }, + hrClasses() { + return [...HR_DEFAULT_CLASSES, 'gl-display-none', 'gl-md-display-block']; + }, }, }; </script> @@ -14,5 +34,7 @@ export default { <template> <filters-template> <language-filter class="gl-mb-5" /> + <hr v-if="showDivider" :class="hrClasses" /> + <archived-filter v-if="showArchivedFilter" class="gl-mb-5" /> </filters-template> </template> diff --git a/app/assets/javascripts/search/sidebar/components/language_filter/index.vue b/app/assets/javascripts/search/sidebar/components/language_filter/index.vue index ca1503d7c64..784207cc702 100644 --- a/app/assets/javascripts/search/sidebar/components/language_filter/index.vue +++ b/app/assets/javascripts/search/sidebar/components/language_filter/index.vue @@ -74,7 +74,7 @@ export default { </script> <template> - <div v-if="hasBuckets" class="gl-my-0 language-filter-checkbox"> + <div v-if="hasBuckets" class="language-filter-checkbox"> <h5 class="gl-mt-0 gl-mb-5" :class="{ 'gl-font-sm': useSidebarNavigation }"> {{ $options.languageFilterData.header }} </h5> |