From e50580c46501f3269d74f567189472a34a9fcdf4 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Fri, 5 May 2023 11:54:48 +0200 Subject: [PATCH] use event id instead of name (#20109) * use id instead of name to add event * "translated" ids to name --- js/apps/admin-ui/src/events/EventsSection.tsx | 8 +++++--- .../src/realm-settings/event-config/EventsTypeTable.tsx | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/js/apps/admin-ui/src/events/EventsSection.tsx b/js/apps/admin-ui/src/events/EventsSection.tsx index 38815af3e5..424235eb58 100644 --- a/js/apps/admin-ui/src/events/EventsSection.tsx +++ b/js/apps/admin-ui/src/events/EventsSection.tsx @@ -312,14 +312,16 @@ export default function EventsSection() { ); }} > - {chip} + {t(`realm-settings:eventTypes.${chip}.name`)} ))} } > {events?.enabledEventTypes?.map((option) => ( - + + {t(`realm-settings:eventTypes.${option}.name`)} + ))} )} @@ -435,7 +437,7 @@ export default function EventsSection() { key={entry} onClick={() => removeFilterValue(key, entry)} > - {entry} + {t(`realm-settings:eventTypes.${entry}.name`)} )) )} diff --git a/js/apps/admin-ui/src/realm-settings/event-config/EventsTypeTable.tsx b/js/apps/admin-ui/src/realm-settings/event-config/EventsTypeTable.tsx index d91b1af9aa..c3a529927b 100644 --- a/js/apps/admin-ui/src/realm-settings/event-config/EventsTypeTable.tsx +++ b/js/apps/admin-ui/src/realm-settings/event-config/EventsTypeTable.tsx @@ -29,7 +29,8 @@ export function EventsTypeTable({ const { t } = useTranslation("realm-settings"); const data = eventTypes.map((type) => ({ - id: t(`eventTypes.${type}.name`), + id: type, + name: t(`eventTypes.${type}.name`), description: t(`eventTypes.${type}.description`), })); return ( @@ -60,7 +61,7 @@ export function EventsTypeTable({ } columns={[ { - name: "id", + name: "name", displayKey: "realm-settings:eventType", }, {