diff --git a/public/resources/en/realm-settings.json b/public/resources/en/realm-settings.json index 81fac270fc..77a539f626 100644 --- a/public/resources/en/realm-settings.json +++ b/public/resources/en/realm-settings.json @@ -347,6 +347,11 @@ "required": "Required", "requiredFor": "Required for", "requiredWhen": "Required when", + "requiredForLabel": { + "both": "Both users and admins", + "users": "Only users", + "admins": "Only admins" + }, "whoCanEdit": "Who can edit?", "whoCanView": "Who can view?", "user": "User", diff --git a/src/realm-settings/NewAttributeSettings.tsx b/src/realm-settings/NewAttributeSettings.tsx index f804c64e66..3686550767 100644 --- a/src/realm-settings/NewAttributeSettings.tsx +++ b/src/realm-settings/NewAttributeSettings.tsx @@ -162,6 +162,7 @@ export default function NewAttributeSettings() { return attribute; } + delete attribute.required; return Object.assign( { ...attribute, diff --git a/src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx b/src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx index dce0d00609..a4fc53251d 100644 --- a/src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx +++ b/src/realm-settings/user-profile/attribute/AttributeGeneralSettings.tsx @@ -1,5 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unnecessary-condition */ -/* eslint-disable prettier/prettier */ import React, { useState } from "react"; import { Divider, @@ -24,9 +22,9 @@ import { isEqual } from "lodash-es"; import "../../realm-settings-section.css"; const REQUIRED_FOR = [ - { label: "Both users and admins", value: ["admin", "user"] }, - { label: "Only users", value: ["user"] }, - { label: "Only admins", value: ["admin"] }, + { label: "requiredForLabel.both", value: ["admin", "user"] }, + { label: "requiredForLabel.users", value: ["user"] }, + { label: "requiredForLabel.admins", value: ["admin"] }, ] as const; export const AttributeGeneralSettings = () => { @@ -292,7 +290,7 @@ export const AttributeGeneralSettings = () => { onChange={() => { onChange(option.value); }} - label={option.label} + label={t(option.label)} className="kc-requiredFor-option" /> ))}