]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/forms/form-validators/video.ts
Begin new menu design
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / forms / form-validators / video.ts
1 import { Validators } from '@angular/forms'
2
3 export const VIDEO_NAME = {
4 VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ],
5 MESSAGES: {
6 'required': 'Video name is required.',
7 'minlength': 'Video name must be at least 3 characters long.',
8 'maxlength': 'Video name cannot be more than 120 characters long.'
9 }
10 }
11
12 export const VIDEO_PRIVACY = {
13 VALIDATORS: [ Validators.required ],
14 MESSAGES: {
15 'required': 'Video privacy is required.'
16 }
17 }
18
19 export const VIDEO_CATEGORY = {
20 VALIDATORS: [ Validators.required ],
21 MESSAGES: {
22 'required': 'Video category is required.'
23 }
24 }
25
26 export const VIDEO_LICENCE = {
27 VALIDATORS: [ Validators.required ],
28 MESSAGES: {
29 'required': 'Video licence is required.'
30 }
31 }
32
33 export const VIDEO_LANGUAGE = {
34 VALIDATORS: [ ],
35 MESSAGES: {}
36 }
37
38 export const VIDEO_CHANNEL = {
39 VALIDATORS: [ Validators.required ],
40 MESSAGES: {
41 'required': 'Video channel is required.'
42 }
43 }
44
45 export const VIDEO_DESCRIPTION = {
46 VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(3000) ],
47 MESSAGES: {
48 'required': 'Video description is required.',
49 'minlength': 'Video description must be at least 3 characters long.',
50 'maxlength': 'Video description cannot be more than 3000 characters long.'
51 }
52 }
53
54 export const VIDEO_TAGS = {
55 VALIDATORS: [ Validators.minLength(2), Validators.maxLength(30) ],
56 MESSAGES: {
57 'minlength': 'A tag should be more than 2 characters long.',
58 'maxlength': 'A tag should be less than 30 characters long.'
59 }
60 }
61
62 export const VIDEO_FILE = {
63 VALIDATORS: [ Validators.required ],
64 MESSAGES: {
65 'required': 'Video file is required.'
66 }
67 }