aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators/video-block-validators.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/forms/form-validators/video-block-validators.service.ts')
-rw-r--r--client/src/app/shared/forms/form-validators/video-block-validators.service.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/video-block-validators.service.ts b/client/src/app/shared/forms/form-validators/video-block-validators.service.ts
new file mode 100644
index 000000000..dc8257761
--- /dev/null
+++ b/client/src/app/shared/forms/form-validators/video-block-validators.service.ts
@@ -0,0 +1,19 @@
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 VideoBlockValidatorsService {
8 readonly VIDEO_BLOCK_REASON: BuildFormValidator
9
10 constructor (private i18n: I18n) {
11 this.VIDEO_BLOCK_REASON = {
12 VALIDATORS: [ Validators.minLength(2), Validators.maxLength(300) ],
13 MESSAGES: {
14 'minlength': this.i18n('Block reason must be at least 2 characters long.'),
15 'maxlength': this.i18n('Block reason cannot be more than 300 characters long.')
16 }
17 }
18 }
19}