diff --git a/src/main/java/org/datasurvey/web/rest/AccountResource.java b/src/main/java/org/datasurvey/web/rest/AccountResource.java index 6b830e9..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,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() == null || (!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 5742030..77121fd 100644 --- a/src/main/resources/i18n/messages_es.properties +++ b/src/main/resources/i18n/messages_es.properties @@ -15,15 +15,15 @@ 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=Modificación de contraseña exitosa email.restored.greeting=¡Hola, {0}! -email.restored.text1=Se ha restablecido correctamente su contraseña en DataSurvey. +email.restored.text1=¡Se ha restablecido correctamente su contraseña en DataSurvey! email.restored.text2=Saludos, email.restored.text3=Si usted no realizó este cambio, favor notifique inmediatamente al siguiente correo: email.restored.email=datasurvey@gmail.com diff --git a/src/main/resources/templates/mail/activationEmail.html b/src/main/resources/templates/mail/activationEmail.html index cd90b5a..673edc0 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

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

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

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

diff --git a/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html b/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html index 3aeecc5..9971405 100644 --- a/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html +++ b/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html @@ -35,7 +35,6 @@
Your password has been reset. - sign in
- 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. -
@@ -115,7 +99,7 @@

- ¿Aún no se encuentra registrado/a? + ¿Aún no es parte de DataSurvey? Crea una cuenta

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.spec.ts b/src/main/webapp/app/account/register/register.component.spec.ts index d040495..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,6 +63,7 @@ describe('Component Tests', () => { login: '', langKey: 'es', name: '', + firstName: 'normalUser', profileIcon: 1, isAdmin: 0, isGoogle: 0, 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/encuesta/encuesta.module.ts b/src/main/webapp/app/entities/encuesta/encuesta.module.ts index c78f7dc..6cd231e 100644 --- a/src/main/webapp/app/entities/encuesta/encuesta.module.ts +++ b/src/main/webapp/app/entities/encuesta/encuesta.module.ts @@ -5,9 +5,10 @@ import { EncuestaDetailComponent } from './detail/encuesta-detail.component'; import { EncuestaUpdateComponent } from './update/encuesta-update.component'; import { EncuestaDeleteDialogComponent } from './delete/encuesta-delete-dialog.component'; import { EncuestaRoutingModule } from './route/encuesta-routing.module'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; @NgModule({ - imports: [SharedModule, EncuestaRoutingModule], + imports: [SharedModule, EncuestaRoutingModule, FontAwesomeModule], declarations: [EncuestaComponent, EncuestaDetailComponent, EncuestaUpdateComponent, EncuestaDeleteDialogComponent], entryComponents: [EncuestaDeleteDialogComponent], }) diff --git a/src/main/webapp/app/entities/encuesta/list/encuesta.component.html b/src/main/webapp/app/entities/encuesta/list/encuesta.component.html index 388fc7d..f0545aa 100644 --- a/src/main/webapp/app/entities/encuesta/list/encuesta.component.html +++ b/src/main/webapp/app/entities/encuesta/list/encuesta.component.html @@ -1,22 +1,29 @@

- Encuestas +
+
+ Encuestas +

Cree encuestas y publiquelas mundialmente.

+
-
- +
+ - + +

@@ -28,7 +35,177 @@ No encuestas found
-
+ +
+ +
+
    +
    +
  • + +
  • +
    +
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
    +
    +
  • + +
  • +
    +
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+   {{ encuesta.nombre | titlecase }} +
+
+   {{ encuesta.nombre | titlecase }} +
+
+   {{ + encuesta.fechaCreacion | formatShortDatetime | titlecase + }} +
+
+ {{ encuesta.descripcion | titlecase }} +
+
+ {{ encuesta.categoria?.nombre | lowercase }} +
+
+ +
+
+ + +
+
+
+ + - - -