From e40afb5bc486ff2ce1e5f0a21df7e4e32c344b47 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 31 Jan 2020 00:59:41 +0100 Subject: [PATCH] Fix signup limit validator, and add warning message. --- .../edit-custom-config/edit-custom-config.component.html | 8 ++++++-- .../edit-custom-config/edit-custom-config.component.scss | 5 +++++ .../form-validators/custom-config-validators.service.ts | 2 +- client/src/sass/include/_mixins.scss | 9 ++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 915d60090..d806ea355 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html @@ -234,6 +234,9 @@ inputName="signupEnabled" formControlName="enabled" i18n-labelText labelText="Signup enabled" > + + ⚠️ This functionality requires a lot of attention and extra moderation. +
{{ formErrors.signup.limit }}
+ Signup won't be limited to a fixed number of users.
@@ -318,7 +322,7 @@ i18n-labelText labelText="Blacklist new videos automatically" > - Videos of regular users will stay private until a moderator reviews them. Can be overriden per user. + Unless a user is marked as trusted, their videos will stay private until a moderator reviews them. diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss index 60d608028..dd70f1c06 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.scss @@ -10,6 +10,11 @@ input[type=text] { display: block; } +input[type=number] { + @include peertube-input-text(315px); + display: block; +} + input[type=checkbox] { @include peertube-checkbox(1px); } diff --git a/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts b/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts index 767e3f026..d20754d11 100644 --- a/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts +++ b/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts @@ -56,7 +56,7 @@ export class CustomConfigValidatorsService { } this.SIGNUP_LIMIT = { - VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ], + VALIDATORS: [ Validators.required, Validators.min(-1), Validators.pattern('-?[0-9]+') ], MESSAGES: { 'required': this.i18n('Signup limit is required.'), 'min': this.i18n('Signup limit must be greater than 1.'), diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss index ee86a32d4..317781e0e 100644 --- a/client/src/sass/include/_mixins.scss +++ b/client/src/sass/include/_mixins.scss @@ -77,6 +77,12 @@ } } +@mixin button-focus-visible-shadow($color) { + &.focus-visible { + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px $color; + } +} + @mixin peertube-input-text($width) { display: inline-block; height: $button-height; @@ -118,6 +124,8 @@ } @mixin orange-button { + @include button-focus-visible-shadow(var(--mainHoverColor)); + &, &:active, &:focus { color: #fff; background-color: var(--mainColor); @@ -169,7 +177,6 @@ text-align: center; padding: 0 17px 0 13px; cursor: pointer; - outline: 0; } @mixin peertube-button-link { -- 2.25.1