diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-31 06:10:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-31 06:10:18 +0300 |
commit | b6cb3bc944b0ca803e758d9e9da3790c0f310d21 (patch) | |
tree | a0712bd4d614880aa1d3f724e39308f3fa7c4e2a /app | |
parent | 453bb35fc81741c1dd7178cde1f64df2c9ec7252 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
12 files changed, 56 insertions, 66 deletions
diff --git a/app/assets/javascripts/content_editor/components/suggestions_dropdown.vue b/app/assets/javascripts/content_editor/components/suggestions_dropdown.vue index 6535d9eaa5d..b34ebe85eb4 100644 --- a/app/assets/javascripts/content_editor/components/suggestions_dropdown.vue +++ b/app/assets/javascripts/content_editor/components/suggestions_dropdown.vue @@ -161,6 +161,8 @@ export default { }, onKeyDown({ event }) { + if (!this.items.length) return false; + if (event.key === 'ArrowUp') { this.upHandler(); return true; diff --git a/app/assets/javascripts/content_editor/extensions/suggestions.js b/app/assets/javascripts/content_editor/extensions/suggestions.js index 0560322191e..f7ff2fd6647 100644 --- a/app/assets/javascripts/content_editor/extensions/suggestions.js +++ b/app/assets/javascripts/content_editor/extensions/suggestions.js @@ -57,6 +57,7 @@ function createSuggestionPlugin({ render: () => { let component; let popup; + let isHidden = false; const onUpdate = (props) => { component?.updateProps({ ...props, loading: false }); @@ -88,6 +89,12 @@ function createSuggestionPlugin({ popup = tippy('body', { getReferenceClientRect: props.clientRect, appendTo: () => document.body, + onHide: () => { + isHidden = true; + }, + onShow: () => { + isHidden = false; + }, content: component.element, showOnCreate: true, interactive: true, @@ -100,6 +107,8 @@ function createSuggestionPlugin({ onUpdate, onKeyDown(props) { + if (isHidden) return false; + if (props.event.key === 'Escape') { popup?.[0].hide(); diff --git a/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue b/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue index c7d8a50f402..62e1ebc50a8 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_comment_form.vue @@ -195,7 +195,6 @@ export default { :autocomplete-data-sources="autocompleteDataSources" :form-field-props="formFieldProps" :add-spacing-classes="false" - data-testid="work-item-add-comment" use-bottom-toolbar supports-quick-actions :autofocus="autofocus" diff --git a/app/assets/javascripts/work_items/components/notes/work_item_note_actions.vue b/app/assets/javascripts/work_items/components/notes/work_item_note_actions.vue index 2d36a89169a..cb9a560f9e1 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_note_actions.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_note_actions.vue @@ -207,7 +207,6 @@ export default { <gl-button v-if="showEdit" v-gl-tooltip - data-testid="edit-work-item-note" data-track-action="click_button" data-track-label="edit_button" category="tertiary" @@ -219,7 +218,6 @@ export default { <gl-disclosure-dropdown ref="dropdown" v-gl-tooltip - data-testid="work-item-note-actions" icon="ellipsis_v" text-sr-only placement="right" diff --git a/app/assets/javascripts/work_items/components/work_item_actions.vue b/app/assets/javascripts/work_items/components/work_item_actions.vue index 08ad03ad4fe..88f82fb6fb7 100644 --- a/app/assets/javascripts/work_items/components/work_item_actions.vue +++ b/app/assets/javascripts/work_items/components/work_item_actions.vue @@ -20,7 +20,6 @@ import { I18N_WORK_ITEM_DELETE, I18N_WORK_ITEM_ARE_YOU_SURE_DELETE, TEST_ID_CONFIDENTIALITY_TOGGLE_ACTION, - TEST_ID_NOTIFICATIONS_TOGGLE_ACTION, TEST_ID_NOTIFICATIONS_TOGGLE_FORM, TEST_ID_DELETE_ACTION, TEST_ID_PROMOTE_ACTION, @@ -39,8 +38,8 @@ import projectWorkItemTypesQuery from '../graphql/project_work_item_types.query. export default { i18n: { - enableTaskConfidentiality: s__('WorkItem|Turn on confidentiality'), - disableTaskConfidentiality: s__('WorkItem|Turn off confidentiality'), + enableConfidentiality: s__('WorkItem|Turn on confidentiality'), + disableConfidentiality: s__('WorkItem|Turn off confidentiality'), notifications: s__('WorkItem|Notifications'), notificationOn: s__('WorkItem|Notifications turned on.'), notificationOff: s__('WorkItem|Notifications turned off.'), @@ -60,7 +59,6 @@ export default { }, mixins: [Tracking.mixin({ label: 'actions_menu' })], isLoggedIn: isLoggedIn(), - notificationsToggleTestId: TEST_ID_NOTIFICATIONS_TOGGLE_ACTION, notificationsToggleFormTestId: TEST_ID_NOTIFICATIONS_TOGGLE_FORM, confidentialityTestId: TEST_ID_CONFIDENTIALITY_TOGGLE_ACTION, copyReferenceTestId: TEST_ID_COPY_REFERENCE_ACTION, @@ -165,6 +163,11 @@ export default { canPromoteToObjective() { return this.canUpdate && this.workItemType === WORK_ITEM_TYPE_VALUE_KEY_RESULT; }, + confidentialItemText() { + return this.isConfidential + ? this.$options.i18n.disableConfidentiality + : this.$options.i18n.enableConfidentiality; + }, objectiveWorkItemTypeId() { return this.workItemTypes.find((type) => type.name === WORK_ITEM_TYPE_VALUE_OBJECTIVE).id; }, @@ -267,7 +270,7 @@ export default { icon="ellipsis_v" data-testid="work-item-actions-dropdown" text-sr-only - :text="__('More actions')" + :toggle-text="__('More actions')" category="tertiary" :auto-close="false" no-caret @@ -282,7 +285,6 @@ export default { <gl-toggle :value="subscribedToNotifications" :label="$options.i18n.notifications" - :data-testid="$options.notificationsToggleTestId" class="work-item-notification-toggle" label-position="left" @change="toggleNotifications($event)" @@ -299,49 +301,46 @@ export default { > <template #list-item>{{ __('Promote to objective') }}</template> </gl-disclosure-dropdown-item> - <template v-if="canUpdate && !isParentConfidential"> - <gl-disclosure-dropdown-item - :data-testid="$options.confidentialityTestId" - @action="handleToggleWorkItemConfidentiality" - ><template #list-item>{{ - isConfidential - ? $options.i18n.disableTaskConfidentiality - : $options.i18n.enableTaskConfidentiality - }}</template></gl-disclosure-dropdown-item - > - </template> + + <gl-disclosure-dropdown-item + v-if="canUpdate && !isParentConfidential" + :data-testid="$options.confidentialityTestId" + @action="handleToggleWorkItemConfidentiality" + > + <template #list-item>{{ confidentialItemText }}</template> + </gl-disclosure-dropdown-item> + <gl-disclosure-dropdown-item - ref="workItemReference" :data-testid="$options.copyReferenceTestId" :data-clipboard-text="workItemReference" @action="copyToClipboard(workItemReference, $options.i18n.referenceCopied)" - ><template #list-item>{{ - $options.i18n.copyReference - }}</template></gl-disclosure-dropdown-item > - <template v-if="$options.isLoggedIn && workItemCreateNoteEmail"> - <gl-disclosure-dropdown-item - ref="workItemCreateNoteEmail" - :data-testid="$options.copyCreateNoteEmailTestId" - :data-clipboard-text="workItemCreateNoteEmail" - @action="copyToClipboard(workItemCreateNoteEmail, $options.i18n.emailAddressCopied)" - ><template #list-item>{{ - i18n.copyCreateNoteEmail - }}</template></gl-disclosure-dropdown-item - > - </template> - <gl-dropdown-divider v-if="canDelete" /> + <template #list-item>{{ $options.i18n.copyReference }}</template> + </gl-disclosure-dropdown-item> + <gl-disclosure-dropdown-item - v-if="canDelete" - :data-testid="$options.deleteActionTestId" - variant="danger" - @action="handleDelete" + v-if="$options.isLoggedIn && workItemCreateNoteEmail" + :data-testid="$options.copyCreateNoteEmailTestId" + :data-clipboard-text="workItemCreateNoteEmail" + @action="copyToClipboard(workItemCreateNoteEmail, $options.i18n.emailAddressCopied)" > - <template #list-item - ><span class="text-danger">{{ i18n.deleteWorkItem }}</span></template - > + <template #list-item>{{ i18n.copyCreateNoteEmail }}</template> </gl-disclosure-dropdown-item> + + <template v-if="canDelete"> + <gl-dropdown-divider /> + <gl-disclosure-dropdown-item + :data-testid="$options.deleteActionTestId" + variant="danger" + @action="handleDelete" + > + <template #list-item> + <span class="text-danger">{{ i18n.deleteWorkItem }}</span> + </template> + </gl-disclosure-dropdown-item> + </template> </gl-disclosure-dropdown> + <gl-modal ref="modal" modal-id="work-item-confirm-delete" diff --git a/app/assets/javascripts/work_items/components/work_item_award_emoji.vue b/app/assets/javascripts/work_items/components/work_item_award_emoji.vue index fb710836a88..f806946509f 100644 --- a/app/assets/javascripts/work_items/components/work_item_award_emoji.vue +++ b/app/assets/javascripts/work_items/components/work_item_award_emoji.vue @@ -238,7 +238,6 @@ export default { <template> <div v-if="!isLoading" class="gl-mt-3"> <awards-list - data-testid="work-item-award-list" :awards="awards" :can-award-emoji="$options.isLoggedIn" :current-user-id="currentUserId" diff --git a/app/assets/javascripts/work_items/components/work_item_description.vue b/app/assets/javascripts/work_items/components/work_item_description.vue index 245099d958d..77c573b47e4 100644 --- a/app/assets/javascripts/work_items/components/work_item_description.vue +++ b/app/assets/javascripts/work_items/components/work_item_description.vue @@ -244,13 +244,7 @@ export default { @keydown.ctrl.enter="updateWorkItem" /> <div class="gl-display-flex"> - <gl-alert - v-if="hasConflicts" - :dismissible="false" - variant="danger" - class="gl-w-full" - data-testid="work-item-description-conflicts" - > + <gl-alert v-if="hasConflicts" :dismissible="false" variant="danger" class="gl-w-full"> <p> {{ s__( diff --git a/app/assets/javascripts/work_items/components/work_item_detail.vue b/app/assets/javascripts/work_items/components/work_item_detail.vue index d95b434a829..c8ea2a12038 100644 --- a/app/assets/javascripts/work_items/components/work_item_detail.vue +++ b/app/assets/javascripts/work_items/components/work_item_detail.vue @@ -409,7 +409,7 @@ export default { </gl-skeleton-loader> </div> <template v-else> - <div class="gl-display-flex gl-align-items-center" data-testid="work-item-body"> + <div class="gl-display-flex gl-align-items-center"> <ul v-if="parentWorkItem" class="list-unstyled gl-display-flex gl-min-w-0 gl-mr-auto gl-mb-0 gl-z-index-0" diff --git a/app/assets/javascripts/work_items/components/work_item_milestone.vue b/app/assets/javascripts/work_items/components/work_item_milestone.vue index 867d25702d8..fe09105e173 100644 --- a/app/assets/javascripts/work_items/components/work_item_milestone.vue +++ b/app/assets/javascripts/work_items/components/work_item_milestone.vue @@ -225,7 +225,6 @@ export default { <gl-dropdown v-else id="milestone-value" - data-testid="work-item-milestone-dropdown" class="gl-pl-0 gl-max-w-full work-item-field-value" :toggle-class="dropdownClasses" :text="dropdownText" diff --git a/app/assets/javascripts/work_items/components/work_item_state_toggle_button.vue b/app/assets/javascripts/work_items/components/work_item_state_toggle_button.vue index 7edda2592de..6d7a93f64c4 100644 --- a/app/assets/javascripts/work_items/components/work_item_state_toggle_button.vue +++ b/app/assets/javascripts/work_items/components/work_item_state_toggle_button.vue @@ -104,10 +104,7 @@ export default { </script> <template> - <gl-button - :loading="updateInProgress" - data-testid="work-item-state-toggle" - @click="updateWorkItem" - >{{ toggleWorkItemStateText }}</gl-button - > + <gl-button :loading="updateInProgress" @click="updateWorkItem">{{ + toggleWorkItemStateText + }}</gl-button> </template> diff --git a/app/assets/javascripts/work_items/components/work_item_todos.vue b/app/assets/javascripts/work_items/components/work_item_todos.vue index e6d7f2067ba..d5633adec9a 100644 --- a/app/assets/javascripts/work_items/components/work_item_todos.vue +++ b/app/assets/javascripts/work_items/components/work_item_todos.vue @@ -175,17 +175,12 @@ export default { <template> <gl-button v-gl-tooltip.hover - data-testid="work-item-todos-action" :loading="isLoading" :title="buttonLabel" category="tertiary" :aria-label="buttonLabel" @click="onToggle" > - <gl-icon - data-testid="work-item-todos-icon" - :class="{ 'gl-fill-blue-500': pendingTodo }" - :name="buttonIcon" - /> + <gl-icon :class="{ 'gl-fill-blue-500': pendingTodo }" :name="buttonIcon" /> </gl-button> </template> diff --git a/app/assets/javascripts/work_items/constants.js b/app/assets/javascripts/work_items/constants.js index 8de539f06f7..e4fa277485a 100644 --- a/app/assets/javascripts/work_items/constants.js +++ b/app/assets/javascripts/work_items/constants.js @@ -246,7 +246,6 @@ export const WORK_ITEM_ACTIVITY_SORT_OPTIONS = [ ]; export const TEST_ID_CONFIDENTIALITY_TOGGLE_ACTION = 'confidentiality-toggle-action'; -export const TEST_ID_NOTIFICATIONS_TOGGLE_ACTION = 'notifications-toggle-action'; export const TEST_ID_NOTIFICATIONS_TOGGLE_FORM = 'notifications-toggle-form'; export const TEST_ID_DELETE_ACTION = 'delete-action'; export const TEST_ID_PROMOTE_ACTION = 'promote-action'; |