From 262cc33ebd4bc950081471c7575d6495358b8e36 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Thu, 20 Jul 2023 20:15:03 +0200 Subject: [PATCH] fixes the details page (#21776) fixes: https://github.com/keycloak/keycloak/issues/15344#issuecomment-1636965834 --- .../identity-providers/add/DetailSettings.tsx | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/js/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx b/js/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx index ef84fe5feb..58d118dfe1 100644 --- a/js/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx +++ b/js/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx @@ -164,13 +164,22 @@ export default function DetailSettings() { const [selectedMapper, setSelectedMapper] = useState(); const serverInfo = useServerInfo(); - const providerInfo = useMemo( - () => - serverInfo.componentTypes?.[ - "org.keycloak.broker.social.SocialIdentityProvider" - ]?.find((p) => p.id === providerId), - [serverInfo, providerId], - ); + const providerInfo = useMemo(() => { + const namespaces = [ + "org.keycloak.broker.social.SocialIdentityProvider", + "org.keycloak.broker.provider.IdentityProvider", + ]; + + for (const namespace of namespaces) { + const social = serverInfo.componentTypes?.[namespace]?.find( + ({ id }) => id === providerId, + ); + + if (social) { + return social; + } + } + }, [serverInfo, providerId]); const { addAlert, addError } = useAlerts(); const navigate = useNavigate();