Fixed required for + localization (#2784)
This commit is contained in:
parent
4eb0b90d75
commit
741c09cca1
3 changed files with 10 additions and 6 deletions
|
@ -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",
|
||||
|
|
|
@ -162,6 +162,7 @@ export default function NewAttributeSettings() {
|
|||
return attribute;
|
||||
}
|
||||
|
||||
delete attribute.required;
|
||||
return Object.assign(
|
||||
{
|
||||
...attribute,
|
||||
|
|
|
@ -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"
|
||||
/>
|
||||
))}
|
||||
|
|
Loading…
Reference in a new issue