Commit 4c1a2a9b authored by Clement Ho's avatar Clement Ho

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
parents eba05eb8 98aeab28
......@@ -11,6 +11,8 @@ import {
LINE_HOVER_CLASS_NAME,
LINE_UNFOLD_CLASS_NAME,
INLINE_DIFF_VIEW_TYPE,
LINE_POSITION_LEFT,
LINE_POSITION_RIGHT,
} from '../constants';
export default {
......@@ -65,11 +67,17 @@ export default {
computed: {
...mapGetters(['isLoggedIn']),
normalizedLine() {
let normalizedLine;
if (this.diffViewType === INLINE_DIFF_VIEW_TYPE) {
return this.line;
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;
}
return this.lineType === OLD_LINE_TYPE ? this.line.left : this.line.right;
return normalizedLine;
},
isMatchLine() {
return this.normalizedLine.type === MATCH_LINE_TYPE;
......
......@@ -118,6 +118,7 @@ export default {
:diff-file="diffFile"
:line="line"
:is-content-line="true"
:line-position="linePositionLeft"
:line-type="parallelViewLeftLineType"
:diff-view-type="parallelDiffViewType"
class="line_content parallel left-side"
......@@ -139,6 +140,7 @@ export default {
:diff-file="diffFile"
:line="line"
:is-content-line="true"
:line-position="linePositionRight"
:line-type="line.right.type"
:diff-view-type="parallelDiffViewType"
class="line_content parallel right-side"
......
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