1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00
Peertube/client/src/app/shared/form-validators/abuse-validators.ts
2021-08-18 08:35:06 +02:00

29 lines
1.3 KiB
TypeScript

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.`
}
}