1 import { Injectable } from '@angular/core'
2 import { Validators } from '@angular/forms'
3 import { BuildFormValidator } from './form-validator.service'
6 export class InstanceValidatorsService {
7 readonly FROM_EMAIL: BuildFormValidator
8 readonly FROM_NAME: BuildFormValidator
9 readonly SUBJECT: BuildFormValidator
10 readonly BODY: BuildFormValidator
15 VALIDATORS: [ Validators.required, Validators.email ],
17 'required': $localize`Email is required.`,
18 'email': $localize`Email must be valid.`
25 Validators.minLength(1),
26 Validators.maxLength(120)
29 'required': $localize`Your name is required.`,
30 'minlength': $localize`Your name must be at least 1 character long.`,
31 'maxlength': $localize`Your name cannot be more than 120 characters long.`
38 Validators.minLength(1),
39 Validators.maxLength(120)
42 'required': $localize`A subject is required.`,
43 'minlength': $localize`The subject must be at least 1 character long.`,
44 'maxlength': $localize`The subject cannot be more than 120 characters long.`
51 Validators.minLength(3),
52 Validators.maxLength(5000)
55 'required': $localize`A message is required.`,
56 'minlength': $localize`The message must be at least 3 characters long.`,
57 'maxlength': $localize`The message cannot be more than 5000 characters long.`