aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/forms/form-validators/user.ts')
-rw-r--r--client/src/app/shared/forms/form-validators/user.ts70
1 files changed, 0 insertions, 70 deletions
diff --git a/client/src/app/shared/forms/form-validators/user.ts b/client/src/app/shared/forms/form-validators/user.ts
deleted file mode 100644
index 0973f1b00..000000000
--- a/client/src/app/shared/forms/form-validators/user.ts
+++ /dev/null
@@ -1,70 +0,0 @@
1import { Validators } from '@angular/forms'
2
3export const USER_USERNAME = {
4 VALIDATORS: [
5 Validators.required,
6 Validators.minLength(3),
7 Validators.maxLength(20),
8 Validators.pattern(/^[a-z0-9._]+$/)
9 ],
10 MESSAGES: {
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.'
15 }
16}
17export const USER_EMAIL = {
18 VALIDATORS: [ Validators.required, Validators.email ],
19 MESSAGES: {
20 'required': 'Email is required.',
21 'email': 'Email must be valid.'
22 }
23}
24export const USER_PASSWORD = {
25 VALIDATORS: [
26 Validators.required,
27 Validators.minLength(6),
28 Validators.maxLength(255)
29 ],
30 MESSAGES: {
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.'
34 }
35}
36export const USER_VIDEO_QUOTA = {
37 VALIDATORS: [ Validators.required, Validators.min(-1) ],
38 MESSAGES: {
39 'required': 'Video quota is required.',
40 'min': 'Quota must be greater than -1.'
41 }
42}
43export const USER_ROLE = {
44 VALIDATORS: [ Validators.required ],
45 MESSAGES: {
46 'required': 'User role is required.'
47 }
48}
49export const USER_DISPLAY_NAME = {
50 VALIDATORS: [
51 Validators.required,
52 Validators.minLength(3),
53 Validators.maxLength(120)
54 ],
55 MESSAGES: {
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.'
59 }
60}
61export const USER_DESCRIPTION = {
62 VALIDATORS: [
63 Validators.minLength(3),
64 Validators.maxLength(250)
65 ],
66 MESSAGES: {
67 'minlength': 'Description must be at least 3 characters long.',
68 'maxlength': 'Description cannot be more than 250 characters long.'
69 }
70}