debian-mirror-gitlab/app/assets/javascripts/jira_import/index.js
2021-01-03 14:25:43 +05:30

38 lines
1.1 KiB
JavaScript

import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { parseBoolean } from '~/lib/utils/common_utils';
import App from './components/jira_import_app.vue';
Vue.use(VueApollo);
const defaultClient = createDefaultClient({}, { assumeImmutableResults: true });
const apolloProvider = new VueApollo({
defaultClient,
});
export default function mountJiraImportApp() {
const el = document.querySelector('.js-jira-import-root');
if (!el) {
return false;
}
return new Vue({
el,
apolloProvider,
render(createComponent) {
return createComponent(App, {
props: {
inProgressIllustration: el.dataset.inProgressIllustration,
isJiraConfigured: parseBoolean(el.dataset.isJiraConfigured),
issuesPath: el.dataset.issuesPath,
jiraIntegrationPath: el.dataset.jiraIntegrationPath,
projectId: el.dataset.projectId,
projectPath: el.dataset.projectPath,
setupIllustration: el.dataset.setupIllustration,
},
});
},
});
}