X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fforms%2Fform-validators%2Fvideo.ts;h=6542cf8f6e34db47e0ae57627bff64306446e094;hb=df98563e2104b82b119c00a3cd83cd0dc1242d25;hp=de5112238083910a9dc8dc6a046bc386e213597c;hpb=e54163c2d5cc925eb56ead831f2fecd000222a98;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/forms/form-validators/video.ts b/client/src/app/shared/forms/form-validators/video.ts index de5112238..6542cf8f6 100644 --- a/client/src/app/shared/forms/form-validators/video.ts +++ b/client/src/app/shared/forms/form-validators/video.ts @@ -1,4 +1,4 @@ -import { Validators } from '@angular/forms'; +import { Validators } from '@angular/forms' export const VIDEO_NAME = { VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(50) ], @@ -7,13 +7,27 @@ export const VIDEO_NAME = { 'minlength': 'Video name must be at least 3 characters long.', 'maxlength': 'Video name cannot be more than 50 characters long.' } -}; +} + export const VIDEO_CATEGORY = { VALIDATORS: [ Validators.required ], MESSAGES: { 'required': 'Video category is required.' } -}; +} + +export const VIDEO_LICENCE = { + VALIDATORS: [ Validators.required ], + MESSAGES: { + 'required': 'Video licence is required.' + } +} + +export const VIDEO_LANGUAGE = { + VALIDATORS: [ ], + MESSAGES: {} +} + export const VIDEO_DESCRIPTION = { VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(250) ], MESSAGES: { @@ -21,11 +35,12 @@ export const VIDEO_DESCRIPTION = { 'minlength': 'Video description must be at least 3 characters long.', 'maxlength': 'Video description cannot be more than 250 characters long.' } -}; +} export const VIDEO_TAGS = { - VALIDATORS: [ Validators.maxLength(10) ], + VALIDATORS: [ Validators.minLength(2), Validators.maxLength(10) ], MESSAGES: { + 'minlength': 'A tag should be more than 2 characters long.', 'maxlength': 'A tag should be less than 10 characters long.' } -}; +}