Commit db800a16 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'tr-fix-error-tracking-hmr' into 'master'

Fix hot module reload for error tracking pages

See merge request gitlab-org/gitlab!25068
parents 103e3dfa ebf086bb
...@@ -8,28 +8,30 @@ import csrf from '~/lib/utils/csrf'; ...@@ -8,28 +8,30 @@ import csrf from '~/lib/utils/csrf';
Vue.use(VueApollo); Vue.use(VueApollo);
export default () => { export default () => {
const selector = '#js-error_details';
const domEl = document.querySelector(selector);
const {
issueId,
projectPath,
issueUpdatePath,
issueStackTracePath,
projectIssuesPath,
} = domEl.dataset;
const apolloProvider = new VueApollo({ const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(), defaultClient: createDefaultClient(),
}); });
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el: '#js-error_details', el: selector,
apolloProvider, apolloProvider,
components: { components: {
ErrorDetails, ErrorDetails,
}, },
store, store,
render(createElement) { render(createElement) {
const domEl = document.querySelector(this.$options.el);
const {
issueId,
projectPath,
issueUpdatePath,
issueStackTracePath,
projectIssuesPath,
} = domEl.dataset;
return createElement('error-details', { return createElement('error-details', {
props: { props: {
issueId, issueId,
......
...@@ -4,27 +4,29 @@ import store from './store'; ...@@ -4,27 +4,29 @@ import store from './store';
import ErrorTrackingList from './components/error_tracking_list.vue'; import ErrorTrackingList from './components/error_tracking_list.vue';
export default () => { export default () => {
const selector = '#js-error_tracking';
const domEl = document.querySelector(selector);
const {
indexPath,
enableErrorTrackingLink,
illustrationPath,
projectPath,
listPath,
} = domEl.dataset;
let { errorTrackingEnabled, userCanEnableErrorTracking } = domEl.dataset;
errorTrackingEnabled = parseBoolean(errorTrackingEnabled);
userCanEnableErrorTracking = parseBoolean(userCanEnableErrorTracking);
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el: '#js-error_tracking', el: selector,
components: { components: {
ErrorTrackingList, ErrorTrackingList,
}, },
store, store,
render(createElement) { render(createElement) {
const domEl = document.querySelector(this.$options.el);
const {
indexPath,
enableErrorTrackingLink,
illustrationPath,
projectPath,
listPath,
} = domEl.dataset;
let { errorTrackingEnabled, userCanEnableErrorTracking } = domEl.dataset;
errorTrackingEnabled = parseBoolean(errorTrackingEnabled);
userCanEnableErrorTracking = parseBoolean(userCanEnableErrorTracking);
return createElement('error-tracking-list', { return createElement('error-tracking-list', {
props: { props: {
indexPath, indexPath,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment