summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-07-04 00:08:34 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-07-04 00:08:34 +0000
commit4c1a2a9b9977f68a05512ed1ff378ee0a2368aca (patch)
treecd65f5f2d89d81ba429d7bdae830160d60cbdd16
parenteba05eb8d48445e6560f3ecbc3f3eb649da00e57 (diff)
parent98aeab2848d94da55640aaf756d014e40ea01d2d (diff)
downloadgitlab-ce-4c1a2a9b9977f68a05512ed1ff378ee0a2368aca.tar.gz
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
-rw-r--r--app/assets/javascripts/diffs/components/diff_table_cell.vue12
-rw-r--r--app/assets/javascripts/diffs/components/parallel_diff_table_row.vue2
2 files changed, 12 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_table_cell.vue b/app/assets/javascripts/diffs/components/diff_table_cell.vue
index fdefd63ced2..5b08b161114 100644
--- a/app/assets/javascripts/diffs/components/diff_table_cell.vue
+++ b/app/assets/javascripts/diffs/components/diff_table_cell.vue
@@ -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;
diff --git a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
index 9cb68971c49..eb769584d74 100644
--- a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
+++ b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
@@ -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"