diff options
Diffstat (limited to 'client/src/app/+signup/+register/shared/register-validators.ts')
-rw-r--r-- | client/src/app/+signup/+register/shared/register-validators.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/client/src/app/+signup/+register/shared/register-validators.ts b/client/src/app/+signup/+register/shared/register-validators.ts new file mode 100644 index 000000000..f14803b68 --- /dev/null +++ b/client/src/app/+signup/+register/shared/register-validators.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | import { Validators } from '@angular/forms' | ||
2 | import { BuildFormValidator } from '@app/shared/form-validators' | ||
3 | |||
4 | export const REGISTER_TERMS_VALIDATOR: BuildFormValidator = { | ||
5 | VALIDATORS: [ Validators.requiredTrue ], | ||
6 | MESSAGES: { | ||
7 | required: $localize`You must agree with the instance terms in order to register on it.` | ||
8 | } | ||
9 | } | ||
10 | |||
11 | export const REGISTER_REASON_VALIDATOR: BuildFormValidator = { | ||
12 | VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ], | ||
13 | MESSAGES: { | ||
14 | required: $localize`Registration reason is required.`, | ||
15 | minlength: $localize`Registration reason must be at least 2 characters long.`, | ||
16 | maxlength: $localize`Registration reason cannot be more than 3000 characters long.` | ||
17 | } | ||
18 | } | ||