1 import { Validators } from '@angular/forms'
2 import { BuildFormValidator } from './form-validator.model'
4 export const VIDEO_CHANNEL_NAME_VALIDATOR: BuildFormValidator = {
7 Validators.minLength(1),
8 Validators.maxLength(50),
9 Validators.pattern(/^[a-z0-9][a-z0-9._]*$/)
12 'required': $localize`Name is required.`,
13 'minlength': $localize`Name must be at least 1 character long.`,
14 'maxlength': $localize`Name cannot be more than 50 characters long.`,
15 'pattern': $localize`Name should be lowercase alphanumeric; dots and underscores are allowed.`
19 export const VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR: BuildFormValidator = {
22 Validators.minLength(1),
23 Validators.maxLength(50)
26 'required': $localize`Display name is required.`,
27 'minlength': $localize`Display name must be at least 1 character long.`,
28 'maxlength': $localize`Display name cannot be more than 50 characters long.`
32 export const VIDEO_CHANNEL_DESCRIPTION_VALIDATOR: BuildFormValidator = {
34 Validators.minLength(3),
35 Validators.maxLength(1000)
38 'minlength': $localize`Description must be at least 3 characters long.`,
39 'maxlength': $localize`Description cannot be more than 1000 characters long.`
43 export const VIDEO_CHANNEL_SUPPORT_VALIDATOR: BuildFormValidator = {
45 Validators.minLength(3),
46 Validators.maxLength(1000)
49 'minlength': $localize`Support text must be at least 3 characters long.`,
50 'maxlength': $localize`Support text cannot be more than 1000 characters long`