Add 'Email Verified' checkbox if user profile is enabled (#24463)
This commit is contained in:
parent
be65ba8689
commit
222db659f4
1 changed files with 34 additions and 5 deletions
|
@ -187,11 +187,40 @@ export const UserForm = ({
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
)}
|
)}
|
||||||
{userProfileMetadata ? (
|
{userProfileMetadata ? (
|
||||||
<UserProfileFields
|
<>
|
||||||
form={form}
|
<FormGroup
|
||||||
userProfileMetadata={userProfileMetadata}
|
label={t("emailVerified")}
|
||||||
hideReadOnly={!user}
|
fieldId="kc-email-verified"
|
||||||
/>
|
helperTextInvalid={t("required")}
|
||||||
|
labelIcon={
|
||||||
|
<HelpItem
|
||||||
|
helpText={t("emailVerifiedHelp")}
|
||||||
|
fieldLabelId="emailVerified"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Controller
|
||||||
|
name="emailVerified"
|
||||||
|
defaultValue={false}
|
||||||
|
control={control}
|
||||||
|
render={({ field }) => (
|
||||||
|
<Switch
|
||||||
|
data-testid="email-verified-switch"
|
||||||
|
id="kc-user-email-verified"
|
||||||
|
onChange={(value) => field.onChange(value)}
|
||||||
|
isChecked={field.value}
|
||||||
|
label={t("yes")}
|
||||||
|
labelOff={t("no")}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
<UserProfileFields
|
||||||
|
form={form}
|
||||||
|
userProfileMetadata={userProfileMetadata}
|
||||||
|
hideReadOnly={!user}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{!realm.registrationEmailAsUsername && (
|
{!realm.registrationEmailAsUsername && (
|
||||||
|
|
Loading…
Reference in a new issue