]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/forms/form-validators/video.ts
Design follow admin page
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / forms / form-validators / video.ts
CommitLineData
df98563e 1import { Validators } from '@angular/forms'
4b2f33f3 2
ff249f49
C
3export type ValidatorMessage = {
4 [ id: string ]: {
5 [ error: string ]: string
6 }
7}
8
4b2f33f3 9export const VIDEO_NAME = {
a265f7f3 10 VALIDATORS: [ Validators.required, Validators.minLength(3), Validators.maxLength(120) ],
4b2f33f3
C
11 MESSAGES: {
12 'required': 'Video name is required.',
13 'minlength': 'Video name must be at least 3 characters long.',
a265f7f3 14 'maxlength': 'Video name cannot be more than 120 characters long.'
4b2f33f3 15 }
df98563e 16}
d07137b9 17
fd45e8f4
C
18export const VIDEO_PRIVACY = {
19 VALIDATORS: [ Validators.required ],
20 MESSAGES: {
21 'required': 'Video privacy is required.'
22 }
23}
24
6e07c3de 25export const VIDEO_CATEGORY = {
cadb46d8
C
26 VALIDATORS: [ ],
27 MESSAGES: {}
df98563e 28}
d07137b9
C
29
30export const VIDEO_LICENCE = {
cadb46d8
C
31 VALIDATORS: [ ],
32 MESSAGES: {}
df98563e 33}
d07137b9 34
db216afd
C
35export const VIDEO_LANGUAGE = {
36 VALIDATORS: [ ],
37 MESSAGES: {}
df98563e 38}
db216afd 39
bcd9f81e
C
40export const VIDEO_CHANNEL = {
41 VALIDATORS: [ Validators.required ],
42 MESSAGES: {
43 'required': 'Video channel is required.'
44 }
45}
46
4b2f33f3 47export const VIDEO_DESCRIPTION = {
cadb46d8 48 VALIDATORS: [ Validators.minLength(3), Validators.maxLength(3000) ],
4b2f33f3 49 MESSAGES: {
4b2f33f3 50 'minlength': 'Video description must be at least 3 characters long.',
2de96f4d 51 'maxlength': 'Video description cannot be more than 3000 characters long.'
4b2f33f3 52 }
df98563e 53}
4b2f33f3
C
54
55export const VIDEO_TAGS = {
a265f7f3 56 VALIDATORS: [ Validators.minLength(2), Validators.maxLength(30) ],
4b2f33f3 57 MESSAGES: {
3758da94 58 'minlength': 'A tag should be more than 2 characters long.',
a265f7f3 59 'maxlength': 'A tag should be less than 30 characters long.'
4b2f33f3 60 }
df98563e 61}