gitlab-org--gitlab-foss/app/assets/javascripts/error_tracking/details.js

47 lines
1,023 B
JavaScript

import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import csrf from '~/lib/utils/csrf';
import ErrorDetails from './components/error_details.vue';
import store from './store';
Vue.use(VueApollo);
export default () => {
const selector = '#js-error_details';
const domEl = document.querySelector(selector);
const {
issueId,
projectPath,
issueUpdatePath,
issueStackTracePath,
projectIssuesPath,
} = domEl.dataset;
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
// eslint-disable-next-line no-new
new Vue({
el: selector,
apolloProvider,
components: {
ErrorDetails,
},
store,
render(createElement) {
return createElement('error-details', {
props: {
issueId,
projectPath,
issueUpdatePath,
issueStackTracePath,
projectIssuesPath,
csrfToken: csrf.token,
},
});
},
});
};