1 import { Validators } from '@angular/forms'
3 export const USER_USERNAME = {
6 Validators.minLength(3),
7 Validators.maxLength(20),
8 Validators.pattern(/^[a-z0-9._]+$/)
11 'required': 'Username is required.',
12 'minlength': 'Username must be at least 3 characters long.',
13 'maxlength': 'Username cannot be more than 20 characters long.',
14 'pattern': 'Username should be only lowercase alphanumeric characters.'
17 export const USER_EMAIL = {
18 VALIDATORS: [ Validators.required, Validators.email ],
20 'required': 'Email is required.',
21 'email': 'Email must be valid.'
24 export const USER_PASSWORD = {
27 Validators.minLength(6),
28 Validators.maxLength(255)
31 'required': 'Password is required.',
32 'minlength': 'Password must be at least 6 characters long.',
33 'maxlength': 'Password cannot be more than 255 characters long.'
36 export const USER_VIDEO_QUOTA = {
37 VALIDATORS: [ Validators.required, Validators.min(-1) ],
39 'required': 'Video quota is required.',
40 'min': 'Quota must be greater than -1.'
43 export const USER_ROLE = {
44 VALIDATORS: [ Validators.required ],
46 'required': 'User role is required.'
49 export const USER_DISPLAY_NAME = {
52 Validators.minLength(3),
53 Validators.maxLength(120)
56 'required': 'Display name is required.',
57 'minlength': 'Display name must be at least 3 characters long.',
58 'maxlength': 'Display name cannot be more than 120 characters long.'
61 export const USER_DESCRIPTION = {
63 Validators.minLength(3),
64 Validators.maxLength(250)
67 'minlength': 'Description must be at least 3 characters long.',
68 'maxlength': 'Description cannot be more than 250 characters long.'