aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators
diff options
context:
space:
mode:
authorFelix Ableitner <me@nutomic.com>2018-08-28 02:01:35 -0500
committerChocobozzz <me@florianbigard.com>2018-08-28 09:01:35 +0200
commitbee0abffff73804d816b90c7fd599e0a51c09d61 (patch)
treefae6d58637f9c63a3800090277f8e130b43442dd /client/src/app/shared/forms/form-validators
parentc907c2fa3fd7c0a741117a0204d0ebca675124bd (diff)
downloadPeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.gz
PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.zst
PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.zip
Implement daily upload limit (#956)
* Implement daily upload limit (ref #652) * remove duplicate code * review fixes * fix tests? * whitespace fixes, finish leftover todo * fix tests * added some new tests * use different config value for tests * remove todo
Diffstat (limited to 'client/src/app/shared/forms/form-validators')
-rw-r--r--client/src/app/shared/forms/form-validators/user-validators.service.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/src/app/shared/forms/form-validators/user-validators.service.ts b/client/src/app/shared/forms/form-validators/user-validators.service.ts
index ec9566ef3..424553d74 100644
--- a/client/src/app/shared/forms/form-validators/user-validators.service.ts
+++ b/client/src/app/shared/forms/form-validators/user-validators.service.ts
@@ -9,6 +9,7 @@ export class UserValidatorsService {
9 readonly USER_EMAIL: BuildFormValidator 9 readonly USER_EMAIL: BuildFormValidator
10 readonly USER_PASSWORD: BuildFormValidator 10 readonly USER_PASSWORD: BuildFormValidator
11 readonly USER_VIDEO_QUOTA: BuildFormValidator 11 readonly USER_VIDEO_QUOTA: BuildFormValidator
12 readonly USER_VIDEO_QUOTA_DAILY: BuildFormValidator
12 readonly USER_ROLE: BuildFormValidator 13 readonly USER_ROLE: BuildFormValidator
13 readonly USER_DISPLAY_NAME: BuildFormValidator 14 readonly USER_DISPLAY_NAME: BuildFormValidator
14 readonly USER_DESCRIPTION: BuildFormValidator 15 readonly USER_DESCRIPTION: BuildFormValidator
@@ -61,6 +62,13 @@ export class UserValidatorsService {
61 'min': this.i18n('Quota must be greater than -1.') 62 'min': this.i18n('Quota must be greater than -1.')
62 } 63 }
63 } 64 }
65 this.USER_VIDEO_QUOTA_DAILY = {
66 VALIDATORS: [ Validators.required, Validators.min(-1) ],
67 MESSAGES: {
68 'required': this.i18n('Daily upload limit is required.'),
69 'min': this.i18n('Daily upload limit must be greater than -1.')
70 }
71 }
64 72
65 this.USER_ROLE = { 73 this.USER_ROLE = {
66 VALIDATORS: [ Validators.required ], 74 VALIDATORS: [ Validators.required ],