* removed header title * fixed showing events list on save click * feedback Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
This commit is contained in:
parent
62c170f765
commit
0f426ee76d
4 changed files with 5 additions and 21 deletions
|
@ -57,9 +57,7 @@
|
||||||
"saveEventListeners": "Save Event Listeners",
|
"saveEventListeners": "Save Event Listeners",
|
||||||
"saveEventListenersSuccess": "Event listener has been updated.",
|
"saveEventListenersSuccess": "Event listener has been updated.",
|
||||||
"saveEventListenersError": "Error saving event listener: {{error}}",
|
"saveEventListenersError": "Error saving event listener: {{error}}",
|
||||||
"userEventsConfig": "User events configuration",
|
|
||||||
"userEventsSettings": "User events settings",
|
"userEventsSettings": "User events settings",
|
||||||
"adminEventsConfig": "Admin events configuration",
|
|
||||||
"adminEventsSettings": "Admin events settings",
|
"adminEventsSettings": "Admin events settings",
|
||||||
"saveEvents": "Save events",
|
"saveEvents": "Save events",
|
||||||
"expiration": "Expiration",
|
"expiration": "Expiration",
|
||||||
|
@ -894,5 +892,4 @@
|
||||||
"importSkipped_zero": "No records skipped.",
|
"importSkipped_zero": "No records skipped.",
|
||||||
"importSkipped_one": "One record skipped.",
|
"importSkipped_one": "One record skipped.",
|
||||||
"importSkipped_other": "{{count}} records skipped."
|
"importSkipped_other": "{{count}} records skipped."
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ export const EventConfigForm = ({
|
||||||
setValue,
|
setValue,
|
||||||
formState: { isDirty },
|
formState: { isDirty },
|
||||||
} = form;
|
} = form;
|
||||||
|
|
||||||
const eventKey = type === "admin" ? "adminEventsEnabled" : "eventsEnabled";
|
const eventKey = type === "admin" ? "adminEventsEnabled" : "eventsEnabled";
|
||||||
const eventsEnabled: boolean = watch(eventKey);
|
const eventsEnabled: boolean = watch(eventKey);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import {
|
||||||
Tab,
|
Tab,
|
||||||
Tabs,
|
Tabs,
|
||||||
TabTitleText,
|
TabTitleText,
|
||||||
Title,
|
|
||||||
} from "@patternfly/react-core";
|
} from "@patternfly/react-core";
|
||||||
|
|
||||||
import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation";
|
import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation";
|
||||||
|
@ -35,7 +34,7 @@ type EventsConfigForm = RealmEventsConfigRepresentation & {
|
||||||
export const EventsTab = ({ realm }: EventsTabProps) => {
|
export const EventsTab = ({ realm }: EventsTabProps) => {
|
||||||
const { t } = useTranslation("realm-settings");
|
const { t } = useTranslation("realm-settings");
|
||||||
const form = useForm<EventsConfigForm>();
|
const form = useForm<EventsConfigForm>();
|
||||||
const { setValue, handleSubmit, watch } = form;
|
const { setValue, handleSubmit } = form;
|
||||||
|
|
||||||
const [key, setKey] = useState(0);
|
const [key, setKey] = useState(0);
|
||||||
const refresh = () => setKey(new Date().getTime());
|
const refresh = () => setKey(new Date().getTime());
|
||||||
|
@ -145,7 +144,6 @@ export const EventsTab = ({ realm }: EventsTabProps) => {
|
||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
const eventsEnabled: boolean = watch("eventsEnabled") || false;
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DeleteConfirm />
|
<DeleteConfirm />
|
||||||
|
@ -180,11 +178,6 @@ export const EventsTab = ({ realm }: EventsTabProps) => {
|
||||||
title={<TabTitleText>{t("userEventsSettings")}</TabTitleText>}
|
title={<TabTitleText>{t("userEventsSettings")}</TabTitleText>}
|
||||||
data-testid="rs-events-tab"
|
data-testid="rs-events-tab"
|
||||||
>
|
>
|
||||||
<PageSection>
|
|
||||||
<Title headingLevel="h1" size="xl">
|
|
||||||
{t("userEventsConfig")}
|
|
||||||
</Title>
|
|
||||||
</PageSection>
|
|
||||||
<PageSection>
|
<PageSection>
|
||||||
<FormAccess
|
<FormAccess
|
||||||
role="manage-events"
|
role="manage-events"
|
||||||
|
@ -199,20 +192,20 @@ export const EventsTab = ({ realm }: EventsTabProps) => {
|
||||||
/>
|
/>
|
||||||
</FormAccess>
|
</FormAccess>
|
||||||
</PageSection>
|
</PageSection>
|
||||||
{eventsEnabled && (
|
{events?.eventsEnabled && (
|
||||||
<PageSection>
|
<PageSection>
|
||||||
<EventsTypeTable
|
<EventsTypeTable
|
||||||
key={tableKey}
|
key={tableKey}
|
||||||
addTypes={() => setAddEventType(true)}
|
addTypes={() => setAddEventType(true)}
|
||||||
loader={() =>
|
loader={() =>
|
||||||
Promise.resolve(
|
Promise.resolve(
|
||||||
events?.enabledEventTypes?.map((id) => {
|
events.enabledEventTypes?.map((id) => {
|
||||||
return { id };
|
return { id };
|
||||||
}) || []
|
}) || []
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
onDelete={(value) => {
|
onDelete={(value) => {
|
||||||
const enabledEventTypes = events?.enabledEventTypes?.filter(
|
const enabledEventTypes = events.enabledEventTypes?.filter(
|
||||||
(e) => e !== value.id
|
(e) => e !== value.id
|
||||||
);
|
);
|
||||||
addEvents(enabledEventTypes);
|
addEvents(enabledEventTypes);
|
||||||
|
@ -227,11 +220,6 @@ export const EventsTab = ({ realm }: EventsTabProps) => {
|
||||||
title={<TabTitleText>{t("adminEventsSettings")}</TabTitleText>}
|
title={<TabTitleText>{t("adminEventsSettings")}</TabTitleText>}
|
||||||
data-testid="rs-admin-events-tab"
|
data-testid="rs-admin-events-tab"
|
||||||
>
|
>
|
||||||
<PageSection>
|
|
||||||
<Title headingLevel="h4" size="xl">
|
|
||||||
{t("adminEventsConfig")}
|
|
||||||
</Title>
|
|
||||||
</PageSection>
|
|
||||||
<PageSection>
|
<PageSection>
|
||||||
<FormAccess
|
<FormAccess
|
||||||
role="manage-events"
|
role="manage-events"
|
||||||
|
|
|
@ -52,7 +52,7 @@ export function EventsTypeTable({
|
||||||
? []
|
? []
|
||||||
: [
|
: [
|
||||||
{
|
{
|
||||||
title: t("common:delete"),
|
title: t("common:remove"),
|
||||||
onRowClick: onDelete,
|
onRowClick: onDelete,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue