all mappers saving except two roles

This commit is contained in:
mfrances 2021-04-08 12:33:59 -04:00
parent dcbb2b90bf
commit a50cf33138
6 changed files with 28 additions and 22 deletions

View file

@ -86,10 +86,12 @@ export const LdapMapperDetails = () => {
if (id) { if (id) {
if (id === "new") { if (id === "new") {
await adminClient.components.create(mapper); await adminClient.components.create(mapper);
history.push(`/${realm}/user-federation/ldap/${mapper!.parentId}/mappers`); history.push(
`/${realm}/user-federation/ldap/${mapper!.parentId}/mappers`
);
} else { } else {
// TODO remove after debugging each mapper type // TODO remove after debugging each mapper type
console.log(`On save - mapping is:`) console.log(`On save - mapping is:`);
console.log(`${JSON.stringify(mapping)}`); console.log(`${JSON.stringify(mapping)}`);
console.log(`id is:`); console.log(`id is:`);
console.log(`${id}`); console.log(`${id}`);

View file

@ -33,7 +33,7 @@ export const LdapMapperFullNameAttribute = ({
type="text" type="text"
id="kc-full-name-attribute" id="kc-full-name-attribute"
data-testid="full-name-attribute" data-testid="full-name-attribute"
name="config.ldap-full-name-attribute" name="config.ldap-full-name-attribute[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>

View file

@ -33,7 +33,7 @@ export const LdapMapperHardcodedLdapAttribute = ({
type="text" type="text"
id="kc-ldap-attribute-name" id="kc-ldap-attribute-name"
data-testid="ldap-attribute-name" data-testid="ldap-attribute-name"
name="config.ldap-attribute-name" name="config.ldap-attribute-name[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>
@ -54,7 +54,7 @@ export const LdapMapperHardcodedLdapAttribute = ({
type="text" type="text"
id="kc-ldap-attribute-value" id="kc-ldap-attribute-value"
data-testid="ldap-attribute-value" data-testid="ldap-attribute-value"
name="config.ldap-attribute-value" name="config.ldap-attribute-value[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>

View file

@ -33,7 +33,7 @@ export const LdapMapperHardcodedLdapGroup = ({
type="text" type="text"
id="kc-group" id="kc-group"
data-testid="group" data-testid="group"
name="config.group" name="config.group[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>

View file

@ -33,7 +33,7 @@ export const LdapMapperHardcodedLdapRole = ({
type="text" type="text"
id="kc-role" id="kc-role"
data-testid="role" data-testid="role"
name="config.role" name="config.role[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>

View file

@ -61,7 +61,7 @@ export const LdapMapperRoleGroup = ({
type="text" type="text"
id="kc-ldap-dn" id="kc-ldap-dn"
data-testid="ldap-dn" data-testid="ldap-dn"
name={isRole ? "config.roles-dn" : "config.groups-dn"} name={isRole ? "config.roles-dn[0]" : "config.groups-dn[0]"}
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>
@ -77,7 +77,7 @@ export const LdapMapperRoleGroup = ({
: helpText("groupNameLdapAttributeHelp") : helpText("groupNameLdapAttributeHelp")
} }
forLabel={ forLabel={
isRole ? t("roleNameLdapAttribute") : t("roleNameLdapAttribute") isRole ? t("roleNameLdapAttribute") : t("groupNameLdapAttribute")
} }
forID="kc-name-attribute" forID="kc-name-attribute"
/> />
@ -92,8 +92,8 @@ export const LdapMapperRoleGroup = ({
data-testid="name-attribute" data-testid="name-attribute"
name={ name={
isRole isRole
? "config.role-name-ldap-attribute" ? "config.role-name-ldap-attribute[0]"
: "config.group-name-ldap-attribute" : "config.group-name-ldap-attribute[0]"
} }
ref={form.register} ref={form.register}
/> />
@ -121,8 +121,8 @@ export const LdapMapperRoleGroup = ({
data-testid="object-classes" data-testid="object-classes"
name={ name={
isRole isRole
? "config.role-object-classes" ? "config.role-object-classes[0]"
: "config.group-object-classes" : "config.group-object-classes[0]"
} }
ref={form.register} ref={form.register}
/> />
@ -204,7 +204,7 @@ export const LdapMapperRoleGroup = ({
type="text" type="text"
id="kc-membership-ldap-attribute" id="kc-membership-ldap-attribute"
data-testid="membership-ldap-attribute" data-testid="membership-ldap-attribute"
name="config.membership-ldap-attribute" name="config.membership-ldap-attribute[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>
@ -264,7 +264,7 @@ export const LdapMapperRoleGroup = ({
type="text" type="text"
id="kc-membership-user-ldap-attribute" id="kc-membership-user-ldap-attribute"
data-testid="membership-user-ldap-attribute" data-testid="membership-user-ldap-attribute"
name="config.membership-user-ldap-attribute" name="config.membership-user-ldap-attribute[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>
@ -285,7 +285,11 @@ export const LdapMapperRoleGroup = ({
type="text" type="text"
id="kc-ldap-filter" id="kc-ldap-filter"
data-testid="ldap-filter" data-testid="ldap-filter"
name="config.ldap-filter" name={
isRole
? "config.roles-ldap-filter[0]"
: "config.groups-ldap-filter[0]"
}
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>
@ -410,7 +414,7 @@ export const LdapMapperRoleGroup = ({
type="text" type="text"
id="kc-member-of-attribute" id="kc-member-of-attribute"
data-testid="member-of-attribute" data-testid="member-of-attribute"
name="config.memberof-ldap-attribute" name="config.memberof-ldap-attribute[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>
@ -504,7 +508,7 @@ export const LdapMapperRoleGroup = ({
type="text" type="text"
id="kc-mapped-attributes" id="kc-mapped-attributes"
data-testid="mapped-attributes" data-testid="mapped-attributes"
name="config.mapped-group-attributes" name="config.mapped-group-attributes[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>
@ -553,7 +557,7 @@ export const LdapMapperRoleGroup = ({
type="text" type="text"
id="kc-path" id="kc-path"
data-testid="path" data-testid="path"
name="config.groups-path" name="config.groups-path[0]"
ref={form.register} ref={form.register}
/> />
</FormGroup> </FormGroup>