]>
Commit | Line | Data |
---|---|---|
df98563e | 1 | import { Validators } from '@angular/forms' |
4b2f33f3 C |
2 | |
3 | export const USER_USERNAME = { | |
563d032e C |
4 | VALIDATORS: [ |
5 | Validators.required, | |
6 | Validators.minLength(3), | |
7 | Validators.maxLength(20), | |
8 | Validators.pattern(/^[a-z0-9._]+$/) | |
9 | ], | |
4b2f33f3 C |
10 | MESSAGES: { |
11 | 'required': 'Username is required.', | |
12 | 'minlength': 'Username must be at least 3 characters long.', | |
563d032e C |
13 | 'maxlength': 'Username cannot be more than 20 characters long.', |
14 | 'pattern': 'Username should be only lowercase alphanumeric characters.' | |
4b2f33f3 | 15 | } |
df98563e | 16 | } |
ad4a8a1c | 17 | export const USER_EMAIL = { |
c689fcdc | 18 | VALIDATORS: [ Validators.required, Validators.email ], |
ad4a8a1c C |
19 | MESSAGES: { |
20 | 'required': 'Email is required.', | |
df98563e | 21 | 'email': 'Email must be valid.' |
ad4a8a1c | 22 | } |
df98563e | 23 | } |
4b2f33f3 C |
24 | export const USER_PASSWORD = { |
25 | VALIDATORS: [ Validators.required, Validators.minLength(6) ], | |
26 | MESSAGES: { | |
27 | 'required': 'Password is required.', | |
df98563e | 28 | 'minlength': 'Password must be at least 6 characters long.' |
4b2f33f3 | 29 | } |
df98563e | 30 | } |
b0f9f39e C |
31 | export const USER_VIDEO_QUOTA = { |
32 | VALIDATORS: [ Validators.required, Validators.min(-1) ], | |
33 | MESSAGES: { | |
34 | 'required': 'Video quota is required.', | |
35 | 'min': 'Quota must be greater than -1.' | |
36 | } | |
980246ea | 37 | } |
954605a8 C |
38 | export const USER_ROLE = { |
39 | VALIDATORS: [ Validators.required ], | |
40 | MESSAGES: { | |
757f0da3 | 41 | 'required': 'User role is required.' |
954605a8 C |
42 | } |
43 | } |