diff options
Diffstat (limited to 'app/assets/javascripts/notes/components')
9 files changed, 54 insertions, 14 deletions
diff --git a/app/assets/javascripts/notes/components/comment_type_dropdown.vue b/app/assets/javascripts/notes/components/comment_type_dropdown.vue index 663a912999d..30ea5d3532e 100644 --- a/app/assets/javascripts/notes/components/comment_type_dropdown.vue +++ b/app/assets/javascripts/notes/components/comment_type_dropdown.vue @@ -96,7 +96,11 @@ export default { data-track-action="click_button" @click="$emit('click')" > - <gl-dropdown-item is-check-item :is-checked="isNoteTypeComment" @click="setNoteTypeToComment"> + <gl-dropdown-item + is-check-item + :is-checked="isNoteTypeComment" + @click.stop.prevent="setNoteTypeToComment" + > <strong>{{ $options.i18n.submitButton.comment }}</strong> <p class="gl-m-0">{{ commentDescription }}</p> </gl-dropdown-item> @@ -105,7 +109,7 @@ export default { is-check-item :is-checked="isNoteTypeDiscussion" data-qa-selector="discussion_menu_item" - @click="setNoteTypeToDiscussion" + @click.stop.prevent="setNoteTypeToDiscussion" > <strong>{{ $options.i18n.submitButton.startThread }}</strong> <p class="gl-m-0">{{ startDiscussionDescription }}</p> diff --git a/app/assets/javascripts/notes/components/discussion_notes.vue b/app/assets/javascripts/notes/components/discussion_notes.vue index 0892276ff3b..6fcfa66ea49 100644 --- a/app/assets/javascripts/notes/components/discussion_notes.vue +++ b/app/assets/javascripts/notes/components/discussion_notes.vue @@ -47,6 +47,11 @@ export default { required: false, default: '', }, + isOverviewTab: { + type: Boolean, + required: false, + default: false, + }, }, computed: { ...mapGetters(['userCanReply']), @@ -127,6 +132,7 @@ export default { :show-reply-button="userCanReply" :discussion-root="true" :discussion-resolve-path="discussion.resolve_path" + :is-overview-tab="isOverviewTab" @handleDeleteNote="$emit('deleteNote')" @startReplying="$emit('startReplying')" > @@ -176,6 +182,7 @@ export default { :line="diffLine" :discussion-root="index === 0" :discussion-resolve-path="discussion.resolve_path" + :is-overview-tab="isOverviewTab" @handleDeleteNote="$emit('deleteNote')" > <template #avatar-badge> diff --git a/app/assets/javascripts/notes/components/note_actions.vue b/app/assets/javascripts/notes/components/note_actions.vue index 44d0c741d5a..e2a2edd7344 100644 --- a/app/assets/javascripts/notes/components/note_actions.vue +++ b/app/assets/javascripts/notes/components/note_actions.vue @@ -257,7 +257,7 @@ export default { <user-access-role-badge v-if="isAuthor" v-gl-tooltip - class="gl-mx-3 d-none d-md-inline-block" + class="gl-mr-3 d-none d-md-inline-block" :title="displayAuthorBadgeText" > {{ __('Author') }} @@ -265,7 +265,7 @@ export default { <user-access-role-badge v-if="accessLevel" v-gl-tooltip - class="gl-mx-3" + class="gl-mr-3" :title="displayMemberBadgeText" > {{ accessLevel }} @@ -273,7 +273,7 @@ export default { <user-access-role-badge v-else-if="isContributor" v-gl-tooltip - class="gl-mx-3" + class="gl-mr-3" :title="displayContributorBadgeText" > {{ __('Contributor') }} diff --git a/app/assets/javascripts/notes/components/note_body.vue b/app/assets/javascripts/notes/components/note_body.vue index 93f71276120..1ce1696e332 100644 --- a/app/assets/javascripts/notes/components/note_body.vue +++ b/app/assets/javascripts/notes/components/note_body.vue @@ -51,7 +51,7 @@ export default { }, }, computed: { - ...mapGetters(['getDiscussion', 'suggestionsCount']), + ...mapGetters(['getDiscussion', 'suggestionsCount', 'getSuggestionsFilePaths']), ...mapGetters('diffs', ['suggestionCommitMessage']), discussion() { if (!this.note.isDraft) return {}; @@ -74,9 +74,10 @@ export default { // Please see this issue comment for why these // are hard-coded to 1: // https://gitlab.com/gitlab-org/gitlab/-/issues/291027#note_468308022 - const suggestionsCount = 1; - const filesCount = 1; - const filePaths = this.file ? [this.file.file_path] : []; + const suggestionsCount = this.batchSuggestionsInfo.length || 1; + const batchFilePaths = this.getSuggestionsFilePaths(); + const filePaths = batchFilePaths.length ? batchFilePaths : [this.file.file_path]; + const filesCount = filePaths.length; const suggestion = this.suggestionCommitMessage({ file_paths: filePaths.join(', '), suggestions_count: suggestionsCount, @@ -131,8 +132,8 @@ export default { message, }).then(callback); }, - applySuggestionBatch({ flashContainer }) { - return this.submitSuggestionBatch({ flashContainer }); + applySuggestionBatch({ message, flashContainer }) { + return this.submitSuggestionBatch({ message, flashContainer }); }, addSuggestionToBatch(suggestionId) { const { discussion_id: discussionId, id: noteId } = this.note; diff --git a/app/assets/javascripts/notes/components/note_form.vue b/app/assets/javascripts/notes/components/note_form.vue index a4f06a8d9f5..b05643e5e13 100644 --- a/app/assets/javascripts/notes/components/note_form.vue +++ b/app/assets/javascripts/notes/components/note_form.vue @@ -348,6 +348,7 @@ export default { id="note_note" ref="textarea" v-model="updatedNoteBody" + :disabled="isSubmitting" :data-supports-quick-actions="!isEditing && !glFeatures.tributeAutocomplete" name="note[note]" class="note-textarea js-gfm-input js-note-text js-autosize markdown-area js-vue-issue-note-form" diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue index 4e686ce8719..0925195d4bb 100644 --- a/app/assets/javascripts/notes/components/note_header.vue +++ b/app/assets/javascripts/notes/components/note_header.vue @@ -1,10 +1,16 @@ <script> -import { GlIcon, GlLoadingIcon, GlTooltipDirective } from '@gitlab/ui'; +import { + GlIcon, + GlLoadingIcon, + GlTooltipDirective, + GlSafeHtmlDirective as SafeHtml, +} from '@gitlab/ui'; import { mapActions } from 'vuex'; import timeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import UserNameWithStatus from '../../sidebar/components/assignees/user_name_with_status.vue'; export default { + safeHtmlConfig: { ADD_TAGS: ['gl-emoji'] }, components: { timeAgoTooltip, GitlabTeamMemberBadge: () => @@ -14,6 +20,7 @@ export default { UserNameWithStatus, }, directives: { + SafeHtml, GlTooltip: GlTooltipDirective, }, props: { @@ -165,10 +172,10 @@ export default { <span v-if="authorStatus" ref="authorStatus" + v-safe-html:[$options.safeHtmlConfig]="authorStatus" v-on=" authorStatusHasTooltip ? { mouseenter: removeEmojiTitle, mouseleave: addEmojiTitle } : {} " - v-html="authorStatus /* eslint-disable-line vue/no-v-html */" ></span> <span class="text-nowrap author-username"> <a diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue index b99579fb9a7..77f796fe8b0 100644 --- a/app/assets/javascripts/notes/components/noteable_discussion.vue +++ b/app/assets/javascripts/notes/components/noteable_discussion.vue @@ -66,6 +66,11 @@ export default { required: false, default: '', }, + isOverviewTab: { + type: Boolean, + required: false, + default: false, + }, }, data() { return { @@ -263,6 +268,7 @@ export default { :is-expanded="isExpanded" :line="line" :should-group-replies="shouldGroupReplies" + :is-overview-tab="isOverviewTab" @startReplying="showReplyForm" @deleteNote="deleteNoteHandler" > diff --git a/app/assets/javascripts/notes/components/noteable_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue index 3c6ed0a8aac..e35d8d94289 100644 --- a/app/assets/javascripts/notes/components/noteable_note.vue +++ b/app/assets/javascripts/notes/components/noteable_note.vue @@ -84,6 +84,11 @@ export default { required: false, default: '', }, + isOverviewTab: { + type: Boolean, + required: false, + default: false, + }, }, data() { return { @@ -186,6 +191,14 @@ export default { return fileResolvedFromAvailableSource || null; }, + avatarSize() { + // Use a different size if shown on a Merge Request Diff + if (this.line && !this.isOverviewTab) { + return 24; + } + + return 40; + }, }, created() { const line = this.note.position?.line_range?.start || this.line; @@ -391,7 +404,7 @@ export default { :link-href="author.path" :img-src="author.avatar_url" :img-alt="author.name" - :img-size="40" + :img-size="avatarSize" lazy > <template #avatar-badge> diff --git a/app/assets/javascripts/notes/components/notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue index 29c60b96d8a..58570e76795 100644 --- a/app/assets/javascripts/notes/components/notes_app.vue +++ b/app/assets/javascripts/notes/components/notes_app.vue @@ -317,6 +317,7 @@ export default { :key="discussion.id" :discussion="discussion" :render-diff-file="true" + is-overview-tab :help-page-path="helpPagePath" /> </template> |