summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/batch_comments
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:26:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:26:25 +0000
commita09983ae35713f5a2bbb100981116d31ce99826e (patch)
tree2ee2af7bd104d57086db360a7e6d8c9d5d43667a /app/assets/javascripts/batch_comments
parent18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff)
downloadgitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'app/assets/javascripts/batch_comments')
-rw-r--r--app/assets/javascripts/batch_comments/components/draft_note.vue11
-rw-r--r--app/assets/javascripts/batch_comments/components/parallel_draft_comment_row.vue8
-rw-r--r--app/assets/javascripts/batch_comments/components/preview_dropdown.vue2
-rw-r--r--app/assets/javascripts/batch_comments/components/preview_item.vue15
4 files changed, 23 insertions, 13 deletions
diff --git a/app/assets/javascripts/batch_comments/components/draft_note.vue b/app/assets/javascripts/batch_comments/components/draft_note.vue
index 963d104b6b3..4c100ec7335 100644
--- a/app/assets/javascripts/batch_comments/components/draft_note.vue
+++ b/app/assets/javascripts/batch_comments/components/draft_note.vue
@@ -51,6 +51,7 @@ export default {
'scrollToDraft',
'toggleResolveDiscussion',
]),
+ ...mapActions(['setSelectedCommentPositionHover']),
update(data) {
this.updateDraft(data);
},
@@ -67,12 +68,16 @@ export default {
};
</script>
<template>
- <article class="draft-note-component note-wrapper">
+ <article
+ class="draft-note-component note-wrapper"
+ @mouseenter="setSelectedCommentPositionHover(draft.position.line_range)"
+ @mouseleave="setSelectedCommentPositionHover()"
+ >
<ul class="notes draft-notes">
<noteable-note
:note="draft"
- :diff-lines="diffFile.highlighted_diff_lines"
:line="line"
+ :discussion-root="true"
class="draft-note"
@handleEdit="handleEditing"
@cancelForm="handleNotEditing"
@@ -81,7 +86,7 @@ export default {
@handleUpdateNote="update"
@toggleResolveStatus="toggleResolveDiscussion(draft.id)"
>
- <strong slot="note-header-info" class="badge draft-pending-label append-right-4">
+ <strong slot="note-header-info" class="badge draft-pending-label gl-mr-2">
{{ __('Pending') }}
</strong>
</noteable-note>
diff --git a/app/assets/javascripts/batch_comments/components/parallel_draft_comment_row.vue b/app/assets/javascripts/batch_comments/components/parallel_draft_comment_row.vue
index 68fd20e56bc..b0916623cd2 100644
--- a/app/assets/javascripts/batch_comments/components/parallel_draft_comment_row.vue
+++ b/app/assets/javascripts/batch_comments/components/parallel_draft_comment_row.vue
@@ -35,11 +35,15 @@ export default {
<tr :class="className" class="notes_holder">
<td class="notes_line old"></td>
<td class="notes-content parallel old" colspan="2">
- <div v-if="leftDraft.isDraft" class="content"><draft-note :draft="leftDraft" /></div>
+ <div v-if="leftDraft.isDraft" class="content">
+ <draft-note :draft="leftDraft" :line="line.left" />
+ </div>
</td>
<td class="notes_line new"></td>
<td class="notes-content parallel new" colspan="2">
- <div v-if="rightDraft.isDraft" class="content"><draft-note :draft="rightDraft" /></div>
+ <div v-if="rightDraft.isDraft" class="content">
+ <draft-note :draft="rightDraft" :line="line.right" />
+ </div>
</td>
</tr>
</template>
diff --git a/app/assets/javascripts/batch_comments/components/preview_dropdown.vue b/app/assets/javascripts/batch_comments/components/preview_dropdown.vue
index 195e1b7ec5c..7520cc2401b 100644
--- a/app/assets/javascripts/batch_comments/components/preview_dropdown.vue
+++ b/app/assets/javascripts/batch_comments/components/preview_dropdown.vue
@@ -96,7 +96,7 @@ export default {
<preview-item :draft="draft" :is-last="isLast(index)" />
</li>
</ul>
- <gl-loading-icon v-else size="lg" class="prepend-top-default append-bottom-default" />
+ <gl-loading-icon v-else size="lg" class="gl-mt-3 gl-mb-3" />
</div>
<div class="dropdown-footer">
<publish-button
diff --git a/app/assets/javascripts/batch_comments/components/preview_item.vue b/app/assets/javascripts/batch_comments/components/preview_item.vue
index 22495eb4d7d..3162a83f099 100644
--- a/app/assets/javascripts/batch_comments/components/preview_item.vue
+++ b/app/assets/javascripts/batch_comments/components/preview_item.vue
@@ -52,14 +52,12 @@ export default {
});
},
linePosition() {
- if (this.draft.position && this.draft.position.position_type === IMAGE_DIFF_POSITION_TYPE) {
+ if (this.position?.position_type === IMAGE_DIFF_POSITION_TYPE) {
// eslint-disable-next-line @gitlab/require-i18n-strings
- return `${this.draft.position.x}x ${this.draft.position.y}y`;
+ return `${this.position.x}x ${this.position.y}y`;
}
- const position = this.discussion ? this.discussion.position : this.draft.position;
-
- return position?.new_line || position?.old_line;
+ return this.position?.new_line || this.position?.old_line;
},
content() {
const el = document.createElement('div');
@@ -70,11 +68,14 @@ export default {
showLinePosition() {
return this.draft.file_hash || this.isDiffDiscussion;
},
+ position() {
+ return this.draft.position || this.discussion.position;
+ },
startLineNumber() {
- return getStartLineNumber(this.draft.position?.line_range);
+ return getStartLineNumber(this.position?.line_range);
},
endLineNumber() {
- return getEndLineNumber(this.draft.position?.line_range);
+ return getEndLineNumber(this.position?.line_range);
},
},
methods: {