diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-03 15:13:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-03 15:13:59 +0300 |
commit | 6e228f38c37c4c7b6d6be648ae2664ebfb5c3c80 (patch) | |
tree | 0c7abe13728c198df556d04143dc624a67aaad85 /app/assets/javascripts/groups | |
parent | f6a4346585dcc6cc564cb4974a0ea49d2ac0531d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/groups')
-rw-r--r-- | app/assets/javascripts/groups/init_group_readme.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/assets/javascripts/groups/init_group_readme.js b/app/assets/javascripts/groups/init_group_readme.js new file mode 100644 index 00000000000..7cde64fed4d --- /dev/null +++ b/app/assets/javascripts/groups/init_group_readme.js @@ -0,0 +1,26 @@ +import Vue from 'vue'; +import VueApollo from 'vue-apollo'; +import apolloProvider from '~/repository/graphql'; +import FilePreview from '~/repository/components/preview/index.vue'; + +Vue.use(VueApollo); + +export const initGroupReadme = () => { + const el = document.getElementById('js-group-readme'); + + if (!el) return false; + + const { webPath, name } = el.dataset; + + return new Vue({ + el, + apolloProvider, + render(createElement) { + return createElement(FilePreview, { + props: { + blob: { webPath, name }, + }, + }); + }, + }); +}; |