debian-mirror-gitlab/app/assets/javascripts/crm/organizations_bundle.js

42 lines
992 B
JavaScript
Raw Normal View History

2022-01-26 12:08:38 +05:30
import { GlToast } from '@gitlab/ui';
2021-12-11 22:18:48 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
2022-01-26 12:08:38 +05:30
import VueRouter from 'vue-router';
2021-12-11 22:18:48 +05:30
import createDefaultClient from '~/lib/graphql';
import CrmOrganizationsRoot from './components/organizations_root.vue';
2022-01-26 12:08:38 +05:30
import routes from './routes';
2021-12-11 22:18:48 +05:30
Vue.use(VueApollo);
2022-01-26 12:08:38 +05:30
Vue.use(VueRouter);
Vue.use(GlToast);
2021-12-11 22:18:48 +05:30
export default () => {
const el = document.getElementById('js-crm-organizations-app');
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
if (!el) {
return false;
}
2022-01-26 12:08:38 +05:30
const { basePath, canAdminCrmOrganization, groupFullPath, groupId, groupIssuesPath } = el.dataset;
const router = new VueRouter({
base: basePath,
mode: 'history',
routes,
});
2021-12-11 22:18:48 +05:30
return new Vue({
el,
2022-01-26 12:08:38 +05:30
router,
2021-12-11 22:18:48 +05:30
apolloProvider,
2022-01-26 12:08:38 +05:30
provide: { canAdminCrmOrganization, groupFullPath, groupId, groupIssuesPath },
2021-12-11 22:18:48 +05:30
render(createElement) {
return createElement(CrmOrganizationsRoot);
},
});
};