diff options
Diffstat (limited to 'app/assets/javascripts/notes/components')
3 files changed, 18 insertions, 4 deletions
diff --git a/app/assets/javascripts/notes/components/comment_form.vue b/app/assets/javascripts/notes/components/comment_form.vue index 90be5b3e470..7213658bdf2 100644 --- a/app/assets/javascripts/notes/components/comment_form.vue +++ b/app/assets/javascripts/notes/components/comment_form.vue @@ -273,6 +273,13 @@ export default { this.toggleIssueState(); } }, + handleEnter() { + if (this.hasDrafts) { + this.handleSaveDraft(); + } else { + this.handleSave(); + } + }, toggleIssueState() { if (this.isIssue) { // We want to invoke the close/reopen logic in the issue header @@ -395,8 +402,8 @@ export default { :aria-label="$options.i18n.comment" :placeholder="$options.i18n.bodyPlaceholder" @keydown.up="editCurrentUserLastNote()" - @keydown.meta.enter="handleSave()" - @keydown.ctrl.enter="handleSave()" + @keydown.meta.enter="handleEnter()" + @keydown.ctrl.enter="handleEnter()" ></textarea> </template> </markdown-field> diff --git a/app/assets/javascripts/notes/components/note_actions.vue b/app/assets/javascripts/notes/components/note_actions.vue index 0cc818c6d0e..0f72b4f2dba 100644 --- a/app/assets/javascripts/notes/components/note_actions.vue +++ b/app/assets/javascripts/notes/components/note_actions.vue @@ -304,7 +304,7 @@ export default { v-else v-gl-tooltip :class="{ 'js-user-authored': isAuthoredByCurrentUser }" - class="note-action-button note-emoji-button add-reaction-button btn-icon js-add-award js-note-emoji" + class="note-action-button note-emoji-button add-reaction-button js-add-award js-note-emoji" category="tertiary" variant="default" :title="$options.i18n.addReactionLabel" diff --git a/app/assets/javascripts/notes/components/noteable_discussion.vue b/app/assets/javascripts/notes/components/noteable_discussion.vue index 34dd21dcbac..1af9e4be373 100644 --- a/app/assets/javascripts/notes/components/noteable_discussion.vue +++ b/app/assets/javascripts/notes/components/noteable_discussion.vue @@ -135,6 +135,13 @@ export default { resolveWithIssuePath() { return !this.discussionResolved ? this.discussion.resolve_with_issue_path : ''; }, + canShowReplyActions() { + if (this.shouldRenderDiffs && !this.discussion.diff_file.diff_refs) { + return false; + } + + return true; + }, }, created() { eventHub.$on('startReplying', this.onStartReplying); @@ -263,7 +270,7 @@ export default { :draft="draftForDiscussion(discussion.reply_id)" /> <div - v-else-if="showReplies" + v-else-if="canShowReplyActions && showReplies" :class="{ 'is-replying': isReplying }" class="discussion-reply-holder gl-border-t-0! clearfix" > |