reset form when provider / mapperPype changes (#26971)
fixes: #26697 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
parent
562decde35
commit
dfd3fee95a
1 changed files with 16 additions and 2 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue