aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts
blob: 18e7ae2648f9ef21bae6b762b2cf9ceb1bb74963 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                          
                                           
                                                             




                                                 
                  


                                                                                               


                                                                                 



       
import { Injectable } from '@angular/core'
import { Validators } from '@angular/forms'
import { BuildFormValidator } from './form-validator.service'

@Injectable()
export class VideoCommentValidatorsService {
  readonly VIDEO_COMMENT_TEXT: BuildFormValidator

  constructor () {
    this.VIDEO_COMMENT_TEXT = {
      VALIDATORS: [ Validators.required, Validators.minLength(1), Validators.maxLength(3000) ],
      MESSAGES: {
        'required': $localize`Comment is required.`,
        'minlength': $localize`Comment must be at least 2 characters long.`,
        'maxlength': $localize`Comment cannot be more than 3000 characters long.`
      }
    }
  }
}