From a196be8c6f9a0b25a1d977519d40afb48bf32b32 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 10 Sep 2022 09:29:17 +0300 Subject: [PATCH] audit changes --- components/AuditPage/AuditPage.module.scss | 2 +- components/AuditPage/AuditPage.tsx | 9 +++++++-- components/UsersPage/UsersPage.tsx | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/components/AuditPage/AuditPage.module.scss b/components/AuditPage/AuditPage.module.scss index c864d10..9037d1d 100644 --- a/components/AuditPage/AuditPage.module.scss +++ b/components/AuditPage/AuditPage.module.scss @@ -1,7 +1,7 @@ .wrapper { display: flex; flex-direction: column; - gap: 2rem; + gap: 1rem; } .logs { diff --git a/components/AuditPage/AuditPage.tsx b/components/AuditPage/AuditPage.tsx index d03f008..3a8e4f5 100644 --- a/components/AuditPage/AuditPage.tsx +++ b/components/AuditPage/AuditPage.tsx @@ -88,7 +88,12 @@ export const AuditLogs = ({}) => { return; } - setTypes(Array.from({ length: filter.data.length }).fill(true)); + setTypes( + Array.from( + { length: filter.data.length }, + (_, k) => k > 0 + ) + ); }, [types, filter.data]); useEffect(() => { @@ -110,7 +115,7 @@ export const AuditLogs = ({}) => { setSearchParams(urlparams); }, [filter.data, types]); - if (!data || !filter.data) { + if (!data || !filter.data || !types.length) { return <>; } diff --git a/components/UsersPage/UsersPage.tsx b/components/UsersPage/UsersPage.tsx index 38f61f6..5a68506 100644 --- a/components/UsersPage/UsersPage.tsx +++ b/components/UsersPage/UsersPage.tsx @@ -343,7 +343,7 @@ const UserCard = ({
{user.uuid}
Email
{user.email}
- {user.privileges?.length && ( + {user.privileges && user.privileges.length > 0 && ( <>
Privileges