debian-mirror-gitlab/app/assets/javascripts/issue_show/incident.js

39 lines
1 KiB
JavaScript
Raw Normal View History

2020-11-24 15:15:51 +05:30
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import issuableApp from './components/app.vue';
import incidentTabs from './components/incidents/incident_tabs.vue';
2021-01-03 14:25:43 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
2020-11-24 15:15:51 +05:30
Vue.use(VueApollo);
export default function initIssuableApp(issuableData = {}) {
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
2021-01-03 14:25:43 +05:30
const { iid, projectNamespace, projectPath, slaFeatureAvailable } = issuableData;
2020-11-24 15:15:51 +05:30
return new Vue({
el: document.getElementById('js-issuable-app'),
apolloProvider,
components: {
issuableApp,
},
provide: {
fullPath: `${projectNamespace}/${projectPath}`,
iid,
2021-01-03 14:25:43 +05:30
slaFeatureAvailable: parseBoolean(slaFeatureAvailable),
2020-11-24 15:15:51 +05:30
},
render(createElement) {
return createElement('issuable-app', {
props: {
...issuableData,
descriptionComponent: incidentTabs,
showTitleBorder: false,
},
});
},
});
}