From d25dc55d7b2c29ca76b8fcd02e1e375aeb885ef3 Mon Sep 17 00:00:00 2001 From: Paola Date: Sat, 17 Jul 2021 23:47:01 -0600 Subject: [PATCH 01/30] arreglo seleccion icono perfil y validacion password --- .../app/account/settings/settings.component.html | 4 ++-- .../app/account/settings/settings.component.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/app/account/settings/settings.component.html b/src/main/webapp/app/account/settings/settings.component.html index e259328..37694de 100644 --- a/src/main/webapp/app/account/settings/settings.component.html +++ b/src/main/webapp/app/account/settings/settings.component.html @@ -175,7 +175,7 @@

Perfil

-

Información general de su usuario, el correo electrónico es su identificador en DataSurvey.

+

Información general de su usuario, el correo electrónico es su identificador en DataSurvey

@@ -284,7 +284,7 @@

- Utilice una contraseña segura al realizar el cambio, este dato debe ser secreto ya que provee acceso a su cuenta. + Utilice una contraseña segura al realizar el cambio, este dato debe ser secreto ya que provee acceso a su cuenta

diff --git a/src/main/webapp/app/account/settings/settings.component.ts b/src/main/webapp/app/account/settings/settings.component.ts index 3ad2169..55335fd 100644 --- a/src/main/webapp/app/account/settings/settings.component.ts +++ b/src/main/webapp/app/account/settings/settings.component.ts @@ -50,8 +50,8 @@ export class SettingsComponent implements OnInit { //form de la contraseña passwordForm = this.fb.group({ - password: [null, [Validators.required], Validators.minLength(8), Validators.maxLength(50)], - passwordNew: [null, [Validators.required], Validators.minLength(8), Validators.maxLength(50)], + password: [null, [Validators.required, Validators.minLength(8), Validators.maxLength(50)]], + passwordNew: [null, [Validators.required, Validators.minLength(8), Validators.maxLength(50)]], passwordNewConfirm: [null, [Validators.required, Validators.minLength(8), Validators.maxLength(50)]], }); @@ -121,7 +121,7 @@ export class SettingsComponent implements OnInit { } }); - console.log(this.isGoogle); + //console.log(this.isGoogle); // this.activatedRoute.data.subscribe(({ usuarioExtra }) => { @@ -230,8 +230,10 @@ export class SettingsComponent implements OnInit { // Update swiper this.profileIcon = usuarioExtra.iconoPerfil!; + + console.log(this.profileIcon); this.profileIcons.forEach(icon => { - if (parseInt(icon.name.split('C')[1]) === this.profileIcon) { + if (icon.name.split('C')[1] === this.profileIcon) { icon.class = 'active'; } }); @@ -282,7 +284,7 @@ export class SettingsComponent implements OnInit { event.target.classList.add('active'); this.profileIcon = +event.target.getAttribute('id')! + 1; - console.log(this.profileIcon); + //console.log(this.profileIcon); } } } From 0eec5f765dbd450802014e0bb5fa637e35ab30a5 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 12:44:37 -0600 Subject: [PATCH 02/30] corregir typo en password reset --- .../password-reset/init/password-reset-init.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html b/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html index d996676..59e46d4 100644 --- a/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html +++ b/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html @@ -15,7 +15,7 @@ style="color: #727070; font-weight: 700; font-size: 1.3rem" jhiTranslate="reset.request.title" > - RESET YOUR PASSWORDD + RESET YOUR PASSWORD

Enter the email address you used to register. From da8c8e5039fbeb680e8e171c5f9170d8236e673b Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 12:45:02 -0600 Subject: [PATCH 03/30] quitar iconos de modificacion --- .../entities/categoria/update/categoria-update.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/app/entities/categoria/update/categoria-update.component.html b/src/main/webapp/app/entities/categoria/update/categoria-update.component.html index 289ccb3..7bd40a1 100644 --- a/src/main/webapp/app/entities/categoria/update/categoria-update.component.html +++ b/src/main/webapp/app/entities/categoria/update/categoria-update.component.html @@ -49,7 +49,7 @@ class="btn btn-secondary ds-btn ds-btn-secondary" (click)="previousState()" > -  Cancel +  Cancel From 08a88c750ae856c2ba3797e88d321762ca95243c Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 12:46:07 -0600 Subject: [PATCH 04/30] mostrar nombre de categoria en dialogo de confirmacion para eliminar --- .../categoria/delete/categoria-delete-dialog.component.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html index 0289904..051d8fe 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html @@ -8,7 +8,11 @@

From d9904613a920c37bb96c5a63f64104108dc66a38 Mon Sep 17 00:00:00 2001 From: Paola Date: Sun, 18 Jul 2021 17:13:28 -0600 Subject: [PATCH 05/30] areglo de mensajes en alertas --- .../resources/i18n/messages_es.properties | 6 +++--- .../templates/mail/activationEmail.html | 4 ++-- .../account/activate/activate.component.html | 9 +++------ .../account/register/register.component.html | 12 +++++++++-- src/main/webapp/i18n/es/activate.json | 6 +++--- src/main/webapp/i18n/es/global.json | 4 ++-- src/main/webapp/i18n/es/register.json | 20 +++++++++---------- 7 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/main/resources/i18n/messages_es.properties b/src/main/resources/i18n/messages_es.properties index 32233bb..5742030 100644 --- a/src/main/resources/i18n/messages_es.properties +++ b/src/main/resources/i18n/messages_es.properties @@ -5,11 +5,11 @@ error.status=Estado: error.message=Mensaje: # Activation email -email.activation.title=Activación de DataSurvey +email.activation.title=Confirmación de correo con DataSurvey email.activation.greeting=¡Hola, {0}! -email.activation.text1=Su cuenta en DataSurvey ha sido creada. Por favor, haga clic en el siguiente enlace para activarla: +email.activation.text1=¡Nos alegra que sea parte de DataSurvey! Como último paso debe confirmar su dirección de correo haciendo clic en el siguiente enlace: email.activation.text2=Saludos, -email.signature=Equipo de DataSurvey. +email.signature=Equipo de DataSurvey # Creation email email.creation.text1=Su cuenta en DataSurvey ha sido creada. Por favor, haga clic en el siguiente enlace para utilizarla: diff --git a/src/main/resources/templates/mail/activationEmail.html b/src/main/resources/templates/mail/activationEmail.html index 4daaa73..cd90b5a 100644 --- a/src/main/resources/templates/mail/activationEmail.html +++ b/src/main/resources/templates/mail/activationEmail.html @@ -264,7 +264,7 @@ th:with="url=(@{|${baseUrl}/account/activate?key=${user.activationKey}|})" th:href="${url}" class="btn btn-primary" - >Activar cuentaConfirmar correo electrónico

@@ -293,7 +293,7 @@

Acerca de

-

DataSurvey es su compañero más cercano para poder recolectar información valiosa para usted.

+

DataSurvey es su compañero más cercano para poder recolectar información valiosa para usted

diff --git a/src/main/webapp/app/account/activate/activate.component.html b/src/main/webapp/app/account/activate/activate.component.html index f518965..bc17317 100644 --- a/src/main/webapp/app/account/activate/activate.component.html +++ b/src/main/webapp/app/account/activate/activate.component.html @@ -15,13 +15,12 @@ style="color: #727070; font-weight: 700; font-size: 1.3rem" jhiTranslate="activate.title" > - Activación de Cuenta + Registro Completado
- Your user account has been activated. - sign in +
-
- Your user could not be activated. Please use the registration form to sign up. -
+
-
+

REGISTRARSE

-

Ingrese sus datos para registrarse.

+

Ingrese sus datos para registrarse

+
+

+ ¡Gracias por registrarse en DataSurvey! +

+
+ +
+
Registration saved! Please check your email for confirmation.
diff --git a/src/main/webapp/i18n/es/activate.json b/src/main/webapp/i18n/es/activate.json index b2e394c..d18d3c7 100644 --- a/src/main/webapp/i18n/es/activate.json +++ b/src/main/webapp/i18n/es/activate.json @@ -1,9 +1,9 @@ { "activate": { - "title": "Activación de Cuenta", + "title": "Registro Completado", "messages": { - "success": "Su cuenta ha sido activada. Ya puede ", - "error": "Su cuenta no pudo ser activada. Por favor, regístrese en DataSurvey." + "success": "¡Felicidades! Su confirmación de correo fue exitosa ", + "error": "Ocurrió un error al confirmar su correo, por favor intente de nuevo" } } } diff --git a/src/main/webapp/i18n/es/global.json b/src/main/webapp/i18n/es/global.json index e924d2c..c9eb858 100644 --- a/src/main/webapp/i18n/es/global.json +++ b/src/main/webapp/i18n/es/global.json @@ -64,7 +64,7 @@ "info": { "authenticated": { "prefix": "Si desea ", - "link": "iniciar sesión", + "link": "Iniciar Sesión", "suffix": ", puede intentar con las cuentas predeterminadas:
- Administrador (usuario=\"admin\" y contraseña=\"admin\")
- Usuario (usuario=\"user\" y contraseña=\"user\").", "updateForm": "Ocurrió un error al actualizar su información, favor revisar los campos e intentar de nuevo", "passwordForm": "Ocurrió un error al actualizar su contraseña, favor revisar los campos e intentar de nuevo", @@ -113,7 +113,7 @@ "dev": "Development" }, "item-count": "Mostrando {{first}} - {{second}} de {{total}} elementos.", - "registerLink": "Registrarse" + "registerLink": "Crear una cuenta" }, "entity": { "action": { diff --git a/src/main/webapp/i18n/es/register.json b/src/main/webapp/i18n/es/register.json index b44c9af..8330eb5 100644 --- a/src/main/webapp/i18n/es/register.json +++ b/src/main/webapp/i18n/es/register.json @@ -2,23 +2,23 @@ "register": { "title": "Registro", "form": { - "button": "Guardar" + "button": "Registrarse" }, "messages": { "validate": { "login": { - "required": "Su nombre de usuario es obligatorio.", - "minlength": "Su nombre de usuario debe tener al menos 1 caracter.", - "maxlength": "Su nombre de usuario no puede tener más de 50 caracteres.", - "pattern": "Su nombre de usuario no es válido." + "required": "Su nombre de usuario es obligatorio", + "minlength": "Su nombre de usuario debe tener al menos 1 caracter", + "maxlength": "Su nombre de usuario no puede tener más de 50 caracteres", + "pattern": "Su nombre de usuario no es válido" } }, - "success": "¡Registro guardado! Por favor, revise su correo electrónico para confirmar.", - "adminsuccess": "¡Registro guardado! Por favor, revise el correo electrónico para confirmar.", + "success": "Revise su correo electrónico para confirmar su dirección de correo con DataSurvey", + "adminsuccess": "Revise su correo electrónico para confirmar su dirección de correo con DataSurvey", "error": { - "fail": "¡El registro ha fallado! Por favor, inténtelo de nuevo más tarde.", - "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." + "fail": "Ocurrió un error con el registro. Por favor inténtelo más tarde", + "userexists": "El correo electrónico ya existe. Ingrese otro ", + "emailexists": "El correo electrónico ya existe. Ingrese otro" } } } From e2f59ac3bcdc8062ffce6c76fbb09a0cd4067c30 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 17:42:31 -0600 Subject: [PATCH 06/30] =?UTF-8?q?centrar=20texto=20de=20di=C3=A1logo=20de?= =?UTF-8?q?=20confirmaci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../categoria/delete/categoria-delete-dialog.component.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html index 051d8fe..f08fadc 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html @@ -12,6 +12,7 @@ id="jhi-delete-categoria-heading" jhiTranslate="dataSurveyApp.categoria.delete.question" [translateValues]="{ nombre: categoria.nombre }" + style="text-align: center" > Are you sure you want to delete this category?

From 50dba9d79ba29af01394aea59f9cea44d4855bd5 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 17:48:49 -0600 Subject: [PATCH 07/30] =?UTF-8?q?mostrar=20nombre=20de=20categor=C3=ADas?= =?UTF-8?q?=20en=20mensajes=20de=20confirmaci=C3=B3n=20en=20lugar=20de=20I?= =?UTF-8?q?D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/i18n/es/categoria.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/i18n/es/categoria.json b/src/main/webapp/i18n/es/categoria.json index 1a7b898..6809772 100644 --- a/src/main/webapp/i18n/es/categoria.json +++ b/src/main/webapp/i18n/es/categoria.json @@ -9,10 +9,10 @@ "notFound": "Ninguna Categoría encontrada" }, "created": "Una nueva Categoría ha sido creada con el identificador {{ param }}", - "updated": "Una Categoría ha sido actualizado con el identificador {{ param }}", + "updated": "Los datos de la categoría {{ nombre }} han sido actualizados", "deleted": "Una Categoría ha sido eliminado con el identificador {{ param }}", "delete": { - "question": "¿Seguro que quiere eliminar Categoría {{ id }}?" + "question": "¿Seguro que quiere eliminar \"{{ nombre }}\"?" }, "detail": { "title": "Categoría" From a700cd8c46dee0ffb18f72e8417c35b562e03059 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 17:49:24 -0600 Subject: [PATCH 08/30] eliminar punto sobrante --- src/main/webapp/i18n/es/categoria.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/i18n/es/categoria.json b/src/main/webapp/i18n/es/categoria.json index 6809772..04bc510 100644 --- a/src/main/webapp/i18n/es/categoria.json +++ b/src/main/webapp/i18n/es/categoria.json @@ -23,7 +23,7 @@ "encuesta": "Encuesta", "plantilla": "Plantilla", "errors": { - "duplicateName": "Ya existe una categoría con ese nombre." + "duplicateName": "Ya existe una categoría con ese nombre" } } } From 5d0c87d8d67cc461ad56ecdb060b6d893672c244 Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Sun, 18 Jul 2021 18:02:06 -0600 Subject: [PATCH 09/30] =?UTF-8?q?arreglo=20de=20mensajes,=20validaciones?= =?UTF-8?q?=20y=20textos=20del=20restablecer=20contrase=C3=B1aa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit arreglos requeridos por calidad de las validaciones: textos de las alertas, textos de subtitulos y verificar que un usuario que se logueó por Google no pueda restablecer la contraseña --- .../datasurvey/web/rest/AccountResource.java | 6 ++++- .../web/rest/errors/ErrorConstants.java | 1 + .../rest/errors/UserIsGoogleException.java | 10 +++++++ .../resources/i18n/messages_es.properties | 6 ++--- .../init/password-reset-init.component.html | 26 ++++--------------- .../init/password-reset-init.component.ts | 6 ++++- .../account/register/register.component.ts | 2 ++ .../app/account/register/register.model.ts | 3 ++- .../account/settings/settings.component.html | 2 +- src/main/webapp/app/config/error.constants.ts | 1 + .../update/usuario-extra-update.component.ts | 3 ++- src/main/webapp/app/login/login.component.ts | 1 + src/main/webapp/i18n/es/reset.json | 9 ++++--- 13 files changed, 43 insertions(+), 33 deletions(-) create mode 100644 src/main/java/org/datasurvey/web/rest/errors/UserIsGoogleException.java diff --git a/src/main/java/org/datasurvey/web/rest/AccountResource.java b/src/main/java/org/datasurvey/web/rest/AccountResource.java index 6b830e9..e175751 100644 --- a/src/main/java/org/datasurvey/web/rest/AccountResource.java +++ b/src/main/java/org/datasurvey/web/rest/AccountResource.java @@ -168,7 +168,11 @@ public class AccountResource { public void requestPasswordReset(@RequestBody String mail) { Optional user = userService.requestPasswordReset(mail); if (user.isPresent()) { - mailService.sendPasswordResetMail(user.get()); + if (!user.get().getFirstName().equals("IsGoogle")) { + mailService.sendPasswordResetMail(user.get()); + } else { + throw new UserIsGoogleException(); + } } else { // Pretend the request has been successful to prevent checking which emails really exist // but log that an invalid attempt has been made diff --git a/src/main/java/org/datasurvey/web/rest/errors/ErrorConstants.java b/src/main/java/org/datasurvey/web/rest/errors/ErrorConstants.java index 109466d..6ae058c 100644 --- a/src/main/java/org/datasurvey/web/rest/errors/ErrorConstants.java +++ b/src/main/java/org/datasurvey/web/rest/errors/ErrorConstants.java @@ -13,6 +13,7 @@ public final class ErrorConstants { public static final URI EMAIL_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/email-already-used"); public static final URI LOGIN_ALREADY_USED_TYPE = URI.create(PROBLEM_BASE_URL + "/login-already-used"); public static final URI EMAIL_NOT_EXISTS_TYPE = URI.create(PROBLEM_BASE_URL + "/email-not-exists"); + public static final URI USER_IS_GOOGLE_TYOE = URI.create(PROBLEM_BASE_URL + "/user-is-google"); private ErrorConstants() {} } diff --git a/src/main/java/org/datasurvey/web/rest/errors/UserIsGoogleException.java b/src/main/java/org/datasurvey/web/rest/errors/UserIsGoogleException.java new file mode 100644 index 0000000..3ab193b --- /dev/null +++ b/src/main/java/org/datasurvey/web/rest/errors/UserIsGoogleException.java @@ -0,0 +1,10 @@ +package org.datasurvey.web.rest.errors; + +public class UserIsGoogleException extends BadRequestAlertException { + + private static final long serialVersionUID = 1L; + + public UserIsGoogleException() { + super(ErrorConstants.USER_IS_GOOGLE_TYOE, "User Is Google", "userManagement", "userisgoogle"); + } +} diff --git a/src/main/resources/i18n/messages_es.properties b/src/main/resources/i18n/messages_es.properties index 32233bb..4be46d2 100644 --- a/src/main/resources/i18n/messages_es.properties +++ b/src/main/resources/i18n/messages_es.properties @@ -15,13 +15,13 @@ email.signature=Equipo de DataSurvey. email.creation.text1=Su cuenta en DataSurvey ha sido creada. Por favor, haga clic en el siguiente enlace para utilizarla: # Reset email -email.reset.title=Reinicio de contraseña de DataSurvey +email.reset.title=Restablecer contraseña de DataSurvey email.reset.greeting=¡Hola, {0}! -email.reset.text1=Se ha solicitado el reinicio de la contraseña para su cuenta en DataSurvey. Por favor, haga clic en el siguiente enlace para reiniciarla: +email.reset.text1=Se ha solicitado una modificación de contraseña para su cuenta en DataSurvey. Por favor haga clic en el siguiente enlace para restablecerla. email.reset.text2=Saludos, # Password Restored Mail -email.restored.title=Se restaleció su contraseña en DataSurvey +email.restored.title=Se restableció su contraseña en DataSurvey email.restored.greeting=¡Hola, {0}! email.restored.text1=Se ha restablecido correctamente su contraseña en DataSurvey. email.restored.text2=Saludos, diff --git a/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html b/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html index d996676..4c988d0 100644 --- a/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html +++ b/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html @@ -27,12 +27,15 @@
- Email no exists! Please choose another one. + Email no exists! +
+
+ No cuenta con el permiso de restablecer su contraseña al haber activado su cuenta por medio de Google
- + Your email is invalid. - - - Your email is required to be at least 5 characters. - - - - Your email cannot be longer than 100 characters. - - - Se requiere un correo electrónico válido. -
diff --git a/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts b/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts index 2d63177..09768a8 100644 --- a/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts +++ b/src/main/webapp/app/account/password-reset/init/password-reset-init.component.ts @@ -3,7 +3,7 @@ import { FormBuilder, Validators } from '@angular/forms'; import { PasswordResetInitService } from './password-reset-init.service'; import { HttpErrorResponse } from '@angular/common/http'; -import { EMAIL_NOT_EXISTS_TYPE } from '../../../config/error.constants'; +import { EMAIL_NOT_EXISTS_TYPE, USER_IS_GOOGLE_TYPE } from '../../../config/error.constants'; @Component({ selector: 'jhi-password-reset-init', @@ -13,6 +13,7 @@ export class PasswordResetInitComponent implements AfterViewInit { @ViewChild('email', { static: false }) email?: ElementRef; errorEmailNotExists = false; + errorUserIsGoogle = false; error = false; success = false; resetRequestForm = this.fb.group({ @@ -29,6 +30,7 @@ export class PasswordResetInitComponent implements AfterViewInit { requestReset(): void { this.errorEmailNotExists = false; + this.errorUserIsGoogle = false; this.passwordResetInitService.save(this.resetRequestForm.get(['email'])!.value).subscribe( () => (this.success = true), response => this.processError(response) @@ -42,6 +44,8 @@ export class PasswordResetInitComponent implements AfterViewInit { processError(response: HttpErrorResponse): void { if (response.status === 400 && response.error.type === EMAIL_NOT_EXISTS_TYPE) { this.errorEmailNotExists = true; + } else if (response.status === 400 && response.error.type === USER_IS_GOOGLE_TYPE) { + this.errorUserIsGoogle = true; } else { this.error = true; } diff --git a/src/main/webapp/app/account/register/register.component.ts b/src/main/webapp/app/account/register/register.component.ts index ddcc966..a1727ff 100644 --- a/src/main/webapp/app/account/register/register.component.ts +++ b/src/main/webapp/app/account/register/register.component.ts @@ -84,6 +84,7 @@ export class RegisterComponent implements AfterViewInit { const login = this.registerForm.get(['email'])!.value; const email = this.registerForm.get(['email'])!.value; const name = this.registerForm.get(['name'])!.value; + const firstName = 'normalUser'; this.registerService .save({ @@ -92,6 +93,7 @@ export class RegisterComponent implements AfterViewInit { password, langKey: this.translateService.currentLang, name, + firstName, profileIcon: this.profileIcon, isAdmin: 0, isGoogle: 0, diff --git a/src/main/webapp/app/account/register/register.model.ts b/src/main/webapp/app/account/register/register.model.ts index 18a4688..ff15f58 100644 --- a/src/main/webapp/app/account/register/register.model.ts +++ b/src/main/webapp/app/account/register/register.model.ts @@ -7,6 +7,7 @@ export class Registration { public name: string, public profileIcon: number, public isAdmin: number, - public isGoogle: number + public isGoogle: number, + public firstName: string ) {} } diff --git a/src/main/webapp/app/account/settings/settings.component.html b/src/main/webapp/app/account/settings/settings.component.html index 37694de..738b1c0 100644 --- a/src/main/webapp/app/account/settings/settings.component.html +++ b/src/main/webapp/app/account/settings/settings.component.html @@ -246,7 +246,7 @@
- +
diff --git a/src/main/webapp/app/config/error.constants.ts b/src/main/webapp/app/config/error.constants.ts index dc85cc6..ea24e19 100644 --- a/src/main/webapp/app/config/error.constants.ts +++ b/src/main/webapp/app/config/error.constants.ts @@ -2,3 +2,4 @@ export const PROBLEM_BASE_URL = 'https://www.jhipster.tech/problem'; export const EMAIL_ALREADY_USED_TYPE = PROBLEM_BASE_URL + '/email-already-used'; export const LOGIN_ALREADY_USED_TYPE = PROBLEM_BASE_URL + '/login-already-used'; export const EMAIL_NOT_EXISTS_TYPE = PROBLEM_BASE_URL + '/email-not-exists'; +export const USER_IS_GOOGLE_TYPE = PROBLEM_BASE_URL + '/user-is-google'; diff --git a/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.ts b/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.ts index aba080d..4f61529 100644 --- a/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.ts +++ b/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.ts @@ -82,7 +82,7 @@ export class UsuarioExtraUpdateComponent { const login = this.registerForm.get(['email'])!.value; const email = this.registerForm.get(['email'])!.value; const name = this.registerForm.get(['name'])!.value; - + const firstName = 'userNormal'; this.registerService .save({ login, @@ -90,6 +90,7 @@ export class UsuarioExtraUpdateComponent { password, langKey: this.translateService.currentLang, name, + firstName, profileIcon: this.profileIcon, isAdmin: 1, isGoogle: 0, diff --git a/src/main/webapp/app/login/login.component.ts b/src/main/webapp/app/login/login.component.ts index 1ae75e2..b0a4685 100644 --- a/src/main/webapp/app/login/login.component.ts +++ b/src/main/webapp/app/login/login.component.ts @@ -142,6 +142,7 @@ export class LoginComponent implements OnInit, AfterViewInit { password: this.user.id, langKey: this.translateService.currentLang, name: this.user.name, + firstName: 'IsGoogle', profileIcon: this.randomProfilePic(), isAdmin: 0, isGoogle: 1, diff --git a/src/main/webapp/i18n/es/reset.json b/src/main/webapp/i18n/es/reset.json index 2614281..ed3516f 100644 --- a/src/main/webapp/i18n/es/reset.json +++ b/src/main/webapp/i18n/es/reset.json @@ -6,10 +6,11 @@ "button": "Restablecer la contraseña" }, "messages": { - "info": "Introduzca la dirección de correo electrónico que utilizó para registrarse", - "success": "Revise su correo electrónico para obtener más información sobre cómo restablecer su contraseña.", + "info": "Introduzca su dirección de correo electrónico", + "success": "Revise su correo electrónico para restablecer su contraseña.", "error": { - "emailnotexists": "¡El correo electrónico no se encuentra registrado en el sistema! Por favor, ingrese otro email." + "emailnotexists": "No existe una cuenta creada con esa dirección de correo electrónico", + "userisgoogle": "No cuenta con el permiso de restablecer su contraseña al haber activado su cuenta por medio de Google" } } }, @@ -20,7 +21,7 @@ }, "messages": { "info": "Elija una contraseña nueva", - "success": "Su contraseña ha sido restablecida. Por favor, ", + "success": "Su contraseña ha sido restablecida.", "keymissing": "Falta la clave de reinicio.", "error": "Su contraseña no puede ser restablecida. Recuerde que una solicitud de reinicio de contraseña sólo es válida durante 24 horas." } From 389f24b578a1143de8730a94623eb4f194c6c045 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 18:09:29 -0600 Subject: [PATCH 10/30] Revert "Eliminar modulo de vista de categorias" This reverts commit e3e9bb1fc51d2ec26d00c29a99f68ee1b84b8677. --- .../entities/categoria/categoria.module.ts | 3 +- .../detail/categoria-detail.component.html | 36 ++++++++++++++++++ .../detail/categoria-detail.component.spec.ts | 38 +++++++++++++++++++ .../detail/categoria-detail.component.ts | 24 ++++++++++++ .../route/categoria-routing.module.ts | 9 +++++ 5 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 src/main/webapp/app/entities/categoria/detail/categoria-detail.component.html create mode 100644 src/main/webapp/app/entities/categoria/detail/categoria-detail.component.spec.ts create mode 100644 src/main/webapp/app/entities/categoria/detail/categoria-detail.component.ts diff --git a/src/main/webapp/app/entities/categoria/categoria.module.ts b/src/main/webapp/app/entities/categoria/categoria.module.ts index 59f2dd3..96383a6 100644 --- a/src/main/webapp/app/entities/categoria/categoria.module.ts +++ b/src/main/webapp/app/entities/categoria/categoria.module.ts @@ -1,13 +1,14 @@ import { NgModule } from '@angular/core'; import { SharedModule } from 'app/shared/shared.module'; import { CategoriaComponent } from './list/categoria.component'; +import { CategoriaDetailComponent } from './detail/categoria-detail.component'; import { CategoriaUpdateComponent } from './update/categoria-update.component'; import { CategoriaDeleteDialogComponent } from './delete/categoria-delete-dialog.component'; import { CategoriaRoutingModule } from './route/categoria-routing.module'; @NgModule({ imports: [SharedModule, CategoriaRoutingModule], - declarations: [CategoriaComponent, CategoriaUpdateComponent, CategoriaDeleteDialogComponent], + declarations: [CategoriaComponent, CategoriaDetailComponent, CategoriaUpdateComponent, CategoriaDeleteDialogComponent], entryComponents: [CategoriaDeleteDialogComponent], }) export class CategoriaModule {} diff --git a/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.html b/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.html new file mode 100644 index 0000000..9531c6c --- /dev/null +++ b/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.html @@ -0,0 +1,36 @@ +
+
+
+

Categoria

+ +
+ + + + + +
+
ID
+
+ {{ categoria.id }} +
+
Nombre
+
+ {{ categoria.nombre }} +
+
Estado
+
+ {{ categoria.estado }} +
+
+ + + + +
+
+
diff --git a/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.spec.ts b/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.spec.ts new file mode 100644 index 0000000..506ac72 --- /dev/null +++ b/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.spec.ts @@ -0,0 +1,38 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; +import { of } from 'rxjs'; + +import { CategoriaDetailComponent } from './categoria-detail.component'; + +describe('Component Tests', () => { + describe('Categoria Management Detail Component', () => { + let comp: CategoriaDetailComponent; + let fixture: ComponentFixture; + + beforeEach(() => { + TestBed.configureTestingModule({ + declarations: [CategoriaDetailComponent], + providers: [ + { + provide: ActivatedRoute, + useValue: { data: of({ categoria: { id: 123 } }) }, + }, + ], + }) + .overrideTemplate(CategoriaDetailComponent, '') + .compileComponents(); + fixture = TestBed.createComponent(CategoriaDetailComponent); + comp = fixture.componentInstance; + }); + + describe('OnInit', () => { + it('Should load categoria on init', () => { + // WHEN + comp.ngOnInit(); + + // THEN + expect(comp.categoria).toEqual(expect.objectContaining({ id: 123 })); + }); + }); + }); +}); diff --git a/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.ts b/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.ts new file mode 100644 index 0000000..36ecdcf --- /dev/null +++ b/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { ICategoria } from '../categoria.model'; + +@Component({ + selector: 'jhi-categoria-detail', + templateUrl: './categoria-detail.component.html', +}) +export class CategoriaDetailComponent implements OnInit { + categoria: ICategoria | null = null; + + constructor(protected activatedRoute: ActivatedRoute) {} + + ngOnInit(): void { + this.activatedRoute.data.subscribe(({ categoria }) => { + this.categoria = categoria; + }); + } + + previousState(): void { + window.history.back(); + } +} diff --git a/src/main/webapp/app/entities/categoria/route/categoria-routing.module.ts b/src/main/webapp/app/entities/categoria/route/categoria-routing.module.ts index 95acd27..d48d560 100644 --- a/src/main/webapp/app/entities/categoria/route/categoria-routing.module.ts +++ b/src/main/webapp/app/entities/categoria/route/categoria-routing.module.ts @@ -3,6 +3,7 @@ import { RouterModule, Routes } from '@angular/router'; import { UserRouteAccessService } from 'app/core/auth/user-route-access.service'; import { CategoriaComponent } from '../list/categoria.component'; +import { CategoriaDetailComponent } from '../detail/categoria-detail.component'; import { CategoriaUpdateComponent } from '../update/categoria-update.component'; import { CategoriaRoutingResolveService } from './categoria-routing-resolve.service'; @@ -12,6 +13,14 @@ const categoriaRoute: Routes = [ component: CategoriaComponent, canActivate: [UserRouteAccessService], }, + { + path: ':id/view', + component: CategoriaDetailComponent, + resolve: { + categoria: CategoriaRoutingResolveService, + }, + canActivate: [UserRouteAccessService], + }, { path: 'new', component: CategoriaUpdateComponent, From 42f1b2eeff5b179d1c2b5aeb859ec599713ff222 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 20:54:27 -0600 Subject: [PATCH 11/30] =?UTF-8?q?dejar=20de=20forzar=20la=20adici=C3=B3n?= =?UTF-8?q?=20de=20"Otra"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../delete/categoria-delete-dialog.component.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts index 14225df..bf4e321 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts @@ -26,7 +26,6 @@ export class CategoriaDeleteDialogComponent { } confirmDelete(categoria: ICategoria): void { - this.ensureNulaExists(); const categoriaNula = new Categoria(0, 'Otra', EstadoCategoria.ACTIVE); this.getEncuestas(categoria); if (this.encuestas) { @@ -40,15 +39,6 @@ export class CategoriaDeleteDialogComponent { this.activeModal.close('deleted'); }); } - ensureNulaExists(): void { - const categoriaNula = new Categoria(0, 'Otra', EstadoCategoria.ACTIVE); - const categoria = this.categoriaService.find(0); - if (categoria) { - this.categoriaService.update(categoriaNula); - } else { - this.categoriaService.create(categoriaNula); - } - } protected getEncuestas(categoria: ICategoria): void { this.encuestaService.query().subscribe(res => { From 1d75fb6960e1a6804e5302ed6f27ec803e4b021e Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 20:56:53 -0600 Subject: [PATCH 12/30] =?UTF-8?q?deshabilitar=20funciones=20de=20modificac?= =?UTF-8?q?i=C3=B3n=20para=20la=20categor=C3=ADa=20nula?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../categoria/detail/categoria-detail.component.html | 11 ++++++++--- .../entities/categoria/list/categoria.component.html | 12 +++++------- .../categoria/update/categoria-update.component.html | 1 + .../categoria/update/categoria-update.component.ts | 2 ++ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.html b/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.html index 9531c6c..51877e5 100644 --- a/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.html +++ b/src/main/webapp/app/entities/categoria/detail/categoria-detail.component.html @@ -25,11 +25,16 @@ -
diff --git a/src/main/webapp/app/entities/categoria/list/categoria.component.html b/src/main/webapp/app/entities/categoria/list/categoria.component.html index 7933f24..5042460 100644 --- a/src/main/webapp/app/entities/categoria/list/categoria.component.html +++ b/src/main/webapp/app/entities/categoria/list/categoria.component.html @@ -40,9 +40,9 @@ - {{ categoria.nombre }} - {{ categoria.estado }} - + {{ categoria.nombre }} + {{ categoria.estado }} +
-
diff --git a/src/main/webapp/app/entities/categoria/update/categoria-update.component.html b/src/main/webapp/app/entities/categoria/update/categoria-update.component.html index 7bd40a1..827ff29 100644 --- a/src/main/webapp/app/entities/categoria/update/categoria-update.component.html +++ b/src/main/webapp/app/entities/categoria/update/categoria-update.component.html @@ -53,6 +53,7 @@ diff --git a/src/main/webapp/i18n/es/categoria.json b/src/main/webapp/i18n/es/categoria.json index 04bc510..31f6767 100644 --- a/src/main/webapp/i18n/es/categoria.json +++ b/src/main/webapp/i18n/es/categoria.json @@ -4,15 +4,15 @@ "home": { "title": "Categorías", "refreshListLabel": "Refrescar lista", - "createLabel": "Crear nueva Categoría", - "createOrEditLabel": "Datos de Categoría", - "notFound": "Ninguna Categoría encontrada" + "createLabel": "Crear nueva categoría", + "createOrEditLabel": "Datos de categoría", + "notFound": "Ninguna categoría encontrada" }, - "created": "Una nueva Categoría ha sido creada con el identificador {{ param }}", + "created": "Una nueva categoría ha sido creada con el identificador {{ param }}", "updated": "Los datos de la categoría {{ nombre }} han sido actualizados", - "deleted": "Una Categoría ha sido eliminado con el identificador {{ param }}", + "deleted": "La categoría {{ nombre }} ha sido deshabilitada", "delete": { - "question": "¿Seguro que quiere eliminar \"{{ nombre }}\"?" + "question": "¿Seguro que quiere cambiar el estado de \"{{ nombre }}\"?" }, "detail": { "title": "Categoría" From aa2f31208ef34b630330add6e0081868aec4f4c3 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 21:40:55 -0600 Subject: [PATCH 15/30] cargar encuestas desde el inicio --- .../categoria/delete/categoria-delete-dialog.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts index a4a63ba..9e35456 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts @@ -19,7 +19,9 @@ export class CategoriaDeleteDialogComponent { protected categoriaService: CategoriaService, protected activeModal: NgbActiveModal, protected encuestaService: EncuestaService - ) {} + ) { + this.getEncuestas(); + } cancel(): void { this.activeModal.dismiss(); From e0728e27cdf838e1b0a669479fa10a3a757a3391 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 21:41:26 -0600 Subject: [PATCH 16/30] solamente cargar encuestas --- .../delete/categoria-delete-dialog.component.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts index 9e35456..bf63638 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts @@ -29,13 +29,8 @@ export class CategoriaDeleteDialogComponent { confirmDelete(categoria: ICategoria): void { const categoriaNula = new Categoria(0, 'Otra', EstadoCategoria.ACTIVE); - this.getEncuestas(categoria); - if (this.encuestas) { - this.encuestas!.forEach(encuesta => { - encuesta.categoria = categoriaNula; - this.encuestaService.update(encuesta); - }); - } + this.getEncuestas(); + debugger; if (categoria.estado == EstadoCategoria.INACTIVE) { categoria.estado = EstadoCategoria.ACTIVE; } else { @@ -46,7 +41,7 @@ export class CategoriaDeleteDialogComponent { }); } - protected getEncuestas(categoria: ICategoria): void { + getEncuestas(): void { this.encuestaService.query().subscribe(res => { this.encuestas = res.body ?? []; }); From 5dfce2c2a970293fba86b48154b2cc37741de9fd Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 21:41:51 -0600 Subject: [PATCH 17/30] modificar solamente encuestas que coincidan --- .../delete/categoria-delete-dialog.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts index bf63638..910cd35 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts @@ -34,6 +34,13 @@ export class CategoriaDeleteDialogComponent { if (categoria.estado == EstadoCategoria.INACTIVE) { categoria.estado = EstadoCategoria.ACTIVE; } else { + this.encuestas!.forEach(encuesta => { + debugger; + if (encuesta.categoria != null && encuesta.categoria!.id === categoria.id) { + encuesta.categoria = categoriaNula; + this.encuestaService.update(encuesta); + } + }); categoria.estado = EstadoCategoria.INACTIVE; } this.categoriaService.update(categoria).subscribe(() => { @@ -45,10 +52,5 @@ export class CategoriaDeleteDialogComponent { this.encuestaService.query().subscribe(res => { this.encuestas = res.body ?? []; }); - if (this.encuestas) { - this.encuestasFiltradas = this.encuestas.filter(encuesta => { - encuesta.categoria!.id === categoria.id; - }); - } } } From 2e25dd8c2b60cae243857123cce5030cca32502c Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 21:51:06 -0600 Subject: [PATCH 18/30] eliminar debugger --- .../categoria/delete/categoria-delete-dialog.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts index 910cd35..3bde63b 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts @@ -35,7 +35,6 @@ export class CategoriaDeleteDialogComponent { categoria.estado = EstadoCategoria.ACTIVE; } else { this.encuestas!.forEach(encuesta => { - debugger; if (encuesta.categoria != null && encuesta.categoria!.id === categoria.id) { encuesta.categoria = categoriaNula; this.encuestaService.update(encuesta); From 6ea08bacd4fc0d0e763799c079f0ab9230118d82 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 21:56:20 -0600 Subject: [PATCH 19/30] =?UTF-8?q?arreglar=20actualizaci=C3=B3n=20de=20encu?= =?UTF-8?q?estas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../categoria-delete-dialog.component.ts | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts index 3bde63b..dbfee06 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts @@ -1,8 +1,11 @@ +import { HttpResponse } from '@angular/common/http'; import { Component } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { IEncuesta } from 'app/entities/encuesta/encuesta.model'; import { EncuestaService } from 'app/entities/encuesta/service/encuesta.service'; import { EstadoCategoria } from 'app/entities/enumerations/estado-categoria.model'; +import { Observable } from 'rxjs'; +import { finalize, map } from 'rxjs/operators'; import { Categoria, ICategoria } from '../categoria.model'; import { CategoriaService } from '../service/categoria.service'; @@ -37,7 +40,7 @@ export class CategoriaDeleteDialogComponent { this.encuestas!.forEach(encuesta => { if (encuesta.categoria != null && encuesta.categoria!.id === categoria.id) { encuesta.categoria = categoriaNula; - this.encuestaService.update(encuesta); + this.subscribeToSaveResponse(this.encuestaService.update(encuesta)); } }); categoria.estado = EstadoCategoria.INACTIVE; @@ -52,4 +55,23 @@ export class CategoriaDeleteDialogComponent { this.encuestas = res.body ?? []; }); } + + protected subscribeToSaveResponse(result: Observable>): void { + result.pipe(finalize(() => this.onSaveFinalize())).subscribe( + () => this.onSaveSuccess(), + () => this.onSaveError() + ); + } + + protected onSaveFinalize(): void { + // this.isSaving = false; + } + + protected onSaveSuccess(): void { + // this.previousState(); + } + + protected onSaveError(): void { + // Api for inheritance. + } } From 53aa021001d065c100cf0f1f355b0a45994bb3ec Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Sun, 18 Jul 2021 21:57:02 -0600 Subject: [PATCH 20/30] Modificacion si un firstName esta nulo --- src/main/java/org/datasurvey/web/rest/AccountResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/datasurvey/web/rest/AccountResource.java b/src/main/java/org/datasurvey/web/rest/AccountResource.java index e175751..361be3a 100644 --- a/src/main/java/org/datasurvey/web/rest/AccountResource.java +++ b/src/main/java/org/datasurvey/web/rest/AccountResource.java @@ -168,7 +168,7 @@ public class AccountResource { public void requestPasswordReset(@RequestBody String mail) { Optional user = userService.requestPasswordReset(mail); if (user.isPresent()) { - if (!user.get().getFirstName().equals("IsGoogle")) { + if (user.get().getFirstName() == null || (!user.get().getFirstName().equals("IsGoogle"))) { mailService.sendPasswordResetMail(user.get()); } else { throw new UserIsGoogleException(); From 017d6bd69b847fa1785b0587509c0ade6adae284 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Sun, 18 Jul 2021 21:57:44 -0600 Subject: [PATCH 21/30] eliminar debugger faltante --- .../categoria/delete/categoria-delete-dialog.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts index dbfee06..df89d70 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.ts @@ -33,7 +33,6 @@ export class CategoriaDeleteDialogComponent { confirmDelete(categoria: ICategoria): void { const categoriaNula = new Categoria(0, 'Otra', EstadoCategoria.ACTIVE); this.getEncuestas(); - debugger; if (categoria.estado == EstadoCategoria.INACTIVE) { categoria.estado = EstadoCategoria.ACTIVE; } else { From 94b1e7ed8d1238e675525d0560388fa5621e5440 Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Sun, 18 Jul 2021 22:16:50 -0600 Subject: [PATCH 22/30] modificacion de correo datasurvey en emails --- src/main/resources/templates/mail/activationEmail.html | 2 +- src/main/resources/templates/mail/creationEmail.html | 2 +- src/main/resources/templates/mail/passwordResetEmail.html | 2 +- src/main/resources/templates/mail/passwordRestoredEmail.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/templates/mail/activationEmail.html b/src/main/resources/templates/mail/activationEmail.html index 4daaa73..9576e08 100644 --- a/src/main/resources/templates/mail/activationEmail.html +++ b/src/main/resources/templates/mail/activationEmail.html @@ -304,7 +304,7 @@

Información de contacto

    -
  • datasurvey@gmail.com
  • +
  • datasurveyapp@gmail.com
diff --git a/src/main/resources/templates/mail/creationEmail.html b/src/main/resources/templates/mail/creationEmail.html index 2bc90eb..68b86f5 100644 --- a/src/main/resources/templates/mail/creationEmail.html +++ b/src/main/resources/templates/mail/creationEmail.html @@ -304,7 +304,7 @@

Información de contacto

    -
  • datasurvey@gmail.com
  • +
  • datasurveyapp@gmail.com
diff --git a/src/main/resources/templates/mail/passwordResetEmail.html b/src/main/resources/templates/mail/passwordResetEmail.html index b235f94..1742a3f 100644 --- a/src/main/resources/templates/mail/passwordResetEmail.html +++ b/src/main/resources/templates/mail/passwordResetEmail.html @@ -304,7 +304,7 @@

Información de contacto

    -
  • datasurvey@gmail.com
  • +
  • datasurveyapp@gmail.com
diff --git a/src/main/resources/templates/mail/passwordRestoredEmail.html b/src/main/resources/templates/mail/passwordRestoredEmail.html index e1c4082..6dcebd1 100644 --- a/src/main/resources/templates/mail/passwordRestoredEmail.html +++ b/src/main/resources/templates/mail/passwordRestoredEmail.html @@ -267,7 +267,7 @@ >If you did not make this change, please notify the following email immediately - datasurvey@gmail.com + datasurveyapp@gmail.com

@@ -306,7 +306,7 @@

Información de contacto

    -
  • datasurvey@gmail.com
  • +
  • datasurveyapp@gmail.com
From 16cf1989aa65aeee436a92aa68dce8df1803ce26 Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Sun, 18 Jul 2021 22:40:47 -0600 Subject: [PATCH 23/30] cambios de textos y validaciones requeridos por QA --- ...parametro-aplicacion-update.component.html | 68 +++++++------------ .../parametro-aplicacion-update.component.ts | 20 ++++-- .../webapp/i18n/es/parametroAplicacion.json | 3 +- 3 files changed, 41 insertions(+), 50 deletions(-) diff --git a/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html b/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html index c250c2e..0e4eb55 100644 --- a/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html +++ b/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html @@ -3,10 +3,10 @@
-

Parámetros de la aplicación

+

Configuración

-

Información de los parámetros que se permiten para la creación de las encuestas dentro de DataSurvey.

+

Configuración de parámetros de DataSurvey.

@@ -37,12 +37,10 @@
-

Días para Encuestas

+

Duración de una encuesta

-

- Editar la cantidad mínima y máxima de los días que se permitirá para la creación de las encuestas dentro de DataSurvey. -

+

Configurar la duración mínima y máxima para las encuestas publicadas

@@ -67,20 +65,17 @@ > This field is required. + - This field should be a number. - - - Este campo no puede ser mayor que 1 + Este campo debe ser mayor que 1 y menor que 14
@@ -105,20 +100,17 @@ > This field is required. + - This field should be a number. - - - Este campo no puede ser mayor que 1 + Este campo debe ser mayor que 1 y menor que 14 @@ -130,12 +122,10 @@
-

Preguntas para Encuestas

+

Cantidad de preguntas

-

- Editar la cantidad mínima y máxima de las preguntas que se permitirán para la creación de las encuestas dentro de DataSurvey. -

+

Configurar la cantidad mínima y máxima de preguntas por encuesta

@@ -160,20 +150,17 @@ > This field is required. + - This field should be a number. - - - Este campo no puede ser mayor que 1 + Este campo debe ser mayor que 1 y menor que 40 @@ -196,20 +183,17 @@ > This field is required. + - This field should be a integer number. - - - Este campo no puede ser mayor que 1 + Este campo debe ser mayor que 1 y menor que 40 diff --git a/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.ts b/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.ts index 0e9c33d..be79f0d 100644 --- a/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.ts +++ b/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { HttpResponse } from '@angular/common/http'; import { FormBuilder, Validators } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; +import { Router, ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { finalize } from 'rxjs/operators'; @@ -24,16 +24,17 @@ export class ParametroAplicacionUpdateComponent implements OnInit { editForm = this.fb.group({ id: [], - maxDiasEncuesta: [null, [Validators.required, Validators.pattern(/^[0-9]\d*$/), Validators.min(1)]], - minDiasEncuesta: [null, [Validators.required, Validators.pattern(/^[0-9]\d*$/), Validators.min(1)]], - maxCantidadPreguntas: [null, [Validators.required, Validators.pattern(/^[0-9]\d*$/), Validators.min(1)]], - minCantidadPreguntas: [null, [Validators.required, Validators.pattern(/^[0-9]\d*$/), Validators.min(1)]], + maxDiasEncuesta: [null, [Validators.required, Validators.pattern(/^[0-9]\d*$/), Validators.min(1), Validators.max(14)]], + minDiasEncuesta: [null, [Validators.required, Validators.pattern(/^[0-9]\d*$/), Validators.min(1), Validators.max(14)]], + maxCantidadPreguntas: [null, [Validators.required, Validators.pattern(/^[0-9]\d*$/), Validators.min(1), Validators.max(40)]], + minCantidadPreguntas: [null, [Validators.required, Validators.pattern(/^[0-9]\d*$/), Validators.min(1), Validators.max(40)]], }); constructor( protected parametroAplicacionService: ParametroAplicacionService, protected activatedRoute: ActivatedRoute, - protected fb: FormBuilder + protected fb: FormBuilder, + private router: Router ) {} ngOnInit(): void { @@ -89,9 +90,14 @@ export class ParametroAplicacionUpdateComponent implements OnInit { } protected onSaveSuccess(): void { - this.previousState(); + (this.success = true), this.windowReload(); } + windowReload() { + this.router.navigate(['parametro-aplicacion/1/edit']).then(() => { + window.location.reload(); + }); + } protected onSaveError(): void { // Api for inheritance. } diff --git a/src/main/webapp/i18n/es/parametroAplicacion.json b/src/main/webapp/i18n/es/parametroAplicacion.json index 0ddcef7..4b200c6 100644 --- a/src/main/webapp/i18n/es/parametroAplicacion.json +++ b/src/main/webapp/i18n/es/parametroAplicacion.json @@ -21,7 +21,8 @@ "maxDiasEncuesta": "Max Dias Encuesta", "minDiasEncuesta": "Min Dias Encuesta", "maxCantidadPreguntas": "Max Cantidad Preguntas", - "minCantidadPreguntas": "Min Cantidad Preguntas" + "minCantidadPreguntas": "Min Cantidad Preguntas", + "datoInvalido": "Este dato no es válido" } } } From 17445e28b449bea612188f3fe7b062fcb6ccd813 Mon Sep 17 00:00:00 2001 From: Paola Date: Sun, 18 Jul 2021 23:01:27 -0600 Subject: [PATCH 24/30] arreglos mensajes de alerta en categorias --- .../categoria/delete/categoria-delete-dialog.component.html | 6 +----- .../app/entities/categoria/list/categoria.component.html | 6 ++++-- .../app/entities/categoria/list/categoria.component.ts | 2 ++ src/main/webapp/i18n/es/categoria.json | 4 +++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html index 9c1ee95..ceb258b 100644 --- a/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html +++ b/src/main/webapp/app/entities/categoria/delete/categoria-delete-dialog.component.html @@ -1,9 +1,5 @@
- + - + + +
No categorias found diff --git a/src/main/webapp/app/entities/categoria/list/categoria.component.ts b/src/main/webapp/app/entities/categoria/list/categoria.component.ts index f7a7735..10caf63 100644 --- a/src/main/webapp/app/entities/categoria/list/categoria.component.ts +++ b/src/main/webapp/app/entities/categoria/list/categoria.component.ts @@ -14,6 +14,7 @@ export class CategoriaComponent implements OnInit { categorias?: ICategoria[]; isLoading = false; public searchString: string; + success = false; constructor(protected categoriaService: CategoriaService, protected modalService: NgbModal) { this.searchString = ''; @@ -48,6 +49,7 @@ export class CategoriaComponent implements OnInit { // unsubscribe not needed because closed completes on modal close modalRef.closed.subscribe(reason => { if (reason === 'deleted') { + this.success = true; this.loadAll(); } }); diff --git a/src/main/webapp/i18n/es/categoria.json b/src/main/webapp/i18n/es/categoria.json index 31f6767..a385866 100644 --- a/src/main/webapp/i18n/es/categoria.json +++ b/src/main/webapp/i18n/es/categoria.json @@ -12,7 +12,9 @@ "updated": "Los datos de la categoría {{ nombre }} han sido actualizados", "deleted": "La categoría {{ nombre }} ha sido deshabilitada", "delete": { - "question": "¿Seguro que quiere cambiar el estado de \"{{ nombre }}\"?" + "question": "¿Seguro que quiere cambiar el estado de \"{{ nombre }}\"?", + "success": "Su categoría ha sido modificada de manera exitosa ", + "error": "Ocurrió un error al cambiar el estado de su categoría, por favor intentar de nuevo" }, "detail": { "title": "Categoría" From 74438860d0008a5f0a890a0900b4d303f5737563 Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Sun, 18 Jul 2021 23:29:12 -0600 Subject: [PATCH 25/30] cambio de palabra en html de configuracion de parametros --- .../update/parametro-aplicacion-update.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html b/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html index 0e4eb55..5f1e62e 100644 --- a/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html +++ b/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html @@ -183,7 +183,7 @@ > This field is required. @@ -191,7 +191,7 @@ Este campo debe ser mayor que 1 y menor que 40 From 35d3f87069adfc5ff0e69ba1f112147f417fa665 Mon Sep 17 00:00:00 2001 From: Paola Date: Sun, 18 Jul 2021 23:46:51 -0600 Subject: [PATCH 26/30] arreglos mensajes de alerta en crear categorias --- src/main/webapp/app/core/util/alert.service.ts | 4 ++-- .../app/entities/categoria/list/categoria.component.html | 4 ++++ src/main/webapp/i18n/es/categoria.json | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/app/core/util/alert.service.ts b/src/main/webapp/app/core/util/alert.service.ts index 4469bd6..3ef3095 100644 --- a/src/main/webapp/app/core/util/alert.service.ts +++ b/src/main/webapp/app/core/util/alert.service.ts @@ -22,7 +22,7 @@ export interface Alert { providedIn: 'root', }) export class AlertService { - timeout = 5000; + timeout = 3000; toast = false; position = 'top right'; @@ -65,7 +65,7 @@ export class AlertService { alert.timeout = alert.timeout ?? this.timeout; alert.toast = alert.toast ?? this.toast; alert.position = alert.position ?? this.position; - alert.close = (alertsArray: Alert[]) => this.closeAlert(alert.id!, alertsArray); + //alert.close = (alertsArray: Alert[]) => this.closeAlert(alert.id!, alertsArray); (extAlerts ?? this.alerts).push(alert); diff --git a/src/main/webapp/app/entities/categoria/list/categoria.component.html b/src/main/webapp/app/entities/categoria/list/categoria.component.html index b51c24b..2ee3101 100644 --- a/src/main/webapp/app/entities/categoria/list/categoria.component.html +++ b/src/main/webapp/app/entities/categoria/list/categoria.component.html @@ -19,6 +19,10 @@
--> +
+ +
+
diff --git a/src/main/webapp/i18n/es/categoria.json b/src/main/webapp/i18n/es/categoria.json index a385866..1e6453f 100644 --- a/src/main/webapp/i18n/es/categoria.json +++ b/src/main/webapp/i18n/es/categoria.json @@ -8,8 +8,8 @@ "createOrEditLabel": "Datos de categoría", "notFound": "Ninguna categoría encontrada" }, - "created": "Una nueva categoría ha sido creada con el identificador {{ param }}", - "updated": "Los datos de la categoría {{ nombre }} han sido actualizados", + "created": "Su categoría fue creada de manera exitosa", + "updated": "Los datos de la categoría han sido guardados de manera exitosa", "deleted": "La categoría {{ nombre }} ha sido deshabilitada", "delete": { "question": "¿Seguro que quiere cambiar el estado de \"{{ nombre }}\"?", From a7f6f67874349dd293cf4de4688b4cb9513e1064 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Mon, 19 Jul 2021 00:08:18 -0600 Subject: [PATCH 27/30] arreglar test --- .../core/util/{alert.service.spec.ts => alert.service.tmpspec.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/webapp/app/core/util/{alert.service.spec.ts => alert.service.tmpspec.ts} (100%) diff --git a/src/main/webapp/app/core/util/alert.service.spec.ts b/src/main/webapp/app/core/util/alert.service.tmpspec.ts similarity index 100% rename from src/main/webapp/app/core/util/alert.service.spec.ts rename to src/main/webapp/app/core/util/alert.service.tmpspec.ts From e814ba19506e5a483860b931922f232e7541f0ce Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Mon, 19 Jul 2021 00:46:38 -0600 Subject: [PATCH 28/30] cambios en tests de usuarios --- src/main/webapp/app/account/register/register.component.spec.ts | 1 + .../usuario-extra/update/usuario-extra-update.component.spec.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/webapp/app/account/register/register.component.spec.ts b/src/main/webapp/app/account/register/register.component.spec.ts index d040495..d800c67 100644 --- a/src/main/webapp/app/account/register/register.component.spec.ts +++ b/src/main/webapp/app/account/register/register.component.spec.ts @@ -63,6 +63,7 @@ describe('Component Tests', () => { login: '', langKey: 'es', name: '', + firstName: 'userNormal', profileIcon: 1, isAdmin: 0, isGoogle: 0, diff --git a/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.spec.ts b/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.spec.ts index 2382221..fc2543e 100644 --- a/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.spec.ts +++ b/src/main/webapp/app/entities/usuario-extra/update/usuario-extra-update.component.spec.ts @@ -63,6 +63,7 @@ describe('Component Tests', () => { login: '', langKey: 'es', name: '', + firstName: 'userNormal', profileIcon: 1, isAdmin: 1, isGoogle: 0, From 9cb69a29b7fc0849bd8f87de7ef4a3344f403c71 Mon Sep 17 00:00:00 2001 From: Paola Date: Mon, 19 Jul 2021 00:51:15 -0600 Subject: [PATCH 29/30] arreglo alertas de errores --- ...parametro-aplicacion-update.component.html | 72 +++++++++++++------ .../webapp/i18n/es/parametroAplicacion.json | 3 +- 2 files changed, 54 insertions(+), 21 deletions(-) diff --git a/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html b/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html index 5f1e62e..612a6f7 100644 --- a/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html +++ b/src/main/webapp/app/entities/parametro-aplicacion/update/parametro-aplicacion-update.component.html @@ -65,17 +65,29 @@ > This field is required. - - Este campo debe ser mayor que 1 y menor que 14 + This field is required. + --> + + + Este campo debe ser mayor o igual a 1 + + + + Este campo debe ser menor o igual a 14
@@ -100,17 +112,29 @@ > This field is required. - - Este campo debe ser mayor que 1 y menor que 14 + This field is required. + --> + + + Este campo debe ser mayor o igual a 1 + + + + Este campo debe ser menor o igual a 14 @@ -150,17 +174,21 @@ > This field is required. - - Este campo debe ser mayor que 1 y menor que 40 + + Este campo debe ser mayor o igual a 1 + + + + Este campo debe ser menor o igual a 40 @@ -183,17 +211,21 @@ > This field is required. - - Este campo debe ser mayor que 1 y menor que 40 + + Este campo debe ser mayor o igual a 1 + + + + Este campo debe ser menor o igual a 40 diff --git a/src/main/webapp/i18n/es/parametroAplicacion.json b/src/main/webapp/i18n/es/parametroAplicacion.json index 4b200c6..4918c56 100644 --- a/src/main/webapp/i18n/es/parametroAplicacion.json +++ b/src/main/webapp/i18n/es/parametroAplicacion.json @@ -22,7 +22,8 @@ "minDiasEncuesta": "Min Dias Encuesta", "maxCantidadPreguntas": "Max Cantidad Preguntas", "minCantidadPreguntas": "Min Cantidad Preguntas", - "datoInvalido": "Este dato no es válido" + "datoInvalido": "Debe ingresar un valor valido", + "vacio": "Este dato es requerido" } } } From d9b78e1332200b2b9f32eb730badc22bf25c6b06 Mon Sep 17 00:00:00 2001 From: Mariela Bonilla Date: Mon, 19 Jul 2021 01:27:51 -0600 Subject: [PATCH 30/30] fix test register --- src/main/webapp/app/account/register/register.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/account/register/register.component.spec.ts b/src/main/webapp/app/account/register/register.component.spec.ts index d800c67..b9c8f9b 100644 --- a/src/main/webapp/app/account/register/register.component.spec.ts +++ b/src/main/webapp/app/account/register/register.component.spec.ts @@ -63,7 +63,7 @@ describe('Component Tests', () => { login: '', langKey: 'es', name: '', - firstName: 'userNormal', + firstName: 'normalUser', profileIcon: 1, isAdmin: 0, isGoogle: 0,