]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - 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
CommitLineData
fd206f0b
C
1import { Validators } from '@angular/forms'
2
66b16caf
C
3export const INSTANCE_NAME = {
4 VALIDATORS: [ Validators.required ],
5 MESSAGES: {
36f9424f 6 'required': 'Instance name is required.'
2e3a0215
C
7 }
8}
9
10export const INSTANCE_SHORT_DESCRIPTION = {
11 VALIDATORS: [ Validators.max(250) ],
12 MESSAGES: {
13 'max': 'Short description should not be longer than 250 characters.'
8be1afa1
C
14 }
15}
16
17export const SERVICES_TWITTER_USERNAME = {
18 VALIDATORS: [ Validators.required ],
19 MESSAGES: {
20 'required': 'Twitter username is required.'
66b16caf
C
21 }
22}
23
fd206f0b
C
24export 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
33export 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
42export 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
50export 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}