diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-12-13 18:49:05 +0100 |
---|---|---|
committer | Francisco Javier López <fjlopez@gitlab.com> | 2018-12-27 16:51:07 +0100 |
commit | 5a3e6fdff96f50cb293a8c9fe64ccbf59619936f (patch) | |
tree | 2a5d109ec7bfc07336ad7a155f3234ba4e0f6580 /app/assets | |
parent | 77909a88460bbc864a5f95f3fa66053eb6cab5a8 (diff) | |
download | gitlab-ce-5a3e6fdff96f50cb293a8c9fe64ccbf59619936f.tar.gz |
Fixing image lfs bug and also displaying text lfs
This commit, introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23812,
fixes a problem creating a displaying image diff notes when the image
is stored in LFS. The main problem was that `Gitlab::Diff::File` was
returning an invalid valid in `text?` for this kind of files.
It also fixes a rendering problem with other LFS files, like text
ones. They LFS pointer shouldn't be shown when LFS is enabled
for the project, but they were.
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_content.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_content.vue b/app/assets/javascripts/diffs/components/diff_content.vue index 42d09e44768..ba6dcd63880 100644 --- a/app/assets/javascripts/diffs/components/diff_content.vue +++ b/app/assets/javascripts/diffs/components/diff_content.vue @@ -45,6 +45,9 @@ export default { isTextFile() { return this.diffFile.viewer.name === 'text'; }, + errorMessage() { + return this.diffFile.viewer.error; + }, diffFileCommentForm() { return this.getCommentFormForDiffFile(this.diffFile.file_hash); }, @@ -75,7 +78,7 @@ export default { <template> <div class="diff-content"> - <div class="diff-viewer"> + <div v-if="!errorMessage" class="diff-viewer"> <template v-if="isTextFile"> <empty-file-viewer v-if="diffFile.empty" /> <inline-diff-view @@ -129,5 +132,8 @@ export default { </div> </diff-viewer> </div> + <div v-else class="diff-viewer"> + <div class="nothing-here-block" v-html="errorMessage"></div> + </div> </div> </template> |