use event id instead of name (#20109)

* use id instead of name to add event

* "translated" ids to name
This commit is contained in:
Erik Jan de Wit 2023-05-05 11:54:48 +02:00 committed by GitHub
parent d1ab921c50
commit e50580c465
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -312,14 +312,16 @@ export default function EventsSection() {
);
}}
>
{chip}
{t(`realm-settings:eventTypes.${chip}.name`)}
</Chip>
))}
</ChipGroup>
}
>
{events?.enabledEventTypes?.map((option) => (
<SelectOption key={option} value={option} />
<SelectOption key={option} value={option}>
{t(`realm-settings:eventTypes.${option}.name`)}
</SelectOption>
))}
</Select>
)}
@ -435,7 +437,7 @@ export default function EventsSection() {
key={entry}
onClick={() => removeFilterValue(key, entry)}
>
{entry}
{t(`realm-settings:eventTypes.${entry}.name`)}
</Chip>
))
)}

View file

@ -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",
},
{