aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators/custom-config.ts
blob: 17ae0e75c7d4d5998f5befea9f38fd16f0640bb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Validators } from '@angular/forms'

export const CACHE_PREVIEWS_SIZE = {
  VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
  MESSAGES: {
    'required': 'Preview cache size is required.',
    'min': 'Preview cache size must be greater than 1.',
    'pattern': 'Preview cache size must be a number.'
  }
}

export const SIGNUP_LIMIT = {
  VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
  MESSAGES: {
    'required': 'Signup limit is required.',
    'min': 'Signup limit must be greater than 1.',
    'pattern': 'Preview cache size must be a number.'
  }
}

export const ADMIN_EMAIL = {
  VALIDATORS: [ Validators.required, Validators.email ],
  MESSAGES: {
    'required': 'Admin email is required.',
    'email': 'Admin email must be valid.'
  }
}

export const TRANSCODING_THREADS = {
  VALIDATORS: [ Validators.required, Validators.min(1) ],
  MESSAGES: {
    'required': 'Transcoding threads is required.',
    'min': 'Transcoding threads must be greater than 1.'
  }
}