]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/forms/form-validators/video.ts
Add channels to upload form
[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(50) ],
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 50 characters long.'
9 }
10 }
11
12 export const VIDEO_CATEGORY = {
13 VALIDATORS: [ Validators.required ],
14 MESSAGES: {
15 'required': 'Video category is required.'
16 }
17 }
18
19 export const VIDEO_LICENCE = {
20 VALIDATORS: [ Validators.required ],
21 MESSAGES: {
22 'required': 'Video licence is required.'
23 }
24 }
25
26 export const VIDEO_LANGUAGE = {
27 VALIDATORS: [ ],
28 MESSAGES: {}
29 }
30
31 export const VIDEO_CHANNEL = {
32 VALIDATORS: [ Validators.required ],
33 MESSAGES: {
34 'required': 'Video channel is required.'
35 }
36 }
37
38 export const VIDEO_DESCRIPTION = {
39 VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(250) ],
40 MESSAGES: {
41 'required': 'Video description is required.',
42 'minlength': 'Video description must be at least 3 characters long.',
43 'maxlength': 'Video description cannot be more than 250 characters long.'
44 }
45 }
46
47 export const VIDEO_TAGS = {
48 VALIDATORS: [ Validators.minLength(2), Validators.maxLength(10) ],
49 MESSAGES: {
50 'minlength': 'A tag should be more than 2 characters long.',
51 'maxlength': 'A tag should be less than 10 characters long.'
52 }
53 }
54
55 export const VIDEO_FILE = {
56 VALIDATORS: [ Validators.required ],
57 MESSAGES: {
58 'required': 'Video file is required.'
59 }
60 }