aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-forms
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-24 17:21:25 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-31 11:35:19 +0200
commit441e453ae53e491b09c9b09b00b041788176ce64 (patch)
tree6104afc6b8344b39ec95211ed236ed784895d65d /client/src/app/shared/shared-forms
parentedbc9325462ddf4536775871ebc25e06f46612d1 (diff)
downloadPeerTube-441e453ae53e491b09c9b09b00b041788176ce64.tar.gz
PeerTube-441e453ae53e491b09c9b09b00b041788176ce64.tar.zst
PeerTube-441e453ae53e491b09c9b09b00b041788176ce64.zip
Add abuse message management in admin
Diffstat (limited to 'client/src/app/shared/shared-forms')
-rw-r--r--client/src/app/shared/shared-forms/form-validators/abuse-validators.service.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-forms/form-validators/abuse-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/abuse-validators.service.ts
index 739115e19..5f15963f3 100644
--- a/client/src/app/shared/shared-forms/form-validators/abuse-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/abuse-validators.service.ts
@@ -7,6 +7,7 @@ import { BuildFormValidator } from './form-validator.service'
7export class AbuseValidatorsService { 7export class AbuseValidatorsService {
8 readonly ABUSE_REASON: BuildFormValidator 8 readonly ABUSE_REASON: BuildFormValidator
9 readonly ABUSE_MODERATION_COMMENT: BuildFormValidator 9 readonly ABUSE_MODERATION_COMMENT: BuildFormValidator
10 readonly ABUSE_MESSAGE: BuildFormValidator
10 11
11 constructor (private i18n: I18n) { 12 constructor (private i18n: I18n) {
12 this.ABUSE_REASON = { 13 this.ABUSE_REASON = {
@@ -26,5 +27,14 @@ export class AbuseValidatorsService {
26 'maxlength': this.i18n('Moderation comment cannot be more than 3000 characters long.') 27 'maxlength': this.i18n('Moderation comment cannot be more than 3000 characters long.')
27 } 28 }
28 } 29 }
30
31 this.ABUSE_MESSAGE = {
32 VALIDATORS: [ Validators.required, Validators.minLength(2), Validators.maxLength(3000) ],
33 MESSAGES: {
34 'required': this.i18n('Abuse message is required.'),
35 'minlength': this.i18n('Abuse message must be at least 2 characters long.'),
36 'maxlength': this.i18n('Abuse message cannot be more than 3000 characters long.')
37 }
38 }
29 } 39 }
30} 40}