2021-11-18 22:05:49 +05:30
|
|
|
import Vue from 'vue';
|
2022-08-27 11:52:29 +05:30
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2021-11-18 22:05:49 +05:30
|
|
|
import app from '~/packages_and_registries/dependency_proxy/app.vue';
|
|
|
|
import { apolloProvider } from '~/packages_and_registries/dependency_proxy/graphql';
|
|
|
|
import Translate from '~/vue_shared/translate';
|
|
|
|
|
|
|
|
Vue.use(Translate);
|
|
|
|
|
|
|
|
export const initDependencyProxyApp = () => {
|
|
|
|
const el = document.getElementById('js-dependency-proxy');
|
|
|
|
if (!el) {
|
|
|
|
return null;
|
|
|
|
}
|
2022-08-27 11:52:29 +05:30
|
|
|
const { groupPath, groupId, noManifestsIllustration, canClearCache } = el.dataset;
|
2021-11-18 22:05:49 +05:30
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
apolloProvider,
|
|
|
|
provide: {
|
2022-08-27 11:52:29 +05:30
|
|
|
groupPath,
|
|
|
|
groupId,
|
|
|
|
noManifestsIllustration,
|
|
|
|
canClearCache: parseBoolean(canClearCache),
|
2021-11-18 22:05:49 +05:30
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(app);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|