2020-07-23 05:09:18 -04:00
|
|
|
import Vue from 'vue';
|
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2020-10-15 08:09:06 -04:00
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2020-07-23 05:09:18 -04:00
|
|
|
import IncidentsList from './components/incidents_list.vue';
|
|
|
|
|
|
|
|
Vue.use(VueApollo);
|
|
|
|
export default () => {
|
|
|
|
const selector = '#js-incidents';
|
|
|
|
|
|
|
|
const domEl = document.querySelector(selector);
|
2020-08-04 23:10:58 -04:00
|
|
|
const {
|
|
|
|
projectPath,
|
|
|
|
newIssuePath,
|
|
|
|
incidentTemplateName,
|
2020-08-17 08:10:12 -04:00
|
|
|
incidentType,
|
2020-08-04 23:10:58 -04:00
|
|
|
issuePath,
|
|
|
|
publishedAvailable,
|
2020-08-19 08:10:17 -04:00
|
|
|
emptyListSvgPath,
|
2020-09-21 08:09:34 -04:00
|
|
|
textQuery,
|
2020-10-15 14:08:43 -04:00
|
|
|
authorUsernameQuery,
|
|
|
|
assigneeUsernameQuery,
|
2020-10-15 08:09:06 -04:00
|
|
|
slaFeatureAvailable,
|
2021-11-09 16:10:00 -05:00
|
|
|
canCreateIncident,
|
2020-08-04 23:10:58 -04:00
|
|
|
} = domEl.dataset;
|
2020-07-23 05:09:18 -04:00
|
|
|
|
|
|
|
const apolloProvider = new VueApollo({
|
2021-11-01 08:11:46 -04:00
|
|
|
defaultClient: createDefaultClient(),
|
2020-07-23 05:09:18 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el: selector,
|
2021-01-12 04:10:49 -05:00
|
|
|
components: {
|
|
|
|
IncidentsList,
|
|
|
|
},
|
2020-07-23 05:09:18 -04:00
|
|
|
provide: {
|
|
|
|
projectPath,
|
2020-07-24 20:09:23 -04:00
|
|
|
incidentTemplateName,
|
2020-08-17 08:10:12 -04:00
|
|
|
incidentType,
|
2020-07-24 20:09:23 -04:00
|
|
|
newIssuePath,
|
2020-07-27 11:09:25 -04:00
|
|
|
issuePath,
|
2020-10-15 08:09:06 -04:00
|
|
|
publishedAvailable: parseBoolean(publishedAvailable),
|
2020-08-19 08:10:17 -04:00
|
|
|
emptyListSvgPath,
|
2020-09-21 08:09:34 -04:00
|
|
|
textQuery,
|
2020-10-15 14:08:43 -04:00
|
|
|
authorUsernameQuery,
|
|
|
|
assigneeUsernameQuery,
|
2020-10-15 08:09:06 -04:00
|
|
|
slaFeatureAvailable: parseBoolean(slaFeatureAvailable),
|
2021-11-09 16:10:00 -05:00
|
|
|
canCreateIncident: parseBoolean(canCreateIncident),
|
2022-02-23 13:16:59 -05:00
|
|
|
incidentEscalationsAvailable: parseBoolean(gon?.features?.incidentEscalations),
|
2020-07-23 05:09:18 -04:00
|
|
|
},
|
|
|
|
apolloProvider,
|
|
|
|
render(createElement) {
|
2020-07-24 20:09:23 -04:00
|
|
|
return createElement('incidents-list');
|
2020-07-23 05:09:18 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|