diff --git a/.eslintrc.yml b/.eslintrc.yml index b6abb574e19..6b9a1ce62c0 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -3,7 +3,7 @@ extends: - plugin:@gitlab/i18n - plugin:no-jquery/slim - plugin:no-jquery/deprecated-3.4 - - ./tooling/eslint-config/conditionally_ignore_ee.js + - ./tooling/eslint-config/conditionally_ignore.js globals: __webpack_public_path__: true gl: false diff --git a/app/assets/javascripts/cycle_analytics/components/stage_table.vue b/app/assets/javascripts/cycle_analytics/components/stage_table.vue index 7b31e8d902d..0c47838c773 100644 --- a/app/assets/javascripts/cycle_analytics/components/stage_table.vue +++ b/app/assets/javascripts/cycle_analytics/components/stage_table.vue @@ -17,8 +17,6 @@ import { PAGINATION_SORT_FIELD_DURATION, PAGINATION_SORT_DIRECTION_ASC, PAGINATION_SORT_DIRECTION_DESC, - STAGE_TITLE_STAGING, - STAGE_TITLE_TEST, } from '../constants'; import TotalTime from './total_time_component.vue'; @@ -107,28 +105,12 @@ export default { emptyStateTitleText() { return this.emptyStateTitle || NOT_ENOUGH_DATA_ERROR; }, - isDefaultTestStage() { - const { selectedStage } = this; - return ( - !selectedStage.custom && selectedStage.title?.toLowerCase().trim() === STAGE_TITLE_TEST - ); - }, - isDefaultStagingStage() { - const { selectedStage } = this; - return ( - !selectedStage.custom && selectedStage.title?.toLowerCase().trim() === STAGE_TITLE_STAGING - ); - }, isMergeRequestStage() { const [firstEvent] = this.stageEvents; return this.isMrLink(firstEvent.url); }, workflowTitle() { - if (this.isDefaultTestStage) { - return WORKFLOW_COLUMN_TITLES.jobs; - } else if (this.isDefaultStagingStage) { - return WORKFLOW_COLUMN_TITLES.deployments; - } else if (this.isMergeRequestStage) { + if (this.isMergeRequestStage) { return WORKFLOW_COLUMN_TITLES.mergeRequests; } return WORKFLOW_COLUMN_TITLES.issues; @@ -209,22 +191,6 @@ export default {

- #{{ item.id }} @@ -246,12 +212,7 @@ export default { >

- - {{ - item.date - }} - - + {{ item.date }} diff --git a/app/assets/javascripts/cycle_analytics/constants.js b/app/assets/javascripts/cycle_analytics/constants.js index ea8d9b76b2a..c1be2ce7096 100644 --- a/app/assets/javascripts/cycle_analytics/constants.js +++ b/app/assets/javascripts/cycle_analytics/constants.js @@ -25,9 +25,6 @@ export const PAGINATION_SORT_FIELD_DURATION = 'duration'; export const PAGINATION_SORT_DIRECTION_DESC = 'desc'; export const PAGINATION_SORT_DIRECTION_ASC = 'asc'; -export const STAGE_TITLE_STAGING = 'staging'; -export const STAGE_TITLE_TEST = 'test'; - export const I18N_VSA_ERROR_STAGES = __( 'There was an error fetching value stream analytics stages.', ); diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js b/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js index ebda2dce61c..2e9634819a0 100644 --- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js +++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/constants.js @@ -9,6 +9,7 @@ export const FILTER_ANY = 'Any'; export const FILTER_CURRENT = 'Current'; export const FILTER_UPCOMING = 'Upcoming'; export const FILTER_STARTED = 'Started'; +export const FILTER_NONE_ANY = [FILTER_NONE, FILTER_ANY]; export const OPERATOR_IS = '='; export const OPERATOR_IS_TEXT = __('is'); @@ -27,8 +28,6 @@ export const DEFAULT_ITERATIONS = DEFAULT_NONE_ANY.concat([ { value: FILTER_CURRENT, text: __(FILTER_CURRENT) }, ]); -export const DEFAULT_LABELS = [DEFAULT_LABEL_NONE, DEFAULT_LABEL_ANY]; - export const DEFAULT_MILESTONES = DEFAULT_NONE_ANY.concat([ { value: FILTER_UPCOMING, text: __(FILTER_UPCOMING) }, { value: FILTER_STARTED, text: __(FILTER_STARTED) }, diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/base_token.vue b/app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/base_token.vue index 172b5c402f6..d1326e96794 100644 --- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/base_token.vue +++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/tokens/base_token.vue @@ -8,7 +8,7 @@ import { } from '@gitlab/ui'; import { debounce } from 'lodash'; -import { DEBOUNCE_DELAY } from '../constants'; +import { DEBOUNCE_DELAY, FILTER_NONE_ANY, OPERATOR_IS_NOT } from '../constants'; import { getRecentlyUsedSuggestions, setTokenValueToRecentlyUsed } from '../filtered_search_utils'; export default { @@ -89,6 +89,14 @@ export default { activeTokenValue() { return this.getActiveTokenValue(this.suggestions, this.value.data); }, + availableDefaultSuggestions() { + if (this.value.operator === OPERATOR_IS_NOT) { + return this.defaultSuggestions.filter( + (suggestion) => !FILTER_NONE_ANY.includes(suggestion.value), + ); + } + return this.defaultSuggestions; + }, /** * Return all the suggestions when searchKey is present * otherwise return only the suggestions which aren't @@ -104,7 +112,7 @@ export default { ); }, showDefaultSuggestions() { - return this.defaultSuggestions.length; + return this.availableDefaultSuggestions.length; }, showRecentSuggestions() { return this.isRecentSuggestionsEnabled && this.recentSuggestions.length && !this.searchKey; @@ -180,7 +188,7 @@ export default {