Web:Client:UsersStore: refactoring
This commit is contained in:
parent
c864d465a4
commit
13e97338b1
@ -193,18 +193,11 @@ class UsersStore {
|
||||
options.push("change-email");
|
||||
options.push("change-password");
|
||||
options.push("reset-auth");
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: add check on manager type
|
||||
if (
|
||||
(isOwner && !isMySelf) ||
|
||||
(isAdmin && !isUserAdmin && !isUserOwner) ||
|
||||
userRole === "user"
|
||||
) {
|
||||
options.push("separator-2");
|
||||
options.push("disable");
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "disabled":
|
||||
@ -234,16 +227,8 @@ class UsersStore {
|
||||
userRole === "user"
|
||||
) {
|
||||
options.push("invite-again");
|
||||
}
|
||||
|
||||
options.push("details");
|
||||
|
||||
// TODO: add check on manager type
|
||||
if (
|
||||
(isOwner && !isMySelf) ||
|
||||
(isAdmin && !isUserAdmin && !isUserOwner) ||
|
||||
userRole === "user"
|
||||
) {
|
||||
options.push("separator-1");
|
||||
|
||||
if (status === EmployeeStatus.Active) {
|
||||
@ -251,6 +236,8 @@ class UsersStore {
|
||||
} else {
|
||||
options.push("enable");
|
||||
}
|
||||
} else {
|
||||
options.push("details");
|
||||
}
|
||||
|
||||
break;
|
||||
@ -323,8 +310,7 @@ class UsersStore {
|
||||
isAdministrator,
|
||||
statusType,
|
||||
role,
|
||||
status,
|
||||
!!mobilePhone
|
||||
status
|
||||
);
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user