mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-22 22:10:42 +00:00
chore: apply breaking change types
This commit is contained in:
parent
49ecbd6d0b
commit
07573f2f8a
6 changed files with 23 additions and 14 deletions
|
@ -28,11 +28,11 @@ const FrameRateForm: FunctionComponent<Props> = ({ selections, onSubmit }) => {
|
|||
},
|
||||
validate: {
|
||||
from: FormUtils.validation(
|
||||
(value) => value > 0,
|
||||
(value: number) => value > 0,
|
||||
"The From value must be larger than 0",
|
||||
),
|
||||
to: FormUtils.validation(
|
||||
(value) => value > 0,
|
||||
(value: number) => value > 0,
|
||||
"The To value must be larger than 0",
|
||||
),
|
||||
},
|
||||
|
|
|
@ -114,10 +114,10 @@ const MovieUploadForm: FunctionComponent<Props> = ({
|
|||
})),
|
||||
},
|
||||
validate: {
|
||||
files: FormUtils.validation((values) => {
|
||||
files: FormUtils.validation((values: SubtitleFile[]) => {
|
||||
return (
|
||||
values.find(
|
||||
(v) =>
|
||||
(v: SubtitleFile) =>
|
||||
v.language === null ||
|
||||
v.validateResult === undefined ||
|
||||
v.validateResult.state === "error",
|
||||
|
|
|
@ -70,10 +70,10 @@ const ProfileEditForm: FunctionComponent<Props> = ({
|
|||
initialValues: profile,
|
||||
validate: {
|
||||
name: FormUtils.validation(
|
||||
(value) => value.length > 0,
|
||||
(value: string) => value.length > 0,
|
||||
"Must have a name",
|
||||
),
|
||||
tag: FormUtils.validation((value) => {
|
||||
tag: FormUtils.validation((value: string | undefined) => {
|
||||
if (!value) {
|
||||
return true;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ const ProfileEditForm: FunctionComponent<Props> = ({
|
|||
return /^[a-z_0-9-]+$/.test(value);
|
||||
}, "Only lowercase alphanumeric characters, underscores (_) and hyphens (-) are allowed"),
|
||||
items: FormUtils.validation(
|
||||
(value) => value.length > 0,
|
||||
(value: Language.ProfileItem[]) => value.length > 0,
|
||||
"Must contain at least 1 language",
|
||||
),
|
||||
},
|
||||
|
|
|
@ -128,9 +128,9 @@ const SeriesUploadForm: FunctionComponent<Props> = ({
|
|||
},
|
||||
validate: {
|
||||
files: FormUtils.validation(
|
||||
(values) =>
|
||||
(values: SubtitleFile[]) =>
|
||||
values.find(
|
||||
(v) =>
|
||||
(v: SubtitleFile) =>
|
||||
v.language === null ||
|
||||
v.episode === null ||
|
||||
v.validateResult === undefined ||
|
||||
|
|
|
@ -32,11 +32,20 @@ const TimeOffsetForm: FunctionComponent<Props> = ({ selections, onSubmit }) => {
|
|||
ms: 0,
|
||||
},
|
||||
validate: {
|
||||
hour: FormUtils.validation((v) => v >= 0, "Hour must be larger than 0"),
|
||||
min: FormUtils.validation((v) => v >= 0, "Minute must be larger than 0"),
|
||||
sec: FormUtils.validation((v) => v >= 0, "Second must be larger than 0"),
|
||||
hour: FormUtils.validation(
|
||||
(v: number) => v >= 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(
|
||||
(v) => v >= 0,
|
||||
(v: number) => v >= 0,
|
||||
"Millisecond must be larger than 0",
|
||||
),
|
||||
},
|
||||
|
|
|
@ -57,7 +57,7 @@ const NotificationForm: FunctionComponent<Props> = ({
|
|||
"Please select a notification provider",
|
||||
),
|
||||
url: FormUtils.validation(
|
||||
(value) => value.trim().length !== 0,
|
||||
(value: string) => value.trim().length !== 0,
|
||||
"URL must not be empty",
|
||||
),
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue