diff options
Diffstat (limited to 'client/src/app/shared/forms')
-rw-r--r-- | client/src/app/shared/forms/form-validators/instance-validators.service.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/instance-validators.service.ts b/client/src/app/shared/forms/form-validators/instance-validators.service.ts index 5bb852858..cc5f3c5a1 100644 --- a/client/src/app/shared/forms/form-validators/instance-validators.service.ts +++ b/client/src/app/shared/forms/form-validators/instance-validators.service.ts | |||
@@ -7,6 +7,7 @@ import { Injectable } from '@angular/core' | |||
7 | export class InstanceValidatorsService { | 7 | export class InstanceValidatorsService { |
8 | readonly FROM_EMAIL: BuildFormValidator | 8 | readonly FROM_EMAIL: BuildFormValidator |
9 | readonly FROM_NAME: BuildFormValidator | 9 | readonly FROM_NAME: BuildFormValidator |
10 | readonly SUBJECT: BuildFormValidator | ||
10 | readonly BODY: BuildFormValidator | 11 | readonly BODY: BuildFormValidator |
11 | 12 | ||
12 | constructor (private i18n: I18n) { | 13 | constructor (private i18n: I18n) { |
@@ -32,6 +33,19 @@ export class InstanceValidatorsService { | |||
32 | } | 33 | } |
33 | } | 34 | } |
34 | 35 | ||
36 | this.SUBJECT = { | ||
37 | VALIDATORS: [ | ||
38 | Validators.required, | ||
39 | Validators.minLength(1), | ||
40 | Validators.maxLength(120) | ||
41 | ], | ||
42 | MESSAGES: { | ||
43 | 'required': this.i18n('A subject is required.'), | ||
44 | 'minlength': this.i18n('The subject must be at least 1 character long.'), | ||
45 | 'maxlength': this.i18n('The subject cannot be more than 120 characters long.') | ||
46 | } | ||
47 | } | ||
48 | |||
35 | this.BODY = { | 49 | this.BODY = { |
36 | VALIDATORS: [ | 50 | VALIDATORS: [ |
37 | Validators.required, | 51 | Validators.required, |