diff options
Diffstat (limited to 'client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts')
-rw-r--r-- | client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts deleted file mode 100644 index 3e7444196..000000000 --- a/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | import { Injectable } from '@angular/core' | ||
2 | import { Validators } from '@angular/forms' | ||
3 | import { BuildFormValidator } from './form-validator.service' | ||
4 | |||
5 | @Injectable() | ||
6 | export class VideoChannelValidatorsService { | ||
7 | readonly VIDEO_CHANNEL_NAME: BuildFormValidator | ||
8 | readonly VIDEO_CHANNEL_DISPLAY_NAME: BuildFormValidator | ||
9 | readonly VIDEO_CHANNEL_DESCRIPTION: BuildFormValidator | ||
10 | readonly VIDEO_CHANNEL_SUPPORT: BuildFormValidator | ||
11 | |||
12 | constructor () { | ||
13 | this.VIDEO_CHANNEL_NAME = { | ||
14 | VALIDATORS: [ | ||
15 | Validators.required, | ||
16 | Validators.minLength(1), | ||
17 | Validators.maxLength(50), | ||
18 | Validators.pattern(/^[a-z0-9][a-z0-9._]*$/) | ||
19 | ], | ||
20 | MESSAGES: { | ||
21 | 'required': $localize`Name is required.`, | ||
22 | 'minlength': $localize`Name must be at least 1 character long.`, | ||
23 | 'maxlength': $localize`Name cannot be more than 50 characters long.`, | ||
24 | 'pattern': $localize`Name should be lowercase alphanumeric; dots and underscores are allowed.` | ||
25 | } | ||
26 | } | ||
27 | |||
28 | this.VIDEO_CHANNEL_DISPLAY_NAME = { | ||
29 | VALIDATORS: [ | ||
30 | Validators.required, | ||
31 | Validators.minLength(1), | ||
32 | Validators.maxLength(50) | ||
33 | ], | ||
34 | MESSAGES: { | ||
35 | 'required': $localize`Display name is required.`, | ||
36 | 'minlength': $localize`Display name must be at least 1 character long.`, | ||
37 | 'maxlength': $localize`Display name cannot be more than 50 characters long.` | ||
38 | } | ||
39 | } | ||
40 | |||
41 | this.VIDEO_CHANNEL_DESCRIPTION = { | ||
42 | VALIDATORS: [ | ||
43 | Validators.minLength(3), | ||
44 | Validators.maxLength(1000) | ||
45 | ], | ||
46 | MESSAGES: { | ||
47 | 'minlength': $localize`Description must be at least 3 characters long.`, | ||
48 | 'maxlength': $localize`Description cannot be more than 1000 characters long.` | ||
49 | } | ||
50 | } | ||
51 | |||
52 | this.VIDEO_CHANNEL_SUPPORT = { | ||
53 | VALIDATORS: [ | ||
54 | Validators.minLength(3), | ||
55 | Validators.maxLength(1000) | ||
56 | ], | ||
57 | MESSAGES: { | ||
58 | 'minlength': $localize`Support text must be at least 3 characters long.`, | ||
59 | 'maxlength': $localize`Support text cannot be more than 1000 characters long` | ||
60 | } | ||
61 | } | ||
62 | } | ||
63 | } | ||