diff options
Diffstat (limited to 'client/src/app/shared/forms/form-validators/video.ts')
-rw-r--r-- | client/src/app/shared/forms/form-validators/video.ts | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/client/src/app/shared/forms/form-validators/video.ts b/client/src/app/shared/forms/form-validators/video.ts index 65f11f5da..45da7df4a 100644 --- a/client/src/app/shared/forms/form-validators/video.ts +++ b/client/src/app/shared/forms/form-validators/video.ts | |||
@@ -1,5 +1,11 @@ | |||
1 | import { Validators } from '@angular/forms' | 1 | import { Validators } from '@angular/forms' |
2 | 2 | ||
3 | export type ValidatorMessage = { | ||
4 | [ id: string ]: { | ||
5 | [ error: string ]: string | ||
6 | } | ||
7 | } | ||
8 | |||
3 | export const VIDEO_NAME = { | 9 | export const VIDEO_NAME = { |
4 | VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ], | 10 | VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ], |
5 | MESSAGES: { | 11 | MESSAGES: { |
@@ -17,17 +23,13 @@ export const VIDEO_PRIVACY = { | |||
17 | } | 23 | } |
18 | 24 | ||
19 | export const VIDEO_CATEGORY = { | 25 | export const VIDEO_CATEGORY = { |
20 | VALIDATORS: [ Validators.required ], | 26 | VALIDATORS: [ ], |
21 | MESSAGES: { | 27 | MESSAGES: {} |
22 | 'required': 'Video category is required.' | ||
23 | } | ||
24 | } | 28 | } |
25 | 29 | ||
26 | export const VIDEO_LICENCE = { | 30 | export const VIDEO_LICENCE = { |
27 | VALIDATORS: [ Validators.required ], | 31 | VALIDATORS: [ ], |
28 | MESSAGES: { | 32 | MESSAGES: {} |
29 | 'required': 'Video licence is required.' | ||
30 | } | ||
31 | } | 33 | } |
32 | 34 | ||
33 | export const VIDEO_LANGUAGE = { | 35 | export const VIDEO_LANGUAGE = { |
@@ -43,9 +45,8 @@ export const VIDEO_CHANNEL = { | |||
43 | } | 45 | } |
44 | 46 | ||
45 | export const VIDEO_DESCRIPTION = { | 47 | export const VIDEO_DESCRIPTION = { |
46 | VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(3000) ], | 48 | VALIDATORS: [ Validators.minLength(3), Validators.maxLength(3000) ], |
47 | MESSAGES: { | 49 | MESSAGES: { |
48 | 'required': 'Video description is required.', | ||
49 | 'minlength': 'Video description must be at least 3 characters long.', | 50 | 'minlength': 'Video description must be at least 3 characters long.', |
50 | 'maxlength': 'Video description cannot be more than 3000 characters long.' | 51 | 'maxlength': 'Video description cannot be more than 3000 characters long.' |
51 | } | 52 | } |
@@ -58,10 +59,3 @@ export const VIDEO_TAGS = { | |||
58 | 'maxlength': 'A tag should be less than 30 characters long.' | 59 | 'maxlength': 'A tag should be less than 30 characters long.' |
59 | } | 60 | } |
60 | } | 61 | } |
61 | |||
62 | export const VIDEO_FILE = { | ||
63 | VALIDATORS: [ Validators.required ], | ||
64 | MESSAGES: { | ||
65 | 'required': 'Video file is required.' | ||
66 | } | ||
67 | } | ||