diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-09 00:09:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-09 00:09:09 +0300 |
commit | 83fc2f3dc81052cad76addb44726876ba1d0f156 (patch) | |
tree | 1d58eedea14b1462b40bc5b02c9561e5a128ac0b /app/assets/javascripts/batch_comments | |
parent | 1d3086ebb41758289c1184dc5ad1462c81e1a1f9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/batch_comments')
3 files changed, 15 insertions, 10 deletions
diff --git a/app/assets/javascripts/batch_comments/components/draft_note.vue b/app/assets/javascripts/batch_comments/components/draft_note.vue index 9abfd43d85c..db5516b7b93 100644 --- a/app/assets/javascripts/batch_comments/components/draft_note.vue +++ b/app/assets/javascripts/batch_comments/components/draft_note.vue @@ -71,8 +71,8 @@ export default { <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" 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_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: { |