summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/groups/new/index.js
blob: 7557edb1b499c19eb2c1ce58832543f2b2ac2eb2 (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
32
33
import Vue from 'vue';
import BindInOut from '~/behaviors/bind_in_out';
import initFilePickers from '~/file_pickers';
import Group from '~/group';
import { parseBoolean } from '~/lib/utils/common_utils';
import NewGroupCreationApp from './components/app.vue';
import GroupPathValidator from './group_path_validator';

new GroupPathValidator(); // eslint-disable-line no-new

BindInOut.initAll();
initFilePickers();

new Group(); // eslint-disable-line no-new

function initNewGroupCreation(el) {
  const { hasErrors } = el.dataset;

  const props = {
    hasErrors: parseBoolean(hasErrors),
  };

  return new Vue({
    el,
    render(h) {
      return h(NewGroupCreationApp, { props });
    },
  });
}

const el = document.querySelector('.js-new-group-creation');

initNewGroupCreation(el);