summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/config_toggle.js
blob: 1e54c2511b89164ea131d227bcf1bd4c1305813d (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
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import ConfigToggle from './components/config_toggle.vue';

export default () => {
  const el = document.querySelector('.js-board-config');

  if (!el) {
    return;
  }

  // eslint-disable-next-line no-new
  new Vue({
    el,
    name: 'ConfigToggleRoot',
    render(h) {
      return h(ConfigToggle, {
        props: {
          canAdminList: parseBoolean(el.dataset.canAdminList),
          hasScope: parseBoolean(el.dataset.hasScope),
        },
      });
    },
  });
};