debian-mirror-gitlab/app/assets/javascripts/crm/organizations/bundle.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.1 KiB
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';
2022-10-11 01:57:18 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
2021-12-11 22:18:48 +05:30
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-10-11 01:57:18 +05:30
const {
basePath,
canAdminCrmOrganization,
groupFullPath,
groupId,
groupIssuesPath,
textQuery,
} = el.dataset;
2022-01-26 12:08:38 +05:30
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-10-11 01:57:18 +05:30
provide: {
canAdminCrmOrganization: parseBoolean(canAdminCrmOrganization),
groupFullPath,
groupId,
groupIssuesPath,
textQuery,
},
2021-12-11 22:18:48 +05:30
render(createElement) {
return createElement(CrmOrganizationsRoot);
},
});
};