2019-12-26 22:10:19 +05:30
|
|
|
import Vue from 'vue';
|
2020-03-13 15:44:24 +05:30
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2020-01-01 13:55:28 +05:30
|
|
|
import csrf from '~/lib/utils/csrf';
|
2021-03-11 19:13:27 +05:30
|
|
|
import ErrorDetails from './components/error_details.vue';
|
|
|
|
import store from './store';
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
Vue.use(VueApollo);
|
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
export default () => {
|
2020-03-13 15:44:24 +05:30
|
|
|
const selector = '#js-error_details';
|
|
|
|
|
|
|
|
const domEl = document.querySelector(selector);
|
|
|
|
const {
|
|
|
|
issueId,
|
|
|
|
projectPath,
|
|
|
|
issueUpdatePath,
|
|
|
|
issueStackTracePath,
|
|
|
|
projectIssuesPath,
|
|
|
|
} = domEl.dataset;
|
|
|
|
|
|
|
|
const apolloProvider = new VueApollo({
|
|
|
|
defaultClient: createDefaultClient(),
|
|
|
|
});
|
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
2020-03-13 15:44:24 +05:30
|
|
|
el: selector,
|
|
|
|
apolloProvider,
|
2019-12-26 22:10:19 +05:30
|
|
|
components: {
|
|
|
|
ErrorDetails,
|
|
|
|
},
|
|
|
|
store,
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('error-details', {
|
|
|
|
props: {
|
2020-03-13 15:44:24 +05:30
|
|
|
issueId,
|
|
|
|
projectPath,
|
|
|
|
issueUpdatePath,
|
2019-12-26 22:10:19 +05:30
|
|
|
issueStackTracePath,
|
2020-01-01 13:55:28 +05:30
|
|
|
projectIssuesPath,
|
|
|
|
csrfToken: csrf.token,
|
2019-12-26 22:10:19 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|