diff options
author | Phil Hughes <me@iamphill.com> | 2017-10-26 18:54:44 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-10-26 18:54:44 +0300 |
commit | 4d18e2001102fc2269da0509861770cc5bf8de11 (patch) | |
tree | 036a02cd13a4e5dab824eb3e74b5ab8b1863e357 /app/assets/javascripts/repo | |
parent | bdac5569b10b4dde32a7ac98973da2805f42e92d (diff) |
fixed render_error not being hooked up correctly
[ci skip]
Diffstat (limited to 'app/assets/javascripts/repo')
4 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/repo/components/repo_preview.vue b/app/assets/javascripts/repo/components/repo_preview.vue index 23b71b03a14..647c9079d0f 100644 --- a/app/assets/javascripts/repo/components/repo_preview.vue +++ b/app/assets/javascripts/repo/components/repo_preview.vue @@ -33,21 +33,21 @@ export default { <template> <div> <div - v-if="!activeFile.render_error" + v-if="!activeFile.renderError" v-html="activeFile.html"> </div> <div - v-else-if="activeFile.tooLarge" + v-else-if="activeFile.renderError == 'too_large'" class="vertical-center render-error"> <p class="text-center"> - The source could not be displayed because it is too large. You can <a :href="activeFile.raw_path">download</a> it instead. + The source could not be displayed because it is too large. You can <a :href="activeFile.rawPath" download>download</a> it instead. </p> </div> <div v-else class="vertical-center render-error"> <p class="text-center"> - The source could not be displayed because a rendering error occurred. You can <a :href="activeFile.raw_path">download</a> it instead. + The source could not be displayed because a rendering error occurred. You can <a :href="activeFile.rawPath" download>download</a> it instead. </p> </div> </div> diff --git a/app/assets/javascripts/repo/stores/getters.js b/app/assets/javascripts/repo/stores/getters.js index 9fa593a82da..1c83c943ef7 100644 --- a/app/assets/javascripts/repo/stores/getters.js +++ b/app/assets/javascripts/repo/stores/getters.js @@ -35,5 +35,5 @@ export const canEditFile = (state) => { return state.canCommit && state.onTopOfBranch && openedFiles.length && - (currentActiveFile && !currentActiveFile.render_error && !currentActiveFile.binary); + (currentActiveFile && !currentActiveFile.renderError && !currentActiveFile.binary); }; diff --git a/app/assets/javascripts/repo/stores/mutations/file.js b/app/assets/javascripts/repo/stores/mutations/file.js index 4d10fa8169d..f9ba80b9dc2 100644 --- a/app/assets/javascripts/repo/stores/mutations/file.js +++ b/app/assets/javascripts/repo/stores/mutations/file.js @@ -26,6 +26,7 @@ export default { rawPath: data.raw_path, binary: data.binary, html: data.html, + renderError: data.render_error, }); }, [types.SET_FILE_RAW_DATA](state, { file, raw }) { diff --git a/app/assets/javascripts/repo/stores/utils.js b/app/assets/javascripts/repo/stores/utils.js index 81638e46672..feafcebcfe2 100644 --- a/app/assets/javascripts/repo/stores/utils.js +++ b/app/assets/javascripts/repo/stores/utils.js @@ -23,6 +23,7 @@ export const dataStructure = () => ({ raw: '', content: '', parentTreeUrl: '', + renderError: false, }); export const decorateData = (entity, projectUrl = '') => { @@ -36,6 +37,7 @@ export const decorateData = (entity, projectUrl = '') => { tree_url, path, tempFile, + renderError, active = false, opened = false, changed = false, @@ -58,6 +60,7 @@ export const decorateData = (entity, projectUrl = '') => { active, parentTreeUrl, changed, + renderError, // eslint-disable-next-line camelcase lastCommit: last_commit ? { url: `${projectUrl}/commit/${last_commit.id}`, |