debian-mirror-gitlab/app/assets/javascripts/pages/groups/new/index.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.5 KiB
JavaScript
Raw Normal View History

2021-09-04 01:27:46 +05:30
import Vue from 'vue';
2022-11-25 23:54:43 +05:30
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
2018-03-17 18:26:18 +05:30
import BindInOut from '~/behaviors/bind_in_out';
2021-03-11 19:13:27 +05:30
import initFilePickers from '~/file_pickers';
2018-03-17 18:26:18 +05:30
import Group from '~/group';
2022-07-23 23:45:48 +05:30
import { initGroupNameAndPath } from '~/groups/create_edit_form';
2021-09-04 01:27:46 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
import NewGroupCreationApp from './components/app.vue';
2019-12-26 22:10:19 +05:30
import GroupPathValidator from './group_path_validator';
2021-11-11 11:23:49 +05:30
import initToggleInviteMembers from './toggle_invite_members';
2018-03-17 18:26:18 +05:30
2022-11-25 23:54:43 +05:30
Vue.use(VueApollo);
2021-04-29 21:17:54 +05:30
new GroupPathValidator(); // eslint-disable-line no-new
2022-07-23 23:45:48 +05:30
new Group(); // eslint-disable-line no-new
initGroupNameAndPath();
2021-04-29 21:17:54 +05:30
2021-01-29 00:20:46 +05:30
BindInOut.initAll();
initFilePickers();
2020-06-23 00:09:42 +05:30
2021-09-04 01:27:46 +05:30
function initNewGroupCreation(el) {
2022-08-27 11:52:29 +05:30
const {
hasErrors,
parentGroupName,
importExistingGroupPath,
verificationRequired,
verificationFormUrl,
subscriptionsUrl,
} = el.dataset;
2021-09-04 01:27:46 +05:30
const props = {
2022-08-27 11:52:29 +05:30
parentGroupName,
importExistingGroupPath,
2021-09-04 01:27:46 +05:30
hasErrors: parseBoolean(hasErrors),
};
2022-11-25 23:54:43 +05:30
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
2021-09-04 01:27:46 +05:30
return new Vue({
el,
2022-11-25 23:54:43 +05:30
apolloProvider,
2022-03-02 08:16:31 +05:30
provide: {
verificationRequired: parseBoolean(verificationRequired),
verificationFormUrl,
subscriptionsUrl,
},
2021-09-04 01:27:46 +05:30
render(h) {
return h(NewGroupCreationApp, { props });
},
});
2021-04-17 20:07:23 +05:30
}
2021-09-04 01:27:46 +05:30
const el = document.querySelector('.js-new-group-creation');
initNewGroupCreation(el);
2021-11-11 11:23:49 +05:30
initToggleInviteMembers();