Fix check comments params unit tests
[oweals/peertube.git] / client / src / app / shared / forms / form-validators / custom-config.ts
1 import { Validators } from '@angular/forms'
2
3 export const INSTANCE_NAME = {
4   VALIDATORS: [ Validators.required ],
5   MESSAGES: {
6     'required': 'Instance name is required.'
7   }
8 }
9
10 export const INSTANCE_SHORT_DESCRIPTION = {
11   VALIDATORS: [ Validators.max(250) ],
12   MESSAGES: {
13     'max': 'Short description should not be longer than 250 characters.'
14   }
15 }
16
17 export const CACHE_PREVIEWS_SIZE = {
18   VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
19   MESSAGES: {
20     'required': 'Preview cache size is required.',
21     'min': 'Preview cache size must be greater than 1.',
22     'pattern': 'Preview cache size must be a number.'
23   }
24 }
25
26 export const SIGNUP_LIMIT = {
27   VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
28   MESSAGES: {
29     'required': 'Signup limit is required.',
30     'min': 'Signup limit must be greater than 1.',
31     'pattern': 'Preview cache size must be a number.'
32   }
33 }
34
35 export const ADMIN_EMAIL = {
36   VALIDATORS: [ Validators.required, Validators.email ],
37   MESSAGES: {
38     'required': 'Admin email is required.',
39     'email': 'Admin email must be valid.'
40   }
41 }
42
43 export const TRANSCODING_THREADS = {
44   VALIDATORS: [ Validators.required, Validators.min(1) ],
45   MESSAGES: {
46     'required': 'Transcoding threads is required.',
47     'min': 'Transcoding threads must be greater than 1.'
48   }
49 }