aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorPoslovitch <poslovitch@bentobox.world>2021-04-24 09:57:01 +0000
committerChocobozzz <me@florianbigard.com>2021-05-28 13:56:05 +0200
commit1f256e7d3cf056c2d999260155cdba58ae1b878b (patch)
treee33db698da50c329e1eea4122e190e6ef247d8e4 /client/src/app/shared
parentf22e0e2c19b06edfc85429198f9e54a075f71ad3 (diff)
downloadPeerTube-1f256e7d3cf056c2d999260155cdba58ae1b878b.tar.gz
PeerTube-1f256e7d3cf056c2d999260155cdba58ae1b878b.tar.zst
PeerTube-1f256e7d3cf056c2d999260155cdba58ae1b878b.zip
Implemented configurable minimum signup age
Implements https://github.com/Chocobozzz/PeerTube/issues/3612 Fixed lint and removed debug Fixed another lint error Apply suggestions from code review Co-authored-by: Chocobozzz <chocobozzz@cpy.re> Add tests for min signup age config
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/form-validators/custom-config-validators.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/src/app/shared/form-validators/custom-config-validators.ts b/client/src/app/shared/form-validators/custom-config-validators.ts
index ef6e9b456..1ed5700ff 100644
--- a/client/src/app/shared/form-validators/custom-config-validators.ts
+++ b/client/src/app/shared/form-validators/custom-config-validators.ts
@@ -49,6 +49,15 @@ export const SIGNUP_LIMIT_VALIDATOR: BuildFormValidator = {
49 } 49 }
50} 50}
51 51
52export const SIGNUP_MINIMUM_AGE_VALIDATOR: BuildFormValidator = {
53 VALIDATORS: [Validators.required, Validators.min(1), Validators.pattern('[0-9]+')],
54 MESSAGES: {
55 'required': $localize`Signup minimum age is required.`,
56 'min': $localize`Signup minimum age must be greater than 1.`,
57 'pattern': $localize`Signup minimum age must be a number.`
58 }
59}
60
52export const ADMIN_EMAIL_VALIDATOR: BuildFormValidator = { 61export const ADMIN_EMAIL_VALIDATOR: BuildFormValidator = {
53 VALIDATORS: [Validators.required, Validators.email], 62 VALIDATORS: [Validators.required, Validators.email],
54 MESSAGES: { 63 MESSAGES: {