aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators/user-validators.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/forms/form-validators/user-validators.service.ts')
-rw-r--r--client/src/app/shared/forms/form-validators/user-validators.service.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/user-validators.service.ts b/client/src/app/shared/forms/form-validators/user-validators.service.ts
index 5edae2e38..ec9566ef3 100644
--- a/client/src/app/shared/forms/form-validators/user-validators.service.ts
+++ b/client/src/app/shared/forms/form-validators/user-validators.service.ts
@@ -14,6 +14,8 @@ export class UserValidatorsService {
14 readonly USER_DESCRIPTION: BuildFormValidator 14 readonly USER_DESCRIPTION: BuildFormValidator
15 readonly USER_TERMS: BuildFormValidator 15 readonly USER_TERMS: BuildFormValidator
16 16
17 readonly USER_BAN_REASON: BuildFormValidator
18
17 constructor (private i18n: I18n) { 19 constructor (private i18n: I18n) {
18 20
19 this.USER_USERNAME = { 21 this.USER_USERNAME = {
@@ -99,5 +101,16 @@ export class UserValidatorsService {
99 'required': this.i18n('You must to agree with the instance terms in order to registering on it.') 101 'required': this.i18n('You must to agree with the instance terms in order to registering on it.')
100 } 102 }
101 } 103 }
104
105 this.USER_BAN_REASON = {
106 VALIDATORS: [
107 Validators.minLength(3),
108 Validators.maxLength(250)
109 ],
110 MESSAGES: {
111 'minlength': this.i18n('Ban reason must be at least 3 characters long.'),
112 'maxlength': this.i18n('Ban reason cannot be more than 250 characters long.')
113 }
114 }
102 } 115 }
103} 116}