2019-11-11 10:06:42 -05:00
|
|
|
import Vue from 'vue';
|
2020-01-14 07:07:41 -05:00
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2019-11-11 10:06:42 -05:00
|
|
|
import store from './store';
|
|
|
|
import ErrorDetails from './components/error_details.vue';
|
2019-12-04 04:06:33 -05:00
|
|
|
import csrf from '~/lib/utils/csrf';
|
2019-11-11 10:06:42 -05:00
|
|
|
|
2020-01-14 07:07:41 -05:00
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
2019-11-11 10:06:42 -05:00
|
|
|
export default () => {
|
2020-02-13 10:08:52 -05:00
|
|
|
const selector = '#js-error_details';
|
|
|
|
|
|
|
|
const domEl = document.querySelector(selector);
|
|
|
|
const {
|
|
|
|
issueId,
|
|
|
|
projectPath,
|
|
|
|
issueUpdatePath,
|
|
|
|
issueStackTracePath,
|
|
|
|
projectIssuesPath,
|
|
|
|
} = domEl.dataset;
|
|
|
|
|
2020-01-14 07:07:41 -05:00
|
|
|
const apolloProvider = new VueApollo({
|
|
|
|
defaultClient: createDefaultClient(),
|
|
|
|
});
|
|
|
|
|
2019-11-11 10:06:42 -05:00
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
2020-02-13 10:08:52 -05:00
|
|
|
el: selector,
|
2020-01-14 07:07:41 -05:00
|
|
|
apolloProvider,
|
2019-11-11 10:06:42 -05:00
|
|
|
components: {
|
|
|
|
ErrorDetails,
|
|
|
|
},
|
|
|
|
store,
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('error-details', {
|
|
|
|
props: {
|
2020-01-14 07:07:41 -05:00
|
|
|
issueId,
|
|
|
|
projectPath,
|
2020-01-15 13:08:34 -05:00
|
|
|
issueUpdatePath,
|
2019-11-11 10:06:42 -05:00
|
|
|
issueStackTracePath,
|
2019-12-04 04:06:33 -05:00
|
|
|
projectIssuesPath,
|
|
|
|
csrfToken: csrf.token,
|
2019-11-11 10:06:42 -05:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|