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,41 +120,40 @@ 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
<DropdownItem key={index}
key={`${index}-cardDelete`} className="keycloak-admin--user-federation__gallery-item"
onClick={() => { >
toggleDeleteForCard(userFederation.id!); <KeycloakCard
}} id={userFederation.id!}
data-testid="card-delete" dropdownItems={[
> <DropdownItem
{t("common:delete")} key={`${index}-cardDelete`}
</DropdownItem>, onClick={() => {
]; toggleDeleteForCard(userFederation.id!);
return ( }}
<GalleryItem data-testid="card-delete"
key={index} >
className="keycloak-admin--user-federation__gallery-item" {t("common:delete")}
> </DropdownItem>,
<KeycloakCard ]}
id={userFederation.id!} providerId={userFederation.providerId!}
dropdownItems={ufCardDropdownItems} title={userFederation.name!}
providerId={userFederation.providerId!} footerText={toUpperCase(userFederation.providerId!)}
title={userFederation.name!} labelText={
footerText={toUpperCase(userFederation.providerId!)} userFederation.config?.["enabled"]?.[0] !== "false"
labelText={ ? `${t("common:enabled")}`
userFederation.config!["enabled"][0] !== "false" : `${t("common:disabled")}`
? `${t("common:enabled")}` }
: `${t("common:disabled")}` labelColor={
} userFederation.config?.["enabled"]?.[0] !== "false"
labelColor={ ? "blue"
userFederation.config!["enabled"][0] !== "false" ? "blue" : "gray" : "gray"
} }
/> />
</GalleryItem> </GalleryItem>
); ));
});
} }
return ( return (