From b38c7c39ac0305dee00a34fa5bb68c5a44d4964a Mon Sep 17 00:00:00 2001 From: Pablo Bonilla Date: Sun, 11 Jul 2021 20:35:10 -0600 Subject: [PATCH] Fix user and admin registration validations --- src/main/resources/config/application-dev.yml | 2 +- .../account/register/register.component.html | 18 ++++++++++----- .../account/register/register.component.ts | 4 ++-- .../usuario-extra-update.component.html | 22 +++++++++++++------ .../update/usuario-extra-update.component.ts | 4 ++-- src/main/webapp/app/login/login.component.ts | 2 +- src/main/webapp/i18n/es/global.json | 4 ++-- src/main/webapp/i18n/es/register.json | 2 +- 8 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/main/resources/config/application-dev.yml b/src/main/resources/config/application-dev.yml index c13b842..6f67fa6 100644 --- a/src/main/resources/config/application-dev.yml +++ b/src/main/resources/config/application-dev.yml @@ -95,7 +95,7 @@ jhipster: token-validity-in-seconds: 86400 token-validity-in-seconds-for-remember-me: 2592000 mail: # specific JHipster mail property, for standard properties see MailProperties - base-url: http://127.0.0.1:8080 + base-url: http://localhost:9000 logging: use-json-format: false # By default, logs are not in Json format logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration diff --git a/src/main/webapp/app/account/register/register.component.html b/src/main/webapp/app/account/register/register.component.html index dc27302..bd4e919 100644 --- a/src/main/webapp/app/account/register/register.component.html +++ b/src/main/webapp/app/account/register/register.component.html @@ -23,6 +23,10 @@ Registration failed! Please try again later. +
+ Login name already registered! Please choose another one. +
+
Email is already in use! Please choose another one.
@@ -34,7 +38,7 @@
- + Your email cannot be longer than 100 characters. + + + Se requiere un correo electrónico válido. +
- +
- + diff --git a/src/main/webapp/app/account/register/register.component.ts b/src/main/webapp/app/account/register/register.component.ts index ca827e5..ddcc966 100644 --- a/src/main/webapp/app/account/register/register.component.ts +++ b/src/main/webapp/app/account/register/register.component.ts @@ -59,8 +59,8 @@ export class RegisterComponent implements AfterViewInit { registerForm = this.fb.group({ name: ['', [Validators.required, Validators.minLength(2), Validators.maxLength(254)]], email: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(254), Validators.email]], - password: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(50)]], - confirmPassword: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(50)]], + password: ['', [Validators.required, Validators.minLength(8), Validators.maxLength(50)]], + confirmPassword: ['', [Validators.required, Validators.minLength(8), Validators.maxLength(50)]], }); constructor(private translateService: TranslateService, private registerService: RegisterService, private fb: FormBuilder) {} diff --git a/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.html b/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.html index 1f2f81e..3f3437d 100644 --- a/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.html +++ b/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.html @@ -9,12 +9,12 @@

- REGISTRAR ADMIN + REGISTRAR ADMINISTRADOR

Ingrese los datos para registrar a un admin.

-
+
Registration saved! Please check your email for confirmation.
@@ -22,6 +22,10 @@ Registration failed! Please try again later.
+
+ Login name already registered! Please choose another one. +
+
Email is already in use! Please choose another one.
@@ -33,13 +37,13 @@
- + @@ -88,7 +92,7 @@ class="form-control" id="email" name="email" - placeholder="{{ 'global.form.email.placeholder' | translate }}" + placeholder="Correo electrónico" formControlName="email" data-cy="email" /> @@ -125,13 +129,17 @@ > Your email cannot be longer than 100 characters. + + + Se requiere un correo electrónico válido. +
- +
- + ¡Registro guardado! Por favor, revise el correo electrónico para confirmar.", "error": { "fail": "¡El registro ha fallado! Por favor, inténtelo de nuevo más tarde.", - "userexists": "¡El nombre de usuario ya está registrado! Por favor, escoja otro usuario.", + "userexists": "¡El correo electrónico ya está en uso! Por favor, escoja otro correo.", "emailexists": "¡El correo electrónico ya está en uso! Por favor, escoja otro email." } }