Added fix for missing enabled flag (#3235)

This commit is contained in:
Erik Jan de Wit 2022-09-01 00:12:29 +02:00 committed by GitHub
parent 86248f7f11
commit df072f5c15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,8 +120,14 @@ export default function UserFederationSection() {
}; };
if (userFederations) { if (userFederations) {
cards = userFederations.sort(cardSorter).map((userFederation, index) => { cards = userFederations.sort(cardSorter).map((userFederation, index) => (
const ufCardDropdownItems = [ <GalleryItem
key={index}
className="keycloak-admin--user-federation__gallery-item"
>
<KeycloakCard
id={userFederation.id!}
dropdownItems={[
<DropdownItem <DropdownItem
key={`${index}-cardDelete`} key={`${index}-cardDelete`}
onClick={() => { onClick={() => {
@ -131,30 +137,23 @@ export default function UserFederationSection() {
> >
{t("common:delete")} {t("common:delete")}
</DropdownItem>, </DropdownItem>,
]; ]}
return (
<GalleryItem
key={index}
className="keycloak-admin--user-federation__gallery-item"
>
<KeycloakCard
id={userFederation.id!}
dropdownItems={ufCardDropdownItems}
providerId={userFederation.providerId!} providerId={userFederation.providerId!}
title={userFederation.name!} title={userFederation.name!}
footerText={toUpperCase(userFederation.providerId!)} footerText={toUpperCase(userFederation.providerId!)}
labelText={ labelText={
userFederation.config!["enabled"][0] !== "false" userFederation.config?.["enabled"]?.[0] !== "false"
? `${t("common:enabled")}` ? `${t("common:enabled")}`
: `${t("common:disabled")}` : `${t("common:disabled")}`
} }
labelColor={ labelColor={
userFederation.config!["enabled"][0] !== "false" ? "blue" : "gray" userFederation.config?.["enabled"]?.[0] !== "false"
? "blue"
: "gray"
} }
/> />
</GalleryItem> </GalleryItem>
); ));
});
} }
return ( return (