chore: apply breaking change types

pull/2851/head
Anderson Shindy Oki 5 days ago
parent 49ecbd6d0b
commit 07573f2f8a

@ -28,11 +28,11 @@ const FrameRateForm: FunctionComponent<Props> = ({ selections, onSubmit }) => {
}, },
validate: { validate: {
from: FormUtils.validation( from: FormUtils.validation(
(value) => value > 0, (value: number) => value > 0,
"The From value must be larger than 0", "The From value must be larger than 0",
), ),
to: FormUtils.validation( to: FormUtils.validation(
(value) => value > 0, (value: number) => value > 0,
"The To value must be larger than 0", "The To value must be larger than 0",
), ),
}, },

@ -114,10 +114,10 @@ const MovieUploadForm: FunctionComponent<Props> = ({
})), })),
}, },
validate: { validate: {
files: FormUtils.validation((values) => { files: FormUtils.validation((values: SubtitleFile[]) => {
return ( return (
values.find( values.find(
(v) => (v: SubtitleFile) =>
v.language === null || v.language === null ||
v.validateResult === undefined || v.validateResult === undefined ||
v.validateResult.state === "error", v.validateResult.state === "error",

@ -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",
), ),
}, },

@ -128,9 +128,9 @@ const SeriesUploadForm: FunctionComponent<Props> = ({
}, },
validate: { validate: {
files: FormUtils.validation( files: FormUtils.validation(
(values) => (values: SubtitleFile[]) =>
values.find( values.find(
(v) => (v: SubtitleFile) =>
v.language === null || v.language === null ||
v.episode === null || v.episode === null ||
v.validateResult === undefined || v.validateResult === undefined ||

@ -32,11 +32,20 @@ const TimeOffsetForm: FunctionComponent<Props> = ({ selections, onSubmit }) => {
ms: 0, ms: 0,
}, },
validate: { validate: {
hour: FormUtils.validation((v) => v >= 0, "Hour must be larger than 0"), hour: FormUtils.validation(
min: FormUtils.validation((v) => v >= 0, "Minute must be larger than 0"), (v: number) => v >= 0,
sec: FormUtils.validation((v) => v >= 0, "Second must be larger than 0"), "Hour must be larger than 0",
),
min: FormUtils.validation(
(v: number) => v >= 0,
"Minute must be larger than 0",
),
sec: FormUtils.validation(
(v: number) => v >= 0,
"Second must be larger than 0",
),
ms: FormUtils.validation( ms: FormUtils.validation(
(v) => v >= 0, (v: number) => v >= 0,
"Millisecond must be larger than 0", "Millisecond must be larger than 0",
), ),
}, },

@ -57,7 +57,7 @@ const NotificationForm: FunctionComponent<Props> = ({
"Please select a notification provider", "Please select a notification provider",
), ),
url: FormUtils.validation( url: FormUtils.validation(
(value) => value.trim().length !== 0, (value: string) => value.trim().length !== 0,
"URL must not be empty", "URL must not be empty",
), ),
}, },

Loading…
Cancel
Save