From 6458d461b98c14560a3ea8c0cd222b4eb4557d35 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Fri, 2 Aug 2024 10:25:25 +0200 Subject: [PATCH] feat: add event types to filter button (#7733) Add event types to the event log filter button. The event types are taken from the OpenAPI definition. --- frontend/src/component/events/EventLog/EventLogFilters.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/events/EventLog/EventLogFilters.tsx b/frontend/src/component/events/EventLog/EventLogFilters.tsx index 522dfc3632..e4915031d8 100644 --- a/frontend/src/component/events/EventLog/EventLogFilters.tsx +++ b/frontend/src/component/events/EventLog/EventLogFilters.tsx @@ -2,6 +2,7 @@ import { useState, useEffect, type FC } from 'react'; import { Filters, type IFilterItem } from 'component/filter/Filters/Filters'; import useProjects from 'hooks/api/getters/useProjects/useProjects'; import { useFeatureSearch } from 'hooks/api/getters/useFeatureSearch/useFeatureSearch'; +import { EventSchemaType } from 'openapi'; const flagLogFilters: IFilterItem[] = [ { @@ -31,7 +32,10 @@ const flagLogFilters: IFilterItem[] = [ // todo fill this in with actual values label: 'Event type', icon: 'announcement', - options: [], + options: Object.entries(EventSchemaType).map(([key, value]) => ({ + label: key, + value: value, + })), filterKey: 'eventType', singularOperators: ['IS'], pluralOperators: ['IS_ANY_OF'],