summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components/diff_table_cell.vue
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-07-03 23:18:27 +0000
committerAlessio Caiazza <acaiazza@gitlab.com>2018-07-04 17:14:31 +0200
commitf91eaa9f4343866ed701a46a06d285174c53370d (patch)
tree72941abcc2a8e366f2928a7c2db0e5b8021297ea /app/assets/javascripts/diffs/components/diff_table_cell.vue
parent05e26797810cf53e6a88aee185a69350b9d50be6 (diff)
downloadgitlab-ce-f91eaa9f4343866ed701a46a06d285174c53370d.tar.gz
Merge branch '_acet-mr-diff-performance' into 'master'
Improve performance of toggling diff view type Closes #48666 and #48733 See merge request gitlab-org/gitlab-ce!20278
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_table_cell.vue')
-rw-r--r--app/assets/javascripts/diffs/components/diff_table_cell.vue21
1 files changed, 17 insertions, 4 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_table_cell.vue b/app/assets/javascripts/diffs/components/diff_table_cell.vue
index 9f7ff315172..fd043102015 100644
--- a/app/assets/javascripts/diffs/components/diff_table_cell.vue
+++ b/app/assets/javascripts/diffs/components/diff_table_cell.vue
@@ -11,8 +11,11 @@ import {
LINE_HOVER_CLASS_NAME,
LINE_UNFOLD_CLASS_NAME,
INLINE_DIFF_VIEW_TYPE,
+<<<<<<< HEAD
LINE_POSITION_LEFT,
LINE_POSITION_RIGHT,
+=======
+>>>>>>> eba05eb8d48... Merge branch '_acet-mr-diff-performance' into 'master'
} from '../constants';
export default {
@@ -28,6 +31,11 @@ export default {
type: Object,
required: true,
},
+ diffViewType: {
+ type: String,
+ required: false,
+ default: INLINE_DIFF_VIEW_TYPE,
+ },
showCommentButton: {
type: Boolean,
required: false,
@@ -60,8 +68,9 @@ export default {
},
},
computed: {
- ...mapGetters(['isLoggedIn', 'isInlineView']),
+ ...mapGetters(['isLoggedIn']),
normalizedLine() {
+<<<<<<< HEAD
let normalizedLine;
if (this.diffViewType === INLINE_DIFF_VIEW_TYPE) {
@@ -70,6 +79,10 @@ export default {
normalizedLine = this.line.left;
} else if (this.linePosition === LINE_POSITION_RIGHT) {
normalizedLine = this.line.right;
+=======
+ if (this.diffViewType === INLINE_DIFF_VIEW_TYPE) {
+ return this.line;
+>>>>>>> eba05eb8d48... Merge branch '_acet-mr-diff-performance' into 'master'
}
return normalizedLine;
@@ -81,10 +94,10 @@ export default {
return this.normalizedLine.type === CONTEXT_LINE_TYPE;
},
isMetaLine() {
+ const { type } = this.normalizedLine;
+
return (
- this.normalizedLine.type === OLD_NO_NEW_LINE_TYPE ||
- this.normalizedLine.type === NEW_NO_NEW_LINE_TYPE ||
- this.normalizedLine.type === EMPTY_CELL_TYPE
+ type === OLD_NO_NEW_LINE_TYPE || type === NEW_NO_NEW_LINE_TYPE || type === EMPTY_CELL_TYPE
);
},
classNameMap() {