summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components/diff_content.vue
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-12-15 12:21:54 +0000
committerNick Thomas <nick@gitlab.com>2018-12-15 12:21:54 +0000
commit8d2e1b724bd515c5977090d722b915f374218eb3 (patch)
tree3e52f0b8994fa274326dacb1a942ab265462d73e /app/assets/javascripts/diffs/components/diff_content.vue
parentc027101d34ebdbd935e2c2b35827323c110b3654 (diff)
parent9f9eb03f3d8247438523a9fee3a83967fecd8114 (diff)
downloadgitlab-ce-8d2e1b724bd515c5977090d722b915f374218eb3.tar.gz
Merge branch '54786-mr-empty-file-display' into 'master'
Display empty files properly on MR diffs Closes #54786 See merge request gitlab-org/gitlab-ce!23671
Diffstat (limited to 'app/assets/javascripts/diffs/components/diff_content.vue')
-rw-r--r--app/assets/javascripts/diffs/components/diff_content.vue7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_content.vue b/app/assets/javascripts/diffs/components/diff_content.vue
index ac963f2971e..42d09e44768 100644
--- a/app/assets/javascripts/diffs/components/diff_content.vue
+++ b/app/assets/javascripts/diffs/components/diff_content.vue
@@ -1,6 +1,7 @@
<script>
import { mapActions, mapGetters, mapState } from 'vuex';
import DiffViewer from '~/vue_shared/components/diff_viewer/diff_viewer.vue';
+import EmptyFileViewer from '~/vue_shared/components/diff_viewer/viewers/empty_file.vue';
import InlineDiffView from './inline_diff_view.vue';
import ParallelDiffView from './parallel_diff_view.vue';
import NoteForm from '../../notes/components/note_form.vue';
@@ -17,6 +18,7 @@ export default {
NoteForm,
DiffDiscussions,
ImageDiffOverlay,
+ EmptyFileViewer,
},
props: {
diffFile: {
@@ -75,14 +77,15 @@ export default {
<div class="diff-content">
<div class="diff-viewer">
<template v-if="isTextFile">
+ <empty-file-viewer v-if="diffFile.empty" />
<inline-diff-view
- v-if="isInlineView"
+ v-else-if="isInlineView"
:diff-file="diffFile"
:diff-lines="diffFile.highlighted_diff_lines || []"
:help-page-path="helpPagePath"
/>
<parallel-diff-view
- v-if="isParallelView"
+ v-else-if="isParallelView"
:diff-file="diffFile"
:diff-lines="diffFile.parallel_diff_lines || []"
:help-page-path="helpPagePath"