debian-mirror-gitlab/app/assets/javascripts/jira_connect/branches/index.js
2021-10-27 15:23:28 +05:30

36 lines
818 B
JavaScript

import Vue from 'vue';
import VueApollo from 'vue-apollo';
import JiraConnectNewBranchPage from '~/jira_connect/branches/pages/index.vue';
import createDefaultClient from '~/lib/graphql';
Vue.use(VueApollo);
export default async function initJiraConnectBranches() {
const el = document.querySelector('.js-jira-connect-create-branch');
if (!el) {
return null;
}
const { initialBranchName, successStateSvgPath } = el.dataset;
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(
{},
{
assumeImmutableResults: true,
},
),
});
return new Vue({
el,
apolloProvider,
provide: {
initialBranchName,
successStateSvgPath,
},
render(createElement) {
return createElement(JiraConnectNewBranchPage);
},
});
}