aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/form-validators/abuse-validators.ts
blob: 75bfacf01de28972ed2d56949a9be1b0b8da9143 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Validators } from '@angular/forms'
import { BuildFormValidator } from './form-validator.model'

export const ABUSE_REASON_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [Validators.required, Validators.minLength(2), Validators.maxLength(3000)],
  MESSAGES: {
    'required': $localize`Report reason is required.`,
    'minlength': $localize`Report reason must be at least 2 characters long.`,
    'maxlength': $localize`Report reason cannot be more than 3000 characters long.`
  }
}

export const ABUSE_MODERATION_COMMENT_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [Validators.required, Validators.minLength(2), Validators.maxLength(3000)],
  MESSAGES: {
    'required': $localize`Moderation comment is required.`,
    'minlength': $localize`Moderation comment must be at least 2 characters long.`,
    'maxlength': $localize`Moderation comment cannot be more than 3000 characters long.`
  }
}

export const ABUSE_MESSAGE_VALIDATOR: BuildFormValidator = {
  VALIDATORS: [Validators.required, Validators.minLength(2), Validators.maxLength(3000)],
  MESSAGES: {
    'required': $localize`Abuse message is required.`,
    'minlength': $localize`Abuse message must be at least 2 characters long.`,
    'maxlength': $localize`Abuse message cannot be more than 3000 characters long.`
  }
}