2020-07-23 09:09:18 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
|
|
|
import IncidentsList from './components/incidents_list.vue';
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
export default () => {
|
|
|
|
const selector = '#js-incidents';
|
|
|
|
|
|
|
|
const domEl = document.querySelector(selector);
|
2020-08-05 03:10:58 +00:00
|
|
|
const {
|
|
|
|
projectPath,
|
|
|
|
newIssuePath,
|
|
|
|
incidentTemplateName,
|
2020-08-17 12:10:12 +00:00
|
|
|
incidentType,
|
2020-08-05 03:10:58 +00:00
|
|
|
issuePath,
|
|
|
|
publishedAvailable,
|
|
|
|
} = domEl.dataset;
|
2020-07-23 09:09:18 +00:00
|
|
|
|
|
|
|
const apolloProvider = new VueApollo({
|
|
|
|
defaultClient: createDefaultClient(),
|
|
|
|
});
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el: selector,
|
|
|
|
provide: {
|
|
|
|
projectPath,
|
2020-07-25 00:09:23 +00:00
|
|
|
incidentTemplateName,
|
2020-08-17 12:10:12 +00:00
|
|
|
incidentType,
|
2020-07-25 00:09:23 +00:00
|
|
|
newIssuePath,
|
2020-07-27 15:09:25 +00:00
|
|
|
issuePath,
|
2020-08-05 03:10:58 +00:00
|
|
|
publishedAvailable,
|
2020-07-23 09:09:18 +00:00
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
components: {
|
|
|
|
IncidentsList,
|
|
|
|
},
|
|
|
|
render(createElement) {
|
2020-07-25 00:09:23 +00:00
|
|
|
return createElement('incidents-list');
|
2020-07-23 09:09:18 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|