diff options
Diffstat (limited to 'app/assets/javascripts/notes')
4 files changed, 22 insertions, 6 deletions
diff --git a/app/assets/javascripts/notes/components/discussion_filter.vue b/app/assets/javascripts/notes/components/discussion_filter.vue index 102afaf308f..d5a7fc36ace 100644 --- a/app/assets/javascripts/notes/components/discussion_filter.vue +++ b/app/assets/javascripts/notes/components/discussion_filter.vue @@ -116,7 +116,7 @@ export default { <gl-dropdown v-if="displayFilters" id="discussion-filter-dropdown" - class="gl-mr-3 full-width-mobile discussion-filter-container js-discussion-filter-container" + class="full-width-mobile discussion-filter-container js-discussion-filter-container" data-qa-selector="discussion_filter_dropdown" :text="currentFilter.title" :disabled="isLoading" diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue index 0925195d4bb..71d767c3b95 100644 --- a/app/assets/javascripts/notes/components/note_header.vue +++ b/app/assets/javascripts/notes/components/note_header.vue @@ -6,6 +6,7 @@ import { GlSafeHtmlDirective as SafeHtml, } from '@gitlab/ui'; import { mapActions } from 'vuex'; +import { __ } from '~/locale'; import timeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import UserNameWithStatus from '../../sidebar/components/assignees/user_name_with_status.vue'; @@ -139,6 +140,10 @@ export default { return selectedAuthor?.availability || ''; }, }, + i18n: { + showThread: __('Show thread'), + hideThread: __('Hide thread'), + }, }; </script> @@ -148,10 +153,16 @@ export default { <button class="note-action-button discussion-toggle-button js-vue-toggle-button" type="button" + data-testid="thread-toggle" @click="handleToggle" > <gl-icon ref="chevronIcon" :name="toggleChevronIconName" /> - {{ __('Toggle thread') }} + <template v-if="expanded"> + {{ $options.i18n.hideThread }} + </template> + <template v-else> + {{ $options.i18n.showThread }} + </template> </button> </div> <template v-if="hasAuthor"> diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue index ddf72587ba3..c4602363da1 100644 --- a/app/assets/javascripts/notes/components/noteable_discussion.vue +++ b/app/assets/javascripts/notes/components/noteable_discussion.vue @@ -6,6 +6,7 @@ import createFlash from '~/flash'; import { clearDraft, getDiscussionReplyKey } from '~/lib/utils/autosave'; import { isLoggedIn } from '~/lib/utils/common_utils'; import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal'; +import { ignoreWhilePending } from '~/lib/utils/ignore_while_pending'; import { s__, __ } from '~/locale'; import diffLineNoteFormMixin from '~/notes/mixins/diff_line_note_form'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; @@ -171,7 +172,7 @@ export default { this.expandDiscussion({ discussionId: this.discussion.id }); } }, - async cancelReplyForm(shouldConfirm, isDirty) { + cancelReplyForm: ignoreWhilePending(async function cancelReplyForm(shouldConfirm, isDirty) { if (shouldConfirm && isDirty) { const msg = s__('Notes|Are you sure you want to cancel creating this comment?'); @@ -188,7 +189,7 @@ export default { this.isReplying = false; clearDraft(this.autosaveKey); - }, + }), saveReply(noteText, form, callback) { if (!noteText) { this.cancelReplyForm(); diff --git a/app/assets/javascripts/notes/components/noteable_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue index 7bad10616cc..a271ac91f6e 100644 --- a/app/assets/javascripts/notes/components/noteable_note.vue +++ b/app/assets/javascripts/notes/components/noteable_note.vue @@ -7,6 +7,7 @@ import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_m import { INLINE_DIFF_LINES_KEY } from '~/diffs/constants'; import createFlash from '~/flash'; import httpStatusCodes from '~/lib/utils/http_status'; +import { ignoreWhilePending } from '~/lib/utils/ignore_while_pending'; import { truncateSha } from '~/lib/utils/text_utility'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import { __, s__, sprintf } from '../../locale'; @@ -350,7 +351,10 @@ export default { parent: this.$el, }); }, - async formCancelHandler({ shouldConfirm, isDirty }) { + formCancelHandler: ignoreWhilePending(async function formCancelHandler({ + shouldConfirm, + isDirty, + }) { if (shouldConfirm && isDirty) { const msg = __('Are you sure you want to cancel editing this comment?'); const confirmed = await confirmAction(msg); @@ -364,7 +368,7 @@ export default { } this.isEditing = false; this.$emit('cancelForm'); - }, + }), recoverNoteContent(noteText) { // we need to do this to prevent noteForm inconsistent content warning // this is something we intentionally do so we need to recover the content |