merge
This commit is contained in:
commit
dbf3551101
|
@ -158,4 +158,9 @@ public class MailService {
|
|||
log.debug("Sending reactivated account mail to '{}'", user.getUser().getEmail());
|
||||
sendEmailFromTemplate(user.getUser(), "mail/encuestaPublicaEmail", "email.public.title");
|
||||
}
|
||||
|
||||
public void sendEncuestaDeleted(UsuarioExtra user) {
|
||||
log.debug("Sending encuesta deletion notification mail to '{}'", user.getUser().getEmail());
|
||||
sendEmailFromTemplate(user.getUser(), "mail/encuestaDeletedEmail", "email.encuestaDeleted.title");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,6 +125,31 @@ public class EncuestaResource {
|
|||
|
||||
Encuesta result = encuestaService.save(encuesta);
|
||||
|
||||
return ResponseEntity
|
||||
.ok()
|
||||
.headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, encuesta.getId().toString()))
|
||||
.body(result);
|
||||
}
|
||||
|
||||
@PutMapping("/encuestas/publish/{id}")
|
||||
public ResponseEntity<Encuesta> publishEncuesta(
|
||||
@PathVariable(value = "id", required = false) final Long id,
|
||||
@Valid @RequestBody Encuesta encuesta
|
||||
) throws URISyntaxException {
|
||||
log.debug("REST request to update Encuesta : {}, {}", id, encuesta);
|
||||
if (encuesta.getId() == null) {
|
||||
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
|
||||
}
|
||||
if (!Objects.equals(id, encuesta.getId())) {
|
||||
throw new BadRequestAlertException("Invalid ID", ENTITY_NAME, "idinvalid");
|
||||
}
|
||||
|
||||
if (!encuestaRepository.existsById(id)) {
|
||||
throw new BadRequestAlertException("Entity not found", ENTITY_NAME, "idnotfound");
|
||||
}
|
||||
|
||||
Encuesta result = encuestaService.save(encuesta);
|
||||
|
||||
if (result.getAcceso().equals(AccesoEncuesta.PRIVATE)) {
|
||||
mailService.sendPublishedPrivateMail(result.getUsuarioExtra(), result.getContrasenna());
|
||||
} else {
|
||||
|
@ -274,4 +299,11 @@ public class EncuestaResource {
|
|||
.headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
|
||||
.build();
|
||||
}
|
||||
|
||||
@DeleteMapping("encuestas/notify/{id}")
|
||||
public ResponseEntity<Void> notifyEncuestaDeleted(@PathVariable Long id, @Valid @RequestBody Encuesta encuesta) {
|
||||
log.debug("REST request to notify {} of deleted Encuesta", encuesta.getUsuarioExtra().getUser().getEmail());
|
||||
mailService.sendEncuestaDeleted(encuesta.getUsuarioExtra());
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,3 +52,9 @@ email.private.title=Su encuesta ha sido publicada de manera privada
|
|||
email.private.greeting=¡Felicidades {0}!
|
||||
email.private.text1=Su encuesta ha sdo publicada de manera privada. Su contraseña de acceso es: {0}
|
||||
email.private.text2=Saludos,
|
||||
|
||||
#DeletedEncuesta
|
||||
email.encuestaDeleted.title=Su encuesta ha sido eliminada
|
||||
email.encuestaDeleted.greeting=Estimado {0}
|
||||
email.encuestaDeleted.text1=Su encuesta ha sido eliminada por un administrador
|
||||
email.encuestaDeleted.text2=Saludos,
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
<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"
|
||||
style="width: 250px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
<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"
|
||||
style="width: 250px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -0,0 +1,310 @@
|
|||
<!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.encuestaDeleted.title}">Encuesta Eliminada</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.encuestaDeleted.greeting(${user.login})}">¡Encuesta eliminada!</h2>
|
||||
<h3 th:text="#{email.encuestaDeleted.text1}">¡Su encuesta ha sido eliminada exitosamente!</h3>
|
||||
</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 href="mailto:datasurveyapp@gmail.com" class="text">datasurveyapp@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>
|
|
@ -244,7 +244,7 @@
|
|||
<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"
|
||||
style="width: 250px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
<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"
|
||||
style="width: 250px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
<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"
|
||||
style="width: 250px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
<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"
|
||||
style="width: 250px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
<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"
|
||||
style="width: 250px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -244,7 +244,7 @@
|
|||
<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"
|
||||
style="width: 250px; max-width: 600px; height: auto; margin: auto; display: block"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,172 +1,3 @@
|
|||
<!-- <div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<h2 jhiTranslate="settings.title" [translateValues]="{ username: account.login }" *ngIf="account">
|
||||
User settings for [<strong>{{ account.login }}</strong
|
||||
>]
|
||||
</h2>
|
||||
|
||||
<div class="alert alert-success" *ngIf="success" jhiTranslate="settings.messages.success">
|
||||
<strong>Settings saved!</strong>
|
||||
</div>
|
||||
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<form name="form" role="form" (ngSubmit)="save()" [formGroup]="settingsForm" *ngIf="account" novalidate>
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" for="firstName" jhiTranslate="settings.form.firstname">First Name</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="firstName"
|
||||
name="firstName"
|
||||
placeholder="{{ 'settings.form.firstname.placeholder' | translate }}"
|
||||
formControlName="firstName"
|
||||
data-cy="firstname"
|
||||
/>
|
||||
|
||||
<div
|
||||
*ngIf="
|
||||
settingsForm.get('firstName')!.invalid && (settingsForm.get('firstName')!.dirty || settingsForm.get('firstName')!.touched)
|
||||
"
|
||||
>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('firstName')?.errors?.required"
|
||||
jhiTranslate="settings.messages.validate.firstname.required"
|
||||
>
|
||||
Your first name is required.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('firstName')?.errors?.minlength"
|
||||
jhiTranslate="settings.messages.validate.firstname.minlength"
|
||||
>
|
||||
Your first name is required to be at least 1 character.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('firstName')?.errors?.maxlength"
|
||||
jhiTranslate="settings.messages.validate.firstname.maxlength"
|
||||
>
|
||||
Your first name cannot be longer than 50 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" for="lastName" jhiTranslate="settings.form.lastname">Last Name</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="lastName"
|
||||
name="lastName"
|
||||
placeholder="{{ 'settings.form.lastname.placeholder' | translate }}"
|
||||
formControlName="lastName"
|
||||
data-cy="lastname"
|
||||
/>
|
||||
|
||||
<div
|
||||
*ngIf="settingsForm.get('lastName')!.invalid && (settingsForm.get('lastName')!.dirty || settingsForm.get('lastName')!.touched)"
|
||||
>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('lastName')?.errors?.required"
|
||||
jhiTranslate="settings.messages.validate.lastname.required"
|
||||
>
|
||||
Your last name is required.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('lastName')?.errors?.minlength"
|
||||
jhiTranslate="settings.messages.validate.lastname.minlength"
|
||||
>
|
||||
Your last name is required to be at least 1 character.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('lastName')?.errors?.maxlength"
|
||||
jhiTranslate="settings.messages.validate.lastname.maxlength"
|
||||
>
|
||||
Your last name cannot be longer than 50 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" for="email" jhiTranslate="global.form.email.label">Email</label>
|
||||
<input
|
||||
type="email"
|
||||
class="form-control"
|
||||
id="email"
|
||||
name="email"
|
||||
placeholder="{{ 'global.form.email.placeholder' | translate }}"
|
||||
formControlName="email"
|
||||
data-cy="email"
|
||||
/>
|
||||
|
||||
<div *ngIf="settingsForm.get('email')!.invalid && (settingsForm.get('email')!.dirty || settingsForm.get('email')!.touched)">
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('email')?.errors?.required"
|
||||
jhiTranslate="global.messages.validate.email.required"
|
||||
>
|
||||
Your email is required.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('email')?.errors?.email"
|
||||
jhiTranslate="global.messages.validate.email.invalid"
|
||||
>
|
||||
Your email is invalid.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('email')?.errors?.minlength"
|
||||
jhiTranslate="global.messages.validate.email.minlength"
|
||||
>
|
||||
Your email is required to be at least 5 characters.
|
||||
</small>
|
||||
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="settingsForm.get('email')?.errors?.maxlength"
|
||||
jhiTranslate="global.messages.validate.email.maxlength"
|
||||
>
|
||||
Your email cannot be longer than 100 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" *ngIf="languages && languages.length > 0">
|
||||
<label for="langKey" jhiTranslate="settings.form.language">Language</label>
|
||||
<select class="form-control" id="langKey" name="langKey" formControlName="langKey" data-cy="langKey">
|
||||
<option *ngFor="let language of languages" [value]="language">{{ language | findLanguageFromKey }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
[disabled]="settingsForm.invalid"
|
||||
class="btn btn-primary"
|
||||
jhiTranslate="settings.form.button"
|
||||
data-cy="submit"
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
-------------------------------------------------------------------------------
|
||||
-->
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="row w-75 pb-lg-5 pr-lg-5 mb-5" style="border-bottom: 1px solid #e7ebf3">
|
||||
<div class="col-lg-4 mr-lg-5">
|
||||
|
|
|
@ -2,24 +2,25 @@
|
|||
<div class="modal-header"></div>
|
||||
|
||||
<div class="modal-body">
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<!-- <jhi-alert-error></jhi-alert-error> -->
|
||||
<p class="ds-title--small">Cambiar estado</p>
|
||||
<p
|
||||
class="ds-subtitle"
|
||||
id="jhi-delete-categoria-heading"
|
||||
jhiTranslate="dataSurveyApp.categoria.delete.question"
|
||||
[translateValues]="{ nombre: categoria.nombre }"
|
||||
style="text-align: center"
|
||||
>
|
||||
Are you sure you want to toggle this category's status?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary ds-btn ds-btn-secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button id="jhi-confirm-delete-categoria" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger ds-btn ds-btn-danger">
|
||||
<button id="jhi-confirm-delete-categoria" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--danger">
|
||||
<fa-icon [icon]="faExchangeAlt"></fa-icon>
|
||||
<span jhiTranslate="entity.action.toggleStatus">Toggle Status</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -10,10 +10,13 @@ import { finalize, map } from 'rxjs/operators';
|
|||
import { Categoria, ICategoria } from '../categoria.model';
|
||||
import { CategoriaService } from '../service/categoria.service';
|
||||
|
||||
import { faExchangeAlt } from '@fortawesome/free-solid-svg-icons';
|
||||
@Component({
|
||||
templateUrl: './categoria-delete-dialog.component.html',
|
||||
})
|
||||
export class CategoriaDeleteDialogComponent {
|
||||
faExchangeAlt = faExchangeAlt;
|
||||
|
||||
categoria?: ICategoria;
|
||||
encuestas?: IEncuesta[];
|
||||
encuestasFiltradas?: IEncuesta[];
|
||||
|
|
|
@ -64,7 +64,8 @@
|
|||
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
|
||||
</button>
|
||||
|
||||
<button type="submit" (click)="toggleStatus(categoria)" class="btn-sm ds-btn ds-btn--toggle" data-cy="entityDeleteButton">
|
||||
<button type="submit" (click)="toggleStatus(categoria)" class="ds-btn ds-btn--danger" data-cy="entityDeleteButton">
|
||||
<fa-icon [icon]="faExchangeAlt"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.toggleStatus">Toggle Status</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -6,11 +6,15 @@ import { ICategoria } from '../categoria.model';
|
|||
import { CategoriaService } from '../service/categoria.service';
|
||||
import { CategoriaDeleteDialogComponent } from '../delete/categoria-delete-dialog.component';
|
||||
|
||||
import { faExchangeAlt } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-categoria',
|
||||
templateUrl: './categoria.component.html',
|
||||
})
|
||||
export class CategoriaComponent implements OnInit {
|
||||
faExchangeAlt = faExchangeAlt;
|
||||
|
||||
categorias?: ICategoria[];
|
||||
isLoading = false;
|
||||
public searchString: string;
|
||||
|
|
|
@ -46,10 +46,10 @@
|
|||
type="button"
|
||||
id="cancel-save"
|
||||
data-cy="entityCreateCancelButton"
|
||||
class="btn btn-secondary ds-btn ds-btn-secondary"
|
||||
class="ds-btn ds-btn--secondary"
|
||||
(click)="previousState()"
|
||||
>
|
||||
<span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
|
@ -58,7 +58,7 @@
|
|||
id="save-entity"
|
||||
data-cy="entityCreateSaveButton"
|
||||
[disabled]="editForm.invalid || isSaving"
|
||||
class="btn btn-primary ds-btn ds-btn-primary"
|
||||
class="ds-btn ds-btn--primary"
|
||||
>
|
||||
<span jhiTranslate="entity.action.save">Save</span>
|
||||
</button>
|
||||
|
|
|
@ -6,9 +6,13 @@
|
|||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<p id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.delete.question" [translateValues]="{ id: encuesta.id }">
|
||||
<p class="ds-title--small">Eliminar encuesta</p>
|
||||
<p
|
||||
class="ds-subtitle"
|
||||
id="jhi-delete-encuesta-heading"
|
||||
jhiTranslate="dataSurveyApp.encuesta.delete.question"
|
||||
[translateValues]="{ id: encuesta.id }"
|
||||
>
|
||||
Are you sure you want to delete this survey?
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -3,12 +3,14 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|||
import { IEncuesta } from '../encuesta.model';
|
||||
import { EncuestaService } from '../service/encuesta.service';
|
||||
import { EstadoEncuesta } from 'app/entities/enumerations/estado-encuesta.model';
|
||||
import { IUsuarioExtra } from 'app/entities/usuario-extra/usuario-extra.model';
|
||||
|
||||
@Component({
|
||||
templateUrl: './encuesta-delete-dialog.component.html',
|
||||
})
|
||||
export class EncuestaDeleteDialogComponent {
|
||||
encuesta?: IEncuesta;
|
||||
usuarioExtra?: IUsuarioExtra;
|
||||
|
||||
constructor(protected encuestaService: EncuestaService, protected activeModal: NgbActiveModal) {}
|
||||
|
||||
|
@ -16,10 +18,11 @@ export class EncuestaDeleteDialogComponent {
|
|||
this.activeModal.dismiss();
|
||||
}
|
||||
|
||||
confirmDelete(encuest: IEncuesta): void {
|
||||
encuest.estado = EstadoEncuesta.DELETED;
|
||||
this.encuestaService.deleteEncuesta(encuest).subscribe(() => {
|
||||
confirmDelete(encuesta: IEncuesta): void {
|
||||
encuesta.estado = EstadoEncuesta.DELETED;
|
||||
this.encuestaService.deleteEncuesta(encuesta).subscribe(() => {
|
||||
this.activeModal.close('deleted');
|
||||
});
|
||||
this.encuestaService.deletedNotification(encuesta);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="row justify-content-center">
|
||||
<!--<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<div *ngIf="encuesta">
|
||||
<h2 data-cy="encuestaDetailsHeading"><span jhiTranslate="dataSurveyApp.encuesta.detail.title">Encuesta</span></h2>
|
||||
|
@ -77,4 +77,169 @@
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="container-fluid" *ngIf="encuesta">
|
||||
<div>
|
||||
<h2 id="page-heading" data-cy="EPreguntaCerradaHeading">
|
||||
<p class="ds-title">Vista previa de {{ encuesta!.nombre }}</p>
|
||||
<p class="ds-subtitle">Creada el día {{ encuesta!.fechaCreacion | formatShortDatetime | lowercase }}</p>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="button" class="ds-btn ds-btn--secondary" (click)="previousState()">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.back">Back</span>
|
||||
</button>
|
||||
<ng-container *ngIf="encuesta!.estado === 'DRAFT'">
|
||||
<button type="button" class="ds-btn ds-btn--primary" (click)="publishSurvey()">Publicar encuesta</button>
|
||||
</ng-container>
|
||||
</div>
|
||||
</h2>
|
||||
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
<div *ngIf="successPublished" class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
Su encuesta fue publicada exitosamente
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- <jhi-alert></jhi-alert> -->
|
||||
|
||||
<div class="alert alert-warning" id="no-result" *ngIf="ePreguntas?.length === 0">
|
||||
<span>No se encontraron preguntas</span>
|
||||
</div>
|
||||
|
||||
<div class="ds-survey preview-survey" id="entities" *ngIf="ePreguntas && ePreguntas.length > 0">
|
||||
<div class="ds-survey--all-question-wrapper col-8">
|
||||
<div class="ds-survey--question-wrapper card-encuesta lift" *ngFor="let ePregunta of ePreguntas; let i = index; trackBy: trackId">
|
||||
<div
|
||||
[attr.data-index]="ePregunta.id"
|
||||
[attr.data-tipo]="ePregunta.tipo"
|
||||
[attr.data-opcional]="ePregunta.opcional"
|
||||
class="ds-survey--question"
|
||||
>
|
||||
<div class="ds-survey--titulo">
|
||||
<span class="ds-survey--titulo--name">{{ i + 1 }}. {{ ePregunta.nombre }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span *ngIf="ePregunta.tipo === 'SINGLE'" class="ds-subtitle"
|
||||
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }}
|
||||
{{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
<span *ngIf="ePregunta.tipo === 'MULTIPLE'" class="ds-subtitle"
|
||||
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }}
|
||||
{{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
<span *ngIf="!ePregunta.tipo" class="ds-subtitle"
|
||||
>Pregunta de respuesta abierta {{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
</div>
|
||||
<ng-container *ngIf="ePregunta.tipo">
|
||||
<ng-container *ngFor="let ePreguntaOpcion of ePreguntasOpciones; let j = index; trackBy: trackId">
|
||||
<ng-container *ngFor="let ePreguntaOpcionFinal of ePreguntaOpcion">
|
||||
<ng-container *ngIf="ePregunta.id === ePreguntaOpcionFinal.epreguntaCerrada.id">
|
||||
<div
|
||||
class="ds-survey--option ds-survey--option--base ds-survey--closed-option can-delete"
|
||||
[attr.data-id]="ePreguntaOpcionFinal.id"
|
||||
>
|
||||
<div class="radio" *ngIf="ePregunta.tipo === 'SINGLE'">
|
||||
<input
|
||||
type="radio"
|
||||
style="border-radius: 3px"
|
||||
name="{{ 'radio' + ePregunta.id }}"
|
||||
id="{{ 'radio' + ePreguntaOpcionFinal.id }}"
|
||||
/>
|
||||
<!-- <input class="ds-survey--checkbox" id="{{ ePregunta.id }}-{{ ePreguntaOpcionFinal.id }}" type="checkbox" disabled /> -->
|
||||
<label for="{{ 'radio' + ePreguntaOpcionFinal.id }}">{{ ePreguntaOpcionFinal.nombre }}</label>
|
||||
</div>
|
||||
<div class="checkbox" *ngIf="ePregunta.tipo === 'MULTIPLE'">
|
||||
<input type="checkbox" style="border-radius: 3px" id="{{ 'checkbox' + ePreguntaOpcionFinal.id }}" />
|
||||
<!-- <input class="ds-survey--checkbox" id="{{ ePregunta.id }}-{{ ePreguntaOpcionFinal.id }}" type="checkbox" disabled /> -->
|
||||
<label for="{{ 'checkbox' + ePreguntaOpcionFinal.id }}">{{ ePreguntaOpcionFinal.nombre }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<div class="ds-survey--option ds-survey--option--base ds-survey--open-option" *ngIf="!ePregunta.tipo">
|
||||
<textarea cols="30" rows="10" disabled></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 info-encuesta">
|
||||
<p style="font-size: 1.2em" class="ds-survey--titulo--name py-3">Cantidad de preguntas: {{ ePreguntas?.length }}</p>
|
||||
<!--<div>
|
||||
<p style="font-size: 1.2em" class="ds-survey--titulo--name">Colaboradores</p>
|
||||
</div>-->
|
||||
<dl>
|
||||
<dt><span jhiTranslate="dataSurveyApp.encuesta.acceso">Acceso</span></dt>
|
||||
<dd>
|
||||
-
|
||||
<span jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}"> {{ encuesta.acceso }}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl *ngIf="encuesta.acceso === 'PRIVATE'">
|
||||
<dt><span jhiTranslate="dataSurveyApp.encuesta.contrasenna">Contrasenna</span></dt>
|
||||
<dd>
|
||||
<span>- {{ encuesta.contrasenna }}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><span jhiTranslate="dataSurveyApp.encuesta.estado">Estado</span></dt>
|
||||
<dd>
|
||||
- <span jhiTranslate="{{ 'dataSurveyApp.EstadoEncuesta.' + encuesta.estado }}">{{ encuesta.estado }}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl *ngIf="encuesta.categoria">
|
||||
<dt><span jhiTranslate="dataSurveyApp.encuesta.categoria">Categoria</span></dt>
|
||||
<dd>
|
||||
<a>- {{ encuesta.categoria?.nombre }}</a>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><span jhiTranslate="dataSurveyApp.encuesta.fechaPublicacion">Fecha Publicacion</span></dt>
|
||||
<dd>
|
||||
<span
|
||||
>-
|
||||
{{
|
||||
encuesta.fechaPublicacion === undefined ? 'Sin publicar' : (encuesta.fechaFinalizada | formatShortDatetime | lowercase)
|
||||
}}</span
|
||||
>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><span jhiTranslate="dataSurveyApp.encuesta.fechaFinalizar">Fecha Finalizar</span></dt>
|
||||
<dd>
|
||||
<span>
|
||||
-
|
||||
{{
|
||||
encuesta.fechaFinalizar === undefined
|
||||
? 'Sin fecha de finalización'
|
||||
: (encuesta.fechaFinalizada | formatShortDatetime | lowercase)
|
||||
}}</span
|
||||
>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><span jhiTranslate="dataSurveyApp.encuesta.fechaFinalizada">Fecha Finalizada</span></dt>
|
||||
<dd>
|
||||
<span>
|
||||
-
|
||||
{{
|
||||
encuesta.fechaFinalizada === undefined ? 'Sin finalizar' : (encuesta.fechaFinalizada | formatShortDatetime | lowercase)
|
||||
}}</span
|
||||
>
|
||||
</dd>
|
||||
</dl>
|
||||
<div>
|
||||
<dt><span jhiTranslate="dataSurveyApp.encuesta.calificacion">Calificacion</span></dt>
|
||||
<dd>
|
||||
<fa-icon *ngFor="let i of [].constructor(encuesta.calificacion)" class="entity-icon--star" [icon]="faStar"></fa-icon
|
||||
><fa-icon *ngFor="let i of [].constructor(5 - encuesta.calificacion!)" class="entity-icon--star--off" [icon]="faStar"></fa-icon>
|
||||
</dd>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,20 +1,159 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { FormBuilder, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { EstadoEncuesta } from 'app/entities/enumerations/estado-encuesta.model';
|
||||
|
||||
import { IEncuesta } from '../encuesta.model';
|
||||
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 { IEncuesta, Encuesta } from '../encuesta.model';
|
||||
import { EncuestaService } from '../service/encuesta.service';
|
||||
import { ICategoria } from 'app/entities/categoria/categoria.model';
|
||||
import { CategoriaService } from 'app/entities/categoria/service/categoria.service';
|
||||
import { IUsuarioExtra } from 'app/entities/usuario-extra/usuario-extra.model';
|
||||
import { UsuarioExtraService } from 'app/entities/usuario-extra/service/usuario-extra.service';
|
||||
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { IEPreguntaCerrada } from 'app/entities/e-pregunta-cerrada/e-pregunta-cerrada.model';
|
||||
import { EPreguntaCerradaService } from 'app/entities/e-pregunta-cerrada/service/e-pregunta-cerrada.service';
|
||||
import { EPreguntaCerradaDeleteDialogComponent } from 'app/entities/e-pregunta-cerrada/delete/e-pregunta-cerrada-delete-dialog.component';
|
||||
import { IEPreguntaAbierta } from '../../e-pregunta-abierta/e-pregunta-abierta.model';
|
||||
import { EPreguntaCerrada } from '../../e-pregunta-cerrada/e-pregunta-cerrada.model';
|
||||
import { EPreguntaCerradaOpcion, IEPreguntaCerradaOpcion } from '../../e-pregunta-cerrada-opcion/e-pregunta-cerrada-opcion.model';
|
||||
import { EPreguntaAbiertaService } from '../../e-pregunta-abierta/service/e-pregunta-abierta.service';
|
||||
import { EPreguntaCerradaOpcionService } from '../../e-pregunta-cerrada-opcion/service/e-pregunta-cerrada-opcion.service';
|
||||
import { PreguntaCerradaTipo } from 'app/entities/enumerations/pregunta-cerrada-tipo.model';
|
||||
|
||||
import { faTimes, faPlus, faStar } from '@fortawesome/free-solid-svg-icons';
|
||||
import { EncuestaPublishDialogComponent } from '../encuesta-publish-dialog/encuesta-publish-dialog.component';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-encuesta-detail',
|
||||
templateUrl: './encuesta-detail.component.html',
|
||||
})
|
||||
export class EncuestaDetailComponent implements OnInit {
|
||||
categoriasSharedCollection: ICategoria[] = [];
|
||||
usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
|
||||
faTimes = faTimes;
|
||||
faPlus = faPlus;
|
||||
faStar = faStar;
|
||||
encuesta: IEncuesta | null = null;
|
||||
isLoading = false;
|
||||
successPublished = false;
|
||||
ePreguntas?: any[];
|
||||
ePreguntasOpciones?: any[];
|
||||
|
||||
constructor(protected activatedRoute: ActivatedRoute) {}
|
||||
constructor(
|
||||
protected activatedRoute: ActivatedRoute,
|
||||
protected encuestaService: EncuestaService,
|
||||
protected categoriaService: CategoriaService,
|
||||
protected usuarioExtraService: UsuarioExtraService,
|
||||
protected fb: FormBuilder,
|
||||
protected modalService: NgbModal,
|
||||
protected ePreguntaCerradaService: EPreguntaCerradaService,
|
||||
protected ePreguntaCerradaOpcionService: EPreguntaCerradaOpcionService,
|
||||
protected ePreguntaAbiertaService: EPreguntaAbiertaService
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.activatedRoute.data.subscribe(({ encuesta }) => {
|
||||
this.encuesta = encuesta;
|
||||
if (encuesta) {
|
||||
this.encuesta = encuesta;
|
||||
this.loadAll();
|
||||
} else {
|
||||
this.previousState();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngAfterViewChecked(): void {
|
||||
this.initListeners();
|
||||
}
|
||||
|
||||
initListeners(): void {
|
||||
const checkboxes = document.getElementsByClassName('ds-survey--checkbox');
|
||||
for (let i = 0; i < checkboxes.length; i++) {
|
||||
checkboxes[i].addEventListener('click', e => {
|
||||
if ((e.target as HTMLInputElement).checked) {
|
||||
(e.target as HTMLElement).offsetParent!.classList.add('ds-survey--closed-option--active');
|
||||
} else {
|
||||
(e.target as HTMLElement).offsetParent!.classList.remove('ds-survey--closed-option--active');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
trackId(index: number, item: IEPreguntaCerrada): number {
|
||||
return item.id!;
|
||||
}
|
||||
|
||||
trackEPreguntaCerradaById(index: number, item: IEPreguntaCerrada): number {
|
||||
return item.id!;
|
||||
}
|
||||
|
||||
trackCategoriaById(index: number, item: ICategoria): number {
|
||||
return item.id!;
|
||||
}
|
||||
|
||||
trackUsuarioExtraById(index: number, item: IUsuarioExtra): number {
|
||||
return item.id!;
|
||||
}
|
||||
|
||||
getEncuesta(id: number) {
|
||||
return this.encuestaService.findEncuesta(id);
|
||||
}
|
||||
|
||||
loadAll(): void {
|
||||
this.isLoading = true;
|
||||
|
||||
this.encuestaService
|
||||
.findQuestions(this.encuesta?.id!)
|
||||
.pipe(
|
||||
finalize(() =>
|
||||
this.encuestaService.findQuestionsOptions(this.encuesta?.id!).subscribe(
|
||||
(res: any) => {
|
||||
this.isLoading = false;
|
||||
this.ePreguntasOpciones = res.body ?? [];
|
||||
},
|
||||
() => {
|
||||
this.isLoading = false;
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
.subscribe(
|
||||
(res: any) => {
|
||||
this.isLoading = false;
|
||||
this.ePreguntas = res.body ?? [];
|
||||
},
|
||||
() => {
|
||||
this.isLoading = false;
|
||||
}
|
||||
);
|
||||
|
||||
/* this.encuestaService.findQuestionsOptions(this.encuesta?.id!).subscribe(
|
||||
(res: any) => {
|
||||
this.isLoading = false;
|
||||
this.ePreguntasOpciones = res.body ?? [];
|
||||
},
|
||||
() => {
|
||||
this.isLoading = false;
|
||||
}
|
||||
);*/
|
||||
}
|
||||
publishSurvey(): void {
|
||||
const modalRef = this.modalService.open(EncuestaPublishDialogComponent, { size: 'lg', backdrop: 'static' });
|
||||
modalRef.componentInstance.encuesta = this.encuesta;
|
||||
// unsubscribe not needed because closed completes on modal close
|
||||
modalRef.closed.subscribe(reason => {
|
||||
if (reason === 'published') {
|
||||
this.successPublished = true;
|
||||
this.loadAll();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1,24 +1,23 @@
|
|||
<form name="deleteForm" (ngSubmit)="confirmDelete()">
|
||||
<form class="ds-form" name="deleteForm" (ngSubmit)="confirmDelete()">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
|
||||
<!-- <h2 class="ds-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h2>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button>-->
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<p id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.delete.deleteoption">
|
||||
<p class="ds-title--small">Eliminar opción</p>
|
||||
<p class="ds-subtitle" id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.delete.deleteoption">
|
||||
Are you sure you want to delete this option?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button id="jhi-confirm-delete-encuesta" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
|
||||
<button id="jhi-confirm-delete-option" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--danger">
|
||||
<fa-icon icon="times"></fa-icon> <span jhiTranslate="entity.action.delete">Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -1,24 +1,23 @@
|
|||
<form name="deleteForm" (ngSubmit)="confirmDelete()">
|
||||
<form class="ds-form" name="deleteForm" (ngSubmit)="confirmDelete()">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
|
||||
<!-- <h2 class="ds-title" data-cy="encuestaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h2>
|
||||
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button>-->
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<p id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.delete.deletequestion">
|
||||
<p class="ds-title--small">Eliminar pregunta</p>
|
||||
<p class="ds-subtitle" id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.delete.deletequestion">
|
||||
Are you sure you want to delete this question?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button id="jhi-confirm-delete-encuesta" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
|
||||
<button id="jhi-confirm-delete-question" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--danger">
|
||||
<fa-icon icon="times"></fa-icon> <span jhiTranslate="entity.action.delete">Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
|
|
|
@ -54,7 +54,6 @@ export class EncuestaPublishDialogComponent implements OnInit {
|
|||
this.fechaFinalizarInvalidMax = false;
|
||||
|
||||
const now = dayjs();
|
||||
debugger;
|
||||
|
||||
/*this.loadAll()
|
||||
|
||||
|
@ -84,7 +83,6 @@ export class EncuestaPublishDialogComponent implements OnInit {
|
|||
loadAll(): void {
|
||||
this.isLoading = true;
|
||||
|
||||
debugger;
|
||||
this.parametroAplicacionService
|
||||
.query()
|
||||
.pipe(finalize(() => this.onLoadFinalize()))
|
||||
|
@ -125,7 +123,6 @@ export class EncuestaPublishDialogComponent implements OnInit {
|
|||
}
|
||||
|
||||
generatePassword(): string {
|
||||
debugger;
|
||||
const alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
|
||||
let password = '';
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
<div>
|
||||
<h2 id="page-heading" data-cy="EncuestaHeading">
|
||||
<div class="d-flex flex-sm-row flex-column justify-content-between align-items-center">
|
||||
<div>
|
||||
<div *ngIf="isAdmin() && isAuthenticated()">
|
||||
<span class="ds-title" jhiTranslate="dataSurveyApp.encuesta.home.title">Encuestas</span>
|
||||
<p class="ds-subtitle">Administre las encuestas de todos los usuarios</p>
|
||||
</div>
|
||||
<div *ngIf="!isAdmin() && isAuthenticated()">
|
||||
<span class="ds-title" jhiTranslate="dataSurveyApp.encuesta.home.title">Encuestas</span>
|
||||
<p class="ds-subtitle">Cree encuestas y publiquelas mundialmente</p>
|
||||
</div>
|
||||
|
@ -85,14 +89,8 @@
|
|||
<div class="ds-contextmenu ds-contextmenu--closed" id="contextmenu">
|
||||
<ul id="ds-context-menu__list">
|
||||
<div class="ds-contextmenu__divider ds-contextmenu__divider--separator-bottom" id="contextmenu-create--separator">
|
||||
<li>
|
||||
<button
|
||||
*ngIf="!isAdmin() && isAuthenticated()"
|
||||
type="button"
|
||||
(click)="resetForm()"
|
||||
data-toggle="modal"
|
||||
data-target="#crearEncuesta"
|
||||
>
|
||||
<li *ngIf="!isAdmin() && isAuthenticated()">
|
||||
<button type="button" (click)="resetForm()" data-toggle="modal" data-target="#crearEncuesta">
|
||||
<fa-icon class="contextmenu__icon" [icon]="faPlus"></fa-icon>Crear
|
||||
</button>
|
||||
</li>
|
||||
|
@ -102,7 +100,9 @@
|
|||
<button type="button" id="contextmenu-edit"><fa-icon class="contextmenu__icon" [icon]="faEdit"></fa-icon>Editar</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="contextmenu-duplicate"><fa-icon class="contextmenu__icon" [icon]="faCopy"></fa-icon>Duplicar</button>
|
||||
<button type="button" (click)="openPreview()" id="contextmenu-preview">
|
||||
<fa-icon class="contextmenu__icon" [icon]="faPollH"></fa-icon>Ver Vista Previa
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
|
@ -112,15 +112,14 @@
|
|||
(click)="publish()"
|
||||
data-toggle="modal"
|
||||
data-target="#publicarEncuesta"
|
||||
*ngIf="isPublished"
|
||||
>
|
||||
<!--Agarrar el id de la encuesta -->
|
||||
<fa-icon class="contextmenu__icon" [icon]="faUpload"></fa-icon>Publicar
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<!-- <li>
|
||||
<button type="button" id="contextmenu-share"><fa-icon class="contextmenu__icon" [icon]="faShareAlt"></fa-icon>Compartir</button>
|
||||
</li>
|
||||
</li> -->
|
||||
</div>
|
||||
<div class="ds-contextmenu__divider" id="contextmenu-delete--separator">
|
||||
<li>
|
||||
|
@ -207,92 +206,6 @@
|
|||
><fa-icon *ngFor="let i of [].constructor(5 - encuesta.calificacion!)" class="entity-icon--star--off" [icon]="faStar"></fa-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <p>
|
||||
<a [routerLink]="['/encuesta', encuesta.id, 'view']">{{ encuesta.id }}</a>
|
||||
</p>
|
||||
<p>{{ encuesta.nombre }}</p>
|
||||
<p>{{ encuesta.descripcion }}</p>
|
||||
<p>{{ encuesta.fechaCreacion | formatMediumDatetime }}</p>
|
||||
<p>{{ encuesta.fechaPublicacion | formatMediumDatetime }}</p>
|
||||
<p>{{ encuesta.fechaFinalizar | formatMediumDatetime }}</p>
|
||||
<p>{{ encuesta.fechaFinalizada | formatMediumDatetime }}</p>
|
||||
<p>{{ encuesta.calificacion }}</p>
|
||||
<p jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</p>
|
||||
<p>{{ encuesta.contrasenna }}</p>
|
||||
<p jhiTranslate="{{ 'dataSurveyApp.EstadoEncuesta.' + encuesta.estado }}">{{ encuesta.estado }}</p>
|
||||
<div>
|
||||
<div *ngIf="encuesta.categoria">
|
||||
<a [routerLink]="['/categoria', encuesta.categoria?.id, 'view']">{{ encuesta.categoria?.nombre }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="encuesta.usuarioExtra">
|
||||
<a [routerLink]="['/usuario-extra', encuesta.usuarioExtra?.id, 'view']">{{ encuesta.usuarioExtra?.id }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="btn-group">
|
||||
<button
|
||||
type="submit"
|
||||
[routerLink]="['/encuesta', encuesta.id, 'view']"
|
||||
class="btn btn-info btn-sm"
|
||||
data-cy="entityDetailsButton"
|
||||
>
|
||||
<fa-icon icon="eye"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
[routerLink]="['/encuesta', encuesta.id, 'edit']"
|
||||
class="btn btn-primary btn-sm"
|
||||
data-cy="entityEditButton"
|
||||
>
|
||||
<fa-icon icon="pencil-alt"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
|
||||
</button>
|
||||
|
||||
<button type="submit" (click)="delete(encuesta)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
|
||||
<fa-icon icon="times"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="encuesta.usuarioExtra">
|
||||
<a [routerLink]="['/usuario-extra', encuesta.usuarioExtra?.id, 'view']">{{ encuesta.usuarioExtra?.id }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="btn-group">
|
||||
<button
|
||||
type="submit"
|
||||
[routerLink]="['/encuesta', encuesta.id, 'view']"
|
||||
class="btn btn-info btn-sm"
|
||||
data-cy="entityDetailsButton"
|
||||
>
|
||||
<fa-icon icon="eye"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
[routerLink]="['/encuesta', encuesta.id, 'edit']"
|
||||
class="btn btn-primary btn-sm"
|
||||
data-cy="entityEditButton"
|
||||
>
|
||||
<fa-icon icon="pencil-alt"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
|
||||
</button>
|
||||
|
||||
<button type="submit" (click)="delete(encuesta)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
|
||||
<fa-icon icon="times"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -301,7 +214,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.encuesta.nombre">Nombre</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.encuesta.fechaCreacion">Fecha Creacion</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.encuesta.fechaCreacion">Fecha Creación</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.encuesta.acceso">Acceso</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.encuesta.estado">Estado</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.encuesta.categoria">Categoria</span></th>
|
||||
|
@ -323,7 +236,8 @@
|
|||
<td jhiTranslate="{{ 'dataSurveyApp.EstadoEncuesta.' + encuesta.estado }}">{{ encuesta.estado }}</td>
|
||||
<td>
|
||||
<div *ngIf="encuesta.categoria">
|
||||
<a [routerLink]="['/categoria', encuesta.categoria?.id, 'view']">{{ encuesta.categoria?.nombre }}</a>
|
||||
<!-- <a [routerLink]="['/categoria', encuesta.categoria?.id, 'view']">{{ encuesta.categoria?.nombre }}</a> -->
|
||||
{{ encuesta.categoria?.nombre }}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -333,7 +247,7 @@
|
|||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<button
|
||||
<!-- <button
|
||||
type="submit"
|
||||
[routerLink]="['/encuesta', encuesta.id, 'view']"
|
||||
class="ds-btn btn-info btn-sm"
|
||||
|
@ -341,9 +255,9 @@
|
|||
>
|
||||
<fa-icon icon="eye"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
|
||||
</button>
|
||||
</button> -->
|
||||
|
||||
<button
|
||||
<!-- <button
|
||||
type="submit"
|
||||
[routerLink]="['/encuesta', encuesta.id, 'edit']"
|
||||
class="ds-btn ds-btn--primary btn-sm"
|
||||
|
@ -351,7 +265,7 @@
|
|||
>
|
||||
<fa-icon icon="pencil-alt"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
|
||||
</button>
|
||||
</button> -->
|
||||
|
||||
<button type="submit" (click)="delete(encuesta)" class="ds-btn ds-btn--danger btn-sm" data-cy="entityDeleteButton">
|
||||
<fa-icon icon="times"></fa-icon>
|
||||
|
@ -493,268 +407,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ------------------------------------------------------------------------------------------------- -->
|
||||
|
||||
<!-- <div ngIf class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<form name="editForm" role="form" novalidate (ngSubmit)="save()" [formGroup]="editForm">
|
||||
<h2 id="jhi-encuesta-heading" data-cy="EncuestaCreateUpdateHeading" jhiTranslate="dataSurveyApp.encuesta.home.createOrEditLabel">
|
||||
Create or edit a Encuesta
|
||||
</h2>
|
||||
|
||||
<div>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<div class="form-group" [hidden]="editForm.get('id')!.value == null">
|
||||
<label class="form-control-label" jhiTranslate="global.field.id" for="field_id">ID</label>
|
||||
<input type="number" class="form-control" name="id" id="field_id" data-cy="id" formControlName="id" [readonly]="true" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.nombre" for="field_nombre">Nombre</label>
|
||||
<input type="text" class="form-control" name="nombre" id="field_nombre" data-cy="nombre" formControlName="nombre" />
|
||||
<div *ngIf="editForm.get('nombre')!.invalid && (editForm.get('nombre')!.dirty || editForm.get('nombre')!.touched)">
|
||||
<small class="form-text text-danger" *ngIf="editForm.get('nombre')?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="editForm.get('nombre')?.errors?.minlength"
|
||||
jhiTranslate="entity.validation.minlength"
|
||||
[translateValues]="{ min: 1 }"
|
||||
>
|
||||
This field is required to be at least 1 characters.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="editForm.get('nombre')?.errors?.maxlength"
|
||||
jhiTranslate="entity.validation.maxlength"
|
||||
[translateValues]="{ max: 50 }"
|
||||
>
|
||||
This field cannot be longer than 50 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.descripcion" for="field_descripcion">Descripcion</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="descripcion"
|
||||
id="field_descripcion"
|
||||
data-cy="descripcion"
|
||||
formControlName="descripcion"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.fechaCreacion" for="field_fechaCreacion"
|
||||
>Fecha Creacion</label
|
||||
>
|
||||
<div class="d-flex">
|
||||
<input
|
||||
id="field_fechaCreacion"
|
||||
data-cy="fechaCreacion"
|
||||
type="datetime-local"
|
||||
class="form-control"
|
||||
name="fechaCreacion"
|
||||
formControlName="fechaCreacion"
|
||||
placeholder="YYYY-MM-DD HH:mm"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
*ngIf="
|
||||
editForm.get('fechaCreacion')!.invalid && (editForm.get('fechaCreacion')!.dirty || editForm.get('fechaCreacion')!.touched)
|
||||
"
|
||||
>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="editForm.get('fechaCreacion')?.errors?.required"
|
||||
jhiTranslate="entity.validation.required"
|
||||
>
|
||||
This field is required.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
[hidden]="!editForm.get('fechaCreacion')?.errors?.ZonedDateTimelocal"
|
||||
jhiTranslate="entity.validation.ZonedDateTimelocal"
|
||||
>
|
||||
This field should be a date and time.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.fechaPublicacion" for="field_fechaPublicacion"
|
||||
>Fecha Publicacion</label
|
||||
>
|
||||
<div class="d-flex">
|
||||
<input
|
||||
id="field_fechaPublicacion"
|
||||
data-cy="fechaPublicacion"
|
||||
type="datetime-local"
|
||||
class="form-control"
|
||||
name="fechaPublicacion"
|
||||
formControlName="fechaPublicacion"
|
||||
placeholder="YYYY-MM-DD HH:mm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.fechaFinalizar" for="field_fechaFinalizar"
|
||||
>Fecha Finalizar</label
|
||||
>
|
||||
<div class="d-flex">
|
||||
<input
|
||||
id="field_fechaFinalizar"
|
||||
data-cy="fechaFinalizar"
|
||||
type="datetime-local"
|
||||
class="form-control"
|
||||
name="fechaFinalizar"
|
||||
formControlName="fechaFinalizar"
|
||||
placeholder="YYYY-MM-DD HH:mm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.fechaFinalizada" for="field_fechaFinalizada"
|
||||
>Fecha Finalizada</label
|
||||
>
|
||||
<div class="d-flex">
|
||||
<input
|
||||
id="field_fechaFinalizada"
|
||||
data-cy="fechaFinalizada"
|
||||
type="datetime-local"
|
||||
class="form-control"
|
||||
name="fechaFinalizada"
|
||||
formControlName="fechaFinalizada"
|
||||
placeholder="YYYY-MM-DD HH:mm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.calificacion" for="field_calificacion">Calificacion</label>
|
||||
<input
|
||||
type="number"
|
||||
class="form-control"
|
||||
name="calificacion"
|
||||
id="field_calificacion"
|
||||
data-cy="calificacion"
|
||||
formControlName="calificacion"
|
||||
/>
|
||||
<div
|
||||
*ngIf="editForm.get('calificacion')!.invalid && (editForm.get('calificacion')!.dirty || editForm.get('calificacion')!.touched)"
|
||||
>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="editForm.get('calificacion')?.errors?.required"
|
||||
jhiTranslate="entity.validation.required"
|
||||
>
|
||||
This field is required.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
[hidden]="!editForm.get('calificacion')?.errors?.number"
|
||||
jhiTranslate="entity.validation.number"
|
||||
>
|
||||
This field should be a number.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.acceso" for="field_acceso">Acceso</label>
|
||||
<select class="form-control" name="acceso" formControlName="acceso" id="field_acceso" data-cy="acceso">
|
||||
<option [ngValue]="null">{{ 'dataSurveyApp.AccesoEncuesta.null' | translate }}</option>
|
||||
<option value="PUBLIC">{{ 'dataSurveyApp.AccesoEncuesta.PUBLIC' | translate }}</option>
|
||||
<option value="PRIVATE">{{ 'dataSurveyApp.AccesoEncuesta.PRIVATE' | translate }}</option>
|
||||
</select>
|
||||
<div *ngIf="editForm.get('acceso')!.invalid && (editForm.get('acceso')!.dirty || editForm.get('acceso')!.touched)">
|
||||
<small class="form-text text-danger" *ngIf="editForm.get('acceso')?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.contrasenna" for="field_contrasenna">Contrasenna</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="contrasenna"
|
||||
id="field_contrasenna"
|
||||
data-cy="contrasenna"
|
||||
formControlName="contrasenna"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.estado" for="field_estado">Estado</label>
|
||||
<select class="form-control" name="estado" formControlName="estado" id="field_estado" data-cy="estado">
|
||||
<option [ngValue]="null">{{ 'dataSurveyApp.EstadoEncuesta.null' | translate }}</option>
|
||||
<option value="DRAFT">{{ 'dataSurveyApp.EstadoEncuesta.DRAFT' | translate }}</option>
|
||||
<option value="ACTIVE">{{ 'dataSurveyApp.EstadoEncuesta.ACTIVE' | translate }}</option>
|
||||
<option value="FINISHED">{{ 'dataSurveyApp.EstadoEncuesta.FINISHED' | translate }}</option>
|
||||
<option value="DELETED">{{ 'dataSurveyApp.EstadoEncuesta.DELETED' | translate }}</option>
|
||||
</select>
|
||||
<div *ngIf="editForm.get('estado')!.invalid && (editForm.get('estado')!.dirty || editForm.get('estado')!.touched)">
|
||||
<small class="form-text text-danger" *ngIf="editForm.get('estado')?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.categoria" for="field_categoria">Categoria</label>
|
||||
<select class="form-control" id="field_categoria" data-cy="categoria" name="categoria" formControlName="categoria">
|
||||
<option [ngValue]="null"></option>
|
||||
<option
|
||||
[ngValue]="categoriaOption.id === editForm.get('categoria')!.value?.id ? editForm.get('categoria')!.value : categoriaOption"
|
||||
*ngFor="let categoriaOption of categoriasSharedCollection; trackBy: trackCategoriaById"
|
||||
>
|
||||
{{ categoriaOption.nombre }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.usuarioExtra" for="field_usuarioExtra"
|
||||
>Usuario Extra</label
|
||||
>
|
||||
<select class="form-control" id="field_usuarioExtra" data-cy="usuarioExtra" name="usuarioExtra" formControlName="usuarioExtra">
|
||||
<option [ngValue]="null"></option>
|
||||
<option
|
||||
[ngValue]="
|
||||
usuarioExtraOption.id === editForm.get('usuarioExtra')!.value?.id ? editForm.get('usuarioExtra')!.value : usuarioExtraOption
|
||||
"
|
||||
*ngFor="let usuarioExtraOption of usuarioExtrasSharedCollection; trackBy: trackUsuarioExtraById"
|
||||
>
|
||||
{{ usuarioExtraOption.id }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="button" id="cancel-save" data-cy="entityCreateCancelButton" class="btn btn-secondary" (click)="previousState()">
|
||||
<fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
id="save-entity"
|
||||
data-cy="entityCreateSaveButton"
|
||||
[disabled]="editForm.invalid || isSaving"
|
||||
class="btn btn-primary"
|
||||
>
|
||||
<fa-icon icon="save"></fa-icon> <span jhiTranslate="entity.action.save">Save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div> -->
|
||||
|
|
|
@ -37,6 +37,7 @@ import {
|
|||
faPlus,
|
||||
faStar,
|
||||
faUpload,
|
||||
faPollH,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
import * as $ from 'jquery';
|
||||
|
@ -58,8 +59,9 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
faPlus = faPlus;
|
||||
faStar = faStar;
|
||||
faUpload = faUpload;
|
||||
isPublished = false;
|
||||
isPublished: Boolean = false;
|
||||
successPublished = false;
|
||||
faPollH = faPollH;
|
||||
account: Account | null = null;
|
||||
usuarioExtra: UsuarioExtra | null = null;
|
||||
estadoDeleted = EstadoEncuesta.DELETED;
|
||||
|
@ -67,13 +69,13 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
encuestas?: IEncuesta[];
|
||||
isLoading = false;
|
||||
selectedSurvey?: IEncuesta | null = null;
|
||||
idEncuesta: number | null = null;
|
||||
isSaving = false;
|
||||
|
||||
categoriasSharedCollection: ICategoria[] = [];
|
||||
usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
|
||||
userSharedCollection: IUser[] = [];
|
||||
|
||||
selectedIdSurvey: number | null = null;
|
||||
encuestaencontrada: IEncuesta | null = null;
|
||||
|
||||
public searchString: string;
|
||||
|
@ -98,7 +100,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
});
|
||||
|
||||
createAnother: Boolean = false;
|
||||
selectedSurveyId: Number = 0;
|
||||
selectedSurveyId: Number | null = null;
|
||||
|
||||
constructor(
|
||||
protected encuestaService: EncuestaService,
|
||||
|
@ -124,7 +126,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
|
||||
this.usuarioExtraService
|
||||
.retrieveAllPublicUsers()
|
||||
.pipe(finalize(() => this.loadUserExtras()))
|
||||
.pipe(finalize(() => this.loadPublicUser()))
|
||||
.subscribe(res => {
|
||||
this.userSharedCollection = res;
|
||||
});
|
||||
|
@ -251,8 +253,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
}
|
||||
|
||||
deleteSurvey(): void {
|
||||
if (this.selectedIdSurvey != null) {
|
||||
this.getEncuesta(this.selectedIdSurvey)
|
||||
if (this.idEncuesta != null) {
|
||||
this.getEncuesta(this.idEncuesta)
|
||||
.pipe(
|
||||
finalize(() => {
|
||||
const modalRef = this.modalService.open(EncuestaDeleteDialogComponent, { size: 'lg', backdrop: 'static' });
|
||||
|
@ -426,6 +428,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
}
|
||||
|
||||
selectSurvey(event: any): void {
|
||||
this.idEncuesta = event.target.getAttribute('data-id');
|
||||
document.querySelectorAll('.ds-list--entity').forEach(e => {
|
||||
e.classList.remove('active');
|
||||
});
|
||||
|
@ -434,6 +437,11 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
}
|
||||
}
|
||||
|
||||
openPreview() {
|
||||
const surveyId = this.idEncuesta;
|
||||
this.router.navigate(['/encuesta', surveyId, 'preview']);
|
||||
}
|
||||
|
||||
counter(i: number) {
|
||||
return new Array(i);
|
||||
}
|
||||
|
@ -443,38 +451,55 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
}
|
||||
|
||||
async openContextMenu(event: any): Promise<void> {
|
||||
document.querySelectorAll('.ds-list--entity').forEach(e => {
|
||||
e.classList.remove('active');
|
||||
});
|
||||
|
||||
if (event.type === 'contextmenu') {
|
||||
event.preventDefault();
|
||||
this.selectedSurveyId = event.target.dataset.id;
|
||||
if (event.target === null) return;
|
||||
document.querySelectorAll('.ds-list--entity').forEach(e => {
|
||||
e.classList.remove('active');
|
||||
});
|
||||
this.selectedSurveyId = Number(event.target.dataset.id);
|
||||
|
||||
let res = await this.encuestaService.find(this.selectedSurveyId).toPromise();
|
||||
this.selectedSurvey = res.body;
|
||||
this.isPublished = this.selectedSurvey!.estado === 'DRAFT'; // QUE SE LE MUESTRE CUANDO ESTE EN DRAFT
|
||||
// }
|
||||
|
||||
document.getElementById('contextmenu-create--separator')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-edit--separator')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-delete--separator')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-edit')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-duplicate')!.style.display = 'block';
|
||||
|
||||
if (this.isPublished) {
|
||||
document.getElementById('contextmenu-publish')!.style.display = 'block'; //cambiar
|
||||
}
|
||||
document.getElementById('contextmenu-share')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-preview')!.style.display = 'block';
|
||||
//document.getElementById('contextmenu-share')!.style.display = 'block';
|
||||
|
||||
if ((event.target as HTMLElement).classList.contains('ds-list')) {
|
||||
document.getElementById('contextmenu-create--separator')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-edit--separator')!.style.display = 'none';
|
||||
document.getElementById('contextmenu-delete--separator')!.style.display = 'none';
|
||||
} else if ((event.target as HTMLElement).classList.contains('ds-list--entity')) {
|
||||
this.selectedSurveyId = Number(event.target.dataset.id);
|
||||
this.idEncuesta = Number(event.target.dataset.id);
|
||||
event.target.classList.add('active');
|
||||
document.getElementById('contextmenu-create--separator')!.style.display = 'none';
|
||||
|
||||
this.selectedIdSurvey = Number(event.target.dataset.id);
|
||||
//this.selectedSurvey = event.target.dataset.encuesta;
|
||||
let res = await this.encuestaService.find(this.selectedSurveyId).toPromise();
|
||||
this.selectedSurvey = res.body;
|
||||
this.isPublished = this.selectedSurvey!.estado === 'ACTIVE' || this.selectedSurvey!.estado === 'FINISHED'; // QUE SE LE MUESTRE CUANDO ESTE EN DRAFT
|
||||
|
||||
document.getElementById('contextmenu-create--separator')!.style.display = 'none';
|
||||
document.getElementById('contextmenu-edit--separator')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-delete--separator')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-edit')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-preview')!.style.display = 'block';
|
||||
|
||||
if (!this.isPublished) {
|
||||
document.getElementById('contextmenu-publish')!.style.display = 'block';
|
||||
} else {
|
||||
document.getElementById('contextmenu-publish')!.style.display = 'none';
|
||||
}
|
||||
// document.getElementById('contextmenu-share')!.style.display = 'block';
|
||||
document.getElementById('contextmenu-create--separator')!.style.display = 'none';
|
||||
}
|
||||
|
||||
document.getElementById('contextmenu')!.style.top = event.layerY + 'px';
|
||||
|
|
|
@ -14,7 +14,7 @@ const encuestaRoute: Routes = [
|
|||
canActivate: [UserRouteAccessService],
|
||||
},
|
||||
{
|
||||
path: ':id/view',
|
||||
path: ':id/preview',
|
||||
component: EncuestaDetailComponent,
|
||||
resolve: {
|
||||
encuesta: EncuestaRoutingResolveService,
|
||||
|
|
|
@ -45,6 +45,10 @@ export class EncuestaService {
|
|||
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
|
||||
}
|
||||
|
||||
findEncuesta(id: number): Observable<IEncuesta> {
|
||||
return this.http.get<IEncuesta>(`${this.resourceUrl}/${id}`);
|
||||
}
|
||||
|
||||
findQuestions(id: number): Observable<EntityResponseType> {
|
||||
return this.http
|
||||
.get<any>(`${this.resourceUrl}/preguntas/${id}`, { observe: 'response' })
|
||||
|
@ -57,8 +61,11 @@ export class EncuestaService {
|
|||
.pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
|
||||
}
|
||||
|
||||
findEncuesta(id: number): Observable<IEncuesta> {
|
||||
return this.http.get<IEncuesta>(`${this.resourceUrl}/${id}`);
|
||||
publishEncuesta(encuesta: IEncuesta): Observable<EntityResponseType> {
|
||||
//const copy = this.convertDateFromClient(encuesta);
|
||||
return this.http.put<IEncuesta>(`${this.resourceUrl}/publish/${getEncuestaIdentifier(encuesta) as number}`, encuesta, {
|
||||
observe: 'response',
|
||||
});
|
||||
}
|
||||
|
||||
deleteEncuesta(encuesta: IEncuesta): Observable<EntityResponseType> {
|
||||
|
@ -77,6 +84,10 @@ export class EncuestaService {
|
|||
return this.http.delete(`${this.resourceUrl}/${id}`, { observe: 'response' });
|
||||
}
|
||||
|
||||
deletedNotification(encuesta: IEncuesta): Observable<HttpResponse<{}>> {
|
||||
return this.http.delete(`${this.resourceUrl}/notify/${encuesta.id}`, { observe: 'response' });
|
||||
}
|
||||
|
||||
addEncuestaToCollectionIfMissing(encuestaCollection: IEncuesta[], ...encuestasToCheck: (IEncuesta | null | undefined)[]): IEncuesta[] {
|
||||
const encuestas: IEncuesta[] = encuestasToCheck.filter(isPresent);
|
||||
if (encuestas.length > 0) {
|
||||
|
|
|
@ -1,18 +1,29 @@
|
|||
<div>
|
||||
<h2 id="page-heading" data-cy="EPreguntaCerradaHeading">
|
||||
<p class="ds-title">{{ encuesta!.nombre }}</p>
|
||||
<div class="d-flex align-items-center">
|
||||
<p class="ds-title">{{ encuesta!.nombre }}</p>
|
||||
<fa-icon
|
||||
class="ds-info--icon"
|
||||
[icon]="faQuestion"
|
||||
data-toggle="modal"
|
||||
data-target="#verParametros"
|
||||
(click)="loadAplicationParameters()"
|
||||
></fa-icon>
|
||||
</div>
|
||||
|
||||
<p class="ds-subtitle">Creada el día {{ encuesta!.fechaCreacion | formatShortDatetime | lowercase }}</p>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="button" class="ds-btn ds-btn--secondary" (click)="previousState()">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.back">Back</span>
|
||||
</button>
|
||||
<button type="button" class="ds-btn ds-btn--secondary" (click)="loadAll()" [disabled]="isLoading">
|
||||
<fa-icon icon="sync" [spin]="isLoading"></fa-icon> <span>Refrescar preguntas</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="ds-btn ds-btn--secondary"
|
||||
class="ds-btn ds-btn--primary"
|
||||
(click)="createQuestion()"
|
||||
[disabled]="isLoading"
|
||||
data-toggle="modal"
|
||||
|
@ -20,6 +31,9 @@
|
|||
>
|
||||
<fa-icon icon="sync" [icon]="faPlus"></fa-icon> <span>Crear pregunta</span>
|
||||
</button>
|
||||
<button type="button" class="ds-btn ds-btn--success" (click)="openPreview()" [disabled]="isLoading">
|
||||
<fa-icon [icon]="faPollH"></fa-icon> <span>Ver vista previa</span>
|
||||
</button>
|
||||
<ng-container *ngIf="encuesta!.estado === 'DRAFT'">
|
||||
<button type="button" class="ds-btn ds-btn--primary" (click)="publishSurvey()">Publicar encuesta</button>
|
||||
</ng-container>
|
||||
|
@ -33,146 +47,100 @@
|
|||
|
||||
<!-- <jhi-alert></jhi-alert> -->
|
||||
|
||||
<div class="alert alert-warning" id="no-result" *ngIf="ePreguntas?.length === 0">
|
||||
<!-- <div class="alert alert-warning" id="no-result" *ngIf="ePreguntas?.length === 0">
|
||||
<span>No se encontraron preguntas</span>
|
||||
</div>
|
||||
|
||||
<div class="ds-survey" id="entities" *ngIf="ePreguntas && ePreguntas.length > 0">
|
||||
</div> -->
|
||||
<!-- *ngIf="ePreguntas && ePreguntas.length > 0" -->
|
||||
<div class="ds-survey" id="entities">
|
||||
<div class="ds-survey--all-question-wrapper">
|
||||
<div class="ds-survey--question-wrapper" *ngFor="let ePregunta of ePreguntas; let i = index; trackBy: trackId">
|
||||
<div
|
||||
[attr.data-index]="ePregunta.id"
|
||||
[attr.data-tipo]="ePregunta.tipo"
|
||||
[attr.data-opcional]="ePregunta.opcional"
|
||||
class="ds-survey--question"
|
||||
>
|
||||
<div class="ds-survey--titulo">
|
||||
<span class="ds-survey--titulo--name">{{ i + 1 }}. {{ ePregunta.nombre }}</span>
|
||||
<fa-icon
|
||||
*ngIf="encuesta!.estado === 'DRAFT'"
|
||||
class="ds-survey--titulo--icon"
|
||||
[icon]="faTimes"
|
||||
(click)="deleteQuestion($event)"
|
||||
[attr.data-id]="ePregunta.id"
|
||||
[attr.data-type]="ePregunta.tipo"
|
||||
></fa-icon>
|
||||
</div>
|
||||
<div>
|
||||
<span *ngIf="ePregunta.tipo === 'SINGLE'" class="ds-subtitle"
|
||||
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }}
|
||||
{{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
<span *ngIf="ePregunta.tipo === 'MULTIPLE'" class="ds-subtitle"
|
||||
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }}
|
||||
{{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
<span *ngIf="!ePregunta.tipo" class="ds-subtitle"
|
||||
>Pregunta de respuesta abierta {{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
</div>
|
||||
<ng-container *ngIf="ePregunta.tipo">
|
||||
<ng-container *ngFor="let ePreguntaOpcion of ePreguntasOpciones; let j = index; trackBy: trackId">
|
||||
<ng-container *ngFor="let ePreguntaOpcionFinal of ePreguntaOpcion">
|
||||
<ng-container *ngIf="ePregunta.id === ePreguntaOpcionFinal.epreguntaCerrada.id">
|
||||
<div
|
||||
class="ds-survey--option ds-survey--option--base ds-survey--closed-option can-delete"
|
||||
[attr.data-id]="ePreguntaOpcionFinal.id"
|
||||
>
|
||||
<!-- <input class="ds-survey--checkbox" id="{{ ePregunta.id }}-{{ ePreguntaOpcionFinal.id }}" type="checkbox" disabled /> -->
|
||||
<label for="{{ ePregunta.id }}-{{ ePreguntaOpcionFinal.id }}">{{ ePreguntaOpcionFinal.nombre }}</label>
|
||||
<fa-icon
|
||||
*ngIf="encuesta!.estado === 'DRAFT'"
|
||||
class="ds-survey--titulo--icon ds-survey--titulo--icon--small"
|
||||
[icon]="faTimes"
|
||||
(click)="deleteOption($event)"
|
||||
[attr.data-optionid]="ePreguntaOpcionFinal.id"
|
||||
></fa-icon>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<div
|
||||
class="ds-survey--option ds-survey--option--add ds-survey--closed-option"
|
||||
(click)="resetForm($event)"
|
||||
data-toggle="modal"
|
||||
data-target="#crearOpcion"
|
||||
[attr.data-id]="ePregunta.id"
|
||||
>
|
||||
<ng-container *ngIf="encuesta!.estado === 'ACTIVE'">
|
||||
<p class="ds-title text-center">Encuesta en progreso</p>
|
||||
<p class="ds-subtitle">No puede modificar la encuesta debido a que esta ya está en progreso.</p>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="encuesta!.estado === 'FINISHED'">
|
||||
<p class="ds-title text-center">Encuesta finalizada</p>
|
||||
<p class="ds-subtitle">No puede modificar la encuesta debido a que esta ya ha concluido.</p>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="encuesta!.estado === 'DRAFT' && ePreguntas && ePreguntas.length === 0">
|
||||
<p class="ds-title text-center">Encuesta vacía</p>
|
||||
<p class="ds-subtitle">Inicie creando preguntas y opciones para su encuesta.</p>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="encuesta!.estado === 'DRAFT'">
|
||||
<div class="ds-survey--question-wrapper" *ngFor="let ePregunta of ePreguntas; let i = index; trackBy: trackId">
|
||||
<div
|
||||
[attr.data-index]="ePregunta.id"
|
||||
[attr.data-tipo]="ePregunta.tipo"
|
||||
[attr.data-opcional]="ePregunta.opcional"
|
||||
class="ds-survey--question"
|
||||
>
|
||||
<div class="ds-survey--titulo">
|
||||
<span class="ds-survey--titulo--name">{{ i + 1 }}. {{ ePregunta.nombre }}</span>
|
||||
<fa-icon
|
||||
class="ds-survey--add-option--icon"
|
||||
[icon]="faPlus"
|
||||
*ngIf="encuesta!.estado === 'DRAFT'"
|
||||
class="ds-survey--titulo--icon"
|
||||
[icon]="faTimes"
|
||||
(click)="deleteQuestion($event)"
|
||||
[attr.data-id]="ePregunta.id"
|
||||
[attr.data-type]="ePregunta.tipo"
|
||||
></fa-icon>
|
||||
<span class="ds-survey--add-option">Añadir opción</span>
|
||||
</div>
|
||||
</ng-container>
|
||||
<div class="ds-survey--option ds-survey--option--base ds-survey--open-option" *ngIf="!ePregunta.tipo">
|
||||
<textarea name="" id="" cols="30" rows="10" disabled></textarea>
|
||||
<div>
|
||||
<span *ngIf="ePregunta.tipo === 'SINGLE'" class="ds-subtitle"
|
||||
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }}
|
||||
{{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
<span *ngIf="ePregunta.tipo === 'MULTIPLE'" class="ds-subtitle"
|
||||
>Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }}
|
||||
{{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
<span *ngIf="!ePregunta.tipo" class="ds-subtitle"
|
||||
>Pregunta de respuesta abierta {{ ePregunta.opcional ? '(opcional)' : '' }}</span
|
||||
>
|
||||
</div>
|
||||
<ng-container *ngIf="ePregunta.tipo">
|
||||
<ng-container *ngFor="let ePreguntaOpcion of ePreguntasOpciones; let j = index; trackBy: trackId">
|
||||
<ng-container *ngFor="let ePreguntaOpcionFinal of ePreguntaOpcion">
|
||||
<ng-container *ngIf="ePregunta.id === ePreguntaOpcionFinal.epreguntaCerrada.id">
|
||||
<div
|
||||
class="ds-survey--option ds-survey--option--base ds-survey--closed-option can-delete"
|
||||
[attr.data-id]="ePreguntaOpcionFinal.id"
|
||||
>
|
||||
<!-- <input class="ds-survey--checkbox" id="{{ ePregunta.id }}-{{ ePreguntaOpcionFinal.id }}" type="checkbox" disabled /> -->
|
||||
<label for="{{ ePregunta.id }}-{{ ePreguntaOpcionFinal.id }}">{{ ePreguntaOpcionFinal.nombre }}</label>
|
||||
<fa-icon
|
||||
*ngIf="encuesta!.estado === 'DRAFT'"
|
||||
class="ds-survey--titulo--icon ds-survey--titulo--icon--small"
|
||||
[icon]="faTimes"
|
||||
(click)="deleteOption($event)"
|
||||
[attr.data-optionid]="ePreguntaOpcionFinal.id"
|
||||
></fa-icon>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<div
|
||||
class="ds-survey--option ds-survey--option--add ds-survey--closed-option"
|
||||
(click)="resetForm($event)"
|
||||
data-toggle="modal"
|
||||
data-target="#crearOpcion"
|
||||
[attr.data-id]="ePregunta.id"
|
||||
>
|
||||
<fa-icon
|
||||
class="ds-survey--add-option--icon"
|
||||
[icon]="faPlus"
|
||||
[attr.data-id]="ePregunta.id"
|
||||
[attr.data-type]="ePregunta.tipo"
|
||||
></fa-icon>
|
||||
<span class="ds-survey--add-option">Añadir opción</span>
|
||||
</div>
|
||||
</ng-container>
|
||||
<div class="ds-survey--option ds-survey--option--base ds-survey--open-option" *ngIf="!ePregunta.tipo">
|
||||
<textarea name="" id="" cols="30" rows="10" disabled></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
||||
<!-- <table class="table table-striped" aria-describedby="page-heading">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><span jhiTranslate="global.field.id">ID</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.ePreguntaCerrada.nombre">Nombre</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.ePreguntaCerrada.tipo">Tipo</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.ePreguntaCerrada.opcional">Opcional</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.ePreguntaCerrada.orden">Orden</span></th>
|
||||
<th scope="col"><span jhiTranslate="dataSurveyApp.ePreguntaCerrada.encuesta">Encuesta</span></th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let ePreguntaCerrada of ePreguntaCerradas; trackBy: trackId" data-cy="entityTable">
|
||||
<td>
|
||||
<a [routerLink]="['/e-pregunta-cerrada', ePreguntaCerrada.id, 'view']">{{ ePreguntaCerrada.id }}</a>
|
||||
</td>
|
||||
<td>{{ ePreguntaCerrada.nombre }}</td>
|
||||
<td *ngIf="ePreguntaCerrada.tipo != undefined" jhiTranslate="{{ 'dataSurveyApp.PreguntaCerradaTipo.' + ePreguntaCerrada.tipo }}">{{ ePreguntaCerrada.tipo }}</td>
|
||||
<td *ngIf="ePreguntaCerrada.tipo == undefined"></td>
|
||||
|
||||
<td>{{ ePreguntaCerrada.opcional }}</td>
|
||||
<td>{{ ePreguntaCerrada.orden }}</td>
|
||||
<td>
|
||||
<div *ngIf="ePreguntaCerrada.encuesta">
|
||||
<a [routerLink]="['/encuesta', ePreguntaCerrada.encuesta?.id, 'view']">{{ ePreguntaCerrada.encuesta?.id }}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<button
|
||||
type="submit"
|
||||
[routerLink]="['/e-pregunta-cerrada', ePreguntaCerrada.id, 'view']"
|
||||
class="btn btn-info btn-sm"
|
||||
data-cy="entityDetailsButton"
|
||||
>
|
||||
<fa-icon icon="eye"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
[routerLink]="['/e-pregunta-cerrada', ePreguntaCerrada.id, 'edit']"
|
||||
class="btn btn-primary btn-sm"
|
||||
data-cy="entityEditButton"
|
||||
>
|
||||
<fa-icon icon="pencil-alt"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
|
||||
</button>
|
||||
|
||||
<button type="submit" (click)="delete(ePreguntaCerrada)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
|
||||
<fa-icon icon="times"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -264,7 +232,7 @@
|
|||
[formGroup]="editFormQuestion"
|
||||
>
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title" id="exampleModalLongTitle">Crear Pregunta</h1>
|
||||
<h1 class="modal-title" id="exampleModalLongTitle2">Crear Pregunta</h1>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- Survey Create Question Modal -->
|
||||
|
@ -273,7 +241,7 @@
|
|||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" for="field_nombre">Pregunta</label>
|
||||
<input type="text" class="form-control" name="nombre" id="field_nombre" data-cy="nombre" formControlName="nombre" />
|
||||
<input type="text" class="form-control" name="nombre" id="field_nombre2" data-cy="nombre" formControlName="nombre" />
|
||||
<div
|
||||
*ngIf="
|
||||
editFormQuestion.get('nombre')!.invalid &&
|
||||
|
@ -309,7 +277,7 @@
|
|||
<!-- Custom Form Group (Closed & Open Question Validation) -->
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" for="field_tipo">Tipo de pregunta</label>
|
||||
<select class="form-control" name="tipopregunta" formControlName="tipopregunta" id="field_tipo" data-cy="tipopregunta">
|
||||
<select class="form-control" name="tipopregunta" formControlName="tipopregunta" id="field_tipo2" data-cy="tipopregunta">
|
||||
<option selected value="CLOSED">Opción multiple</option>
|
||||
<option value="OPEN">Respuesta abierta</option>
|
||||
</select>
|
||||
|
@ -395,265 +363,48 @@
|
|||
|
||||
<!-- ------------------------------------------------------------------------------------------------- -->
|
||||
|
||||
<!-- <div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<form name="editForm" role="form" novalidate (ngSubmit)="save()" [formGroup]="editForm">
|
||||
<h2 id="jhi-encuesta-heading" data-cy="EncuestaCreateUpdateHeading" jhiTranslate="dataSurveyApp.encuesta.home.createOrEditLabel">
|
||||
Create or edit a Encuesta
|
||||
</h2>
|
||||
|
||||
<div>
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<div class="form-group" [hidden]="editForm.get('id')!.value == null">
|
||||
<label class="form-control-label" jhiTranslate="global.field.id" for="field_id">ID</label>
|
||||
<input type="number" class="form-control" name="id" id="field_id" data-cy="id" formControlName="id" [readonly]="true" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.nombre" for="field_nombre">Nombre</label>
|
||||
<input type="text" class="form-control" name="nombre" id="field_nombre" data-cy="nombre" formControlName="nombre" />
|
||||
<div *ngIf="editForm.get('nombre')!.invalid && (editForm.get('nombre')!.dirty || editForm.get('nombre')!.touched)">
|
||||
<small class="form-text text-danger" *ngIf="editForm.get('nombre')?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="editForm.get('nombre')?.errors?.minlength"
|
||||
jhiTranslate="entity.validation.minlength"
|
||||
[translateValues]="{ min: 1 }"
|
||||
>
|
||||
This field is required to be at least 1 characters.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="editForm.get('nombre')?.errors?.maxlength"
|
||||
jhiTranslate="entity.validation.maxlength"
|
||||
[translateValues]="{ max: 50 }"
|
||||
>
|
||||
This field cannot be longer than 50 characters.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.descripcion" for="field_descripcion">Descripcion</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="descripcion"
|
||||
id="field_descripcion"
|
||||
data-cy="descripcion"
|
||||
formControlName="descripcion"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.fechaCreacion" for="field_fechaCreacion"
|
||||
>Fecha Creacion</label
|
||||
>
|
||||
<div class="d-flex">
|
||||
<input
|
||||
id="field_fechaCreacion"
|
||||
data-cy="fechaCreacion"
|
||||
type="datetime-local"
|
||||
class="form-control"
|
||||
name="fechaCreacion"
|
||||
formControlName="fechaCreacion"
|
||||
placeholder="YYYY-MM-DD HH:mm"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
*ngIf="
|
||||
editForm.get('fechaCreacion')!.invalid && (editForm.get('fechaCreacion')!.dirty || editForm.get('fechaCreacion')!.touched)
|
||||
"
|
||||
>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="editForm.get('fechaCreacion')?.errors?.required"
|
||||
jhiTranslate="entity.validation.required"
|
||||
>
|
||||
This field is required.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
[hidden]="!editForm.get('fechaCreacion')?.errors?.ZonedDateTimelocal"
|
||||
jhiTranslate="entity.validation.ZonedDateTimelocal"
|
||||
>
|
||||
This field should be a date and time.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.fechaPublicacion" for="field_fechaPublicacion"
|
||||
>Fecha Publicacion</label
|
||||
>
|
||||
<div class="d-flex">
|
||||
<input
|
||||
id="field_fechaPublicacion"
|
||||
data-cy="fechaPublicacion"
|
||||
type="datetime-local"
|
||||
class="form-control"
|
||||
name="fechaPublicacion"
|
||||
formControlName="fechaPublicacion"
|
||||
placeholder="YYYY-MM-DD HH:mm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.fechaFinalizar" for="field_fechaFinalizar"
|
||||
>Fecha Finalizar</label
|
||||
>
|
||||
<div class="d-flex">
|
||||
<input
|
||||
id="field_fechaFinalizar"
|
||||
data-cy="fechaFinalizar"
|
||||
type="datetime-local"
|
||||
class="form-control"
|
||||
name="fechaFinalizar"
|
||||
formControlName="fechaFinalizar"
|
||||
placeholder="YYYY-MM-DD HH:mm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.fechaFinalizada" for="field_fechaFinalizada"
|
||||
>Fecha Finalizada</label
|
||||
>
|
||||
<div class="d-flex">
|
||||
<input
|
||||
id="field_fechaFinalizada"
|
||||
data-cy="fechaFinalizada"
|
||||
type="datetime-local"
|
||||
class="form-control"
|
||||
name="fechaFinalizada"
|
||||
formControlName="fechaFinalizada"
|
||||
placeholder="YYYY-MM-DD HH:mm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.calificacion" for="field_calificacion">Calificacion</label>
|
||||
<input
|
||||
type="number"
|
||||
class="form-control"
|
||||
name="calificacion"
|
||||
id="field_calificacion"
|
||||
data-cy="calificacion"
|
||||
formControlName="calificacion"
|
||||
/>
|
||||
<div
|
||||
*ngIf="editForm.get('calificacion')!.invalid && (editForm.get('calificacion')!.dirty || editForm.get('calificacion')!.touched)"
|
||||
>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
*ngIf="editForm.get('calificacion')?.errors?.required"
|
||||
jhiTranslate="entity.validation.required"
|
||||
>
|
||||
This field is required.
|
||||
</small>
|
||||
<small
|
||||
class="form-text text-danger"
|
||||
[hidden]="!editForm.get('calificacion')?.errors?.number"
|
||||
jhiTranslate="entity.validation.number"
|
||||
>
|
||||
This field should be a number.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.acceso" for="field_acceso">Acceso</label>
|
||||
<select class="form-control" name="acceso" formControlName="acceso" id="field_acceso" data-cy="acceso">
|
||||
<option [ngValue]="null">{{ 'dataSurveyApp.AccesoEncuesta.null' | translate }}</option>
|
||||
<option value="PUBLIC">{{ 'dataSurveyApp.AccesoEncuesta.PUBLIC' | translate }}</option>
|
||||
<option value="PRIVATE">{{ 'dataSurveyApp.AccesoEncuesta.PRIVATE' | translate }}</option>
|
||||
</select>
|
||||
<div *ngIf="editForm.get('acceso')!.invalid && (editForm.get('acceso')!.dirty || editForm.get('acceso')!.touched)">
|
||||
<small class="form-text text-danger" *ngIf="editForm.get('acceso')?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.contrasenna" for="field_contrasenna">Contrasenna</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
name="contrasenna"
|
||||
id="field_contrasenna"
|
||||
data-cy="contrasenna"
|
||||
formControlName="contrasenna"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.estado" for="field_estado">Estado</label>
|
||||
<select class="form-control" name="estado" formControlName="estado" id="field_estado" data-cy="estado">
|
||||
<option [ngValue]="null">{{ 'dataSurveyApp.EstadoEncuesta.null' | translate }}</option>
|
||||
<option value="DRAFT">{{ 'dataSurveyApp.EstadoEncuesta.DRAFT' | translate }}</option>
|
||||
<option value="ACTIVE">{{ 'dataSurveyApp.EstadoEncuesta.ACTIVE' | translate }}</option>
|
||||
<option value="FINISHED">{{ 'dataSurveyApp.EstadoEncuesta.FINISHED' | translate }}</option>
|
||||
<option value="DELETED">{{ 'dataSurveyApp.EstadoEncuesta.DELETED' | translate }}</option>
|
||||
</select>
|
||||
<div *ngIf="editForm.get('estado')!.invalid && (editForm.get('estado')!.dirty || editForm.get('estado')!.touched)">
|
||||
<small class="form-text text-danger" *ngIf="editForm.get('estado')?.errors?.required" jhiTranslate="entity.validation.required">
|
||||
This field is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.categoria" for="field_categoria">Categoria</label>
|
||||
<select class="form-control" id="field_categoria" data-cy="categoria" name="categoria" formControlName="categoria">
|
||||
<option [ngValue]="null"></option>
|
||||
<option
|
||||
[ngValue]="categoriaOption.id === editForm.get('categoria')!.value?.id ? editForm.get('categoria')!.value : categoriaOption"
|
||||
*ngFor="let categoriaOption of categoriasSharedCollection; trackBy: trackCategoriaById"
|
||||
>
|
||||
{{ categoriaOption.nombre }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" jhiTranslate="dataSurveyApp.encuesta.usuarioExtra" for="field_usuarioExtra"
|
||||
>Usuario Extra</label
|
||||
>
|
||||
<select class="form-control" id="field_usuarioExtra" data-cy="usuarioExtra" name="usuarioExtra" formControlName="usuarioExtra">
|
||||
<option [ngValue]="null"></option>
|
||||
<option
|
||||
[ngValue]="
|
||||
usuarioExtraOption.id === editForm.get('usuarioExtra')!.value?.id ? editForm.get('usuarioExtra')!.value : usuarioExtraOption
|
||||
"
|
||||
*ngFor="let usuarioExtraOption of usuarioExtrasSharedCollection; trackBy: trackUsuarioExtraById"
|
||||
>
|
||||
{{ usuarioExtraOption.id }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- Survey Parameters Information -->
|
||||
<div
|
||||
class="modal fade ds-modal"
|
||||
id="verParametros"
|
||||
tabindex="-1"
|
||||
role="dialog"
|
||||
aria-labelledby="exampleModalCenterTitle"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title" id="exampleModalLongTitle">Información de Encuesta</h1>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="button" id="cancel-save" data-cy="entityCreateCancelButton" class="btn btn-secondary" (click)="previousState()">
|
||||
<fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
<!-- {
|
||||
"id": 1,
|
||||
"maxDiasEncuesta": 20,
|
||||
"minDiasEncuesta": 2,
|
||||
"maxCantidadPreguntas": 10,
|
||||
"minCantidadPreguntas": 2
|
||||
} -->
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
id="save-entity"
|
||||
data-cy="entityCreateSaveButton"
|
||||
[disabled]="editForm.invalid || isSaving"
|
||||
class="btn btn-primary"
|
||||
>
|
||||
<fa-icon icon="save"></fa-icon> <span jhiTranslate="entity.action.save">Save</span>
|
||||
<div class="modal-body">
|
||||
<div>
|
||||
<div class="mb-5">
|
||||
<p class="ds-subtitle">Duración de encuesta permitida</p>
|
||||
<p>{{ parametrosAplicacion!.minDiasEncuesta }} - {{ parametrosAplicacion!.maxDiasEncuesta }} días</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="ds-subtitle">Cantidad de preguntas por encuesta</p>
|
||||
<p>{{ parametrosAplicacion!.minCantidadPreguntas }} - {{ parametrosAplicacion!.maxCantidadPreguntas }} preguntas</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="cancelBtnVerParametros" type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span>Volver</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- ------------------------------------------------------------------------------------------------- -->
|
||||
|
|
|
@ -25,11 +25,15 @@ import { IEPreguntaCerrada } from 'app/entities/e-pregunta-cerrada/e-pregunta-ce
|
|||
import { EPreguntaCerradaService } from 'app/entities/e-pregunta-cerrada/service/e-pregunta-cerrada.service';
|
||||
import { EPreguntaCerradaDeleteDialogComponent } from 'app/entities/e-pregunta-cerrada/delete/e-pregunta-cerrada-delete-dialog.component';
|
||||
|
||||
import { faTimes, faPlus } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faTimes, faPlus, faQuestion, faPollH } from '@fortawesome/free-solid-svg-icons';
|
||||
import { PreguntaCerradaTipo } from 'app/entities/enumerations/pregunta-cerrada-tipo.model';
|
||||
import { EncuestaDeleteQuestionDialogComponent } from '../encuesta-delete-question-dialog/encuesta-delete-question-dialog.component';
|
||||
import { EncuestaDeleteOptionDialogComponent } from '../encuesta-delete-option-dialog/encuesta-delete-option-dialog.component';
|
||||
|
||||
import { ParametroAplicacionService } from './../../parametro-aplicacion/service/parametro-aplicacion.service';
|
||||
import { IParametroAplicacion } from './../../parametro-aplicacion/parametro-aplicacion.model';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-encuesta-update',
|
||||
templateUrl: './encuesta-update.component.html',
|
||||
|
@ -37,6 +41,8 @@ import { EncuestaDeleteOptionDialogComponent } from '../encuesta-delete-option-d
|
|||
export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
|
||||
faTimes = faTimes;
|
||||
faPlus = faPlus;
|
||||
faPollH = faPollH;
|
||||
faQuestion = faQuestion;
|
||||
|
||||
isSaving = false;
|
||||
isSavingQuestion = false;
|
||||
|
@ -79,6 +85,7 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
|
|||
ePreguntas?: any[];
|
||||
ePreguntasOpciones?: any[];
|
||||
encuesta: Encuesta | null = null;
|
||||
parametrosAplicacion?: IParametroAplicacion | null = null;
|
||||
|
||||
isLoading = false;
|
||||
|
||||
|
@ -95,7 +102,9 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
|
|||
protected modalService: NgbModal,
|
||||
protected ePreguntaCerradaService: EPreguntaCerradaService,
|
||||
protected ePreguntaCerradaOpcionService: EPreguntaCerradaOpcionService,
|
||||
protected ePreguntaAbiertaService: EPreguntaAbiertaService
|
||||
protected parametroAplicacionService: ParametroAplicacionService,
|
||||
protected ePreguntaAbiertaService: EPreguntaAbiertaService,
|
||||
protected router: Router
|
||||
) {}
|
||||
|
||||
loadAll(): void {
|
||||
|
@ -123,6 +132,12 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
|
|||
);
|
||||
}
|
||||
|
||||
async loadAplicationParameters(): Promise<void> {
|
||||
const params = await this.parametroAplicacionService.find(1).toPromise();
|
||||
this.parametrosAplicacion = params.body;
|
||||
console.log(this.parametrosAplicacion);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.activatedRoute.data.subscribe(({ encuesta }) => {
|
||||
if (encuesta.id === undefined) {
|
||||
|
@ -134,6 +149,7 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
|
|||
} else {
|
||||
this.encuesta = encuesta;
|
||||
this.loadAll();
|
||||
this.loadAplicationParameters();
|
||||
}
|
||||
|
||||
// this.updateForm(encuesta);
|
||||
|
@ -184,6 +200,11 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
|
|||
|
||||
addOption(event: any): void {}
|
||||
|
||||
openPreview() {
|
||||
const surveyId = this.encuesta?.id;
|
||||
this.router.navigate(['/encuesta', surveyId, 'preview']);
|
||||
}
|
||||
|
||||
resetForm(event: any): void {
|
||||
this.editForm.reset();
|
||||
if (event !== null) {
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
<div class="row justify-content-center ds-form">
|
||||
<div class="row w-75 mb-4" style="border-bottom: 1px solid #e7ebf3">
|
||||
<div class="col-lg-10 mr-lg-5">
|
||||
<div class="row">
|
||||
<div class="w-100">
|
||||
<p class="ds-title">Configuración</p>
|
||||
</div>
|
||||
<div class="row w-75">
|
||||
<!-- <h2 id="page-heading" data-cy="EncuestaHeading">
|
||||
<div class="d-flex flex-sm-row flex-column justify-content-between align-items-center">
|
||||
<div>
|
||||
<p class="ds-subtitle">Configuración de parámetros de DataSurvey.</p>
|
||||
<span class="ds-title">Configuración</span>
|
||||
<p class="ds-subtitle">Configure los parámetros de encuestas de DataSurvey</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row w-75">
|
||||
</h2> -->
|
||||
|
||||
<div class="w-100 alert alert-danger" *ngIf="minDiasIncorrect">
|
||||
La cantidad mínima de los días, debe ser inferior a la cantidad máxima
|
||||
</div>
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
<form *ngIf="usuarioExtra" name="deleteForm" (ngSubmit)="confirmDelete(usuarioExtra)">
|
||||
<form class="ds-form" *ngIf="usuarioExtra" name="deleteForm" (ngSubmit)="confirmDelete(usuarioExtra)">
|
||||
<div class="modal-header">
|
||||
<!--<h4 class="modal-title" data-cy="usuarioExtraDeleteDialogHeading" jhiTranslate="entity.delete.status">Confirm delete operation</h4>-->
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<jhi-alert-error></jhi-alert-error>
|
||||
|
||||
<p id="jhi-delete-usuarioExtra-heading" jhiTranslate="dataSurveyApp.usuarioExtra.delete.question"></p>
|
||||
<p class="ds-title--small">Cambiar estado</p>
|
||||
<p class="ds-subtitle" id="jhi-delete-usuarioExtra-heading" jhiTranslate="dataSurveyApp.usuarioExtra.delete.question">
|
||||
Are you sure you want to toggle this user's status?
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
|
||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||
</button>
|
||||
|
||||
<button id="jhi-confirm-delete-usuarioExtra" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-warning">
|
||||
<button id="jhi-confirm-delete-usuarioExtra" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--danger">
|
||||
<fa-icon [icon]="faExchangeAlt"></fa-icon>
|
||||
<span jhiTranslate="entity.action.toggleStatus">Cambiar estado</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -5,10 +5,14 @@ import { IUsuarioExtra } from '../usuario-extra.model';
|
|||
import { UsuarioExtraService } from '../service/usuario-extra.service';
|
||||
import { EstadoUsuario } from '../../enumerations/estado-usuario.model';
|
||||
|
||||
import { faExchangeAlt } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
@Component({
|
||||
templateUrl: './usuario-extra-delete-dialog.component.html',
|
||||
})
|
||||
export class UsuarioExtraDeleteDialogComponent {
|
||||
faExchangeAlt = faExchangeAlt;
|
||||
|
||||
usuarioExtra?: IUsuarioExtra;
|
||||
|
||||
constructor(protected usuarioExtraService: UsuarioExtraService, protected activeModal: NgbActiveModal) {}
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
</div>
|
||||
<form class="ds-form d-inline">
|
||||
<div class="input-group">
|
||||
<div class="col-3">
|
||||
<div class="ds-filter">
|
||||
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
|
||||
<input type="text" name="searchNombreUsuario" placeholder="Buscar por nombre..." [(ngModel)]="searchNombreUsuario" />
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<div class="ds-filter">
|
||||
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
|
||||
<select name="searchEstadoUsuario" id="searchEstadoUsuario" [(ngModel)]="searchEstadoUsuario" style="width: 200px">
|
||||
<option value="" selected="selected" disabled="disabled">Filtrar por estado</option>
|
||||
|
@ -82,7 +82,7 @@
|
|||
>{{ last ? '' : ', ' }}
|
||||
</span>
|
||||
</td>-->
|
||||
<td class="text-center">
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<button
|
||||
type="submit"
|
||||
|
@ -90,12 +90,12 @@
|
|||
class="ds-btn ds-btn--primary btn-sm"
|
||||
data-cy="entityDetailsButton"
|
||||
>
|
||||
<fa-icon icon="eye"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
|
||||
</button>
|
||||
|
||||
<button type="submit" (click)="delete(usuarioExtra)" class="btn-sm ds-btn ds-btn--toggle" data-cy="entityDeleteButton">
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.toggleStatus"></span>
|
||||
|
||||
<button type="submit" (click)="delete(usuarioExtra)" class="ds-btn ds-btn--danger" data-cy="entityDeleteButton">
|
||||
<fa-icon [icon]="faExchangeAlt"></fa-icon>
|
||||
<span class="d-none d-md-inline" jhiTranslate="entity.action.toggleStatus">Toggle Status</span>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -8,12 +8,16 @@ import { UsuarioExtraDeleteDialogComponent } from '../delete/usuario-extra-delet
|
|||
import { IUser } from '../../user/user.model';
|
||||
import { finalize } from 'rxjs/operators';
|
||||
|
||||
import { faExchangeAlt } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
@Component({
|
||||
selector: 'jhi-usuario-extra',
|
||||
templateUrl: './usuario-extra.component.html',
|
||||
styleUrls: ['./usuario-extra.component.scss'],
|
||||
})
|
||||
export class UsuarioExtraComponent implements OnInit {
|
||||
faExchangeAlt = faExchangeAlt;
|
||||
|
||||
usuarioExtras?: IUsuarioExtra[];
|
||||
publicUsers?: IUser[];
|
||||
isLoading = false;
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<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">
|
||||
<div role="button" routerLink="/" class="pl-4 pt-4 pr-4 pb-1 text-center">
|
||||
<img src="../../content/img_datasurvey/datasurvey-logo-text-black.svg" alt="" />
|
||||
</div>
|
||||
|
||||
|
|
|
@ -101,3 +101,4 @@
|
|||
@import 'paper-dashboard/datasurvey-survey-update';
|
||||
@import 'paper-dashboard/datasurvey-home';
|
||||
@import 'paper-dashboard/datasurvey-filter';
|
||||
@import 'paper-dashboard/datasurvey-survey';
|
||||
|
|
|
@ -11,6 +11,14 @@
|
|||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.ds-title--small {
|
||||
color: #313747;
|
||||
font-weight: 900;
|
||||
letter-spacing: 0.025rem;
|
||||
text-transform: uppercase;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.ds-subtitle {
|
||||
color: #757d94;
|
||||
font-size: 0.9rem;
|
||||
|
@ -19,3 +27,22 @@
|
|||
p {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.ds-info--icon {
|
||||
border-radius: 50%;
|
||||
background-color: #f1f5f9;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease-in-out;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 0.7rem;
|
||||
color: #313747;
|
||||
pointer-events: visible !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
&:hover {
|
||||
background-color: #e3e6e9;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
.modal-header,
|
||||
.modal-footer {
|
||||
border: none;
|
||||
padding: 2rem;
|
||||
padding: 2rem !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
|
|
@ -0,0 +1,115 @@
|
|||
.preview-survey {
|
||||
/* --------------------------------------- */
|
||||
/* ----- Radio Button */
|
||||
/* --------------------------------------- */
|
||||
/* --------------------------------------- */
|
||||
/* ----- Checkbox */
|
||||
/* --------------------------------------- */
|
||||
}
|
||||
.preview-survey h2 {
|
||||
font-size: 16px;
|
||||
color: #001f3f;
|
||||
margin-bottom: 20px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.preview-survey > div {
|
||||
padding: 20px 0;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.preview-survey .radio label,
|
||||
.preview-survey .checkbox label {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
color: #00b88d;
|
||||
position: relative;
|
||||
padding: 5px 15px 5px 51px;
|
||||
font-size: 1em;
|
||||
border-radius: 5px;
|
||||
-webkit-transition: all 0.3s ease;
|
||||
-o-transition: all 0.3s ease;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.preview-survey .radio label:hover,
|
||||
.preview-survey .checkbox label:hover {
|
||||
background: rgba(0, 184, 141, 0.1);
|
||||
}
|
||||
.preview-survey .radio label:before,
|
||||
.preview-survey .checkbox label:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
position: absolute;
|
||||
left: 15px;
|
||||
border-radius: 50%;
|
||||
background: none;
|
||||
border: 3px solid #00b88d;
|
||||
}
|
||||
.preview-survey input[type='radio'] {
|
||||
display: none;
|
||||
}
|
||||
.preview-survey input[type='radio']:checked + label:before {
|
||||
display: none;
|
||||
}
|
||||
.preview-survey input[type='radio']:checked + label {
|
||||
padding: 5px 15px;
|
||||
background: #00b88d;
|
||||
border-radius: 2px;
|
||||
color: #fff;
|
||||
}
|
||||
.preview-survey .checkbox label:before {
|
||||
border-radius: 3px;
|
||||
}
|
||||
.preview-survey .checkbox input[type='checkbox'] {
|
||||
display: none;
|
||||
}
|
||||
.preview-survey .checkbox input[type='checkbox']:checked + label:before {
|
||||
display: none;
|
||||
}
|
||||
.preview-survey .checkbox input[type='checkbox']:checked + label {
|
||||
background: #00b88d;
|
||||
color: #fff;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
.preview-survey .ds-survey--open-option textarea {
|
||||
border: 3px solid #00b88d;
|
||||
}
|
||||
|
||||
.preview-survey .entity-icon--star {
|
||||
color: #ffcc47;
|
||||
margin-right: 0.2rem;
|
||||
}
|
||||
|
||||
.preview-survey dt {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.preview-survey dd {
|
||||
margin-left: 40px;
|
||||
}
|
||||
|
||||
.ds-survey--all-question-wrapper,
|
||||
.info-encuesta {
|
||||
@media screen and (max-width: 991px) {
|
||||
padding: 2rem 0rem;
|
||||
flex-basis: 0;
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ds-survey--option {
|
||||
@media screen and (max-width: 991px) {
|
||||
width: 21rem !important;
|
||||
}
|
||||
@media screen and (max-width: 500px) {
|
||||
width: 12rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
.preview-survey {
|
||||
@media screen and (max-width: 991px) {
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
.modal-header {
|
||||
border-bottom: 1px solid $medium-gray;
|
||||
// border-bottom: 1px solid $medium-gray;
|
||||
border: none !important;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
display: block !important;
|
||||
|
@ -41,9 +42,9 @@
|
|||
}
|
||||
|
||||
.modal-content {
|
||||
border: 0 none;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 15px rgba(0, 0, 0, 0.15), 0 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
border: none !important;
|
||||
border-radius: 3px !important;
|
||||
box-shadow: none !important;
|
||||
.modal-header {
|
||||
h6 {
|
||||
margin-top: 10px;
|
||||
|
@ -59,8 +60,9 @@
|
|||
color: #000;
|
||||
}
|
||||
.modal-footer {
|
||||
border-top: 1px solid $medium-gray;
|
||||
padding: 0px;
|
||||
// border-top: 1px solid $medium-gray;
|
||||
border: none !important;
|
||||
// padding: 0px;
|
||||
|
||||
&.no-border-footer {
|
||||
border-top: 0 none;
|
||||
|
|
|
@ -21,18 +21,18 @@
|
|||
},
|
||||
"id": "ID",
|
||||
"nombre": "Nombre",
|
||||
"descripcion": "Descripcion",
|
||||
"fechaCreacion": "Fecha Creacion",
|
||||
"fechaPublicacion": "Fecha Publicacion",
|
||||
"descripcion": "Descripción",
|
||||
"fechaCreacion": "Fecha Creación",
|
||||
"fechaPublicacion": "Fecha Publicación",
|
||||
"fechaFinalizar": "Fecha Finalizar",
|
||||
"fechaFinalizada": "Fecha Finalizada",
|
||||
"calificacion": "Calificacion",
|
||||
"calificacion": "Calificación",
|
||||
"acceso": "Acceso",
|
||||
"contrasenna": "Contrasenna",
|
||||
"contrasenna": "Contraseña",
|
||||
"estado": "Estado",
|
||||
"usuarioEncuesta": "Usuario Encuesta",
|
||||
"ePreguntaAbierta": "E Pregunta Abierta",
|
||||
"ePreguntaCerrada": "E Pregunta Cerrada",
|
||||
"ePreguntaAbierta": "Pregunta Abierta",
|
||||
"ePreguntaCerrada": "Pregunta Cerrada",
|
||||
"categoria": "Categoría",
|
||||
"usuarioExtra": "Correo Usuario"
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"updated": "El usuario con el identificador {{ param }} ha sido actualizado",
|
||||
"deleted": "El usuario con el identificador {{ param }} ha sido eliminado",
|
||||
"delete": {
|
||||
"question": "¿Seguro que quiere modificar el estado del usuario ?"
|
||||
"question": "¿Seguro que quiere cambiar el estado del usuario?"
|
||||
},
|
||||
"detail": {
|
||||
"title": "Usuario"
|
||||
|
|
Loading…
Reference in New Issue