From 642503e26ac44eecb9402db6a299997086129887 Mon Sep 17 00:00:00 2001 From: Jenny <32821331+jenny-s51@users.noreply.github.com> Date: Fri, 24 Sep 2021 16:27:44 -0400 Subject: [PATCH] Identity Providers(mappers): fix help text (#1212) * fix help text for mapper types * fix name field * address PR feedback from mark and add help text for all mapper types * fix attribute importer help text --- src/identity-providers/add/AddMapper.tsx | 40 ++++++++++++++---------- src/identity-providers/help.ts | 21 ++++++++++++- src/identity-providers/messages.ts | 7 +++-- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/src/identity-providers/add/AddMapper.tsx b/src/identity-providers/add/AddMapper.tsx index 60dddf1920..459490b2f2 100644 --- a/src/identity-providers/add/AddMapper.tsx +++ b/src/identity-providers/add/AddMapper.tsx @@ -26,7 +26,6 @@ import { } from "../../components/attribute-form/AttributeForm"; import { FormAccess } from "../../components/form-access/FormAccess"; import { useAdminClient, useFetch } from "../../context/auth/AdminClient"; -import type IdentityProviderMapperRepresentation from "@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperRepresentation"; import type { IdentityProviderAddMapperParams } from "../routes/AddMapper"; import _ from "lodash"; import { AssociatedRolesModal } from "../../realm-roles/AssociatedRolesModal"; @@ -35,6 +34,7 @@ import { useAlerts } from "../../components/alert/Alerts"; import type { IdentityProviderEditMapperParams } from "../routes/EditMapper"; import { convertToFormValues } from "../../util"; import { toIdentityProvider } from "../routes/IdentityProvider"; +import type IdentityProviderMapperRepresentation from "@keycloak/keycloak-admin-client/lib/defs/identityProviderMapperRepresentation"; type IdPMapperRepresentationWithAttributes = IdentityProviderMapperRepresentation & { @@ -58,6 +58,7 @@ export const AddMapper = () => { const [mapperTypes, setMapperTypes] = useState>(); + const [mapperType, setMapperType] = useState("advancedAttributeToRole"); const [currentMapper, setCurrentMapper] = useState(); const [roles, setRoles] = useState([]); @@ -174,7 +175,15 @@ export const AddMapper = () => { { labelIcon={ @@ -294,7 +303,12 @@ export const AddMapper = () => { label={t("mapperType")} labelIcon={ @@ -326,6 +340,7 @@ export const AddMapper = () => { value.toString().toLowerCase() ); + setMapperType(_.camelCase(value.toString())); onChange(theMapper?.id); setMapperTypeOpen(false); }} @@ -368,19 +383,10 @@ export const AddMapper = () => { } fieldId="kc-gui-order" > - { - return ( - - ); - }} +