summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/error_tracking/index.js
blob: 3d609448efe4c949b117c18a12182145ae4c6aef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import store from './store';
import ErrorTrackingList from './components/error_tracking_list.vue';

export default () => {
  // eslint-disable-next-line no-new
  new Vue({
    el: '#js-error_tracking',
    components: {
      ErrorTrackingList,
    },
    store,
    render(createElement) {
      const domEl = document.querySelector(this.$options.el);
      const { indexPath, enableErrorTrackingLink, illustrationPath } = domEl.dataset;
      let { errorTrackingEnabled } = domEl.dataset;

      errorTrackingEnabled = parseBoolean(errorTrackingEnabled);

      return createElement('error-tracking-list', {
        props: {
          indexPath,
          enableErrorTrackingLink,
          errorTrackingEnabled,
          illustrationPath,
        },
      });
    },
  });
};