]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/forms/form-validators/video-comment-validators.service.ts
provide specific engine boundaries for nodejs and yarn
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / forms / form-validators / video-comment-validators.service.ts
CommitLineData
e309822b
C
1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared'
5
6@Injectable()
7export class VideoCommentValidatorsService {
8 readonly VIDEO_COMMENT_TEXT: BuildFormValidator
9
10 constructor (private i18n: I18n) {
11 this.VIDEO_COMMENT_TEXT = {
12 VALIDATORS: [ Validators.required, Validators.minLength(1), Validators.maxLength(3000) ],
13 MESSAGES: {
14 'required': this.i18n('Comment is required.'),
15 'minlength': this.i18n('Comment must be at least 2 characters long.'),
16 'maxlength': this.i18n('Comment cannot be more than 3000 characters long.')
17 }
18 }
19 }
20}