|
|
@ -70,10 +70,10 @@ const ProfileEditForm: FunctionComponent<Props> = ({
|
|
|
|
initialValues: profile,
|
|
|
|
initialValues: profile,
|
|
|
|
validate: {
|
|
|
|
validate: {
|
|
|
|
name: FormUtils.validation(
|
|
|
|
name: FormUtils.validation(
|
|
|
|
(value) => value.length > 0,
|
|
|
|
(value: string) => value.length > 0,
|
|
|
|
"Must have a name",
|
|
|
|
"Must have a name",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
tag: FormUtils.validation((value) => {
|
|
|
|
tag: FormUtils.validation((value: string | undefined) => {
|
|
|
|
if (!value) {
|
|
|
|
if (!value) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -81,7 +81,7 @@ const ProfileEditForm: FunctionComponent<Props> = ({
|
|
|
|
return /^[a-z_0-9-]+$/.test(value);
|
|
|
|
return /^[a-z_0-9-]+$/.test(value);
|
|
|
|
}, "Only lowercase alphanumeric characters, underscores (_) and hyphens (-) are allowed"),
|
|
|
|
}, "Only lowercase alphanumeric characters, underscores (_) and hyphens (-) are allowed"),
|
|
|
|
items: FormUtils.validation(
|
|
|
|
items: FormUtils.validation(
|
|
|
|
(value) => value.length > 0,
|
|
|
|
(value: Language.ProfileItem[]) => value.length > 0,
|
|
|
|
"Must contain at least 1 language",
|
|
|
|
"Must contain at least 1 language",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|