Commit 644fc958 authored by Clement Ho's avatar Clement Ho Committed by Alessio Caiazza

Merge branch '_acet-fix-parallel-diff-lines' into 'master'

Fix content of the parallel diff lines

Closes #48797

See merge request gitlab-org/gitlab-ce!20350
parent 7295f1aa
......@@ -10,6 +10,12 @@ import {
NEW_NO_NEW_LINE_TYPE,
LINE_HOVER_CLASS_NAME,
LINE_UNFOLD_CLASS_NAME,
<<<<<<< HEAD
=======
INLINE_DIFF_VIEW_TYPE,
LINE_POSITION_LEFT,
LINE_POSITION_RIGHT,
>>>>>>> 4c1a2a9b997... Merge branch '_acet-fix-parallel-diff-lines' into 'master'
} from '../constants';
export default {
......@@ -59,11 +65,22 @@ export default {
computed: {
...mapGetters(['isLoggedIn', 'isInlineView']),
normalizedLine() {
<<<<<<< HEAD
if (this.isInlineView) {
return this.line;
=======
let normalizedLine;
if (this.diffViewType === INLINE_DIFF_VIEW_TYPE) {
normalizedLine = this.line;
} else if (this.linePosition === LINE_POSITION_LEFT) {
normalizedLine = this.line.left;
} else if (this.linePosition === LINE_POSITION_RIGHT) {
normalizedLine = this.line.right;
>>>>>>> 4c1a2a9b997... Merge branch '_acet-fix-parallel-diff-lines' into 'master'
}
return this.lineType === OLD_LINE_TYPE ? this.line.left : this.line.right;
return normalizedLine;
},
isMatchLine() {
return this.normalizedLine.type === MATCH_LINE_TYPE;
......
......@@ -164,6 +164,7 @@ export default {
:diff-file="diffFile"
:line="line"
:is-content-line="true"
:line-position="linePositionLeft"
:line-type="parallelViewLeftLineType"
class="line_content parallel left-side"
@mousedown.native="handleParallelLineMouseDown"
......@@ -183,6 +184,7 @@ export default {
:diff-file="diffFile"
:line="line"
:is-content-line="true"
:line-position="linePositionRight"
:line-type="line.right.type"
class="line_content parallel right-side"
@mousedown.native="handleParallelLineMouseDown"
......
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