diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-14 09:13:55 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-14 09:13:55 +0300 |
commit | 2556bfddbc6b56bace76c409357f0f21dd96ac19 (patch) | |
tree | d454bb5a7435534b1a79cdbb2b27fddfcc16fac2 /app/assets/javascripts/repository | |
parent | be4229fb3ac31e2cc01c84b3a01ba58e1ba52a58 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
-rw-r--r-- | app/assets/javascripts/repository/components/blob_viewers/index.js | 8 | ||||
-rw-r--r-- | app/assets/javascripts/repository/components/blob_viewers/text_viewer.vue | 25 |
2 files changed, 5 insertions, 28 deletions
diff --git a/app/assets/javascripts/repository/components/blob_viewers/index.js b/app/assets/javascripts/repository/components/blob_viewers/index.js index 62d687e848b..8f6f2d15215 100644 --- a/app/assets/javascripts/repository/components/blob_viewers/index.js +++ b/app/assets/javascripts/repository/components/blob_viewers/index.js @@ -4,7 +4,10 @@ export const loadViewer = (type) => { return () => import(/* webpackChunkName: 'blob_empty_viewer' */ './empty_viewer.vue'); case 'text': return gon.features.highlightJs - ? () => import(/* webpackChunkName: 'blob_text_viewer' */ './text_viewer.vue') + ? () => + import( + /* webpackChunkName: 'blob_text_viewer' */ '~/vue_shared/components/source_viewer.vue' + ) : null; case 'download': return () => import(/* webpackChunkName: 'blob_download_viewer' */ './download_viewer.vue'); @@ -23,8 +26,7 @@ export const viewerProps = (type, blob) => { return { text: { content: blob.rawTextBlob, - fileName: blob.name, - readOnly: true, + autoDetect: true, // We'll eventually disable autoDetect and pass the language explicitly to reduce the footprint (https://gitlab.com/gitlab-org/gitlab/-/issues/348145) }, download: { fileName: blob.name, diff --git a/app/assets/javascripts/repository/components/blob_viewers/text_viewer.vue b/app/assets/javascripts/repository/components/blob_viewers/text_viewer.vue deleted file mode 100644 index 57fc979a56e..00000000000 --- a/app/assets/javascripts/repository/components/blob_viewers/text_viewer.vue +++ /dev/null @@ -1,25 +0,0 @@ -<script> -export default { - components: { - SourceEditor: () => - import(/* webpackChunkName: 'SourceEditor' */ '~/vue_shared/components/source_editor.vue'), - }, - props: { - content: { - type: String, - required: true, - }, - fileName: { - type: String, - required: true, - }, - readOnly: { - type: Boolean, - required: true, - }, - }, -}; -</script> -<template> - <source-editor :value="content" :file-name="fileName" :editor-options="{ readOnly }" /> -</template> |