1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-26 01:17:00 +02:00

feat: add authentication as a table filter (#3206)

Adds `auth` as a table filter.
Also fixes the hook to correctly fetch the events based on the new
return type.

<img width="1046" alt="image"
src="https://user-images.githubusercontent.com/14320932/221603312-a40055a8-4c23-4f1f-9a87-7fbd03e7b49e.png">
This commit is contained in:
Nuno Góis 2023-02-28 08:32:21 +00:00 committed by GitHub
parent 8e79820783
commit c0124371ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -79,6 +79,7 @@ export const SignOnLogTable = () => {
maxWidth: 150,
Cell: HighlightCell,
searchable: true,
filterName: 'auth',
},
{
Header: 'IP address',
@ -87,11 +88,11 @@ export const SignOnLogTable = () => {
searchable: true,
},
{
Header: 'Successful',
Header: 'Success',
accessor: 'successful',
align: 'center',
Cell: SignOnLogSuccessfulCell,
filterName: 'successful',
filterName: 'success',
filterParsing: (value: boolean) => value.toString(),
},
{

View File

@ -12,14 +12,14 @@ export const useSignOnLog = () => {
const { data, error, mutate } = useConditionalSWR(
signOnLog && isEnterprise(),
[],
{ events: [] },
formatApiPath(`api/admin/signons`),
fetcher
);
return useMemo(
() => ({
events: (data ?? []) as ISignOnEvent[],
events: (data?.events ?? []) as ISignOnEvent[],
loading: !error && !data,
refetch: () => mutate(),
error,