diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-30 21:09:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-30 21:09:47 +0300 |
commit | cd99e8611a6df11975c227517892606440ad3ff6 (patch) | |
tree | aea53bef850be971e128b4be9649654d760b2b02 /app/assets/javascripts/search | |
parent | 412fe7ab5511ec446f250d415d571108fe838b68 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/search')
7 files changed, 11 insertions, 43 deletions
diff --git a/app/assets/javascripts/search/index.js b/app/assets/javascripts/search/index.js index d4ee857c9c1..d71785d7fac 100644 --- a/app/assets/javascripts/search/index.js +++ b/app/assets/javascripts/search/index.js @@ -1,6 +1,5 @@ import setHighlightClass from 'ee_else_ce/search/highlight_blob_search_result'; import { queryToObject } from '~/lib/utils/url_utility'; -import refreshCounts from '~/pages/search/show/refresh_counts'; import syntaxHighlight from '~/syntax_highlight'; import { initSidebar, sidebarInitState } from './sidebar'; import { initSearchSort } from './sort'; @@ -24,8 +23,4 @@ export const initSearchApp = () => { setHighlightClass(query.search); // Code Highlighting initBlobRefSwitcher(); // Code Search Branch Picker - - if (!gon.features?.searchPageVerticalNav) { - refreshCounts(); // Other Scope Tab Counts - } }; diff --git a/app/assets/javascripts/search/sidebar/components/app.vue b/app/assets/javascripts/search/sidebar/components/app.vue index 6f29864c0a2..927ae6f6b81 100644 --- a/app/assets/javascripts/search/sidebar/components/app.vue +++ b/app/assets/javascripts/search/sidebar/components/app.vue @@ -1,7 +1,6 @@ <script> import { mapState } from 'vuex'; import ScopeNavigation from '~/search/sidebar/components/scope_navigation.vue'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { SCOPE_ISSUES, SCOPE_MERGE_REQUESTS } from '../constants'; import ResultsFilters from './results_filters.vue'; @@ -11,7 +10,6 @@ export default { ResultsFilters, ScopeNavigation, }, - mixins: [glFeatureFlagsMixin()], computed: { ...mapState(['urlQuery']), showFilters() { @@ -23,7 +21,7 @@ export default { <template> <section class="search-sidebar gl-display-flex gl-flex-direction-column gl-mr-4 gl-mb-6 gl-mt-5"> - <scope-navigation v-if="glFeatures.searchPageVerticalNav" /> + <scope-navigation /> <results-filters v-if="showFilters" /> </section> </template> diff --git a/app/assets/javascripts/search/sidebar/components/confidentiality_filter.vue b/app/assets/javascripts/search/sidebar/components/confidentiality_filter.vue index fbfc24a94ae..e7aa3d61409 100644 --- a/app/assets/javascripts/search/sidebar/components/confidentiality_filter.vue +++ b/app/assets/javascripts/search/sidebar/components/confidentiality_filter.vue @@ -1,5 +1,4 @@ <script> -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { confidentialFilterData } from '../constants/confidential_filter_data'; import RadioFilter from './radio_filter.vue'; @@ -8,19 +7,13 @@ export default { components: { RadioFilter, }, - mixins: [glFeatureFlagsMixin()], - computed: { - ffBasedXPadding() { - return this.glFeatures.searchPageVerticalNav ? 'gl-px-5' : 'gl-px-0'; - }, - }, confidentialFilterData, }; </script> <template> <div> - <radio-filter :class="ffBasedXPadding" :filter-data="$options.confidentialFilterData" /> + <radio-filter class="gl-px-5" :filter-data="$options.confidentialFilterData" /> <hr class="gl-my-5 gl-mx-5 gl-border-gray-100" /> </div> </template> diff --git a/app/assets/javascripts/search/sidebar/components/results_filters.vue b/app/assets/javascripts/search/sidebar/components/results_filters.vue index ff7a044736d..4d9cc9d6450 100644 --- a/app/assets/javascripts/search/sidebar/components/results_filters.vue +++ b/app/assets/javascripts/search/sidebar/components/results_filters.vue @@ -1,7 +1,6 @@ <script> import { GlButton, GlLink } from '@gitlab/ui'; import { mapActions, mapState } from 'vuex'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { confidentialFilterData } from '../constants/confidential_filter_data'; import { stateFilterData } from '../constants/state_filter_data'; import ConfidentialityFilter from './confidentiality_filter.vue'; @@ -15,24 +14,17 @@ export default { StatusFilter, ConfidentialityFilter, }, - mixins: [glFeatureFlagsMixin()], computed: { ...mapState(['urlQuery', 'sidebarDirty']), showReset() { return this.urlQuery.state || this.urlQuery.confidential; }, - searchPageVerticalNavFeatureFlag() { - return this.glFeatures.searchPageVerticalNav; - }, showConfidentialityFilter() { return Object.values(confidentialFilterData.scopes).includes(this.urlQuery.scope); }, showStatusFilter() { return Object.values(stateFilterData.scopes).includes(this.urlQuery.scope); }, - ffBasedXPadding() { - return this.glFeatures.searchPageVerticalNav ? 'gl-px-5' : 'gl-px-0'; - }, }, methods: { ...mapActions(['applyQuery', 'resetQuery']), @@ -42,13 +34,10 @@ export default { <template> <form class="gl-pt-5 gl-md-pt-0" @submit.prevent="applyQuery"> - <hr - v-if="searchPageVerticalNavFeatureFlag" - class="gl-my-5 gl-mx-5 gl-border-gray-100 gl-display-none gl-md-display-block" - /> + <hr class="gl-my-5 gl-mx-5 gl-border-gray-100 gl-display-none gl-md-display-block" /> <status-filter v-if="showStatusFilter" /> <confidentiality-filter v-if="showConfidentialityFilter" /> - <div class="gl-display-flex gl-align-items-center gl-mt-4" :class="ffBasedXPadding"> + <div class="gl-display-flex gl-align-items-center gl-mt-4 gl-px-5"> <gl-button category="primary" variant="confirm" type="submit" :disabled="!sidebarDirty"> {{ __('Apply') }} </gl-button> 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))"> diff --git a/app/assets/javascripts/search/sidebar/components/status_filter.vue b/app/assets/javascripts/search/sidebar/components/status_filter.vue index 4da96a41ef7..c3deabfcc26 100644 --- a/app/assets/javascripts/search/sidebar/components/status_filter.vue +++ b/app/assets/javascripts/search/sidebar/components/status_filter.vue @@ -1,5 +1,4 @@ <script> -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { stateFilterData } from '../constants/state_filter_data'; import RadioFilter from './radio_filter.vue'; @@ -8,19 +7,13 @@ export default { components: { RadioFilter, }, - mixins: [glFeatureFlagsMixin()], - computed: { - ffBasedXPadding() { - return this.glFeatures.searchPageVerticalNav ? 'gl-px-5' : 'gl-px-0'; - }, - }, stateFilterData, }; </script> <template> <div> - <radio-filter :class="ffBasedXPadding" :filter-data="$options.stateFilterData" /> + <radio-filter class="gl-px-5" :filter-data="$options.stateFilterData" /> <hr class="gl-my-5 gl-mx-5 gl-border-gray-100" /> </div> </template> diff --git a/app/assets/javascripts/search/topbar/components/app.vue b/app/assets/javascripts/search/topbar/components/app.vue index 0629bea3239..da6039f4758 100644 --- a/app/assets/javascripts/search/topbar/components/app.vue +++ b/app/assets/javascripts/search/topbar/components/app.vue @@ -1,7 +1,6 @@ <script> import { GlSearchBoxByClick, GlButton } from '@gitlab/ui'; import { mapState, mapActions } from 'vuex'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import { s__ } from '~/locale'; import { parseBoolean } from '~/lib/utils/common_utils'; import MarkdownDrawer from '~/vue_shared/components/markdown_drawer/markdown_drawer.vue'; @@ -31,7 +30,6 @@ export default { ProjectFilter, MarkdownDrawer, }, - mixins: [glFeatureFlagsMixin()], props: { groupInitialJson: { type: Object, @@ -70,9 +68,6 @@ export default { showSyntaxOptions() { return this.elasticsearchEnabled && this.isDefaultBranch; }, - hasVerticalNav() { - return this.glFeatures.searchPageVerticalNav; - }, isDefaultBranch() { return !this.query.repository_ref || this.query.repository_ref === this.defaultBranchName; }, @@ -130,6 +125,6 @@ export default { <project-filter :initial-data="projectInitialJson" /> </div> </div> - <hr v-if="hasVerticalNav" class="gl-mt-5 gl-mb-0 gl-border-gray-100" /> + <hr class="gl-mt-5 gl-mb-0 gl-border-gray-100" /> </section> </template> |