2020-07-28 23:09:34 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import Members from 'ee_else_ce/members';
|
|
|
|
import memberExpirationDate from '~/member_expiration_date';
|
|
|
|
import UsersSelect from '~/users_select';
|
|
|
|
import groupsSelect from '~/groups_select';
|
|
|
|
import RemoveMemberModal from '~/vue_shared/components/remove_member_modal.vue';
|
2021-01-03 14:25:43 +05:30
|
|
|
import { initGroupMembersApp } from '~/groups/members';
|
|
|
|
import { memberRequestFormatter, groupLinkRequestFormatter } from '~/groups/members/utils';
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
function mountRemoveMemberModal() {
|
|
|
|
const el = document.querySelector('.js-remove-member-modal');
|
|
|
|
if (!el) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
render(createComponent) {
|
|
|
|
return createComponent(RemoveMemberModal);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
groupsSelect();
|
|
|
|
memberExpirationDate();
|
|
|
|
memberExpirationDate('.js-access-expiration-date-groups');
|
|
|
|
mountRemoveMemberModal();
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
const SHARED_FIELDS = ['account', 'expires', 'maxRole', 'expiration', 'actions'];
|
|
|
|
|
|
|
|
initGroupMembersApp(
|
|
|
|
document.querySelector('.js-group-members-list'),
|
|
|
|
SHARED_FIELDS.concat(['source', 'granted']),
|
|
|
|
memberRequestFormatter,
|
|
|
|
);
|
|
|
|
initGroupMembersApp(
|
|
|
|
document.querySelector('.js-group-linked-list'),
|
|
|
|
SHARED_FIELDS.concat('granted'),
|
|
|
|
groupLinkRequestFormatter,
|
|
|
|
);
|
|
|
|
initGroupMembersApp(
|
|
|
|
document.querySelector('.js-group-invited-members-list'),
|
|
|
|
SHARED_FIELDS.concat('invited'),
|
|
|
|
memberRequestFormatter,
|
|
|
|
);
|
|
|
|
initGroupMembersApp(
|
|
|
|
document.querySelector('.js-group-access-requests-list'),
|
|
|
|
SHARED_FIELDS.concat('requested'),
|
|
|
|
memberRequestFormatter,
|
|
|
|
);
|
2020-11-24 15:15:51 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
new Members(); // eslint-disable-line no-new
|
|
|
|
new UsersSelect(); // eslint-disable-line no-new
|
|
|
|
});
|