mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Migrate client to eslint
This commit is contained in:
parent
adb8809d43
commit
9df52d660f
215 changed files with 2052 additions and 1196 deletions
|
@ -12,17 +12,17 @@ export const trimValidator: ValidatorFn = (control: FormControl) => {
|
|||
export const VIDEO_NAME_VALIDATOR: BuildFormValidator = {
|
||||
VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ],
|
||||
MESSAGES: {
|
||||
'required': $localize`Video name is required.`,
|
||||
'minlength': $localize`Video name must be at least 3 characters long.`,
|
||||
'maxlength': $localize`Video name cannot be more than 120 characters long.`,
|
||||
'spaces': $localize`Video name has leading or trailing whitespace.`
|
||||
required: $localize`Video name is required.`,
|
||||
minlength: $localize`Video name must be at least 3 characters long.`,
|
||||
maxlength: $localize`Video name cannot be more than 120 characters long.`,
|
||||
spaces: $localize`Video name has leading or trailing whitespace.`
|
||||
}
|
||||
}
|
||||
|
||||
export const VIDEO_PRIVACY_VALIDATOR: BuildFormValidator = {
|
||||
VALIDATORS: [ Validators.required ],
|
||||
MESSAGES: {
|
||||
'required': $localize`Video privacy is required.`
|
||||
required: $localize`Video privacy is required.`
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,46 +49,46 @@ export const VIDEO_IMAGE_VALIDATOR: BuildFormValidator = {
|
|||
export const VIDEO_CHANNEL_VALIDATOR: BuildFormValidator = {
|
||||
VALIDATORS: [ Validators.required ],
|
||||
MESSAGES: {
|
||||
'required': $localize`Video channel is required.`
|
||||
required: $localize`Video channel is required.`
|
||||
}
|
||||
}
|
||||
|
||||
export const VIDEO_DESCRIPTION_VALIDATOR: BuildFormValidator = {
|
||||
VALIDATORS: [ Validators.minLength(3), Validators.maxLength(10000) ],
|
||||
MESSAGES: {
|
||||
'minlength': $localize`Video description must be at least 3 characters long.`,
|
||||
'maxlength': $localize`Video description cannot be more than 10000 characters long.`
|
||||
minlength: $localize`Video description must be at least 3 characters long.`,
|
||||
maxlength: $localize`Video description cannot be more than 10000 characters long.`
|
||||
}
|
||||
}
|
||||
|
||||
export const VIDEO_TAG_VALIDATOR: BuildFormValidator = {
|
||||
VALIDATORS: [ Validators.minLength(2), Validators.maxLength(30) ],
|
||||
MESSAGES: {
|
||||
'minlength': $localize`A tag should be more than 2 characters long.`,
|
||||
'maxlength': $localize`A tag should be less than 30 characters long.`
|
||||
minlength: $localize`A tag should be more than 2 characters long.`,
|
||||
maxlength: $localize`A tag should be less than 30 characters long.`
|
||||
}
|
||||
}
|
||||
|
||||
export const VIDEO_TAGS_ARRAY_VALIDATOR: BuildFormValidator = {
|
||||
VALIDATORS: [ Validators.maxLength(5), arrayTagLengthValidator() ],
|
||||
MESSAGES: {
|
||||
'maxlength': $localize`A maximum of 5 tags can be used on a video.`,
|
||||
'arrayTagLength': $localize`A tag should be more than 1 and less than 30 characters long.`
|
||||
maxlength: $localize`A maximum of 5 tags can be used on a video.`,
|
||||
arrayTagLength: $localize`A tag should be more than 1 and less than 30 characters long.`
|
||||
}
|
||||
}
|
||||
|
||||
export const VIDEO_SUPPORT_VALIDATOR: BuildFormValidator = {
|
||||
VALIDATORS: [ Validators.minLength(3), Validators.maxLength(1000) ],
|
||||
MESSAGES: {
|
||||
'minlength': $localize`Video support must be at least 3 characters long.`,
|
||||
'maxlength': $localize`Video support cannot be more than 1000 characters long.`
|
||||
minlength: $localize`Video support must be at least 3 characters long.`,
|
||||
maxlength: $localize`Video support cannot be more than 1000 characters long.`
|
||||
}
|
||||
}
|
||||
|
||||
export const VIDEO_SCHEDULE_PUBLICATION_AT_VALIDATOR: BuildFormValidator = {
|
||||
VALIDATORS: [ ],
|
||||
MESSAGES: {
|
||||
'required': $localize`A date is required to schedule video update.`
|
||||
required: $localize`A date is required to schedule video update.`
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,6 +105,6 @@ function arrayTagLengthValidator (min = 2, max = 30): ValidatorFn {
|
|||
return null
|
||||
}
|
||||
|
||||
return { 'arrayTagLength': true }
|
||||
return { arrayTagLength: true }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue