diff --git a/js/apps/admin-ui/src/user-federation/ldap/mappers/LdapMapperDetails.tsx b/js/apps/admin-ui/src/user-federation/ldap/mappers/LdapMapperDetails.tsx index ebfc472f997..4e44e2d4d5f 100644 --- a/js/apps/admin-ui/src/user-federation/ldap/mappers/LdapMapperDetails.tsx +++ b/js/apps/admin-ui/src/user-federation/ldap/mappers/LdapMapperDetails.tsx @@ -24,7 +24,10 @@ import { HelpItem } from "ui-shared"; import { adminClient } from "../../../admin-client"; import { useAlerts } from "../../../components/alert/Alerts"; import { useConfirmDialog } from "../../../components/confirm-dialog/ConfirmDialog"; -import { DynamicComponents } from "../../../components/dynamic/DynamicComponents"; +import { + DynamicComponents, + convertToName, +} from "../../../components/dynamic/DynamicComponents"; import { FormAccess } from "../../../components/form/FormAccess"; import { KeycloakSpinner } from "../../../components/keycloak-spinner/KeycloakSpinner"; import { KeycloakTextInput } from "../../../components/keycloak-text-input/KeycloakTextInput"; @@ -302,7 +305,18 @@ export default function LdapMapperDetails() { } isOpen={isMapperDropdownOpen} onSelect={(_, value) => { - field.onChange(value as string); + setupForm({ + providerId: value as string, + ...Object.fromEntries( + components + .find((c) => c.id === value) + ?.properties.filter((m) => m.type === "List") + .map((m) => [ + convertToName(m.name!), + m.options?.[0], + ]) || [], + ), + }); setIsMapperDropdownOpen(false); }} selections={field.value}