diff --git a/angular.json b/angular.json index bf588f8..6cb3b53 100644 --- a/angular.json +++ b/angular.json @@ -45,7 +45,15 @@ ], "styles": ["src/main/webapp/content/scss/paper-dashboard.scss", "./node_modules/swiper/swiper-bundle.min.css"], "scripts": [ - "src/main/webapp/content/js/bootstrap.min.js", + "./node_modules/jquery/dist/jquery.min.js", + "src/main/webapp/content/js/jquery.bootstrap.wizard.min.js", + "src/main/webapp/content/js/jquery.datatables.js", + "src/main/webapp/content/js/jquery.easypiechart.min.js", + "src/main/webapp/content/js/jquery.validate.min.js", + "src/main/webapp/content/js/jquery-jvectormap.js", + "src/main/webapp/content/js/jquery-ui.min.js", + "src/main/webapp/content/js/bootstrap.bundle.min.js", + "src/main/webapp/content/js/moment.min.js", "src/main/webapp/content/js/bootstrap-datetimepicker.js", "src/main/webapp/content/js/bootstrap-notify.js", "src/main/webapp/content/js/bootstrap-selectpicker.js", @@ -54,19 +62,11 @@ "src/main/webapp/content/js/chartist.min.js", "src/main/webapp/content/js/es6-promise-auto.min.js", "src/main/webapp/content/js/fullcalendar.min.js", - "src/main/webapp/content/js/jquery.bootstrap.wizard.min.js", - "src/main/webapp/content/js/jquery.datatables.js", - "src/main/webapp/content/js/jquery.easypiechart.min.js", - "src/main/webapp/content/js/jquery.validate.min.js", - "src/main/webapp/content/js/jquery-3.1.1.min.js", - "src/main/webapp/content/js/jquery-jvectormap.js", - "src/main/webapp/content/js/jquery-ui.min.js", - "src/main/webapp/content/js/moment.min.js", "src/main/webapp/content/js/nouislider.min.js", - "src/main/webapp/content/js/paper-dashboard.js", "src/main/webapp/content/js/perfect-scrollbar.min.js", "src/main/webapp/content/js/sweetalert2.js", "./node_modules/swiper/swiper-bundle.min.js", + "src/main/webapp/content/js/paper-dashboard.js", "src/main/webapp/content/js/api-google-platform.js" ] }, diff --git a/package-lock.json b/package-lock.json index 24ede43..82ef242 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "angularx-social-login": "^4.0.1", "bootstrap": "4.6.0", "dayjs": "1.10.5", + "jquery": "^3.6.0", "ngx-infinite-scroll": "10.0.1", "ngx-webstorage": "8.0.0", "rxjs": "6.6.7", @@ -44,7 +45,9 @@ "@angular/cli": "12.0.4", "@angular/compiler-cli": "12.0.5", "@angular/service-worker": "12.0.5", + "@types/bootstrap": "^5.0.17", "@types/jest": "26.0.23", + "@types/jquery": "^3.5.6", "@types/node": "15.12.2", "@types/sockjs-client": "1.5.0", "@typescript-eslint/eslint-plugin": "4.27.0", @@ -3983,6 +3986,16 @@ "integrity": "sha512-15spi3V28QdevleWBNXE4pIls3nFZmBbUGrW9IVPwiQczuSb9n76TCB4bsk8TSel+I1OkHEdPhu5QKMfY6rQHA==", "dev": true }, + "node_modules/@popperjs/core": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.2.tgz", + "integrity": "sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/@scarf/scarf": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.1.1.tgz", @@ -4179,6 +4192,16 @@ "@babel/types": "^7.3.0" } }, + "node_modules/@types/bootstrap": { + "version": "5.0.17", + "resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.0.17.tgz", + "integrity": "sha512-uQQQ3p+zw10VjZLvtCuKWI6QgVCYEnK/yHnno3gyEhikfQdiZexS2XPxjWRboGmX135o470GkmCta9eAgQMVLQ==", + "dev": true, + "dependencies": { + "@popperjs/core": "^2.9.2", + "@types/jquery": "*" + } + }, "node_modules/@types/concat-stream": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.0.tgz", @@ -4295,6 +4318,15 @@ "pretty-format": "^26.0.0" } }, + "node_modules/@types/jquery": { + "version": "3.5.6", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.6.tgz", + "integrity": "sha512-SmgCQRzGPId4MZQKDj9Hqc6kSXFNWZFHpELkyK8AQhf8Zr6HKfCzFv9ZC1Fv3FyQttJZOlap3qYb12h61iZAIg==", + "dev": true, + "dependencies": { + "@types/sizzle": "*" + } + }, "node_modules/@types/json-schema": { "version": "7.0.7", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", @@ -4343,6 +4375,12 @@ "integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA==", "dev": true }, + "node_modules/@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, "node_modules/@types/sockjs-client": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@types/sockjs-client/-/sockjs-client-1.5.0.tgz", @@ -15491,6 +15529,11 @@ "@sideway/pinpoint": "^2.0.0" } }, + "node_modules/jquery": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -21156,7 +21199,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", "dev": true, "engines": { "node": ">=0.4.x" @@ -30128,6 +30171,12 @@ "integrity": "sha512-15spi3V28QdevleWBNXE4pIls3nFZmBbUGrW9IVPwiQczuSb9n76TCB4bsk8TSel+I1OkHEdPhu5QKMfY6rQHA==", "dev": true }, + "@popperjs/core": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.9.2.tgz", + "integrity": "sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==", + "dev": true + }, "@scarf/scarf": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@scarf/scarf/-/scarf-1.1.1.tgz", @@ -30297,6 +30346,16 @@ "@babel/types": "^7.3.0" } }, + "@types/bootstrap": { + "version": "5.0.17", + "resolved": "https://registry.npmjs.org/@types/bootstrap/-/bootstrap-5.0.17.tgz", + "integrity": "sha512-uQQQ3p+zw10VjZLvtCuKWI6QgVCYEnK/yHnno3gyEhikfQdiZexS2XPxjWRboGmX135o470GkmCta9eAgQMVLQ==", + "dev": true, + "requires": { + "@popperjs/core": "^2.9.2", + "@types/jquery": "*" + } + }, "@types/concat-stream": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.0.tgz", @@ -30413,6 +30472,15 @@ "pretty-format": "^26.0.0" } }, + "@types/jquery": { + "version": "3.5.6", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.6.tgz", + "integrity": "sha512-SmgCQRzGPId4MZQKDj9Hqc6kSXFNWZFHpELkyK8AQhf8Zr6HKfCzFv9ZC1Fv3FyQttJZOlap3qYb12h61iZAIg==", + "dev": true, + "requires": { + "@types/sizzle": "*" + } + }, "@types/json-schema": { "version": "7.0.7", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", @@ -30461,6 +30529,12 @@ "integrity": "sha512-0/HnwIfW4ki2D8L8c9GVcG5I72s9jP5GSLVF0VIXDW00kmIpA6O33G7a8n59Tmh7Nz0WUC3rSb7PTY/sdW2JzA==", "dev": true }, + "@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, "@types/sockjs-client": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@types/sockjs-client/-/sockjs-client-1.5.0.tgz", @@ -39054,6 +39128,11 @@ "@sideway/pinpoint": "^2.0.0" } }, + "jquery": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", diff --git a/package.json b/package.json index b6ca8a7..2cceb89 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "angularx-social-login": "^4.0.1", "bootstrap": "4.6.0", "dayjs": "1.10.5", + "jquery": "^3.6.0", "ngx-infinite-scroll": "10.0.1", "ngx-webstorage": "8.0.0", "rxjs": "6.6.7", @@ -101,7 +102,9 @@ "@angular/cli": "12.0.4", "@angular/compiler-cli": "12.0.5", "@angular/service-worker": "12.0.5", + "@types/bootstrap": "^5.0.17", "@types/jest": "26.0.23", + "@types/jquery": "^3.5.6", "@types/node": "15.12.2", "@types/sockjs-client": "1.5.0", "@typescript-eslint/eslint-plugin": "4.27.0", diff --git a/src/main/java/org/datasurvey/repository/CategoriaRepository.java b/src/main/java/org/datasurvey/repository/CategoriaRepository.java index 66368c1..6a4897c 100644 --- a/src/main/java/org/datasurvey/repository/CategoriaRepository.java +++ b/src/main/java/org/datasurvey/repository/CategoriaRepository.java @@ -1,7 +1,8 @@ package org.datasurvey.repository; import org.datasurvey.domain.Categoria; -import org.springframework.data.jpa.repository.*; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.stereotype.Repository; /** diff --git a/src/main/java/org/datasurvey/service/MailService.java b/src/main/java/org/datasurvey/service/MailService.java index 0575e3d..c40c4fe 100644 --- a/src/main/java/org/datasurvey/service/MailService.java +++ b/src/main/java/org/datasurvey/service/MailService.java @@ -109,4 +109,10 @@ public class MailService { log.debug("Sending password reset email to '{}'", user.getEmail()); sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title"); } + + @Async + public void sendPasswordRestoredMail(User user) { + log.debug("Sending password restored email to '{}'", user.getEmail()); + sendEmailFromTemplate(user, "mail/passwordRestoredEmail", "email.restored.title"); + } } diff --git a/src/main/java/org/datasurvey/web/rest/AccountResource.java b/src/main/java/org/datasurvey/web/rest/AccountResource.java index afb4a0c..6b830e9 100644 --- a/src/main/java/org/datasurvey/web/rest/AccountResource.java +++ b/src/main/java/org/datasurvey/web/rest/AccountResource.java @@ -173,6 +173,7 @@ public class AccountResource { // Pretend the request has been successful to prevent checking which emails really exist // but log that an invalid attempt has been made log.warn("Password reset requested for non existing mail"); + throw new EmailNotExistException(); } } @@ -192,6 +193,8 @@ public class AccountResource { if (!user.isPresent()) { throw new AccountResourceException("No user was found for this reset key"); + } else { + mailService.sendPasswordRestoredMail(user.get()); } } diff --git a/src/main/java/org/datasurvey/web/rest/errors/EmailNotExistException.java b/src/main/java/org/datasurvey/web/rest/errors/EmailNotExistException.java new file mode 100644 index 0000000..d212473 --- /dev/null +++ b/src/main/java/org/datasurvey/web/rest/errors/EmailNotExistException.java @@ -0,0 +1,10 @@ +package org.datasurvey.web.rest.errors; + +public class EmailNotExistException extends BadRequestAlertException { + + private static final long serialVersionUID = 1L; + + public EmailNotExistException() { + super(ErrorConstants.EMAIL_NOT_EXISTS_TYPE, "Email not exists!", "userManagement", "emailnotexists"); + } +} 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 20df98d..109466d 100644 --- a/src/main/java/org/datasurvey/web/rest/errors/ErrorConstants.java +++ b/src/main/java/org/datasurvey/web/rest/errors/ErrorConstants.java @@ -12,6 +12,7 @@ public final class ErrorConstants { public static final URI INVALID_PASSWORD_TYPE = URI.create(PROBLEM_BASE_URL + "/invalid-password"); 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"); private ErrorConstants() {} } diff --git a/src/main/resources/i18n/messages.properties b/src/main/resources/i18n/messages.properties index a9f66d4..52b6575 100644 --- a/src/main/resources/i18n/messages.properties +++ b/src/main/resources/i18n/messages.properties @@ -19,3 +19,11 @@ email.reset.title=DataSurvey password reset email.reset.greeting=Dear {0} email.reset.text1=For your DataSurvey account a password reset was requested, please click on the URL below to reset it: email.reset.text2=Regards, + +# Password Restored Mail +email.restored.title=Your password was reset in DataSurvey +email.restored.greeting=Hello, {0}! +email.restored.text1=Your DataSurvey password has been successfully reset.. +email.restored.text2=Regards, +email.restored.text3=If you did not make this change, please notify the following email immediately: +email.restored.email=datasurvey@gmail.com diff --git a/src/main/resources/i18n/messages_es.properties b/src/main/resources/i18n/messages_es.properties index 48d7ea4..5742030 100644 --- a/src/main/resources/i18n/messages_es.properties +++ b/src/main/resources/i18n/messages_es.properties @@ -5,17 +5,26 @@ error.status=Estado: error.message=Mensaje: # Activation email -email.activation.title=Activación de DataSurvey -email.activation.greeting=Estimado/a {0} -email.activation.text1=Su cuenta en DataSurvey ha sido creada. Por favor, haga clic en el siguiente enlace para activarla: +email.activation.title=Confirmación de correo con DataSurvey +email.activation.greeting=¡Hola, {0}! +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: # Reset email email.reset.title=Reinicio de contraseña de DataSurvey -email.reset.greeting=Estimado/a {0} +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.text2=Saludos, + +# Password Restored Mail +email.restored.title=Se restaleció 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, +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 0bb53a2..cd90b5a 100644 --- a/src/main/resources/templates/mail/activationEmail.html +++ b/src/main/resources/templates/mail/activationEmail.html @@ -1,20 +1,327 @@
-Dear
-Your JHipster account has been created, please click on the URL below to activate it:
-- Activation link -
-
- Regards,
-
- JHipster.
-
+
|
+ ||||
+ + | +
Dear
-Your JHipster account has been created, please click on the URL below to access it:
-- Login link -
-
- Regards,
-
- JHipster.
-
+
|
+ |
+ + | +|
+
|
+
+
|
+ ||||
+ + | +
Dear
-- For your JHipster account a password reset was requested, please click on the URL below to reset it: -
-- Login link -
-
- Regards,
-
- JHipster.
-
+
|
+ |
+ + | +|
+
|
+
+
|
+ ||||
+ + | +
+
|
+ |
+ + | +|
+
|
+
+
|
+ ||||
+ + | +
Parámetros de la aplicación
+Informacion de los parametros que se permiten para la creacion de las encuestas dentro de DataSurvey.
+Dias para encuestas
++ Cantidad mínima y máxima de los días que se permitirá para la creación de las encuestas dentro de DataSurvey. +
+{{ parametroAplicacion.minDiasEncuesta }}
+{{ parametroAplicacion.maxDiasEncuesta }}
+Preguntas para encuestas
++ Cantidad mínima y máxima de las preguntas que se permitirá ingresar para la creación de las encuestas dentro de DataSurvey. +
+{{ parametroAplicacion.minCantidadPreguntas }}
+{{ parametroAplicacion.maxCantidadPreguntas }}
+Parámetros de la aplicación
Información de los parámetros que se permiten para la creación de las encuestas dentro de DataSurvey.
Días para Encuestas
++ 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. +
+Preguntas para Encuestas
++ 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. +
+