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",
|
"required": "Required",
|
||||||
"requiredFor": "Required for",
|
"requiredFor": "Required for",
|
||||||
"requiredWhen": "Required when",
|
"requiredWhen": "Required when",
|
||||||
|
"requiredForLabel": {
|
||||||
|
"both": "Both users and admins",
|
||||||
|
"users": "Only users",
|
||||||
|
"admins": "Only admins"
|
||||||
|
},
|
||||||
"whoCanEdit": "Who can edit?",
|
"whoCanEdit": "Who can edit?",
|
||||||
"whoCanView": "Who can view?",
|
"whoCanView": "Who can view?",
|
||||||
"user": "User",
|
"user": "User",
|
||||||
|
|
|
@ -162,6 +162,7 @@ export default function NewAttributeSettings() {
|
||||||
return attribute;
|
return attribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete attribute.required;
|
||||||
return Object.assign(
|
return Object.assign(
|
||||||
{
|
{
|
||||||
...attribute,
|
...attribute,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
||||||
/* eslint-disable prettier/prettier */
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import {
|
import {
|
||||||
Divider,
|
Divider,
|
||||||
|
@ -24,9 +22,9 @@ import { isEqual } from "lodash-es";
|
||||||
import "../../realm-settings-section.css";
|
import "../../realm-settings-section.css";
|
||||||
|
|
||||||
const REQUIRED_FOR = [
|
const REQUIRED_FOR = [
|
||||||
{ label: "Both users and admins", value: ["admin", "user"] },
|
{ label: "requiredForLabel.both", value: ["admin", "user"] },
|
||||||
{ label: "Only users", value: ["user"] },
|
{ label: "requiredForLabel.users", value: ["user"] },
|
||||||
{ label: "Only admins", value: ["admin"] },
|
{ label: "requiredForLabel.admins", value: ["admin"] },
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const AttributeGeneralSettings = () => {
|
export const AttributeGeneralSettings = () => {
|
||||||
|
@ -292,7 +290,7 @@ export const AttributeGeneralSettings = () => {
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
onChange(option.value);
|
onChange(option.value);
|
||||||
}}
|
}}
|
||||||
label={option.label}
|
label={t(option.label)}
|
||||||
className="kc-requiredFor-option"
|
className="kc-requiredFor-option"
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
Loading…
Reference in a new issue