Merge branch 'dev' into feature/US-55
This commit is contained in:
commit
0dfd0b58bf
|
@ -21199,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"
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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() {}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,7 +6,7 @@ error.message=Mensaje:
|
|||
|
||||
# Activation email
|
||||
email.activation.title=Activación de DataSurvey
|
||||
email.activation.greeting=Estimado/a {0}
|
||||
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.text2=Saludos,
|
||||
email.signature=Equipo de DataSurvey.
|
||||
|
@ -16,6 +16,15 @@ email.creation.text1=Su cuenta en DataSurvey ha sido creada. Por favor, haga cli
|
|||
|
||||
# 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
|
||||
|
||||
|
|
|
@ -1,20 +1,327 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" th:lang="${#locale.language}" lang="en">
|
||||
<head>
|
||||
<title th:text="#{email.activation.title}">JHipster activation</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<!-- Forcing initial-scale shouldn't be necessary -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- Use the latest (edge) version of IE rendering engine -->
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
<!-- Disable auto-scale in iOS 10 Mail entirely -->
|
||||
<title th:text="#{email.activation.title}">JHipster activation</title>
|
||||
<link rel="icon" th:href="@{|${baseUrl}/favicon.ico|}" />
|
||||
<link href="https://fonts.googleapis.com/css?family=NotoSansSP:300,400,700" rel="stylesheet" />
|
||||
<link rel="manifest" href="manifest.webapp" />
|
||||
<style>
|
||||
.bg_white {
|
||||
background: #ffffff;
|
||||
}
|
||||
.bg_light {
|
||||
background: #fafafa;
|
||||
}
|
||||
.bg_black {
|
||||
background: #000000;
|
||||
}
|
||||
.bg_dark {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
.email-section {
|
||||
padding: 2.5em;
|
||||
}
|
||||
/*BUTTON*/
|
||||
.btn {
|
||||
padding: 10px 15px;
|
||||
display: inline-block;
|
||||
}
|
||||
.btn.btn-primary {
|
||||
border-radius: 5px;
|
||||
background: #007bff;
|
||||
color: #ffffff;
|
||||
}
|
||||
.btn.btn-white {
|
||||
border-radius: 5px;
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
.btn.btn-white-outline {
|
||||
border-radius: 5px;
|
||||
background: transparent;
|
||||
border: 1px solid #fff;
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-black-outline {
|
||||
border-radius: 0px;
|
||||
background: transparent;
|
||||
border: 2px solid #000;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: 'Lato', sans-serif;
|
||||
color: #000000;
|
||||
margin-top: 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Noto Sans JP', sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
line-height: 1.8;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
a {
|
||||
color: #30e3ca;
|
||||
}
|
||||
|
||||
table {
|
||||
}
|
||||
/*LOGO*/
|
||||
|
||||
.logo h1 {
|
||||
margin: 0;
|
||||
}
|
||||
.logo h1 a {
|
||||
color: #30e3ca;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
|
||||
/*HERO*/
|
||||
.hero {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.hero .text {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.hero .text h2 {
|
||||
color: #000;
|
||||
font-size: 40px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.hero .text h3 {
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
}
|
||||
.hero .text h2 span {
|
||||
font-weight: 600;
|
||||
color: #30e3ca;
|
||||
}
|
||||
|
||||
/*HEADING SECTION*/
|
||||
.heading-section {
|
||||
}
|
||||
.heading-section h2 {
|
||||
color: #000000;
|
||||
font-size: 28px;
|
||||
margin-top: 0;
|
||||
line-height: 1.4;
|
||||
font-weight: 400;
|
||||
}
|
||||
.heading-section .subheading {
|
||||
margin-bottom: 20px !important;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
position: relative;
|
||||
}
|
||||
.heading-section .subheading::after {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -10px;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #30e3ca;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.heading-section-white {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
.heading-section-white h2 {
|
||||
/*font-family: ;*/
|
||||
line-height: 1;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.heading-section-white h2 {
|
||||
color: #ffffff;
|
||||
}
|
||||
.heading-section-white .subheading {
|
||||
margin-bottom: 0;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
ul.social {
|
||||
padding: 0;
|
||||
}
|
||||
ul.social li {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.footer .heading {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
}
|
||||
.footer ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.footer ul li {
|
||||
list-style: none;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.footer ul li a {
|
||||
color: rgba(0, 0, 0, 1);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p th:text="#{email.activation.greeting(${user.login})}">Dear</p>
|
||||
<p th:text="#{email.activation.text1}">Your JHipster account has been created, please click on the URL below to activate it:</p>
|
||||
|
||||
<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f1f1f1">
|
||||
<center style="width: 100%; background-color: #f1f1f1">
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
font-size: 1px;
|
||||
max-height: 0px;
|
||||
max-width: 0px;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
mso-hide: all;
|
||||
font-family: sans-serif;
|
||||
"
|
||||
>
|
||||
‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌
|
||||
</div>
|
||||
<div style="max-width: 600px; margin: 0 auto" class="email-container">
|
||||
<!-- BEGIN BODY -->
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
|
||||
<tr>
|
||||
<td valign="top" class="bg_white" style="padding: 1em 2.5em 0 2.5em">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td class="logo" style="text-align: center">
|
||||
<h1>
|
||||
<a href="#"
|
||||
><img
|
||||
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333881/DataSurveyLogo2_smr2ok.png"
|
||||
alt=""
|
||||
width="300"
|
||||
/></a>
|
||||
</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<tr>
|
||||
<td valign="middle" class="hero bg_white" style="padding: 3em 0 2em 0">
|
||||
<img
|
||||
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333882/email_v7pjtv.png"
|
||||
alt=""
|
||||
style="width: 300px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<tr>
|
||||
<td valign="middle" class="hero bg_white" style="padding: 2em 0 4em 0">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="text" style="padding: 0 2.5em; text-align: center">
|
||||
<h2 th:text="#{email.activation.greeting(${user.login})}">¡Hola!</h2>
|
||||
<h3 th:text="#{email.activation.text1}">
|
||||
Your JHipster account has been created, please click on the URL below to activate it:
|
||||
</h3>
|
||||
<p>
|
||||
<a th:with="url=(@{|${baseUrl}/account/activate?key=${user.activationKey}|})" th:href="${url}" th:text="${url}">Activation link</a>
|
||||
<a
|
||||
th:with="url=(@{|${baseUrl}/account/activate?key=${user.activationKey}|})"
|
||||
th:href="${url}"
|
||||
class="btn btn-primary"
|
||||
>Activar cuenta</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
<div class="text" style="padding: 1em 2.5em; text-align: center">
|
||||
<p>
|
||||
<span th:text="#{email.activation.text2}">Regards, </span>
|
||||
<br />
|
||||
<em th:text="#{email.signature}">JHipster.</em>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<!-- 1 Column Text + Button : END -->
|
||||
</table>
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
|
||||
<tr>
|
||||
<td valign="middle" class="bg_light footer email-section">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="33.333%" style="padding-top: 20px">
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="text-align: left; padding-right: 10px">
|
||||
<h3 class="heading">Acerca de</h3>
|
||||
<p>DataSurvey es su compañero más cercano para poder recolectar información valiosa para usted.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top" width="33.333%" style="padding-top: 20px">
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="text-align: left; padding-left: 5px; padding-right: 5px">
|
||||
<h3 class="heading">Información de contacto</h3>
|
||||
<ul>
|
||||
<li><span class="text">datasurvey@gmail.com</span></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end: tr -->
|
||||
<tr>
|
||||
<td class="bg_light" style="text-align: center">
|
||||
<p><a href="https://datasurvey.org" style="color: rgba(0, 0, 0, 0.8)">DataSurvey.org</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,20 +1,327 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" th:lang="${#locale.language}" lang="en">
|
||||
<head>
|
||||
<title th:text="#{email.activation.title}">JHipster creation</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<!-- Forcing initial-scale shouldn't be necessary -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- Use the latest (edge) version of IE rendering engine -->
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
<!-- Disable auto-scale in iOS 10 Mail entirely -->
|
||||
<title th:text="#{email.activation.title}">JHipster creation</title>
|
||||
<link rel="icon" th:href="@{|${baseUrl}/favicon.ico|}" />
|
||||
<link href="https://fonts.googleapis.com/css?family=NotoSansSP:300,400,700" rel="stylesheet" />
|
||||
<link rel="manifest" href="manifest.webapp" />
|
||||
<style>
|
||||
.bg_white {
|
||||
background: #ffffff;
|
||||
}
|
||||
.bg_light {
|
||||
background: #fafafa;
|
||||
}
|
||||
.bg_black {
|
||||
background: #000000;
|
||||
}
|
||||
.bg_dark {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
.email-section {
|
||||
padding: 2.5em;
|
||||
}
|
||||
/*BUTTON*/
|
||||
.btn {
|
||||
padding: 10px 15px;
|
||||
display: inline-block;
|
||||
}
|
||||
.btn.btn-primary {
|
||||
border-radius: 5px;
|
||||
background: #007bff;
|
||||
color: #ffffff;
|
||||
}
|
||||
.btn.btn-white {
|
||||
border-radius: 5px;
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
.btn.btn-white-outline {
|
||||
border-radius: 5px;
|
||||
background: transparent;
|
||||
border: 1px solid #fff;
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-black-outline {
|
||||
border-radius: 0px;
|
||||
background: transparent;
|
||||
border: 2px solid #000;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: 'Lato', sans-serif;
|
||||
color: #000000;
|
||||
margin-top: 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Noto Sans JP', sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
line-height: 1.8;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
a {
|
||||
color: #30e3ca;
|
||||
}
|
||||
|
||||
table {
|
||||
}
|
||||
/*LOGO*/
|
||||
|
||||
.logo h1 {
|
||||
margin: 0;
|
||||
}
|
||||
.logo h1 a {
|
||||
color: #30e3ca;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
|
||||
/*HERO*/
|
||||
.hero {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.hero .text {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.hero .text h2 {
|
||||
color: #000;
|
||||
font-size: 40px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.hero .text h3 {
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
}
|
||||
.hero .text h2 span {
|
||||
font-weight: 600;
|
||||
color: #30e3ca;
|
||||
}
|
||||
|
||||
/*HEADING SECTION*/
|
||||
.heading-section {
|
||||
}
|
||||
.heading-section h2 {
|
||||
color: #000000;
|
||||
font-size: 28px;
|
||||
margin-top: 0;
|
||||
line-height: 1.4;
|
||||
font-weight: 400;
|
||||
}
|
||||
.heading-section .subheading {
|
||||
margin-bottom: 20px !important;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
position: relative;
|
||||
}
|
||||
.heading-section .subheading::after {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -10px;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #30e3ca;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.heading-section-white {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
.heading-section-white h2 {
|
||||
/*font-family: ;*/
|
||||
line-height: 1;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.heading-section-white h2 {
|
||||
color: #ffffff;
|
||||
}
|
||||
.heading-section-white .subheading {
|
||||
margin-bottom: 0;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
ul.social {
|
||||
padding: 0;
|
||||
}
|
||||
ul.social li {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.footer .heading {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
}
|
||||
.footer ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.footer ul li {
|
||||
list-style: none;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.footer ul li a {
|
||||
color: rgba(0, 0, 0, 1);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p th:text="#{email.activation.greeting(${user.login})}">Dear</p>
|
||||
<p th:text="#{email.creation.text1}">Your JHipster account has been created, please click on the URL below to access it:</p>
|
||||
|
||||
<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f1f1f1">
|
||||
<center style="width: 100%; background-color: #f1f1f1">
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
font-size: 1px;
|
||||
max-height: 0px;
|
||||
max-width: 0px;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
mso-hide: all;
|
||||
font-family: sans-serif;
|
||||
"
|
||||
>
|
||||
‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌
|
||||
</div>
|
||||
<div style="max-width: 600px; margin: 0 auto" class="email-container">
|
||||
<!-- BEGIN BODY -->
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
|
||||
<tr>
|
||||
<td valign="top" class="bg_white" style="padding: 1em 2.5em 0 2.5em">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td class="logo" style="text-align: center">
|
||||
<h1>
|
||||
<a href="#"
|
||||
><img
|
||||
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333881/DataSurveyLogo2_smr2ok.png"
|
||||
alt=""
|
||||
width="300"
|
||||
/></a>
|
||||
</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<tr>
|
||||
<td valign="middle" class="hero bg_white" style="padding: 3em 0 2em 0">
|
||||
<img
|
||||
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333882/email_v7pjtv.png"
|
||||
alt=""
|
||||
style="width: 300px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<tr>
|
||||
<td valign="middle" class="hero bg_white" style="padding: 2em 0 4em 0">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="text" style="padding: 0 2.5em; text-align: center">
|
||||
<h2 th:text="#{email.activation.greeting(${user.login})}">¡Hola!</h2>
|
||||
<h3 th:text="#{email.creation.text1}">
|
||||
Your JHipster account has been created, please click on the URL below to access it:
|
||||
</h3>
|
||||
<p>
|
||||
<a th:with="url=(@{|${baseUrl}/account/reset/finish?key=${user.resetKey}|})" th:href="${url}" th:text="${url}">Login link</a>
|
||||
<a
|
||||
th:with="url=(@{|${baseUrl}/account/reset/finish?key=${user.resetKey}|})"
|
||||
th:href="${url}"
|
||||
class="btn btn-primary"
|
||||
>Iniciar sesión</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
<div class="text" style="padding: 1em 2.5em; text-align: center">
|
||||
<p>
|
||||
<span th:text="#{email.activation.text2}">Regards, </span>
|
||||
<br />
|
||||
<em th:text="#{email.signature}">JHipster.</em>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<!-- 1 Column Text + Button : END -->
|
||||
</table>
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
|
||||
<tr>
|
||||
<td valign="middle" class="bg_light footer email-section">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="33.333%" style="padding-top: 20px">
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="text-align: left; padding-right: 10px">
|
||||
<h3 class="heading">Acerca de</h3>
|
||||
<p>DataSurvey es su compañero más cercano para poder recolectar información valiosa para usted.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top" width="33.333%" style="padding-top: 20px">
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="text-align: left; padding-left: 5px; padding-right: 5px">
|
||||
<h3 class="heading">Información de contacto</h3>
|
||||
<ul>
|
||||
<li><span class="text">datasurvey@gmail.com</span></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end: tr -->
|
||||
<tr>
|
||||
<td class="bg_light" style="text-align: center">
|
||||
<p><a href="https://datasurvey.org" style="color: rgba(0, 0, 0, 0.8)">DataSurvey.org</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,22 +1,327 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" th:lang="${#locale.language}" lang="en">
|
||||
<head>
|
||||
<title th:text="#{email.reset.title}">JHipster password reset</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<!-- Forcing initial-scale shouldn't be necessary -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- Use the latest (edge) version of IE rendering engine -->
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
<!-- Disable auto-scale in iOS 10 Mail entirely -->
|
||||
<title th:text="#{email.reset.title}">JHipster password reset</title>
|
||||
<link rel="icon" th:href="@{|${baseUrl}/favicon.ico|}" />
|
||||
<link href="https://fonts.googleapis.com/css?family=NotoSansSP:300,400,700" rel="stylesheet" />
|
||||
<link rel="manifest" href="manifest.webapp" />
|
||||
<style>
|
||||
.bg_white {
|
||||
background: #ffffff;
|
||||
}
|
||||
.bg_light {
|
||||
background: #fafafa;
|
||||
}
|
||||
.bg_black {
|
||||
background: #000000;
|
||||
}
|
||||
.bg_dark {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
.email-section {
|
||||
padding: 2.5em;
|
||||
}
|
||||
/*BUTTON*/
|
||||
.btn {
|
||||
padding: 10px 15px;
|
||||
display: inline-block;
|
||||
}
|
||||
.btn.btn-primary {
|
||||
border-radius: 5px;
|
||||
background: #007bff;
|
||||
color: #ffffff;
|
||||
}
|
||||
.btn.btn-white {
|
||||
border-radius: 5px;
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
.btn.btn-white-outline {
|
||||
border-radius: 5px;
|
||||
background: transparent;
|
||||
border: 1px solid #fff;
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-black-outline {
|
||||
border-radius: 0px;
|
||||
background: transparent;
|
||||
border: 2px solid #000;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: 'Lato', sans-serif;
|
||||
color: #000000;
|
||||
margin-top: 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Noto Sans JP', sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
line-height: 1.8;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
a {
|
||||
color: #30e3ca;
|
||||
}
|
||||
|
||||
table {
|
||||
}
|
||||
/*LOGO*/
|
||||
|
||||
.logo h1 {
|
||||
margin: 0;
|
||||
}
|
||||
.logo h1 a {
|
||||
color: #30e3ca;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
|
||||
/*HERO*/
|
||||
.hero {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.hero .text {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.hero .text h2 {
|
||||
color: #000;
|
||||
font-size: 40px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.hero .text h3 {
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
}
|
||||
.hero .text h2 span {
|
||||
font-weight: 600;
|
||||
color: #30e3ca;
|
||||
}
|
||||
|
||||
/*HEADING SECTION*/
|
||||
.heading-section {
|
||||
}
|
||||
.heading-section h2 {
|
||||
color: #000000;
|
||||
font-size: 28px;
|
||||
margin-top: 0;
|
||||
line-height: 1.4;
|
||||
font-weight: 400;
|
||||
}
|
||||
.heading-section .subheading {
|
||||
margin-bottom: 20px !important;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
position: relative;
|
||||
}
|
||||
.heading-section .subheading::after {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -10px;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #30e3ca;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.heading-section-white {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
.heading-section-white h2 {
|
||||
/*font-family: ;*/
|
||||
line-height: 1;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.heading-section-white h2 {
|
||||
color: #ffffff;
|
||||
}
|
||||
.heading-section-white .subheading {
|
||||
margin-bottom: 0;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
ul.social {
|
||||
padding: 0;
|
||||
}
|
||||
ul.social li {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.footer .heading {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
}
|
||||
.footer ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.footer ul li {
|
||||
list-style: none;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.footer ul li a {
|
||||
color: rgba(0, 0, 0, 1);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p th:text="#{email.reset.greeting(${user.login})}">Dear</p>
|
||||
<p th:text="#{email.reset.text1}">
|
||||
|
||||
<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f1f1f1">
|
||||
<center style="width: 100%; background-color: #f1f1f1">
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
font-size: 1px;
|
||||
max-height: 0px;
|
||||
max-width: 0px;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
mso-hide: all;
|
||||
font-family: sans-serif;
|
||||
"
|
||||
>
|
||||
‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌
|
||||
</div>
|
||||
<div style="max-width: 600px; margin: 0 auto" class="email-container">
|
||||
<!-- BEGIN BODY -->
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
|
||||
<tr>
|
||||
<td valign="top" class="bg_white" style="padding: 1em 2.5em 0 2.5em">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td class="logo" style="text-align: center">
|
||||
<h1>
|
||||
<a href="#"
|
||||
><img
|
||||
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333881/DataSurveyLogo2_smr2ok.png"
|
||||
alt=""
|
||||
width="300"
|
||||
/></a>
|
||||
</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<tr>
|
||||
<td valign="middle" class="hero bg_white" style="padding: 3em 0 2em 0">
|
||||
<img
|
||||
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333882/email_v7pjtv.png"
|
||||
alt=""
|
||||
style="width: 300px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<tr>
|
||||
<td valign="middle" class="hero bg_white" style="padding: 2em 0 4em 0">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="text" style="padding: 0 2.5em; text-align: center">
|
||||
<h2 th:text="#{email.reset.greeting(${user.login})}">¡Hola!</h2>
|
||||
<h3 th:text="#{email.reset.text1}">
|
||||
For your JHipster account a password reset was requested, please click on the URL below to reset it:
|
||||
</p>
|
||||
</h3>
|
||||
<p>
|
||||
<a th:with="url=(@{|${baseUrl}/account/reset/finish?key=${user.resetKey}|})" th:href="${url}" th:text="${url}">Login link</a>
|
||||
<a
|
||||
th:with="url=(@{|${baseUrl}/account/reset/finish?key=${user.resetKey}|})"
|
||||
th:href="${url}"
|
||||
class="btn btn-primary"
|
||||
>Restablecer contraseña</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
<div class="text" style="padding: 1em 2.5em; text-align: center">
|
||||
<p>
|
||||
<span th:text="#{email.reset.text2}">Regards, </span>
|
||||
<br />
|
||||
<em th:text="#{email.signature}">JHipster.</em>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<!-- 1 Column Text + Button : END -->
|
||||
</table>
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
|
||||
<tr>
|
||||
<td valign="middle" class="bg_light footer email-section">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="33.333%" style="padding-top: 20px">
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="text-align: left; padding-right: 10px">
|
||||
<h3 class="heading">Acerca de</h3>
|
||||
<p>DataSurvey es su compañero más cercano para poder recolectar información valiosa para usted.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top" width="33.333%" style="padding-top: 20px">
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="text-align: left; padding-left: 5px; padding-right: 5px">
|
||||
<h3 class="heading">Información de contacto</h3>
|
||||
<ul>
|
||||
<li><span class="text">datasurvey@gmail.com</span></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end: tr -->
|
||||
<tr>
|
||||
<td class="bg_light" style="text-align: center">
|
||||
<p><a href="https://datasurvey.org" style="color: rgba(0, 0, 0, 0.8)">DataSurvey.org</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,329 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" th:lang="${#locale.language}" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<!-- Forcing initial-scale shouldn't be necessary -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- Use the latest (edge) version of IE rendering engine -->
|
||||
<meta name="x-apple-disable-message-reformatting" />
|
||||
<!-- Disable auto-scale in iOS 10 Mail entirely -->
|
||||
<title th:text="#{email.restored.title}">JHipster password restored</title>
|
||||
<link rel="icon" th:href="@{|${baseUrl}/favicon.ico|}" />
|
||||
<link href="https://fonts.googleapis.com/css?family=NotoSansSP:300,400,700" rel="stylesheet" />
|
||||
<link rel="manifest" href="manifest.webapp" />
|
||||
<style>
|
||||
.bg_white {
|
||||
background: #ffffff;
|
||||
}
|
||||
.bg_light {
|
||||
background: #fafafa;
|
||||
}
|
||||
.bg_black {
|
||||
background: #000000;
|
||||
}
|
||||
.bg_dark {
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
.email-section {
|
||||
padding: 2.5em;
|
||||
}
|
||||
/*BUTTON*/
|
||||
.btn {
|
||||
padding: 10px 15px;
|
||||
display: inline-block;
|
||||
}
|
||||
.btn.btn-primary {
|
||||
border-radius: 5px;
|
||||
background: #007bff;
|
||||
color: #ffffff;
|
||||
}
|
||||
.btn.btn-white {
|
||||
border-radius: 5px;
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
}
|
||||
.btn.btn-white-outline {
|
||||
border-radius: 5px;
|
||||
background: transparent;
|
||||
border: 1px solid #fff;
|
||||
color: #fff;
|
||||
}
|
||||
.btn.btn-black-outline {
|
||||
border-radius: 0px;
|
||||
background: transparent;
|
||||
border: 2px solid #000;
|
||||
color: #000;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-family: 'Lato', sans-serif;
|
||||
color: #000000;
|
||||
margin-top: 0;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Noto Sans JP', sans-serif;
|
||||
font-weight: 400;
|
||||
font-size: 15px;
|
||||
line-height: 1.8;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
a {
|
||||
color: #30e3ca;
|
||||
}
|
||||
|
||||
table {
|
||||
}
|
||||
/*LOGO*/
|
||||
|
||||
.logo h1 {
|
||||
margin: 0;
|
||||
}
|
||||
.logo h1 a {
|
||||
color: #30e3ca;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
|
||||
/*HERO*/
|
||||
.hero {
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.hero .text {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.hero .text h2 {
|
||||
color: #000;
|
||||
font-size: 40px;
|
||||
margin-bottom: 0;
|
||||
font-weight: 400;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.hero .text h3 {
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
}
|
||||
.hero .text h2 span {
|
||||
font-weight: 600;
|
||||
color: #30e3ca;
|
||||
}
|
||||
|
||||
/*HEADING SECTION*/
|
||||
.heading-section {
|
||||
}
|
||||
.heading-section h2 {
|
||||
color: #000000;
|
||||
font-size: 28px;
|
||||
margin-top: 0;
|
||||
line-height: 1.4;
|
||||
font-weight: 400;
|
||||
}
|
||||
.heading-section .subheading {
|
||||
margin-bottom: 20px !important;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
position: relative;
|
||||
}
|
||||
.heading-section .subheading::after {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: -10px;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #30e3ca;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.heading-section-white {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
.heading-section-white h2 {
|
||||
/*font-family: ;*/
|
||||
line-height: 1;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.heading-section-white h2 {
|
||||
color: #ffffff;
|
||||
}
|
||||
.heading-section-white .subheading {
|
||||
margin-bottom: 0;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
ul.social {
|
||||
padding: 0;
|
||||
}
|
||||
ul.social li {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.footer .heading {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
}
|
||||
.footer ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.footer ul li {
|
||||
list-style: none;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.footer ul li a {
|
||||
color: rgba(0, 0, 0, 1);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body width="100%" style="margin: 0; padding: 0 !important; mso-line-height-rule: exactly; background-color: #f1f1f1">
|
||||
<center style="width: 100%; background-color: #f1f1f1">
|
||||
<div
|
||||
style="
|
||||
display: none;
|
||||
font-size: 1px;
|
||||
max-height: 0px;
|
||||
max-width: 0px;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
mso-hide: all;
|
||||
font-family: sans-serif;
|
||||
"
|
||||
>
|
||||
‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌
|
||||
</div>
|
||||
<div style="max-width: 600px; margin: 0 auto" class="email-container">
|
||||
<!-- BEGIN BODY -->
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
|
||||
<tr>
|
||||
<td valign="top" class="bg_white" style="padding: 1em 2.5em 0 2.5em">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td class="logo" style="text-align: center">
|
||||
<h1>
|
||||
<a href="#"
|
||||
><img
|
||||
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333881/DataSurveyLogo2_smr2ok.png"
|
||||
alt=""
|
||||
width="300"
|
||||
/></a>
|
||||
</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<tr>
|
||||
<td valign="middle" class="hero bg_white" style="padding: 3em 0 2em 0">
|
||||
<img
|
||||
src="https://res.cloudinary.com/marielascloud/image/upload/v1626333882/email_v7pjtv.png"
|
||||
alt=""
|
||||
style="width: 300px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<tr>
|
||||
<td valign="middle" class="hero bg_white" style="padding: 2em 0 4em 0">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="text" style="padding: 0 2.5em; text-align: center">
|
||||
<h2 th:text="#{email.restored.greeting(${user.login})}">Hello!</h2>
|
||||
<h3 th:text="#{email.restored.text1}">For your JHipster account a password has been successfully reset</h3>
|
||||
<p style="cursor: pointer">
|
||||
<a th:with="url=(@{|${baseUrl}/login|})" th:href="${url}" class="btn btn-primary">Iniciar Sesión</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="text" style="padding: 1em 2.5em; text-align: center">
|
||||
<p>
|
||||
<span th:text="#{email.restored.text3}"
|
||||
>If you did not make this change, please notify the following email immediately</span
|
||||
>
|
||||
|
||||
<a th:href="#{'mailto:'+email.restored.email}" th:text="#{email.restored.email}">datasurvey@gmail.com</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="text" style="padding: 0.2em 2.5em 0.5em; text-align: center">
|
||||
<p>
|
||||
<span th:text="#{email.restored.text2}">Regards, </span>
|
||||
<br />
|
||||
<em th:text="#{email.signature}">JHipster.</em>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end tr -->
|
||||
<!-- 1 Column Text + Button : END -->
|
||||
</table>
|
||||
<table align="center" role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="margin: auto">
|
||||
<tr>
|
||||
<td valign="middle" class="bg_light footer email-section">
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top" width="33.333%" style="padding-top: 20px">
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="text-align: left; padding-right: 10px">
|
||||
<h3 class="heading">Acerca de</h3>
|
||||
<p>DataSurvey es su compañero más cercano para poder recolectar información valiosa para usted.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top" width="33.333%" style="padding-top: 20px">
|
||||
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="text-align: left; padding-left: 5px; padding-right: 5px">
|
||||
<h3 class="heading">Información de contacto</h3>
|
||||
<ul>
|
||||
<li><span class="text">datasurvey@gmail.com</span></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- end: tr -->
|
||||
<tr>
|
||||
<td class="bg_light" style="text-align: center">
|
||||
<p><a href="https://datasurvey.org" style="color: rgba(0, 0, 0, 0.8)">DataSurvey.org</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
|
@ -1,16 +1,55 @@
|
|||
<div>
|
||||
<div class="account-pages pt-2 pt-sm-5 pb-4 pb-sm-5" style="height: 100vh; background-color: #f1f5f9">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<h1 jhiTranslate="activate.title">Activation</h1>
|
||||
|
||||
<div class="alert alert-success" *ngIf="success">
|
||||
<span jhiTranslate="activate.messages.success"><strong>Your user account has been activated.</strong> Please </span>
|
||||
<a class="alert-link" routerLink="/login" jhiTranslate="global.messages.info.authenticated.link">sign in</a>.
|
||||
<div class="col-xxl-4 col-lg-5">
|
||||
<div class="card mt-5">
|
||||
<!-- Logo -->
|
||||
<div class="pl-4 pt-4 pr-4 pb-1 text-center">
|
||||
<img src="../../content/img_datasurvey/datasurvey-logo-text-black.svg" alt="" />
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger" *ngIf="error" jhiTranslate="activate.messages.error">
|
||||
<div class="card-body p-4">
|
||||
<div class="text-center w-75 m-auto">
|
||||
<h4
|
||||
class="text-dark-50 text-center pb-0 fw-bold p-0 m-0"
|
||||
style="color: #727070; font-weight: 700; font-size: 1.3rem"
|
||||
jhiTranslate="activate.title"
|
||||
>
|
||||
Activación de Cuenta
|
||||
</h4>
|
||||
</div>
|
||||
<div *ngIf="success">
|
||||
<div class="alert alert-success text-center my-2">
|
||||
<span jhiTranslate="activate.messages.success"><strong>Your user account has been activated.</strong></span>
|
||||
<span jhiTranslate="global.messages.info.authenticated.link">sign in</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button class="ds-btn ds-btn--primary" routerLink="/login" jhiTranslate="global.messages.info.authenticated.link">
|
||||
sign in</button
|
||||
>.
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="error">
|
||||
<div class="alert alert-danger text-center my-2" jhiTranslate="activate.messages.error">
|
||||
<strong>Your user could not be activated.</strong> Please use the registration form to sign up.
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button class="ds-btn ds-btn--primary" routerLink="/account/register" jhiTranslate="global.registerLink">
|
||||
create account</button
|
||||
>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card-body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end container -->
|
||||
</div>
|
||||
<!-- end page -->
|
||||
|
|
|
@ -1,14 +1,30 @@
|
|||
<div>
|
||||
<div class="account-pages pt-2 pt-sm-5 pb-4 pb-sm-5" style="height: 100vh; background-color: #f1f5f9">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-4">
|
||||
<h1 jhiTranslate="reset.finish.title">Reset password</h1>
|
||||
|
||||
<div class="alert alert-danger" jhiTranslate="reset.finish.messages.keymissing" *ngIf="initialized && !key">
|
||||
<strong>The password reset key is missing.</strong>
|
||||
<div class="col-xxl-4 col-lg-5">
|
||||
<div class="card mt-5">
|
||||
<!-- Logo -->
|
||||
<div class="pl-4 pt-4 pr-4 pb-1 text-center">
|
||||
<img src="../../content/img_datasurvey/datasurvey-logo-text-black.svg" alt="" />
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning" *ngIf="key && !success">
|
||||
<span jhiTranslate="reset.finish.messages.info">Choose a new password</span>
|
||||
<div class="card-body p-4">
|
||||
<div class="text-center w-75 m-auto">
|
||||
<h4
|
||||
class="text-dark-50 text-center pb-0 fw-bold p-0 m-0"
|
||||
style="color: #727070; font-weight: 700; font-size: 1.3rem"
|
||||
jhiTranslate="reset.finish.title"
|
||||
>
|
||||
Reset password
|
||||
</h4>
|
||||
|
||||
<p class="mb-4" style="color: rgba(146, 146, 146, 0.664)" *ngIf="key && !success" jhiTranslate="reset.finish.messages.info">
|
||||
Choose a new password
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="alert alert-danger" jhiTranslate="reset.finish.messages.keymissing" *ngIf="initialized && !key">
|
||||
<strong>The password reset key is missing.</strong>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger" *ngIf="error">
|
||||
|
@ -16,18 +32,24 @@
|
|||
>Your password couldn't be reset. Remember a password request is only valid for 24 hours.</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-success" *ngIf="success">
|
||||
<span jhiTranslate="reset.finish.messages.success"><strong>Your password has been reset.</strong> Please </span>
|
||||
<a class="alert-link" routerLink="/login" jhiTranslate="global.messages.info.authenticated.link">sign in</a>.
|
||||
<div *ngIf="success">
|
||||
<div class="alert alert-success text-center my-2">
|
||||
<span jhiTranslate="reset.finish.messages.success"><strong>Your password has been reset.</strong></span>
|
||||
<strong><span jhiTranslate="global.messages.info.authenticated.link">sign in</span></strong>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<button class="ds-btn ds-btn--primary" routerLink="/login" jhiTranslate="global.messages.info.authenticated.botonInicio">
|
||||
sign in</button
|
||||
>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger" *ngIf="doNotMatch" jhiTranslate="global.messages.error.dontmatch">
|
||||
The password and its confirmation do not match!
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf="key && !success">
|
||||
<form name="form" role="form" (ngSubmit)="finishReset()" [formGroup]="passwordForm">
|
||||
<form name="form" class="ds-form" role="form" (ngSubmit)="finishReset()" [formGroup]="passwordForm">
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" for="newPassword" jhiTranslate="global.form.newpassword.label">New password</label>
|
||||
<input
|
||||
|
@ -60,7 +82,7 @@
|
|||
*ngIf="passwordForm.get('newPassword')?.errors?.minlength"
|
||||
jhiTranslate="global.messages.validate.newpassword.minlength"
|
||||
>
|
||||
Your password is required to be at least 4 characters.
|
||||
Your password is required to be at least 8 characters.
|
||||
</small>
|
||||
|
||||
<small
|
||||
|
@ -72,7 +94,7 @@
|
|||
</small>
|
||||
</div>
|
||||
|
||||
<jhi-password-strength-bar [passwordToCheck]="passwordForm.get('newPassword')!.value"></jhi-password-strength-bar>
|
||||
<!--<jhi-password-strength-bar [passwordToCheck]="passwordForm.get('newPassword')!.value"></jhi-password-strength-bar>-->
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
@ -108,7 +130,7 @@
|
|||
*ngIf="passwordForm.get('confirmPassword')?.errors?.minlength"
|
||||
jhiTranslate="global.messages.validate.confirmpassword.minlength"
|
||||
>
|
||||
Your password confirmation is required to be at least 4 characters.
|
||||
Your password confirmation is required to be at least 8 characters.
|
||||
</small>
|
||||
|
||||
<small
|
||||
|
@ -121,17 +143,30 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<button
|
||||
type="submit"
|
||||
[disabled]="passwordForm.invalid"
|
||||
class="btn btn-primary"
|
||||
class="ds-btn ds-btn--primary"
|
||||
jhiTranslate="reset.finish.form.button"
|
||||
data-cy="submit"
|
||||
>
|
||||
Reset Password
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card-body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end container -->
|
||||
</div>
|
||||
<!-- end page -->
|
||||
|
|
|
@ -19,8 +19,8 @@ export class PasswordResetFinishComponent implements OnInit, AfterViewInit {
|
|||
key = '';
|
||||
|
||||
passwordForm = this.fb.group({
|
||||
newPassword: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(50)]],
|
||||
confirmPassword: ['', [Validators.required, Validators.minLength(4), Validators.maxLength(50)]],
|
||||
newPassword: ['', [Validators.required, Validators.minLength(8), Validators.maxLength(50)]],
|
||||
confirmPassword: ['', [Validators.required, Validators.minLength(8), Validators.maxLength(50)]],
|
||||
});
|
||||
|
||||
constructor(private passwordResetFinishService: PasswordResetFinishService, private route: ActivatedRoute, private fb: FormBuilder) {}
|
||||
|
|
|
@ -1,21 +1,38 @@
|
|||
<div>
|
||||
<div class="account-pages pt-2 pt-sm-5 pb-4 pb-sm-5" style="height: 100vh; background-color: #f1f5f9">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<h1 jhiTranslate="reset.request.title">Reset your password</h1>
|
||||
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<div class="alert alert-warning" *ngIf="!success">
|
||||
<span jhiTranslate="reset.request.messages.info">Enter the email address you used to register.</span>
|
||||
<div class="col-xxl-4 col-lg-5">
|
||||
<div class="card mt-5">
|
||||
<!-- Logo -->
|
||||
<div class="pl-4 pt-4 pr-4 pb-1 text-center">
|
||||
<img src="../../content/img_datasurvey/datasurvey-logo-text-black.svg" alt="" />
|
||||
</div>
|
||||
|
||||
<div class="card-body p-4">
|
||||
<div class="text-center w-75 m-auto">
|
||||
<h4
|
||||
class="text-dark-50 text-center pb-0 fw-bold p-0 m-0"
|
||||
style="color: #727070; font-weight: 700; font-size: 1.3rem"
|
||||
jhiTranslate="reset.request.title"
|
||||
>
|
||||
RESET YOUR PASSWORDD
|
||||
</h4>
|
||||
<p class="mb-4" style="color: rgba(146, 146, 146, 0.664)" jhiTranslate="reset.request.messages.info">
|
||||
Enter the email address you used to register.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<div class="alert alert-success" *ngIf="success">
|
||||
<span jhiTranslate="reset.request.messages.success">Check your emails for details on how to reset your password.</span>
|
||||
</div>
|
||||
|
||||
<form *ngIf="!success" name="form" role="form" (ngSubmit)="requestReset()" [formGroup]="resetRequestForm">
|
||||
<div class="alert alert-danger" *ngIf="errorEmailNotExists" jhiTranslate="reset.request.messages.error.emailnotexists">
|
||||
<strong>Email no exists!</strong> Please choose another one.
|
||||
</div>
|
||||
</div>
|
||||
<form *ngIf="!success" name="form" class="ds-form" role="form" (ngSubmit)="requestReset()" [formGroup]="resetRequestForm">
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" for="email" jhiTranslate="global.form.email.label">Email</label>
|
||||
<label class="form-label" for="email" jhiTranslate="global.form.email.label">Email</label>
|
||||
<input
|
||||
type="email"
|
||||
class="form-control"
|
||||
|
@ -29,7 +46,8 @@
|
|||
|
||||
<div
|
||||
*ngIf="
|
||||
resetRequestForm.get('email')!.invalid && (resetRequestForm.get('email')!.dirty || resetRequestForm.get('email')!.touched)
|
||||
resetRequestForm.get('email')!.invalid &&
|
||||
(resetRequestForm.get('email')!.dirty || resetRequestForm.get('email')!.touched)
|
||||
"
|
||||
>
|
||||
<small
|
||||
|
@ -63,19 +81,52 @@
|
|||
>
|
||||
Your email cannot be longer than 100 characters.
|
||||
</small>
|
||||
<small class="form-text text-danger" *ngIf="resetRequestForm.get('email')?.errors?.email">
|
||||
Se requiere un correo electrónico válido.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<button
|
||||
type="button"
|
||||
id="cancel-save"
|
||||
data-cy="entityCreateCancelButton"
|
||||
class="ds-btn ds-btn--secondary"
|
||||
(click)="previousState()"
|
||||
>
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.back">Volver</span>
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
[disabled]="resetRequestForm.invalid"
|
||||
class="btn btn-primary"
|
||||
class="ds-btn ds-btn--primary"
|
||||
jhiTranslate="reset.request.form.button"
|
||||
data-cy="submit"
|
||||
>
|
||||
Reset
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- end card-body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
<div class="row mt-3">
|
||||
<div class="col-12 text-center">
|
||||
<p class="text-muted">
|
||||
¿Aún no se encuentra registrado/a?
|
||||
<a routerLink="/account/register" class="text-muted ms-1"><b>Crea una cuenta</b></a>
|
||||
</p>
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end container -->
|
||||
</div>
|
||||
<!-- end page -->
|
||||
|
|
|
@ -2,6 +2,8 @@ import { Component, AfterViewInit, ElementRef, ViewChild } from '@angular/core';
|
|||
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';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-password-reset-init',
|
||||
|
@ -10,7 +12,8 @@ import { PasswordResetInitService } from './password-reset-init.service';
|
|||
export class PasswordResetInitComponent implements AfterViewInit {
|
||||
@ViewChild('email', { static: false })
|
||||
email?: ElementRef;
|
||||
|
||||
errorEmailNotExists = false;
|
||||
error = false;
|
||||
success = false;
|
||||
resetRequestForm = this.fb.group({
|
||||
email: ['', [Validators.required, Validators.minLength(5), Validators.maxLength(254), Validators.email]],
|
||||
|
@ -25,6 +28,22 @@ export class PasswordResetInitComponent implements AfterViewInit {
|
|||
}
|
||||
|
||||
requestReset(): void {
|
||||
this.passwordResetInitService.save(this.resetRequestForm.get(['email'])!.value).subscribe(() => (this.success = true));
|
||||
this.errorEmailNotExists = false;
|
||||
this.passwordResetInitService.save(this.resetRequestForm.get(['email'])!.value).subscribe(
|
||||
() => (this.success = true),
|
||||
response => this.processError(response)
|
||||
);
|
||||
}
|
||||
|
||||
previousState(): void {
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
processError(response: HttpErrorResponse): void {
|
||||
if (response.status === 400 && response.error.type === EMAIL_NOT_EXISTS_TYPE) {
|
||||
this.errorEmailNotExists = true;
|
||||
} else {
|
||||
this.error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="account-pages pt-2 pt-sm-5 pb-4 pb-sm-5" style="height: 100vh; background-color: #f1f5f9">
|
||||
<div class="account-pages pt-2 pt-sm-5 pb-4 pb-sm-5" style="/*height: 100vh;*/ height: 100%; background-color: #f1f5f9">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-xxl-4 col-lg-5">
|
||||
|
|
|
@ -175,12 +175,12 @@
|
|||
<p class="ds-title">Perfil</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="ds-subtitle">Información general de su usuario, el correo electrónico es su identificador en DataSurvey.</p>
|
||||
<p class="ds-subtitle">Información general de su usuario, el correo electrónico es su identificador en DataSurvey</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form -->
|
||||
<!-- Form de info usuario -->
|
||||
<form
|
||||
autocomplete="off"
|
||||
class="ds-form col-lg ml-lg-5 mr-lg-5 pr-lg-5"
|
||||
|
@ -191,6 +191,20 @@
|
|||
[formGroup]="editForm"
|
||||
>
|
||||
<div class="row mb-2">
|
||||
<div
|
||||
class="alert alert-danger"
|
||||
*ngIf="error"
|
||||
jhiTranslate="global.messages.info.authenticated.updateForm"
|
||||
data-cy="loginError"
|
||||
></div>
|
||||
|
||||
<div *ngIf="success" class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
Sus datos fueron actualizados de manera exitosa
|
||||
<!--<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>-->
|
||||
</div>
|
||||
|
||||
<div class="form-group w-100">
|
||||
<label class="form-control-label" for="field_email">Correo electrónico</label>
|
||||
<input type="text" class="form-control" name="email" id="field_email" data-cy="email" formControlName="email" [readonly]="true" />
|
||||
|
@ -221,7 +235,7 @@
|
|||
<input
|
||||
id="field_fechaNacimiento"
|
||||
data-cy="fechaNacimiento"
|
||||
type="datetime-local"
|
||||
type="date"
|
||||
class="form-control"
|
||||
name="fechaNacimiento"
|
||||
formControlName="fechaNacimiento"
|
||||
|
@ -270,36 +284,78 @@
|
|||
</div>
|
||||
<div>
|
||||
<p class="ds-subtitle">
|
||||
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
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-danger" *ngIf="isGoogle" jhiTranslate="login.messages.error.isGoogle" data-cy="loginError"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form -->
|
||||
<!-- Form de password-->
|
||||
<form
|
||||
autocomplete="off"
|
||||
class="ds-form col-lg ml-lg-5 mr-lg-5 pr-lg-5"
|
||||
name="passwordForm"
|
||||
role="form"
|
||||
novalidate
|
||||
(ngSubmit)="save()"
|
||||
(ngSubmit)="savePassword()"
|
||||
[formGroup]="passwordForm"
|
||||
>
|
||||
<div class="row mb-3 pb-3" style="border-bottom: 1px solid #e7ebf3">
|
||||
<div
|
||||
class="alert alert-danger"
|
||||
*ngIf="errorPassword && !doNotMatch && !successPassword && !samePassword"
|
||||
jhiTranslate="global.messages.info.authenticated.passwordForm"
|
||||
data-cy="loginError"
|
||||
></div>
|
||||
|
||||
<div
|
||||
*ngIf="successPassword && !errorPassword && !samePassword && !doNotMatch"
|
||||
class="alert alert-success alert-dismissible fade show"
|
||||
role="alert"
|
||||
>
|
||||
Sus contraseña fue actualizada de manera exitosa
|
||||
<!-- <button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>-->
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="alert alert-danger"
|
||||
*ngIf="doNotMatch && !successPassword && !errorPassword"
|
||||
jhiTranslate="global.messages.error.dontmatch"
|
||||
>
|
||||
The password and its confirmation do not match!
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="alert alert-danger"
|
||||
*ngIf="samePassword && !successPassword && !errorPassword && !doNotMatch"
|
||||
jhiTranslate="global.messages.error.samePassword"
|
||||
>
|
||||
The password and its confirmation do not match!
|
||||
</div>
|
||||
|
||||
<div class="form-group w-100">
|
||||
<label class="form-control-label" for="field_password">Contraseña actual</label>
|
||||
<input
|
||||
type="text"
|
||||
type="password"
|
||||
class="form-control"
|
||||
name="password"
|
||||
id="field_password"
|
||||
data-cy="password"
|
||||
formControlName="password"
|
||||
placeholder="Su contraseña actual"
|
||||
[readOnly]="isGoogle"
|
||||
/>
|
||||
|
||||
<div
|
||||
*ngIf="passwordForm.get('password')!.invalid && (passwordForm.get('password')!.dirty || passwordForm.get('password')!.touched)"
|
||||
*ngIf="
|
||||
passwordForm.get('password')!.invalid &&
|
||||
(passwordForm.get('password')!.dirty || passwordForm.get('password')!.touched) &&
|
||||
!isGoogle
|
||||
"
|
||||
>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
|
@ -308,6 +364,22 @@
|
|||
>
|
||||
This field is required.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="passwordForm.get('password')?.errors?.minlength"
|
||||
jhiTranslate="global.messages.validate.newpassword.minlength"
|
||||
>
|
||||
Your password is required to be at least 4 characters.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="passwordForm.get('password')?.errors?.maxlength"
|
||||
jhiTranslate="global.messages.validate.newpassword.maxlength"
|
||||
>
|
||||
Your password cannot be longer than 50 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -315,18 +387,20 @@
|
|||
<div class="form-group w-100">
|
||||
<label class="form-control-label" for="field_passwordNew">Contraseña nueva</label>
|
||||
<input
|
||||
type="text"
|
||||
type="password"
|
||||
class="form-control"
|
||||
name="passwordNew"
|
||||
id="field_passwordNew"
|
||||
data-cy="passwordNew"
|
||||
formControlName="passwordNew"
|
||||
placeholder="Contraseña nueva"
|
||||
[readOnly]="isGoogle"
|
||||
/>
|
||||
<div
|
||||
*ngIf="
|
||||
passwordForm.get('passwordNew')!.invalid &&
|
||||
(passwordForm.get('passwordNew')!.dirty || passwordForm.get('passwordNew')!.touched)
|
||||
(passwordForm.get('passwordNew')!.dirty || passwordForm.get('passwordNew')!.touched) &&
|
||||
!isGoogle
|
||||
"
|
||||
>
|
||||
<small
|
||||
|
@ -336,6 +410,22 @@
|
|||
>
|
||||
This field is required.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="passwordForm.get('passwordNew')?.errors?.minlength"
|
||||
jhiTranslate="global.messages.validate.newpassword.minlength"
|
||||
>
|
||||
Your password is required to be at least 4 characters.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="passwordForm.get('passwordNew')?.errors?.maxlength"
|
||||
jhiTranslate="global.messages.validate.newpassword.maxlength"
|
||||
>
|
||||
Your password cannot be longer than 50 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -344,18 +434,20 @@
|
|||
<div class="form-group w-100">
|
||||
<label class="form-control-label" for="field_passwordNewConfirm">Confirmar contraseña nueva</label>
|
||||
<input
|
||||
type="text"
|
||||
type="password"
|
||||
class="form-control"
|
||||
name="passwordNewConfirm"
|
||||
id="field_passwordNewConfirm"
|
||||
data-cy="passwordNewConfirm"
|
||||
formControlName="passwordNewConfirm"
|
||||
placeholder="Contraseña nueva"
|
||||
[readOnly]="isGoogle"
|
||||
/>
|
||||
<div
|
||||
*ngIf="
|
||||
passwordForm.get('passwordNewConfirm')!.invalid &&
|
||||
(passwordForm.get('passwordNewConfirm')!.dirty || passwordForm.get('passwordNewConfirm')!.touched)
|
||||
(passwordForm.get('passwordNewConfirm')!.dirty || passwordForm.get('passwordNewConfirm')!.touched) &&
|
||||
!isGoogle
|
||||
"
|
||||
>
|
||||
<small
|
||||
|
@ -365,12 +457,28 @@
|
|||
>
|
||||
This field is required.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="passwordForm.get('passwordNewConfirm')?.errors?.minlength"
|
||||
jhiTranslate="global.messages.validate.newpassword.minlength"
|
||||
>
|
||||
Your password is required to be at least 4 characters.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="passwordForm.get('passwordNewConfirm')?.errors?.maxlength"
|
||||
jhiTranslate="global.messages.validate.newpassword.maxlength"
|
||||
>
|
||||
Your password cannot be longer than 50 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<button
|
||||
*ngIf="!isGoogle"
|
||||
type="button"
|
||||
id="cancel-save"
|
||||
data-cy="entityCreateCancelButton"
|
||||
|
@ -381,6 +489,7 @@
|
|||
</button>
|
||||
|
||||
<button
|
||||
*ngIf="!isGoogle"
|
||||
type="submit"
|
||||
id="save-entity"
|
||||
data-cy="entityCreateSaveButton"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { LocalStorageService } from 'ngx-webstorage';
|
||||
|
||||
jest.mock('@ngx-translate/core');
|
||||
jest.mock('app/core/auth/account.service');
|
||||
|
||||
|
@ -19,6 +21,7 @@ describe('Component Tests', () => {
|
|||
let comp: SettingsComponent;
|
||||
let fixture: ComponentFixture<SettingsComponent>;
|
||||
let mockAccountService: AccountService;
|
||||
let localStorage: LocalStorageService;
|
||||
const account: Account = {
|
||||
id: 0,
|
||||
firstName: 'John',
|
||||
|
@ -36,17 +39,23 @@ describe('Component Tests', () => {
|
|||
TestBed.configureTestingModule({
|
||||
imports: [RouterTestingModule, HttpClientTestingModule],
|
||||
declarations: [SettingsComponent],
|
||||
providers: [FormBuilder, TranslateService, AccountService],
|
||||
providers: [FormBuilder, TranslateService, AccountService, LocalStorageService],
|
||||
})
|
||||
.overrideTemplate(SettingsComponent, '')
|
||||
.compileComponents();
|
||||
localStorage = TestBed.inject(LocalStorageService);
|
||||
})
|
||||
);
|
||||
|
||||
it('should be created', () => {
|
||||
expect(localStorage).toBeTruthy();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SettingsComponent);
|
||||
comp = fixture.componentInstance;
|
||||
mockAccountService = TestBed.inject(AccountService);
|
||||
localStorage = TestBed.inject(LocalStorageService);
|
||||
mockAccountService.identity = jest.fn(() => of(account));
|
||||
mockAccountService.getAuthenticationState = jest.fn(() => of(account));
|
||||
});
|
||||
|
@ -63,6 +72,10 @@ describe('Component Tests', () => {
|
|||
// expect(comp.success).toBe(true);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(localStorage).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should notify of error upon failed save', () => {
|
||||
// GIVEN
|
||||
mockAccountService.save = jest.fn(() => throwError('ERROR'));
|
|
@ -1,12 +1,11 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { Component, ContentChild, OnInit } from '@angular/core';
|
||||
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
|
||||
import { FormBuilder, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
|
||||
import { Observable } from 'rxjs';
|
||||
import { finalize, map } from 'rxjs/operators';
|
||||
|
||||
import * as dayjs from 'dayjs';
|
||||
import { DATE_TIME_FORMAT } from 'app/config/input.constants';
|
||||
import { DATE_FORMAT, DATE_TIME_FORMAT } from 'app/config/input.constants';
|
||||
import { IUser } from 'app/entities/user/user.model';
|
||||
import { UserService } from 'app/entities/user/user.service';
|
||||
import { IPlantilla } from 'app/entities/plantilla/plantilla.model';
|
||||
|
@ -14,17 +13,30 @@ import { PlantillaService } from 'app/entities/plantilla/service/plantilla.servi
|
|||
import { IUsuarioExtra, UsuarioExtra } from 'app/entities/usuario-extra/usuario-extra.model';
|
||||
import { UsuarioExtraService } from 'app/entities/usuario-extra/service/usuario-extra.service';
|
||||
import { AccountService } from 'app/core/auth/account.service';
|
||||
import { LocalStorageService } from 'ngx-webstorage';
|
||||
import { EMAIL_ALREADY_USED_TYPE, LOGIN_ALREADY_USED_TYPE } from '../../config/error.constants';
|
||||
import { PasswordService } from '../password/password.service';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-settings',
|
||||
templateUrl: './settings.component.html',
|
||||
})
|
||||
export class SettingsComponent implements OnInit {
|
||||
currentUrl = this.router.url;
|
||||
isSaving = false;
|
||||
|
||||
success = false;
|
||||
successPassword = false;
|
||||
samePassword = false;
|
||||
error = false;
|
||||
errorPassword = false;
|
||||
doNotMatch = false;
|
||||
usersSharedCollection: IUser[] = [];
|
||||
plantillasSharedCollection: IPlantilla[] = [];
|
||||
showPassword = false;
|
||||
|
||||
isGoogle = this.localStorageService.retrieve('IsGoogle');
|
||||
|
||||
//Form info del usuario
|
||||
editForm = this.fb.group({
|
||||
email: [null, [Validators.required]],
|
||||
id: [],
|
||||
|
@ -36,10 +48,11 @@ export class SettingsComponent implements OnInit {
|
|||
plantillas: [],
|
||||
});
|
||||
|
||||
//form de la contraseña
|
||||
passwordForm = this.fb.group({
|
||||
password: [null, [Validators.required]],
|
||||
passwordNew: [null, [Validators.required]],
|
||||
passwordNewConfirm: [null, [Validators.required]],
|
||||
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)]],
|
||||
});
|
||||
|
||||
usuarioExtra: UsuarioExtra | null = null;
|
||||
|
@ -75,13 +88,18 @@ export class SettingsComponent implements OnInit {
|
|||
{ name: 'C28' },
|
||||
];
|
||||
|
||||
/* @ContentChild(IonInput) input: IonInput;*/
|
||||
|
||||
constructor(
|
||||
protected usuarioExtraService: UsuarioExtraService,
|
||||
protected userService: UserService,
|
||||
protected plantillaService: PlantillaService,
|
||||
protected activatedRoute: ActivatedRoute,
|
||||
protected fb: FormBuilder,
|
||||
protected accountService: AccountService
|
||||
protected accountService: AccountService,
|
||||
private localStorageService: LocalStorageService,
|
||||
protected passwordService: PasswordService,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
@ -103,6 +121,8 @@ export class SettingsComponent implements OnInit {
|
|||
}
|
||||
});
|
||||
|
||||
//console.log(this.isGoogle);
|
||||
|
||||
// this.activatedRoute.data.subscribe(({ usuarioExtra }) => {
|
||||
|
||||
// });
|
||||
|
@ -112,13 +132,37 @@ export class SettingsComponent implements OnInit {
|
|||
window.history.back();
|
||||
}
|
||||
|
||||
//Se manda la info a guardar
|
||||
save(): void {
|
||||
this.isSaving = true;
|
||||
const usuarioExtra = this.createFromForm();
|
||||
if (usuarioExtra.id !== undefined) {
|
||||
|
||||
console.log(usuarioExtra.iconoPerfil);
|
||||
console.log(usuarioExtra.fechaNacimiento);
|
||||
|
||||
this.subscribeToSaveResponse(this.usuarioExtraService.update(usuarioExtra));
|
||||
}
|
||||
|
||||
savePassword(): void {
|
||||
this.successPassword = false;
|
||||
this.doNotMatch = false;
|
||||
this.samePassword = false;
|
||||
this.errorPassword = false;
|
||||
|
||||
const passwordNew = this.passwordForm.get(['passwordNew'])!.value;
|
||||
const passwordOld = this.passwordForm.get(['password'])!.value;
|
||||
if (passwordOld == passwordNew) {
|
||||
this.samePassword = true;
|
||||
} else {
|
||||
this.subscribeToSaveResponse(this.usuarioExtraService.create(usuarioExtra));
|
||||
if (passwordNew !== this.passwordForm.get(['passwordNewConfirm'])!.value) {
|
||||
(this.doNotMatch = true), (this.samePassword = false);
|
||||
} else {
|
||||
this.passwordService.save(passwordNew, passwordOld).subscribe(
|
||||
() => (this.successPassword = true),
|
||||
|
||||
() => (this.errorPassword = true)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,10 +187,21 @@ export class SettingsComponent implements OnInit {
|
|||
|
||||
protected subscribeToSaveResponse(result: Observable<HttpResponse<IUsuarioExtra>>): void {
|
||||
result.pipe(finalize(() => this.onSaveFinalize())).subscribe(
|
||||
() => this.onSaveSuccess(),
|
||||
() => this.onSaveError()
|
||||
() => ((this.success = true), this.windowReload()),
|
||||
response => this.processError(response)
|
||||
);
|
||||
}
|
||||
windowReload() {
|
||||
this.router.navigate(['account/settings']).then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
processError(response: HttpErrorResponse): void {
|
||||
if (response.status === 400) {
|
||||
this.error = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected onSaveSuccess(): void {
|
||||
this.previousState();
|
||||
|
@ -160,22 +215,25 @@ export class SettingsComponent implements OnInit {
|
|||
this.isSaving = false;
|
||||
}
|
||||
|
||||
//Llena el formulario para que se vea en pantalla
|
||||
protected updateForm(usuarioExtra: IUsuarioExtra): void {
|
||||
this.editForm.patchValue({
|
||||
email: usuarioExtra.user?.login,
|
||||
id: usuarioExtra.id,
|
||||
nombre: usuarioExtra.nombre,
|
||||
iconoPerfil: usuarioExtra.iconoPerfil,
|
||||
fechaNacimiento: usuarioExtra.fechaNacimiento ? usuarioExtra.fechaNacimiento.format(DATE_TIME_FORMAT) : null,
|
||||
fechaNacimiento: usuarioExtra.fechaNacimiento ? usuarioExtra.fechaNacimiento.format(DATE_FORMAT) : null,
|
||||
estado: usuarioExtra.estado,
|
||||
user: usuarioExtra.user,
|
||||
plantillas: usuarioExtra.plantillas,
|
||||
});
|
||||
|
||||
// Update swiper
|
||||
this.profileIcon = parseInt(usuarioExtra.iconoPerfil!);
|
||||
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';
|
||||
}
|
||||
});
|
||||
|
@ -210,9 +268,9 @@ export class SettingsComponent implements OnInit {
|
|||
...new UsuarioExtra(),
|
||||
id: this.editForm.get(['id'])!.value,
|
||||
nombre: this.editForm.get(['nombre'])!.value,
|
||||
iconoPerfil: this.editForm.get(['iconoPerfil'])!.value,
|
||||
iconoPerfil: this.profileIcon,
|
||||
fechaNacimiento: this.editForm.get(['fechaNacimiento'])!.value
|
||||
? dayjs(this.editForm.get(['fechaNacimiento'])!.value, DATE_TIME_FORMAT)
|
||||
? dayjs(this.editForm.get(['fechaNacimiento'])!.value, DATE_FORMAT)
|
||||
: undefined,
|
||||
estado: this.editForm.get(['estado'])!.value,
|
||||
user: this.editForm.get(['user'])!.value,
|
||||
|
@ -225,6 +283,8 @@ export class SettingsComponent implements OnInit {
|
|||
document.querySelectorAll('.active').forEach(e => e.classList.remove('active'));
|
||||
event.target.classList.add('active');
|
||||
this.profileIcon = +event.target.getAttribute('id')! + 1;
|
||||
|
||||
//console.log(this.profileIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import { TranslateModule, TranslateService, TranslateLoader, MissingTranslationH
|
|||
import { NgxWebstorageModule, SessionStorageService } from 'ngx-webstorage';
|
||||
import * as dayjs from 'dayjs';
|
||||
import { NgbDateAdapter, NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
import { LocalStorageService } from 'ngx-webstorage';
|
||||
import { SERVER_API_URL } from './app.constants';
|
||||
import { ApplicationConfigService } from 'app/core/config/application-config.service';
|
||||
import './config/dayjs';
|
||||
|
@ -35,6 +35,7 @@ import { SidebarComponent } from './layouts/sidebar/sidebar.component';
|
|||
|
||||
@NgModule({
|
||||
imports: [
|
||||
NgxWebstorageModule.forRoot(),
|
||||
BrowserModule,
|
||||
SharedModule,
|
||||
HomeModule,
|
||||
|
|
|
@ -1,3 +1,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';
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
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, CategoriaDetailComponent, CategoriaUpdateComponent, CategoriaDeleteDialogComponent],
|
||||
declarations: [CategoriaComponent, CategoriaUpdateComponent, CategoriaDeleteDialogComponent],
|
||||
entryComponents: [CategoriaDeleteDialogComponent],
|
||||
})
|
||||
export class CategoriaModule {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<form class="ds-form" *ngIf="categoria" name="deleteForm" (ngSubmit)="confirmDelete(categoria.id!)">
|
||||
<form class="ds-form" *ngIf="categoria" name="deleteForm" (ngSubmit)="confirmDelete(categoria!)">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" data-cy="categoriaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
|||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<p id="jhi-delete-categoria-heading" jhiTranslate="dataSurveyApp.categoria.delete.question" [translateValues]="{ id: categoria.id }">
|
||||
Are you sure you want to delete this Categoria?
|
||||
Are you sure you want to delete this category?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
jest.mock('@ng-bootstrap/ng-bootstrap');
|
||||
|
||||
import { ComponentFixture, TestBed, inject, fakeAsync, tick } from '@angular/core/testing';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { of } from 'rxjs';
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
import { CategoriaService } from '../service/categoria.service';
|
||||
|
||||
import { CategoriaDeleteDialogComponent } from './categoria-delete-dialog.component';
|
||||
|
||||
describe('Component Tests', () => {
|
||||
describe('Categoria Management Delete Component', () => {
|
||||
let comp: CategoriaDeleteDialogComponent;
|
||||
let fixture: ComponentFixture<CategoriaDeleteDialogComponent>;
|
||||
let service: CategoriaService;
|
||||
let mockActiveModal: NgbActiveModal;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
declarations: [CategoriaDeleteDialogComponent],
|
||||
providers: [NgbActiveModal],
|
||||
})
|
||||
.overrideTemplate(CategoriaDeleteDialogComponent, '')
|
||||
.compileComponents();
|
||||
fixture = TestBed.createComponent(CategoriaDeleteDialogComponent);
|
||||
comp = fixture.componentInstance;
|
||||
service = TestBed.inject(CategoriaService);
|
||||
mockActiveModal = TestBed.inject(NgbActiveModal);
|
||||
});
|
||||
|
||||
describe('confirmDelete', () => {
|
||||
it('Should call delete service on confirmDelete', inject(
|
||||
[],
|
||||
fakeAsync(() => {
|
||||
// GIVEN
|
||||
jest.spyOn(service, 'delete').mockReturnValue(of(new HttpResponse({})));
|
||||
|
||||
// WHEN
|
||||
comp.confirmDelete(123);
|
||||
tick();
|
||||
|
||||
// THEN
|
||||
expect(service.delete).toHaveBeenCalledWith(123);
|
||||
expect(mockActiveModal.close).toHaveBeenCalledWith('deleted');
|
||||
})
|
||||
));
|
||||
|
||||
it('Should not call delete service on clear', () => {
|
||||
// GIVEN
|
||||
jest.spyOn(service, 'delete');
|
||||
|
||||
// WHEN
|
||||
comp.cancel();
|
||||
|
||||
// THEN
|
||||
expect(service.delete).not.toHaveBeenCalled();
|
||||
expect(mockActiveModal.close).not.toHaveBeenCalled();
|
||||
expect(mockActiveModal.dismiss).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,7 +1,10 @@
|
|||
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 { ICategoria } from '../categoria.model';
|
||||
import { Categoria, ICategoria } from '../categoria.model';
|
||||
import { CategoriaService } from '../service/categoria.service';
|
||||
|
||||
@Component({
|
||||
|
@ -9,16 +12,52 @@ import { CategoriaService } from '../service/categoria.service';
|
|||
})
|
||||
export class CategoriaDeleteDialogComponent {
|
||||
categoria?: ICategoria;
|
||||
encuestas?: IEncuesta[];
|
||||
encuestasFiltradas?: IEncuesta[];
|
||||
|
||||
constructor(protected categoriaService: CategoriaService, protected activeModal: NgbActiveModal) {}
|
||||
constructor(
|
||||
protected categoriaService: CategoriaService,
|
||||
protected activeModal: NgbActiveModal,
|
||||
protected encuestaService: EncuestaService
|
||||
) {}
|
||||
|
||||
cancel(): void {
|
||||
this.activeModal.dismiss();
|
||||
}
|
||||
|
||||
confirmDelete(id: number): void {
|
||||
this.categoriaService.delete(id).subscribe(() => {
|
||||
confirmDelete(categoria: ICategoria): void {
|
||||
this.ensureNulaExists();
|
||||
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);
|
||||
});
|
||||
}
|
||||
categoria.estado = EstadoCategoria.INACTIVE;
|
||||
this.categoriaService.update(categoria).subscribe(() => {
|
||||
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 => {
|
||||
this.encuestas = res.body ?? [];
|
||||
});
|
||||
if (this.encuestas) {
|
||||
this.encuestasFiltradas = this.encuestas.filter(encuesta => {
|
||||
encuesta.categoria!.id === categoria.id;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<div *ngIf="categoria">
|
||||
<h2 data-cy="categoriaDetailsHeading"><span jhiTranslate="dataSurveyApp.categoria.detail.title">Categoria</span></h2>
|
||||
|
||||
<hr />
|
||||
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<jhi-alert></jhi-alert>
|
||||
|
||||
<dl class="row-md jh-entity-details">
|
||||
<dt><span jhiTranslate="global.field.id">ID</span></dt>
|
||||
<dd>
|
||||
<span>{{ categoria.id }}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="dataSurveyApp.categoria.nombre">Nombre</span></dt>
|
||||
<dd>
|
||||
<span>{{ categoria.nombre }}</span>
|
||||
</dd>
|
||||
<dt><span jhiTranslate="dataSurveyApp.categoria.estado">Estado</span></dt>
|
||||
<dd>
|
||||
<span jhiTranslate="{{ 'dataSurveyApp.EstadoCategoria.' + categoria.estado }}">{{ categoria.estado }}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<button type="submit" (click)="previousState()" class="btn btn-ds btn-info" data-cy="entityDetailsBackButton">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.back">Back</span>
|
||||
</button>
|
||||
|
||||
<button type="button" [routerLink]="['/categoria', categoria.id, 'edit']" class="btn btn-ds btn-ds-primary btn-primary">
|
||||
<fa-icon icon="pencil-alt"></fa-icon> <span jhiTranslate="entity.action.edit">Edit</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,38 +0,0 @@
|
|||
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<CategoriaDetailComponent>;
|
||||
|
||||
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 }));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,24 +0,0 @@
|
|||
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();
|
||||
}
|
||||
}
|
|
@ -38,7 +38,7 @@ export class CategoriaComponent implements OnInit {
|
|||
this.loadAll();
|
||||
}
|
||||
|
||||
trackId(index: number, item: ICategoria): number {
|
||||
trackId(_index: number, item: ICategoria): number {
|
||||
return item.id!;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ 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';
|
||||
|
||||
|
@ -13,14 +12,6 @@ const categoriaRoute: Routes = [
|
|||
component: CategoriaComponent,
|
||||
canActivate: [UserRouteAccessService],
|
||||
},
|
||||
{
|
||||
path: ':id/view',
|
||||
component: CategoriaDetailComponent,
|
||||
resolve: {
|
||||
categoria: CategoriaRoutingResolveService,
|
||||
},
|
||||
canActivate: [UserRouteAccessService],
|
||||
},
|
||||
{
|
||||
path: 'new',
|
||||
component: CategoriaUpdateComponent,
|
||||
|
|
|
@ -64,7 +64,7 @@ export class CategoriaUpdateComponent implements OnInit {
|
|||
|
||||
protected categoryExists(categoria: ICategoria): boolean {
|
||||
this.loadAll();
|
||||
var condicion = this.categorias!.some(cat => cat.nombre!.toLowerCase() === categoria.nombre!.toLowerCase());
|
||||
var condicion = this.categorias!.some(cat => cat.nombre!.toLowerCase() === categoria.nombre!.toLowerCase() && cat.id !== categoria.id);
|
||||
return condicion;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ describe('Service Tests', () => {
|
|||
elemDefault = {
|
||||
id: 0,
|
||||
nombre: 'AAAAAAA',
|
||||
iconoPerfil: 'AAAAAAA',
|
||||
iconoPerfil: 1,
|
||||
fechaNacimiento: currentDate,
|
||||
estado: EstadoUsuario.ACTIVE,
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@ import { EstadoUsuario } from 'app/entities/enumerations/estado-usuario.model';
|
|||
export interface IUsuarioExtra {
|
||||
id?: number;
|
||||
nombre?: string;
|
||||
iconoPerfil?: string | null;
|
||||
iconoPerfil?: number | null;
|
||||
fechaNacimiento?: dayjs.Dayjs | null;
|
||||
estado?: EstadoUsuario;
|
||||
user?: IUser | null;
|
||||
|
@ -21,7 +21,7 @@ export class UsuarioExtra implements IUsuarioExtra {
|
|||
constructor(
|
||||
public id?: number,
|
||||
public nombre?: string,
|
||||
public iconoPerfil?: string | null,
|
||||
public iconoPerfil?: number | null,
|
||||
public fechaNacimiento?: dayjs.Dayjs | null,
|
||||
public estado?: EstadoUsuario,
|
||||
public user?: IUser | null,
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UsuarioGoogleLogInService } from './usuario-google-log-in.service';
|
||||
|
||||
describe('UsuarioGoogleLogInService', () => {
|
||||
let service: UsuarioGoogleLogInService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(UsuarioGoogleLogInService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -1,9 +0,0 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable, ReplaySubject } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class UsuarioGoogleLogInService {
|
||||
constructor() {}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"activate": {
|
||||
"title": "Activación",
|
||||
"title": "Activación de Cuenta",
|
||||
"messages": {
|
||||
"success": "<strong>Su cuenta ha sido activada.</strong> Por favor, ",
|
||||
"error": "<strong>Su cuenta no pudo ser activada.</strong> Por favor, utilice el formulario de inscripción para registrarse."
|
||||
"success": "<strong>Su cuenta ha sido activada.</strong> Ya puede ",
|
||||
"error": "<strong>Su cuenta no pudo ser activada.</strong> Por favor, regístrese en DataSurvey."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,11 @@
|
|||
"authenticated": {
|
||||
"prefix": "Si desea ",
|
||||
"link": "iniciar sesión",
|
||||
"suffix": ", puede intentar con las cuentas predeterminadas:<br/>- Administrador (usuario=\"admin\" y contraseña=\"admin\") <br/>- Usuario (usuario=\"user\" y contraseña=\"user\")."
|
||||
"suffix": ", puede intentar con las cuentas predeterminadas:<br/>- Administrador (usuario=\"admin\" y contraseña=\"admin\") <br/>- 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",
|
||||
|
||||
"botonInicio": "Iniciar Sesión"
|
||||
},
|
||||
"register": {
|
||||
"noaccount": "¿Aún no tienes una cuenta?",
|
||||
|
@ -73,7 +77,8 @@
|
|||
}
|
||||
},
|
||||
"error": {
|
||||
"dontmatch": "¡La contraseña y la confirmación de contraseña no coinciden!"
|
||||
"samePassword": "La contraseña actual y la nueva contraseña no pueden ser iguales",
|
||||
"dontmatch": "La contraseña y la confirmación de contraseña no coinciden"
|
||||
},
|
||||
"validate": {
|
||||
"newpassword": {
|
||||
|
@ -107,7 +112,8 @@
|
|||
"ribbon": {
|
||||
"dev": "Development"
|
||||
},
|
||||
"item-count": "Mostrando {{first}} - {{second}} de {{total}} elementos."
|
||||
"item-count": "Mostrando {{first}} - {{second}} de {{total}} elementos.",
|
||||
"registerLink": "Registrarse"
|
||||
},
|
||||
"entity": {
|
||||
"action": {
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
},
|
||||
"messages": {
|
||||
"error": {
|
||||
"authentication": "Revise las credenciales e intente de nuevo "
|
||||
"authentication": "Revise las credenciales e intente de nuevo ",
|
||||
"isGoogle": "Al haber ingresado por medio de Google no cuenta con los permisos para modificar su contraseña"
|
||||
}
|
||||
},
|
||||
"password": {
|
||||
|
|
|
@ -7,7 +7,10 @@
|
|||
},
|
||||
"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."
|
||||
"success": "Revise su correo electrónico para obtener más información sobre cómo restablecer su contraseña.",
|
||||
"error": {
|
||||
"emailnotexists": "<strong>¡El correo electrónico no se encuentra registrado en el sistema!</strong> Por favor, ingrese otro email."
|
||||
}
|
||||
}
|
||||
},
|
||||
"finish": {
|
||||
|
|
Loading…
Reference in New Issue