diff --git a/src/components/UserEdit.tsx b/src/components/UserEdit.tsx index f5c4b3a..b19818e 100644 --- a/src/components/UserEdit.tsx +++ b/src/components/UserEdit.tsx @@ -89,7 +89,7 @@ const UserEdit = () => { groupsToCreate: groupsToCreate, auto_groups: autoGroups, is_service_user: isServiceUser, - is_blocked: !values.is_active + is_blocked: values.is_blocked } as UserToSave } @@ -286,7 +286,6 @@ const UserEdit = () => { role: user.role, email: user.email, is_blocked: user.is_blocked, - is_active: !user.is_blocked, autoGroupsNames: currentGroups, }) } @@ -328,7 +327,6 @@ const UserEdit = () => { role: formUser.role, email: formUser.email, is_blocked: formUser.is_blocked, - is_active: !formUser.is_blocked, autoGroupsNames: formUser.autoGroupsNames, }} > @@ -391,8 +389,8 @@ const UserEdit = () => { diff --git a/src/views/RegularUsers.tsx b/src/views/RegularUsers.tsx index 3c31f62..4eb0b84 100644 --- a/src/views/RegularUsers.tsx +++ b/src/views/RegularUsers.tsx @@ -268,10 +268,10 @@ export const RegularUsers = () => { if (block) { confirmModal.confirm({ icon: , - title: "Are you sure you want to deactivate \"" + user.name + "\"?", + title: "Are you sure you want to block " + user.name + "?", width: 600, content: - Disabling this user will disconnect their devices and block dashboard access. + Blocking this user will disconnect their devices and disable dashboard access. , onOk() { let userToSave = createUserToSave(user, block) @@ -380,6 +380,12 @@ export const RegularUsers = () => { } + if ((record as User).status === "blocked") { + return
{btn} + blocked +
+ } + return btn }} /> @@ -395,12 +401,12 @@ export const RegularUsers = () => { onFilter={(value: string | number | boolean, record) => (record as any).role.includes(value)} sorter={(a, b) => ((a as any).role.localeCompare((b as any).role))}/> {isAdmin && ( - { - let witch = { - handleBlockUser(!active, record) + handleBlockUser(active, record) }} />