diff options
Diffstat (limited to 'app/assets/javascripts')
10 files changed, 51 insertions, 48 deletions
diff --git a/app/assets/javascripts/deploy_keys/components/app.vue b/app/assets/javascripts/deploy_keys/components/app.vue index 5fc15578827..4860215d8f2 100644 --- a/app/assets/javascripts/deploy_keys/components/app.vue +++ b/app/assets/javascripts/deploy_keys/components/app.vue @@ -155,7 +155,7 @@ export default { :keys="keys[currentTab]" :store="store" :endpoint="endpoint" - data-qa-selector="project_deploy_keys_container" + data-testid="project-deploy-keys-container" /> </template> </div> diff --git a/app/assets/javascripts/deploy_keys/components/key.vue b/app/assets/javascripts/deploy_keys/components/key.vue index 94f27dbf048..d35cf35d624 100644 --- a/app/assets/javascripts/deploy_keys/components/key.vue +++ b/app/assets/javascripts/deploy_keys/components/key.vue @@ -113,18 +113,18 @@ export default { <div class="gl-responsive-table-row deploy-key"> <div class="table-section section-40"> <div role="rowheader" class="table-mobile-header">{{ s__('DeployKeys|Deploy key') }}</div> - <div class="table-mobile-content" data-qa-selector="key_container"> - <strong class="title" data-qa-selector="key_title_content"> {{ deployKey.title }} </strong> + <div class="table-mobile-content" data-testid="key-container"> + <strong class="title" data-testid="key-title-content"> {{ deployKey.title }} </strong> <dl> <dt>{{ __('SHA256') }}</dt> - <dd class="fingerprint" data-qa-selector="key_sha256_fingerprint_content"> + <dd class="fingerprint" data-testid="key-sha256-fingerprint-content"> {{ deployKey.fingerprint_sha256 }} </dd> <template v-if="deployKey.fingerprint"> <dt> {{ __('MD5') }} </dt> - <dd class="fingerprint" data-qa-selector="key_md5_fingerprint_content"> + <dd class="fingerprint" data-testid="key-md5-fingerprint-content"> {{ deployKey.fingerprint }} </dd> </template> diff --git a/app/assets/javascripts/search/sidebar/constants/confidential_filter_data.js b/app/assets/javascripts/search/sidebar/components/confidentiality_filter/data.js index ecb63ed9eea..ecb63ed9eea 100644 --- a/app/assets/javascripts/search/sidebar/constants/confidential_filter_data.js +++ b/app/assets/javascripts/search/sidebar/components/confidentiality_filter/data.js diff --git a/app/assets/javascripts/search/sidebar/components/confidentiality_filter.vue b/app/assets/javascripts/search/sidebar/components/confidentiality_filter/index.vue index 2a7988cd4c6..7909aa9234b 100644 --- a/app/assets/javascripts/search/sidebar/components/confidentiality_filter.vue +++ b/app/assets/javascripts/search/sidebar/components/confidentiality_filter/index.vue @@ -1,8 +1,8 @@ <script> import { mapState } from 'vuex'; -import { confidentialFilterData } from '../constants/confidential_filter_data'; -import { HR_DEFAULT_CLASSES } from '../constants'; -import RadioFilter from './radio_filter.vue'; +import { HR_DEFAULT_CLASSES } from '../../constants'; +import RadioFilter from '../radio_filter.vue'; +import { confidentialFilterData } from './data'; export default { name: 'ConfidentialityFilter', @@ -20,6 +20,5 @@ export default { <template> <div> <radio-filter :filter-data="$options.confidentialFilterData" /> - <hr v-if="!useNewNavigation" :class="$options.HR_DEFAULT_CLASSES" /> </div> </template> diff --git a/app/assets/javascripts/search/sidebar/components/issues_filters.vue b/app/assets/javascripts/search/sidebar/components/issues_filters.vue index 8928f80d83a..3eb025327a2 100644 --- a/app/assets/javascripts/search/sidebar/components/issues_filters.vue +++ b/app/assets/javascripts/search/sidebar/components/issues_filters.vue @@ -10,12 +10,12 @@ import { TRACKING_CATEGORY, TRACKING_LABEL_RESET, } from '../constants/index'; -import { confidentialFilterData } from '../constants/confidential_filter_data'; -import { stateFilterData } from '../constants/state_filter_data'; -import ConfidentialityFilter from './confidentiality_filter.vue'; +import { confidentialFilterData } from './confidentiality_filter/data'; +import { statusFilterData } from './status_filter/data'; +import ConfidentialityFilter from './confidentiality_filter/index.vue'; import { labelFilterData } from './label_filter/data'; import LabelFilter from './label_filter/index.vue'; -import StatusFilter from './status_filter.vue'; +import StatusFilter from './status_filter/index.vue'; export default { name: 'IssuesFilters', @@ -37,7 +37,7 @@ export default { return Object.values(confidentialFilterData.scopes).includes(this.currentScope); }, showStatusFilter() { - return Object.values(stateFilterData.scopes).includes(this.currentScope); + return Object.values(statusFilterData.scopes).includes(this.currentScope); }, showLabelFilter() { return ( @@ -71,7 +71,12 @@ export default { <form class="issue-filters gl-px-5 gl-pt-0" @submit.prevent="applyQueryWithTracking"> <hr v-if="!useNewNavigation" :class="hrClasses" /> <status-filter v-if="showStatusFilter" class="gl-mb-5" /> + <hr v-if="!useNewNavigation" :class="hrClasses" /> <confidentiality-filter v-if="showConfidentialityFilter" class="gl-mb-5" /> + <hr + v-if="!useNewNavigation && showConfidentialityFilter && showLabelFilter" + :class="hrClasses" + /> <label-filter v-if="showLabelFilter" /> <div class="gl-display-flex gl-align-items-center gl-mt-4"> <gl-button category="primary" variant="confirm" type="submit" :disabled="!sidebarDirty"> diff --git a/app/assets/javascripts/search/sidebar/components/results_filters.vue b/app/assets/javascripts/search/sidebar/components/results_filters.vue index 24804baef44..a9addb87f7b 100644 --- a/app/assets/javascripts/search/sidebar/components/results_filters.vue +++ b/app/assets/javascripts/search/sidebar/components/results_filters.vue @@ -2,10 +2,10 @@ import { GlButton, GlLink } from '@gitlab/ui'; import { mapActions, mapState, mapGetters } from 'vuex'; import { HR_DEFAULT_CLASSES } from '../constants/index'; -import { confidentialFilterData } from '../constants/confidential_filter_data'; -import { stateFilterData } from '../constants/state_filter_data'; -import ConfidentialityFilter from './confidentiality_filter.vue'; -import StatusFilter from './status_filter.vue'; +import { confidentialFilterData } from './confidentiality_filter/data'; +import { statusFilterData } from './status_filter/data'; +import ConfidentialityFilter from './confidentiality_filter/index.vue'; +import StatusFilter from './status_filter/index.vue'; export default { name: 'ResultsFilters', @@ -25,7 +25,7 @@ export default { return Object.values(confidentialFilterData.scopes).includes(this.currentScope); }, showStatusFilter() { - return Object.values(stateFilterData.scopes).includes(this.currentScope); + return Object.values(statusFilterData.scopes).includes(this.currentScope); }, hrClasses() { return [...HR_DEFAULT_CLASSES, 'gl-display-none', 'gl-md-display-block']; diff --git a/app/assets/javascripts/search/sidebar/components/status_filter.vue b/app/assets/javascripts/search/sidebar/components/status_filter.vue deleted file mode 100644 index 2a3d9ede982..00000000000 --- a/app/assets/javascripts/search/sidebar/components/status_filter.vue +++ /dev/null @@ -1,25 +0,0 @@ -<script> -import { mapState } from 'vuex'; -import { stateFilterData } from '../constants/state_filter_data'; -import { HR_DEFAULT_CLASSES } from '../constants'; -import RadioFilter from './radio_filter.vue'; - -export default { - name: 'StatusFilter', - components: { - RadioFilter, - }, - computed: { - ...mapState(['useNewNavigation']), - }, - stateFilterData, - HR_DEFAULT_CLASSES, -}; -</script> - -<template> - <div> - <radio-filter :filter-data="$options.stateFilterData" /> - <hr v-if="!useNewNavigation" :class="$options.HR_DEFAULT_CLASSES" /> - </div> -</template> diff --git a/app/assets/javascripts/search/sidebar/constants/state_filter_data.js b/app/assets/javascripts/search/sidebar/components/status_filter/data.js index 2f9f8a7cb46..1e3cd59214b 100644 --- a/app/assets/javascripts/search/sidebar/constants/state_filter_data.js +++ b/app/assets/javascripts/search/sidebar/components/status_filter/data.js @@ -33,7 +33,7 @@ const filterByScope = { const filterParam = 'state'; -export const stateFilterData = { +export const statusFilterData = { header, filters, scopes, diff --git a/app/assets/javascripts/search/sidebar/components/status_filter/index.vue b/app/assets/javascripts/search/sidebar/components/status_filter/index.vue new file mode 100644 index 00000000000..494d75db6ce --- /dev/null +++ b/app/assets/javascripts/search/sidebar/components/status_filter/index.vue @@ -0,0 +1,24 @@ +<script> +import { mapState } from 'vuex'; +import { HR_DEFAULT_CLASSES } from '../../constants'; +import RadioFilter from '../radio_filter.vue'; +import { statusFilterData } from './data'; + +export default { + name: 'StatusFilter', + components: { + RadioFilter, + }, + computed: { + ...mapState(['useNewNavigation']), + }, + statusFilterData, + HR_DEFAULT_CLASSES, +}; +</script> + +<template> + <div> + <radio-filter :filter-data="$options.statusFilterData" /> + </div> +</template> diff --git a/app/assets/javascripts/search/store/constants.js b/app/assets/javascripts/search/store/constants.js index bb112c122ae..311aa599e68 100644 --- a/app/assets/javascripts/search/store/constants.js +++ b/app/assets/javascripts/search/store/constants.js @@ -1,5 +1,5 @@ -import { stateFilterData } from '~/search/sidebar/constants/state_filter_data'; -import { confidentialFilterData } from '~/search/sidebar/constants/confidential_filter_data'; +import { statusFilterData } from '~/search/sidebar/components/status_filter/data'; +import { confidentialFilterData } from '~/search/sidebar/components/confidentiality_filter/data'; import { languageFilterData } from '~/search/sidebar/components/language_filter/data'; import { labelFilterData } from '~/search/sidebar/components/label_filter/data'; @@ -12,7 +12,7 @@ export const GROUPS_LOCAL_STORAGE_KEY = 'global-search-frequent-groups'; export const PROJECTS_LOCAL_STORAGE_KEY = 'global-search-frequent-projects'; export const SIDEBAR_PARAMS = [ - stateFilterData.filterParam, + statusFilterData.filterParam, confidentialFilterData.filterParam, languageFilterData.filterParam, labelFilterData.filterParam, |