Web: People: removed unused getSelectionIds function, fixed getUserType function

This commit is contained in:
Nikita Gopienko 2020-02-20 15:50:33 +03:00
parent c9689bc7df
commit 43bdd40f46

View File

@ -122,10 +122,6 @@ export function getSelectedGroup(groups, selectedGroupId) {
return find(groups, (group) => group.id === selectedGroupId); return find(groups, (group) => group.id === selectedGroupId);
} }
export function getSelectionIds(selections) {
return selections.map((user) => { return user.id });
}
export function toEmployeeWrapper(profile) { export function toEmployeeWrapper(profile) {
const emptyData = { const emptyData = {
id: "", id: "",
@ -173,22 +169,21 @@ export function filterGroupSelectorOptions(options, template) {
}) })
} }
export function getUserType(users) { export function getUserType(users, status, currentUserId) {
const disabledUserType = users.filter( return users.filter(
x => !x.isAdmin && !x.isOwner && x.isVisitor && x.status !== 2 x =>
!x.isAdmin &&
!x.isOwner &&
x.isVisitor === status &&
x.status !== 2 &&
x.id !== currentUserId
); );
return !disabledUserType.length;
} }
export function getGuestType(users) {
const disabledUserType = users.filter(
x => !x.isAdmin && !x.isOwner && !x.isVisitor && x.status !== 2
);
return !disabledUserType.length;
}
export function getUsersStatus(users, status, currentUserId) { export function getUsersStatus(users, status, currentUserId) {
return users.filter(x => !x.isOwner && x.status !== status && x.id !== currentUserId); return users.filter(
x => !x.isOwner && x.status !== status && x.id !== currentUserId
);
} }
export function getInactiveUsers(users) { export function getInactiveUsers(users) {