]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/forms/form-validators/custom-config.ts
Fix typings
[github/Chocobozzz/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 SERVICES_TWITTER_USERNAME = {
18 VALIDATORS: [ Validators.required ],
19 MESSAGES: {
20 'required': 'Twitter username is required.'
21 }
22 }
23
24 export const CACHE_PREVIEWS_SIZE = {
25 VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
26 MESSAGES: {
27 'required': 'Preview cache size is required.',
28 'min': 'Preview cache size must be greater than 1.',
29 'pattern': 'Preview cache size must be a number.'
30 }
31 }
32
33 export const SIGNUP_LIMIT = {
34 VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
35 MESSAGES: {
36 'required': 'Signup limit is required.',
37 'min': 'Signup limit must be greater than 1.',
38 'pattern': 'Preview cache size must be a number.'
39 }
40 }
41
42 export const ADMIN_EMAIL = {
43 VALIDATORS: [ Validators.required, Validators.email ],
44 MESSAGES: {
45 'required': 'Admin email is required.',
46 'email': 'Admin email must be valid.'
47 }
48 }
49
50 export const TRANSCODING_THREADS = {
51 VALIDATORS: [ Validators.required, Validators.min(1) ],
52 MESSAGES: {
53 'required': 'Transcoding threads is required.',
54 'min': 'Transcoding threads must be greater than 1.'
55 }
56 }