diff options
Diffstat (limited to 'app/assets/javascripts/pages/shared/wikis/index.js')
-rw-r--r-- | app/assets/javascripts/pages/shared/wikis/index.js | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/app/assets/javascripts/pages/shared/wikis/index.js b/app/assets/javascripts/pages/shared/wikis/index.js index c8dc75828e4..c382a372260 100644 --- a/app/assets/javascripts/pages/shared/wikis/index.js +++ b/app/assets/javascripts/pages/shared/wikis/index.js @@ -6,9 +6,10 @@ import Translate from '~/vue_shared/translate'; import GLForm from '../../../gl_form'; import ZenMode from '../../../zen_mode'; import deleteWikiModal from './components/delete_wiki_modal.vue'; +import wikiAlert from './components/wiki_alert.vue'; import Wikis from './wikis'; -export default () => { +const createModalVueApp = () => { new Wikis(); // eslint-disable-line no-new new ShortcutsWiki(); // eslint-disable-line no-new new ZenMode(); // eslint-disable-line no-new @@ -39,3 +40,28 @@ export default () => { }); } }; + +const createAlertVueApp = () => { + const el = document.getElementById('js-wiki-error'); + if (el) { + const { error, wikiPagePath } = el.dataset; + + // eslint-disable-next-line no-new + new Vue({ + el, + render(createElement) { + return createElement(wikiAlert, { + props: { + error, + wikiPagePath, + }, + }); + }, + }); + } +}; + +export default () => { + createModalVueApp(); + createAlertVueApp(); +}; |