diff --git a/src/user-federation/ldap/mappers/LdapMapperDetails.tsx b/src/user-federation/ldap/mappers/LdapMapperDetails.tsx
index 93f529626d..fcc0721a15 100644
--- a/src/user-federation/ldap/mappers/LdapMapperDetails.tsx
+++ b/src/user-federation/ldap/mappers/LdapMapperDetails.tsx
@@ -10,7 +10,7 @@ import {
SelectOption,
SelectVariant,
TextInput,
- ValidatedOptions
+ ValidatedOptions,
} from "@patternfly/react-core";
import { convertFormValuesToObject, convertToFormValues } from "../../../util";
import type ComponentRepresentation from "keycloak-admin/lib/defs/componentRepresentation";
@@ -159,9 +159,11 @@ export const LdapMapperDetails = () => {
id="kc-ldap-mapper-name"
data-testid="ldap-mapper-name"
name="name"
- ref={form.register({ required: true})}
- validated={
- form.errors.name ? ValidatedOptions.error : ValidatedOptions.default
+ ref={form.register({ required: true })}
+ validated={
+ form.errors.name
+ ? ValidatedOptions.error
+ : ValidatedOptions.default
}
/>
diff --git a/src/user-federation/ldap/mappers/LdapMapperHardcodedLdapRole.tsx b/src/user-federation/ldap/mappers/LdapMapperHardcodedLdapRole.tsx
index a56feadf0b..82b7759ea7 100644
--- a/src/user-federation/ldap/mappers/LdapMapperHardcodedLdapRole.tsx
+++ b/src/user-federation/ldap/mappers/LdapMapperHardcodedLdapRole.tsx
@@ -1,4 +1,9 @@
-import { Button, FormGroup, TextInput } from "@patternfly/react-core";
+import {
+ Button,
+ FormGroup,
+ TextInput,
+ ValidatedOptions,
+} from "@patternfly/react-core";
import React, { useState } from "react";
import { HelpItem } from "../../../components/help-enabler/HelpItem";
import type { UseFormMethods } from "react-hook-form";
@@ -71,7 +76,12 @@ export const LdapMapperHardcodedLdapRole = ({
id="kc-role"
data-testid="role"
name="config.role[0]"
- ref={form.register}
+ ref={form.register({ required: true })}
+ validated={
+ form.errors.config && form.errors.config.role
+ ? ValidatedOptions.error
+ : ValidatedOptions.default
+ }
/>
}
fieldId="kc-ldap-filter"
- isRequired
>
}
fieldId="kc-mapped-attributes"
- isRequired
>
>