1 import { I18n } from '@ngx-translate/i18n-polyfill'
2 import { Validators } from '@angular/forms'
3 import { Injectable } from '@angular/core'
4 import { BuildFormValidator } from './form-validator.service'
7 export class AbuseValidatorsService {
8 readonly ABUSE_REASON: BuildFormValidator
9 readonly ABUSE_MODERATION_COMMENT: BuildFormValidator
10 readonly ABUSE_MESSAGE: BuildFormValidator
12 constructor (private i18n: I18n) {
14 VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ],
16 'required': this.i18n('Report reason is required.'),
17 'minlength': this.i18n('Report reason must be at least 2 characters long.'),
18 'maxlength': this.i18n('Report reason cannot be more than 3000 characters long.')
22 this.ABUSE_MODERATION_COMMENT = {
23 VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ],
25 'required': this.i18n('Moderation comment is required.'),
26 'minlength': this.i18n('Moderation comment must be at least 2 characters long.'),
27 'maxlength': this.i18n('Moderation comment cannot be more than 3000 characters long.')
31 this.ABUSE_MESSAGE = {
32 VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ],
34 'required': this.i18n('Abuse message is required.'),
35 'minlength': this.i18n('Abuse message must be at least 2 characters long.'),
36 'maxlength': this.i18n('Abuse message cannot be more than 3000 characters long.')