Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « new « groups « pages « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7dab5258b2495bb3ce6185e91d2f0b6e69474fee (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import Vue from 'vue';
import BindInOut from '~/behaviors/bind_in_out';
import initFilePickers from '~/file_pickers';
import Group from '~/group';
import { initGroupNameAndPath } from '~/groups/create_edit_form';
import { parseBoolean } from '~/lib/utils/common_utils';
import NewGroupCreationApp from './components/app.vue';
import GroupPathValidator from './group_path_validator';
import initToggleInviteMembers from './toggle_invite_members';

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

BindInOut.initAll();
initFilePickers();

function initNewGroupCreation(el) {
  const {
    hasErrors,
    parentGroupName,
    importExistingGroupPath,
    verificationRequired,
    verificationFormUrl,
    subscriptionsUrl,
  } = el.dataset;

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

  return new Vue({
    el,
    provide: {
      verificationRequired: parseBoolean(verificationRequired),
      verificationFormUrl,
      subscriptionsUrl,
    },
    render(h) {
      return h(NewGroupCreationApp, { props });
    },
  });
}

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

initNewGroupCreation(el);

initToggleInviteMembers();