diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-25 18:09:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-25 18:09:33 +0300 |
commit | ba8e92f7c9938d7dba333d2396cdd14bfa0de726 (patch) | |
tree | 071d3b0577dce2e95eefa6a504910bc7856181f3 /app/assets/javascripts/sidebar | |
parent | d2d913b606702ecefa01f03362602fde256e3f75 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/sidebar')
8 files changed, 21 insertions, 26 deletions
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/constants.js b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/constants.js deleted file mode 100644 index 00c54313292..00000000000 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/constants.js +++ /dev/null @@ -1,5 +0,0 @@ -export const DropdownVariant = { - Sidebar: 'sidebar', - Standalone: 'standalone', - Embedded: 'embedded', -}; diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/labels_select_root.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/labels_select_root.vue index 04c62c99a11..74e47b333ef 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/labels_select_root.vue +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/labels_select_root.vue @@ -3,8 +3,8 @@ import Vue from 'vue'; import Vuex, { mapState, mapActions, mapGetters } from 'vuex'; import { isInViewport } from '~/lib/utils/common_utils'; import { __ } from '~/locale'; +import { VARIANT_SIDEBAR } from '~/sidebar/components/labels/labels_select_widget/constants'; -import { DropdownVariant } from './constants'; import DropdownButton from './dropdown_button.vue'; import DropdownContents from './dropdown_contents.vue'; import DropdownTitle from './dropdown_title.vue'; @@ -60,7 +60,7 @@ export default { variant: { type: String, required: false, - default: DropdownVariant.Sidebar, + default: VARIANT_SIDEBAR, }, selectedLabels: { type: Array, diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js index ef3eedd9bb2..03ace6286e0 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/getters.js @@ -1,5 +1,9 @@ import { __, s__, sprintf } from '~/locale'; -import { DropdownVariant } from '../constants'; +import { + VARIANT_EMBEDDED, + VARIANT_SIDEBAR, + VARIANT_STANDALONE, +} from '~/sidebar/components/labels/labels_select_widget/constants'; /** * Returns string representing current labels @@ -36,18 +40,18 @@ export const selectedLabelsList = (state) => state.selectedLabels.map((label) => * is `sidebar` * @param {object} state */ -export const isDropdownVariantSidebar = (state) => state.variant === DropdownVariant.Sidebar; +export const isDropdownVariantSidebar = (state) => state.variant === VARIANT_SIDEBAR; /** * Returns boolean representing whether dropdown variant * is `standalone` * @param {object} state */ -export const isDropdownVariantStandalone = (state) => state.variant === DropdownVariant.Standalone; +export const isDropdownVariantStandalone = (state) => state.variant === VARIANT_STANDALONE; /** * Returns boolean representing whether dropdown variant * is `embedded` * @param {object} state */ -export const isDropdownVariantEmbedded = (state) => state.variant === DropdownVariant.Embedded; +export const isDropdownVariantEmbedded = (state) => state.variant === VARIANT_EMBEDDED; diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/mutations.js b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/mutations.js index c85d9befcbb..dba48a721ac 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/mutations.js +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_vue/store/mutations.js @@ -1,5 +1,5 @@ import { isScopedLabel, scopedLabelKey } from '~/lib/utils/common_utils'; -import { DropdownVariant } from '../constants'; +import { VARIANT_SIDEBAR } from '~/sidebar/components/labels/labels_select_widget/constants'; import * as types from './mutation_types'; const transformLabels = (labels, selectedLabels) => @@ -43,7 +43,7 @@ export default { }, [types.TOGGLE_DROPDOWN_CONTENTS](state) { - if (state.variant === DropdownVariant.Sidebar) { + if (state.variant === VARIANT_SIDEBAR) { state.showDropdownButton = !state.showDropdownButton; } state.showDropdownContents = !state.showDropdownContents; diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/constants.js b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/constants.js index 881d84a7d6e..57f08ab59e2 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/constants.js +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/constants.js @@ -2,8 +2,6 @@ export const SCOPED_LABEL_DELIMITER = '::'; export const DEBOUNCE_DROPDOWN_DELAY = 200; export const DEFAULT_LABEL_COLOR = '#6699cc'; -export const DropdownVariant = { - Sidebar: 'sidebar', - Standalone: 'standalone', - Embedded: 'embedded', -}; +export const VARIANT_EMBEDDED = 'embedded'; +export const VARIANT_SIDEBAR = 'sidebar'; +export const VARIANT_STANDALONE = 'standalone'; diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue index 3aa4215443e..72567b7d4a4 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue @@ -9,7 +9,7 @@ import { TYPE_EPIC, TYPE_ISSUE, TYPE_MERGE_REQUEST, TYPE_TEST_CASE } from '~/iss import { __ } from '~/locale'; import { issuableLabelsQueries } from '../../../constants'; import SidebarEditableItem from '../../sidebar_editable_item.vue'; -import { DEBOUNCE_DROPDOWN_DELAY, DropdownVariant } from './constants'; +import { DEBOUNCE_DROPDOWN_DELAY, VARIANT_SIDEBAR } from './constants'; import DropdownContents from './dropdown_contents.vue'; import DropdownValue from './dropdown_value.vue'; import EmbeddedLabelsList from './embedded_labels_list.vue'; @@ -60,7 +60,7 @@ export default { variant: { type: String, required: false, - default: DropdownVariant.Sidebar, + default: VARIANT_SIDEBAR, }, labelsFilterBasePath: { type: String, diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/utils.js b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/utils.js index b5cd946a189..d752accf14a 100644 --- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/utils.js +++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/utils.js @@ -1,22 +1,22 @@ -import { DropdownVariant } from './constants'; +import { VARIANT_EMBEDDED, VARIANT_SIDEBAR, VARIANT_STANDALONE } from './constants'; /** * Returns boolean representing whether dropdown variant * is `sidebar` * @param {string} variant */ -export const isDropdownVariantSidebar = (variant) => variant === DropdownVariant.Sidebar; +export const isDropdownVariantSidebar = (variant) => variant === VARIANT_SIDEBAR; /** * Returns boolean representing whether dropdown variant * is `standalone` * @param {string} variant */ -export const isDropdownVariantStandalone = (variant) => variant === DropdownVariant.Standalone; +export const isDropdownVariantStandalone = (variant) => variant === VARIANT_STANDALONE; /** * Returns boolean representing whether dropdown variant * is `embedded` * @param {string} variant */ -export const isDropdownVariantEmbedded = (variant) => variant === DropdownVariant.Embedded; +export const isDropdownVariantEmbedded = (variant) => variant === VARIANT_EMBEDDED; diff --git a/app/assets/javascripts/sidebar/mount_sidebar.js b/app/assets/javascripts/sidebar/mount_sidebar.js index 2828b9fbf1a..540d57bb5ce 100644 --- a/app/assets/javascripts/sidebar/mount_sidebar.js +++ b/app/assets/javascripts/sidebar/mount_sidebar.js @@ -24,7 +24,6 @@ import SidebarConfidentialityWidget from './components/confidential/sidebar_conf import CopyEmailToClipboard from './components/copy/copy_email_to_clipboard.vue'; import SidebarDueDateWidget from './components/date/sidebar_date_widget.vue'; import SidebarEscalationStatus from './components/incidents/sidebar_escalation_status.vue'; -import { DropdownVariant } from './components/labels/labels_select_vue/constants'; import LabelsSelectWidget from './components/labels/labels_select_widget/labels_select_root.vue'; import IssuableLockForm from './components/lock/issuable_lock_form.vue'; import MilestoneDropdown from './components/milestone/milestone_dropdown.vue'; @@ -351,7 +350,6 @@ export function mountSidebarLabelsWidget() { footerManageLabelTitle: __('Manage project labels'), labelsCreateTitle: __('Create project label'), labelsFilterBasePath: el.dataset.projectIssuesPath, - variant: DropdownVariant.Sidebar, issuableType: isInIssuePage() || isInIncidentPage() || isInDesignPage() ? TYPE_ISSUE |