debian-mirror-gitlab/app/assets/javascripts/error_tracking/details.js

48 lines
1,023 B
JavaScript
Raw Normal View History

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';
2019-12-26 22:10:19 +05:30
import store from './store';
import ErrorDetails from './components/error_details.vue';
2020-01-01 13:55:28 +05:30
import csrf from '~/lib/utils/csrf';
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
},
});
},
});
};