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

52 lines
1.2 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';
2021-03-11 19:13:27 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
2020-11-24 15:15:51 +05:30
import issuableApp from './components/app.vue';
import incidentTabs from './components/incidents/incident_tabs.vue';
Vue.use(VueApollo);
export default function initIssuableApp(issuableData = {}) {
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
2021-03-08 18:12:59 +05:30
const {
canUpdate,
iid,
projectNamespace,
projectPath,
projectId,
slaFeatureAvailable,
uploadMetricsFeatureAvailable,
} = issuableData;
const fullPath = `${projectNamespace}/${projectPath}`;
2020-11-24 15:15:51 +05:30
return new Vue({
el: document.getElementById('js-issuable-app'),
apolloProvider,
components: {
issuableApp,
},
provide: {
2021-03-08 18:12:59 +05:30
canUpdate,
fullPath,
2020-11-24 15:15:51 +05:30
iid,
2021-03-08 18:12:59 +05:30
projectId,
2021-01-03 14:25:43 +05:30
slaFeatureAvailable: parseBoolean(slaFeatureAvailable),
2021-03-08 18:12:59 +05:30
uploadMetricsFeatureAvailable: parseBoolean(uploadMetricsFeatureAvailable),
2020-11-24 15:15:51 +05:30
},
render(createElement) {
return createElement('issuable-app', {
props: {
...issuableData,
descriptionComponent: incidentTabs,
showTitleBorder: false,
},
});
},
});
}