mirror of
https://github.com/hatchet-dev/hatchet.git
synced 2026-01-06 08:49:53 -06:00
Feat: Add scope filter to events page (#1902)
* feat: scope filter * fix: return type
This commit is contained in:
@@ -95,6 +95,7 @@ function EventsTable() {
|
||||
}
|
||||
return [];
|
||||
});
|
||||
|
||||
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({
|
||||
EventId: false,
|
||||
Payload: false,
|
||||
@@ -166,6 +167,16 @@ function EventsTable() {
|
||||
return filter?.value as Array<string>;
|
||||
}, [columnFilters]);
|
||||
|
||||
const scopes = useMemo(() => {
|
||||
const filter = columnFilters.find((filter) => filter.id === 'scope');
|
||||
|
||||
if (!filter) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return filter?.value as Array<string>;
|
||||
}, [columnFilters]);
|
||||
|
||||
const statuses = useMemo(() => {
|
||||
const filter = columnFilters.find((filter) => filter.id === 'status');
|
||||
|
||||
@@ -236,6 +247,7 @@ function EventsTable() {
|
||||
workflowRunStatuses: statuses,
|
||||
additionalMetadata: AdditionalMetadataFilter,
|
||||
workflowIds: workflows,
|
||||
scopes,
|
||||
});
|
||||
|
||||
return response.data;
|
||||
@@ -376,6 +388,11 @@ function EventsTable() {
|
||||
title: 'Event Id',
|
||||
type: ToolbarType.Array,
|
||||
},
|
||||
{
|
||||
columnId: 'scope',
|
||||
title: 'Scope',
|
||||
type: ToolbarType.Array,
|
||||
},
|
||||
]}
|
||||
showColumnToggle={true}
|
||||
columnVisibility={columnVisibility}
|
||||
|
||||
Reference in New Issue
Block a user