fixes the details page (#21776)

fixes: https://github.com/keycloak/keycloak/issues/15344#issuecomment-1636965834
This commit is contained in:
Erik Jan de Wit 2023-07-20 20:15:03 +02:00 committed by GitHub
parent 7c9593f88a
commit 262cc33ebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,14 +164,23 @@ export default function DetailSettings() {
const [selectedMapper, setSelectedMapper] = const [selectedMapper, setSelectedMapper] =
useState<IdPWithMapperAttributes>(); useState<IdPWithMapperAttributes>();
const serverInfo = useServerInfo(); const serverInfo = useServerInfo();
const providerInfo = useMemo( const providerInfo = useMemo(() => {
() => const namespaces = [
serverInfo.componentTypes?.[ "org.keycloak.broker.social.SocialIdentityProvider",
"org.keycloak.broker.social.SocialIdentityProvider" "org.keycloak.broker.provider.IdentityProvider",
]?.find((p) => p.id === providerId), ];
[serverInfo, providerId],
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 { addAlert, addError } = useAlerts();
const navigate = useNavigate(); const navigate = useNavigate();
const { realm } = useRealm(); const { realm } = useRealm();