parent
d8ff73e34f
commit
a584ff94a3
4 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,7 @@ export const OptionComponent = (attr: UserProfileAttribute) => {
|
|||
const isMultiSelect = type.includes("multiselect");
|
||||
const Component = isMultiSelect ? Checkbox : Radio;
|
||||
|
||||
const options = (attr.validations?.options as Options).options || [];
|
||||
const options = (attr.validators?.options as Options).options || [];
|
||||
|
||||
return (
|
||||
<UserProfileGroup {...attr}>
|
||||
|
|
|
@ -41,7 +41,7 @@ export const SelectComponent = (attribute: UserProfileFieldsProps) => {
|
|||
};
|
||||
|
||||
const options =
|
||||
(attribute.validations?.options as Options | undefined)?.options || [];
|
||||
(attribute.validators?.options as Options | undefined)?.options || [];
|
||||
|
||||
const optionLabel = attribute.annotations?.[
|
||||
"inputOptionLabels"
|
||||
|
|
|
@ -19,8 +19,7 @@ type LengthValidator =
|
|||
|
||||
const isRequired = (attribute: UserProfileAttribute) =>
|
||||
Object.keys(attribute.required || {}).length !== 0 ||
|
||||
(((attribute.validations?.length as LengthValidator)?.min as number) || 0) >
|
||||
0;
|
||||
(((attribute.validators?.length as LengthValidator)?.min as number) || 0) > 0;
|
||||
|
||||
export const UserProfileGroup = ({
|
||||
children,
|
||||
|
|
|
@ -8,6 +8,7 @@ export default interface UserProfileConfig {
|
|||
export interface UserProfileAttribute {
|
||||
name?: string;
|
||||
validations?: Record<string, unknown>;
|
||||
validators?: Record<string, unknown>;
|
||||
annotations?: Record<string, unknown>;
|
||||
required?: UserProfileAttributeRequired;
|
||||
readOnly?: boolean;
|
||||
|
|
Loading…
Reference in a new issue