Commit 13682301 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/255626/allowMultipleCommentsInInlineView' into 'master'

Fixed an issue that stop multiple comments being added to same line

See merge request gitlab-org/gitlab!52111
parents f21b97a2 504ba1b2
......@@ -61,10 +61,10 @@ export default {
...mapActions(['setSelectedCommentPosition']),
...mapActions('diffs', ['showCommentForm']),
showCommentLeft(line) {
return !this.inline || line.left;
return line.left && !line.right;
},
showCommentRight(line) {
return !this.inline || (line.right && !line.left);
return line.right && !line.left;
},
onStartDragging(line) {
this.dragStart = line;
......@@ -138,24 +138,20 @@ export default {
:class="line.commentRowClasses"
class="diff-grid-comments diff-tr notes_holder"
>
<div v-if="showCommentLeft(line)" class="diff-td notes-content parallel old">
<div v-if="line.left" :class="{ parallel: !inline }" class="diff-td notes-content old">
<diff-comment-cell
v-if="line.left"
:line="line.left"
:diff-file-hash="diffFile.file_hash"
:help-page-path="helpPagePath"
:has-draft="line.left.hasDraft"
line-position="left"
/>
</div>
<div v-if="showCommentRight(line)" class="diff-td notes-content parallel new">
<div v-if="line.right" :class="{ parallel: !inline }" class="diff-td notes-content new">
<diff-comment-cell
v-if="line.right"
:line="line.right"
:diff-file-hash="diffFile.file_hash"
:line-index="index"
:help-page-path="helpPagePath"
:has-draft="line.right.hasDraft"
line-position="right"
/>
</div>
......
---
title: Allow multiple comments on diff lines in inline view
merge_request: 52111
author:
type: fixed
......@@ -59,8 +59,8 @@ describe('DiffView', () => {
${'parallel'} | ${'left'} | ${'.old'} | ${{ left: { lineDraft: {} }, right: { lineDraft: {} } }} | ${2}
${'parallel'} | ${'right'} | ${'.new'} | ${{ left: { lineDraft: {} }, right: { lineDraft: {} } }} | ${2}
${'inline'} | ${'left'} | ${'.old'} | ${{ left: { lineDraft: {} } }} | ${1}
${'inline'} | ${'right'} | ${'.new'} | ${{ right: { lineDraft: {} } }} | ${1}
${'inline'} | ${'left'} | ${'.old'} | ${{ left: { lineDraft: {} }, right: { lineDraft: {} } }} | ${1}
${'inline'} | ${'left'} | ${'.old'} | ${{ left: { lineDraft: {} } }} | ${1}
${'inline'} | ${'left'} | ${'.old'} | ${{ left: { lineDraft: {} } }} | ${1}
`(
'renders a $type comment row with comment cell on $side',
({ type, container, sides, total }) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment