From 299993d30b3efbe217f10269fc99f01d127c652d Mon Sep 17 00:00:00 2001 From: mfrances17 <39063664+mfrances17@users.noreply.github.com> Date: Fri, 27 Aug 2021 15:18:23 -0400 Subject: [PATCH] Fix labels for user vs admin clear events (#1079) * fix labels for user vs admin clear events * fix lint issue unrelated to fixed issue --- src/events/EventsSection.tsx | 400 +++++++++--------- .../event-config/EventConfigForm.tsx | 8 +- src/realm-settings/messages.ts | 5 +- 3 files changed, 207 insertions(+), 206 deletions(-) diff --git a/src/events/EventsSection.tsx b/src/events/EventsSection.tsx index 1b5531df4b..f0d97d1d87 100644 --- a/src/events/EventsSection.tsx +++ b/src/events/EventsSection.tsx @@ -184,211 +184,209 @@ export const EventsSection = () => { const userEventSearchFormDisplay = () => { return ( - <> - - - setSearchDropdownOpen(isOpen)} - className="keycloak__events_search_selector_dropdown__toggle" - > - {t("searchForUserEvent")} - - } - isOpen={searchDropdownOpen} - > -
+ + setSearchDropdownOpen(isOpen)} + className="keycloak__events_search_selector_dropdown__toggle" > - - - - - void; - value: EventType[]; - }) => ( - - )} - /> - - - - - - - - - - - - - - - - -
- - {Object.entries(activeFilters).length > 0 && ( -
- {Object.entries(activeFilters).map((filter) => { - const [key, value] = filter as [ - keyof UserEventSearchForm, - string | EventType[] - ]; + + + + + void; + value: EventType[]; + }) => ( + + )} + /> + + + + + + + + + + + + + + + + + + + {Object.entries(activeFilters).length > 0 && ( +
+ {Object.entries(activeFilters).map((filter) => { + const [key, value] = filter as [ + keyof UserEventSearchForm, + string | EventType[] + ]; + + return ( + removeFilter(key)} + > + {typeof value === "string" ? ( + {value} + ) : ( + value.map((entry) => ( + removeFilterValue(key, entry)} + > + {entry} + + )) + )} + + ); + })} +
+ )} +
+ ); }; diff --git a/src/realm-settings/event-config/EventConfigForm.tsx b/src/realm-settings/event-config/EventConfigForm.tsx index d9883b0999..d9a255fecb 100644 --- a/src/realm-settings/event-config/EventConfigForm.tsx +++ b/src/realm-settings/event-config/EventConfigForm.tsx @@ -161,12 +161,14 @@ export const EventConfigForm = ({ } @@ -177,7 +179,7 @@ export const EventConfigForm = ({ data-testid={`clear-${type}-events`} onClick={() => clear()} > - {t("clearEvents")} + {type === "user" ? t("clearUserEvents") : t("clearAdminEvents")} diff --git a/src/realm-settings/messages.ts b/src/realm-settings/messages.ts index 180a77b460..554f82a20c 100644 --- a/src/realm-settings/messages.ts +++ b/src/realm-settings/messages.ts @@ -30,11 +30,12 @@ export default { events: "Events", userEventsConfig: "User events configuration", userEventsSettings: "User events settings", - adminEventsConfig: "Admin events config", + adminEventsConfig: "Admin events configuration", adminEventsSettings: "Admin events settings", saveEvents: "Save events", expiration: "Expiration", - clearEvents: "Clear user events", + clearUserEvents: "Clear user events", + clearAdminEvents: "Clear admin events", includeRepresentation: "Include representation", email: "Email", template: "Template",