2021-03-11 19:13:27 +05:30
|
|
|
import { groupMemberRequestFormatter } from '~/groups/members/utils';
|
2021-04-17 20:07:23 +05:30
|
|
|
import initInviteGroupTrigger from '~/invite_members/init_invite_group_trigger';
|
2022-04-04 11:22:00 +05:30
|
|
|
import initInviteGroupsModal from '~/invite_members/init_invite_groups_modal';
|
2021-03-08 18:12:59 +05:30
|
|
|
import initInviteMembersModal from '~/invite_members/init_invite_members_modal';
|
|
|
|
import initInviteMembersTrigger from '~/invite_members/init_invite_members_trigger';
|
2021-02-22 17:27:13 +05:30
|
|
|
import { s__ } from '~/locale';
|
2021-04-17 20:07:23 +05:30
|
|
|
import { initMembersApp } from '~/members';
|
2022-08-13 15:12:31 +05:30
|
|
|
import { MEMBER_TYPES, EE_APP_OPTIONS } from 'ee_else_ce/members/constants';
|
2021-03-11 19:13:27 +05:30
|
|
|
import { groupLinkRequestFormatter } from '~/members/utils';
|
2020-07-28 23:09:34 +05:30
|
|
|
|
2021-11-18 22:05:49 +05:30
|
|
|
const SHARED_FIELDS = ['account', 'maxRole', 'expiration', 'actions'];
|
2022-08-13 15:12:31 +05:30
|
|
|
const APP_OPTIONS = {
|
2021-09-04 01:27:46 +05:30
|
|
|
[MEMBER_TYPES.user]: {
|
2022-06-21 17:19:12 +05:30
|
|
|
tableFields: SHARED_FIELDS.concat(['source', 'granted', 'userCreatedAt', 'lastActivityOn']),
|
2021-09-04 01:27:46 +05:30
|
|
|
tableAttrs: { tr: { 'data-qa-selector': 'member_row' } },
|
2022-06-21 17:19:12 +05:30
|
|
|
tableSortableFields: [
|
|
|
|
'account',
|
|
|
|
'granted',
|
|
|
|
'maxRole',
|
|
|
|
'lastSignIn',
|
|
|
|
'userCreatedAt',
|
|
|
|
'lastActivityOn',
|
|
|
|
],
|
2021-09-04 01:27:46 +05:30
|
|
|
requestFormatter: groupMemberRequestFormatter,
|
|
|
|
filteredSearchBar: {
|
|
|
|
show: true,
|
2022-05-07 20:08:51 +05:30
|
|
|
tokens: ['two_factor', 'with_inherited_permissions', 'enterprise'],
|
2021-09-04 01:27:46 +05:30
|
|
|
searchParam: 'search',
|
|
|
|
placeholder: s__('Members|Filter members'),
|
|
|
|
recentSearchesStorageKey: 'group_members',
|
|
|
|
},
|
2021-02-22 17:27:13 +05:30
|
|
|
},
|
2021-09-04 01:27:46 +05:30
|
|
|
[MEMBER_TYPES.group]: {
|
2022-07-23 23:45:48 +05:30
|
|
|
tableFields: SHARED_FIELDS.concat(['source', 'granted']),
|
2021-09-04 01:27:46 +05:30
|
|
|
tableAttrs: {
|
|
|
|
table: { 'data-qa-selector': 'groups_list' },
|
|
|
|
tr: { 'data-qa-selector': 'group_row' },
|
|
|
|
},
|
|
|
|
requestFormatter: groupLinkRequestFormatter,
|
2022-07-23 23:45:48 +05:30
|
|
|
filteredSearchBar: {
|
|
|
|
show: true,
|
|
|
|
tokens: ['groups_with_inherited_permissions'],
|
|
|
|
searchParam: 'search_groups',
|
|
|
|
placeholder: s__('Members|Filter groups'),
|
|
|
|
recentSearchesStorageKey: 'group_links_members',
|
|
|
|
},
|
2021-02-22 17:27:13 +05:30
|
|
|
},
|
2021-09-04 01:27:46 +05:30
|
|
|
[MEMBER_TYPES.invite]: {
|
|
|
|
tableFields: SHARED_FIELDS.concat('invited'),
|
|
|
|
requestFormatter: groupMemberRequestFormatter,
|
|
|
|
filteredSearchBar: {
|
|
|
|
show: true,
|
|
|
|
tokens: [],
|
|
|
|
searchParam: 'search_invited',
|
|
|
|
placeholder: s__('Members|Search invited'),
|
|
|
|
recentSearchesStorageKey: 'group_invited_members',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
[MEMBER_TYPES.accessRequest]: {
|
|
|
|
tableFields: SHARED_FIELDS.concat('requested'),
|
|
|
|
requestFormatter: groupMemberRequestFormatter,
|
2021-02-22 17:27:13 +05:30
|
|
|
},
|
2022-08-13 15:12:31 +05:30
|
|
|
...EE_APP_OPTIONS,
|
|
|
|
};
|
|
|
|
|
|
|
|
initMembersApp(document.querySelector('.js-group-members-list-app'), APP_OPTIONS);
|
2020-07-28 23:09:34 +05:30
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
initInviteMembersModal();
|
2022-04-04 11:22:00 +05:30
|
|
|
initInviteGroupsModal();
|
2021-03-08 18:12:59 +05:30
|
|
|
initInviteMembersTrigger();
|
2021-04-17 20:07:23 +05:30
|
|
|
initInviteGroupTrigger();
|