gitlab-org--gitlab-foss/app/assets/javascripts/jira_connect/branches/index.js

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);
},
});
}