Merge branch 'dev' into feature/US-63
This commit is contained in:
		
						commit
						2b51cacb7a
					
				| 
						 | 
				
			
			@ -159,6 +159,7 @@ public class MailService {
 | 
			
		|||
        sendEmailFromTemplate(user.getUser(), "mail/encuestaPublicaEmail", "email.public.title");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Async
 | 
			
		||||
    public void sendEncuestaDeleted(UsuarioExtra user) {
 | 
			
		||||
        log.debug("Sending encuesta deletion notification mail to '{}'", user.getUser().getEmail());
 | 
			
		||||
        sendEmailFromTemplate(user.getUser(), "mail/encuestaDeletedEmail", "email.encuestaDeleted.title");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -126,6 +126,35 @@ public class EncuestaResource {
 | 
			
		|||
 | 
			
		||||
        Encuesta result = encuestaService.save(encuesta);
 | 
			
		||||
 | 
			
		||||
        if (encuesta.getUsuarioExtra().getUser() != null) {
 | 
			
		||||
            mailService.sendEncuestaDeleted(encuesta.getUsuarioExtra());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return ResponseEntity
 | 
			
		||||
            .ok()
 | 
			
		||||
            .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, encuesta.getId().toString()))
 | 
			
		||||
            .body(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PutMapping("/encuestas/update/{id}")
 | 
			
		||||
    public ResponseEntity<Encuesta> updateEncuestaReal(
 | 
			
		||||
        @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);
 | 
			
		||||
 | 
			
		||||
        return ResponseEntity
 | 
			
		||||
            .ok()
 | 
			
		||||
            .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, encuesta.getId().toString()))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,15 +2,20 @@ package org.datasurvey.web.rest;
 | 
			
		|||
 | 
			
		||||
import java.net.URI;
 | 
			
		||||
import java.net.URISyntaxException;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Objects;
 | 
			
		||||
import java.util.Optional;
 | 
			
		||||
import java.util.stream.Collectors;
 | 
			
		||||
import javax.validation.Valid;
 | 
			
		||||
import javax.validation.constraints.NotNull;
 | 
			
		||||
import org.datasurvey.domain.UsuarioEncuesta;
 | 
			
		||||
import org.datasurvey.domain.UsuarioExtra;
 | 
			
		||||
import org.datasurvey.repository.UsuarioEncuestaRepository;
 | 
			
		||||
import org.datasurvey.service.EncuestaService;
 | 
			
		||||
import org.datasurvey.service.UsuarioEncuestaQueryService;
 | 
			
		||||
import org.datasurvey.service.UsuarioEncuestaService;
 | 
			
		||||
import org.datasurvey.service.UsuarioExtraService;
 | 
			
		||||
import org.datasurvey.service.criteria.UsuarioEncuestaCriteria;
 | 
			
		||||
import org.datasurvey.web.rest.errors.BadRequestAlertException;
 | 
			
		||||
import org.slf4j.Logger;
 | 
			
		||||
| 
						 | 
				
			
			@ -36,6 +41,8 @@ public class UsuarioEncuestaResource {
 | 
			
		|||
    private String applicationName;
 | 
			
		||||
 | 
			
		||||
    private final UsuarioEncuestaService usuarioEncuestaService;
 | 
			
		||||
    private final UsuarioExtraService usuarioExtraService;
 | 
			
		||||
    private final EncuestaService encuestaService;
 | 
			
		||||
 | 
			
		||||
    private final UsuarioEncuestaRepository usuarioEncuestaRepository;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -44,11 +51,15 @@ public class UsuarioEncuestaResource {
 | 
			
		|||
    public UsuarioEncuestaResource(
 | 
			
		||||
        UsuarioEncuestaService usuarioEncuestaService,
 | 
			
		||||
        UsuarioEncuestaRepository usuarioEncuestaRepository,
 | 
			
		||||
        UsuarioEncuestaQueryService usuarioEncuestaQueryService
 | 
			
		||||
        UsuarioEncuestaQueryService usuarioEncuestaQueryService,
 | 
			
		||||
        UsuarioExtraService usuarioExtraService,
 | 
			
		||||
        EncuestaService encuestaService
 | 
			
		||||
    ) {
 | 
			
		||||
        this.usuarioEncuestaService = usuarioEncuestaService;
 | 
			
		||||
        this.usuarioEncuestaRepository = usuarioEncuestaRepository;
 | 
			
		||||
        this.usuarioEncuestaQueryService = usuarioEncuestaQueryService;
 | 
			
		||||
        this.usuarioExtraService = usuarioExtraService;
 | 
			
		||||
        this.encuestaService = encuestaService;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -195,4 +206,23 @@ public class UsuarioEncuestaResource {
 | 
			
		|||
            .headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString()))
 | 
			
		||||
            .build();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/usuario-encuestas/encuesta/{id}")
 | 
			
		||||
    public ResponseEntity<List<UsuarioEncuesta>> getColaboradores(@PathVariable Long id) {
 | 
			
		||||
        List<UsuarioExtra> usuariosExtras = usuarioExtraService.findAll();
 | 
			
		||||
        List<UsuarioEncuesta> usuariosEncuestas = usuarioEncuestaService
 | 
			
		||||
            .findAll()
 | 
			
		||||
            .stream()
 | 
			
		||||
            .filter(uE -> Objects.nonNull(uE.getEncuesta()))
 | 
			
		||||
            .filter(uE -> uE.getEncuesta().getId().equals(id))
 | 
			
		||||
            .collect(Collectors.toList());
 | 
			
		||||
 | 
			
		||||
        for (UsuarioEncuesta usuarioEncuesta : usuariosEncuestas) {
 | 
			
		||||
            long usuarioExtraId = usuarioEncuesta.getUsuarioExtra().getId();
 | 
			
		||||
            UsuarioExtra usuarioExtra = usuariosExtras.stream().filter(u -> u.getId() == usuarioExtraId).findFirst().get();
 | 
			
		||||
            usuarioEncuesta.getUsuarioExtra().setNombre(usuarioExtra.getNombre());
 | 
			
		||||
            usuarioEncuesta.getUsuarioExtra().setIconoPerfil(usuarioExtra.getIconoPerfil());
 | 
			
		||||
        }
 | 
			
		||||
        return ResponseEntity.ok().body(usuariosEncuestas);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -56,5 +56,5 @@ 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.text1=Lamentamos informarle que su encuesta ha sido eliminada por un administrador
 | 
			
		||||
email.encuestaDeleted.text2=Saludos,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,16 +24,16 @@
 | 
			
		|||
              </div>
 | 
			
		||||
              <div class="d-flex justify-content-center">
 | 
			
		||||
                <button class="ds-btn ds-btn--primary" routerLink="/login" jhiTranslate="global.messages.info.authenticated.link">
 | 
			
		||||
                  sign in</button
 | 
			
		||||
                >.
 | 
			
		||||
                  sign in
 | 
			
		||||
                </button>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div *ngIf="error">
 | 
			
		||||
              <div class="alert alert-danger text-center my-2" jhiTranslate="activate.messages.error"></div>
 | 
			
		||||
              <div class="d-flex justify-content-center">
 | 
			
		||||
                <button class="ds-btn ds-btn--primary" routerLink="/account/register" jhiTranslate="global.registerLink">
 | 
			
		||||
                  create account</button
 | 
			
		||||
                >.
 | 
			
		||||
                  create account
 | 
			
		||||
                </button>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -38,8 +38,8 @@
 | 
			
		|||
                </div>
 | 
			
		||||
                <div class="d-flex justify-content-center">
 | 
			
		||||
                  <button class="ds-btn ds-btn--primary" routerLink="/login" jhiTranslate="global.messages.info.authenticated.botonInicio">
 | 
			
		||||
                    sign in</button
 | 
			
		||||
                  >.
 | 
			
		||||
                    sign in
 | 
			
		||||
                  </button>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ import { AppRoutingModule } from './app-routing.module';
 | 
			
		|||
import { HomeModule } from './home/home.module';
 | 
			
		||||
import { EntityRoutingModule } from './entities/entity-routing.module';
 | 
			
		||||
import { ReactiveFormsModule } from '@angular/forms';
 | 
			
		||||
 | 
			
		||||
import { PaginaPrincipalModule } from './pagina-principal/pagina-principal.module';
 | 
			
		||||
import { SocialLoginModule, SocialAuthServiceConfig } from 'angularx-social-login';
 | 
			
		||||
import { GoogleLoginProvider } from 'angularx-social-login';
 | 
			
		||||
// jhipster-needle-angular-add-module-import JHipster will add new module here
 | 
			
		||||
| 
						 | 
				
			
			@ -32,6 +32,7 @@ import { FooterComponent } from './layouts/footer/footer.component';
 | 
			
		|||
import { PageRibbonComponent } from './layouts/profiles/page-ribbon.component';
 | 
			
		||||
import { ErrorComponent } from './layouts/error/error.component';
 | 
			
		||||
import { SidebarComponent } from './layouts/sidebar/sidebar.component';
 | 
			
		||||
import { PaginaPrincipalComponent } from './pagina-principal/pagina-principal.component';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [
 | 
			
		||||
| 
						 | 
				
			
			@ -39,6 +40,7 @@ import { SidebarComponent } from './layouts/sidebar/sidebar.component';
 | 
			
		|||
    BrowserModule,
 | 
			
		||||
    SharedModule,
 | 
			
		||||
    HomeModule,
 | 
			
		||||
    PaginaPrincipalModule,
 | 
			
		||||
    // jhipster-needle-angular-add-module JHipster will add new module here
 | 
			
		||||
    EntityRoutingModule,
 | 
			
		||||
    AppRoutingModule,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,6 +23,6 @@ export class EncuestaDeleteDialogComponent {
 | 
			
		|||
    this.encuestaService.deleteEncuesta(encuesta).subscribe(() => {
 | 
			
		||||
      this.activeModal.close('deleted');
 | 
			
		||||
    });
 | 
			
		||||
    this.encuestaService.deletedNotification(encuesta);
 | 
			
		||||
    //this.encuestaService.deletedNotification(encuesta);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,88 +1,11 @@
 | 
			
		|||
<!--<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>
 | 
			
		||||
 | 
			
		||||
      <hr />
 | 
			
		||||
 | 
			
		||||
      <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
 | 
			
		||||
      <jhi-alert></jhi-alert>
 | 
			
		||||
 | 
			
		||||
      <dl class="row-md jh-entity-details">
 | 
			
		||||
        <dt><span jhiTranslate="global.field.id">ID</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.id }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.nombre">Nombre</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.nombre }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.descripcion">Descripcion</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.descripcion }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.fechaCreacion">Fecha Creacion</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.fechaCreacion | formatMediumDatetime }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.fechaPublicacion">Fecha Publicacion</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.fechaPublicacion | formatMediumDatetime }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.fechaFinalizar">Fecha Finalizar</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.fechaFinalizar | formatMediumDatetime }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.fechaFinalizada">Fecha Finalizada</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.fechaFinalizada | formatMediumDatetime }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.calificacion">Calificacion</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.calificacion }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.acceso">Acceso</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.contrasenna">Contrasenna</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span>{{ encuesta.contrasenna }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.estado">Estado</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <span jhiTranslate="{{ 'dataSurveyApp.EstadoEncuesta.' + encuesta.estado }}">{{ encuesta.estado }}</span>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.categoria">Categoria</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <div *ngIf="encuesta.categoria">
 | 
			
		||||
            <a [routerLink]="['/categoria', encuesta.categoria?.id, 'view']">{{ encuesta.categoria?.nombre }}</a>
 | 
			
		||||
          </div>
 | 
			
		||||
        </dd>
 | 
			
		||||
        <dt><span jhiTranslate="dataSurveyApp.encuesta.usuarioExtra">Usuario Extra</span></dt>
 | 
			
		||||
        <dd>
 | 
			
		||||
          <div *ngIf="encuesta.usuarioExtra">
 | 
			
		||||
            <a [routerLink]="['/usuario-extra', encuesta.usuarioExtra?.id, 'view']">{{ encuesta.usuarioExtra?.id }}</a>
 | 
			
		||||
          </div>
 | 
			
		||||
        </dd>
 | 
			
		||||
      </dl>
 | 
			
		||||
 | 
			
		||||
      <button type="submit" (click)="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
 | 
			
		||||
        <fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.back">Back</span>
 | 
			
		||||
      </button>
 | 
			
		||||
 | 
			
		||||
      <button type="button" [routerLink]="['/encuesta', encuesta.id, 'edit']" class="btn btn-primary">
 | 
			
		||||
        <fa-icon icon="pencil-alt"></fa-icon> <span jhiTranslate="entity.action.edit">Edit</span>
 | 
			
		||||
      </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>
 | 
			
		||||
      <div class="d-flex align-items-center">
 | 
			
		||||
        <p class="ds-title">Vista previa de {{ encuesta!.nombre }}</p>
 | 
			
		||||
          <fa-icon class="ds-info--icon" [icon]="faQuestion" data-toggle="modal" data-target="#verParametros"></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()">
 | 
			
		||||
| 
						 | 
				
			
			@ -167,77 +90,110 @@
 | 
			
		|||
          </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.fechaPublicacion | 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.fechaFinalizar | 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
 | 
			
		||||
        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 class="modal-body">
 | 
			
		||||
              <div>
 | 
			
		||||
                <div class="mb-5">
 | 
			
		||||
                  <p style="font-size: 1.2em" class="ds-subtitle">Cantidad de preguntas</p>
 | 
			
		||||
                  <p>{{ ePreguntas?.length }}</p>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <!--<div>
 | 
			
		||||
                    <p style="font-size: 1.2em" class="ds-survey--titulo--name">Colaboradores</p>
 | 
			
		||||
                  </div>-->
 | 
			
		||||
 | 
			
		||||
                <div class="mb-5">
 | 
			
		||||
                  <p class="ds-subtitle" jhiTranslate="dataSurveyApp.encuesta.acceso">Acceso</p>
 | 
			
		||||
                  <p jhiTranslate="{{ 'dataSurveyApp.AccesoEncuesta.' + encuesta.acceso }}">{{ encuesta.acceso }}</p>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div *ngIf="encuesta.acceso === 'PRIVATE'" class="mb-5">
 | 
			
		||||
                  <p class="ds-subtitle">Contraseña</p>
 | 
			
		||||
                  <p>{{ encuesta.contrasenna }}</p>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div class="mb-5">
 | 
			
		||||
                  <p class="ds-subtitle">Estado:</p>
 | 
			
		||||
                  <p jhiTranslate="{{ 'dataSurveyApp.EstadoEncuesta.' + encuesta.estado }}">{{ encuesta.estado }}</p>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div *ngIf="encuesta.categoria" class="mb-5">
 | 
			
		||||
                  <p class="ds-subtitle">Categoría</p>
 | 
			
		||||
                  <P> </P> {{ encuesta.categoria?.nombre }}
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div class="mb-5">
 | 
			
		||||
                  <p class="ds-subtitle">Fecha de publicación</p>
 | 
			
		||||
                  <P
 | 
			
		||||
                    >{{
 | 
			
		||||
                      encuesta.fechaPublicacion === undefined
 | 
			
		||||
                        ? 'Sin publicar'
 | 
			
		||||
                        : (encuesta.fechaPublicacion | formatShortDatetime | lowercase)
 | 
			
		||||
                    }}
 | 
			
		||||
                  </P>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <!--<div class="mb-5">
 | 
			
		||||
                <p jhiTranslate="dataSurveyApp.encuesta.fechaFinalizar" class="ds-subtitle" > Fecha Finalizar</p>
 | 
			
		||||
                <p> </p></div>
 | 
			
		||||
              <dl>
 | 
			
		||||
                <dt><span jhiTranslate="dataSurveyApp.encuesta.fechaFinalizar">Fecha Finalizar</span></dt>
 | 
			
		||||
                <dd>
 | 
			
		||||
                <span>
 | 
			
		||||
                  -
 | 
			
		||||
                  {{
 | 
			
		||||
                  encuesta.fechaFinalizar === undefined
 | 
			
		||||
                    ? 'Sin fecha de finalización'
 | 
			
		||||
                    : (encuesta.fechaFinalizar | formatShortDatetime | lowercase)
 | 
			
		||||
                  }}</span
 | 
			
		||||
                >
 | 
			
		||||
                </dd>
 | 
			
		||||
              </dl>-->
 | 
			
		||||
 | 
			
		||||
                <div class="mb-5">
 | 
			
		||||
                  <p class="ds-subtitle">Fecha de finalización</p>
 | 
			
		||||
                  <P>
 | 
			
		||||
                    {{
 | 
			
		||||
                      encuesta.fechaFinalizada === undefined
 | 
			
		||||
                        ? 'Sin finalizar'
 | 
			
		||||
                        : (encuesta.fechaFinalizada | formatShortDatetime | lowercase)
 | 
			
		||||
                    }}
 | 
			
		||||
                  </P>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div class="mb-5">
 | 
			
		||||
                  <p class="ds-subtitle">Calificación</p>
 | 
			
		||||
                  <div>
 | 
			
		||||
                    <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>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </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>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,7 +28,7 @@ import { EPreguntaAbiertaService } from '../../e-pregunta-abierta/service/e-preg
 | 
			
		|||
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 { faTimes, faPlus, faStar, faQuestion } from '@fortawesome/free-solid-svg-icons';
 | 
			
		||||
import { EncuestaPublishDialogComponent } from '../encuesta-publish-dialog/encuesta-publish-dialog.component';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
| 
						 | 
				
			
			@ -41,6 +41,7 @@ export class EncuestaDetailComponent implements OnInit {
 | 
			
		|||
  faTimes = faTimes;
 | 
			
		||||
  faPlus = faPlus;
 | 
			
		||||
  faStar = faStar;
 | 
			
		||||
  faQuestion = faQuestion;
 | 
			
		||||
  encuesta: IEncuesta | null = null;
 | 
			
		||||
  isLoading = false;
 | 
			
		||||
  successPublished = false;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
<p>encuesta-compartir-dialog works!</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { EncuestaCompartirDialogComponent } from './encuesta-compartir-dialog.component';
 | 
			
		||||
 | 
			
		||||
describe('EncuestaCompartirDialogComponent', () => {
 | 
			
		||||
  let component: EncuestaCompartirDialogComponent;
 | 
			
		||||
  let fixture: ComponentFixture<EncuestaCompartirDialogComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [EncuestaCompartirDialogComponent],
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(EncuestaCompartirDialogComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-encuesta-compartir-dialog',
 | 
			
		||||
  templateUrl: './encuesta-compartir-dialog.component.html',
 | 
			
		||||
  styleUrls: ['./encuesta-compartir-dialog.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class EncuestaCompartirDialogComponent implements OnInit {
 | 
			
		||||
  constructor() {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -9,6 +9,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
 | 
			
		|||
import { EncuestaPublishDialogComponent } from './encuesta-publish-dialog/encuesta-publish-dialog.component';
 | 
			
		||||
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 { EncuestaCompartirDialogComponent } from './encuesta-compartir-dialog/encuesta-compartir-dialog.component';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [SharedModule, EncuestaRoutingModule, FontAwesomeModule],
 | 
			
		||||
| 
						 | 
				
			
			@ -20,6 +21,7 @@ import { EncuestaDeleteOptionDialogComponent } from './encuesta-delete-option-di
 | 
			
		|||
    EncuestaPublishDialogComponent,
 | 
			
		||||
    EncuestaDeleteQuestionDialogComponent,
 | 
			
		||||
    EncuestaDeleteOptionDialogComponent,
 | 
			
		||||
    EncuestaCompartirDialogComponent,
 | 
			
		||||
  ],
 | 
			
		||||
  entryComponents: [EncuestaDeleteDialogComponent],
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -97,7 +97,9 @@
 | 
			
		|||
        </div>
 | 
			
		||||
        <div class="ds-contextmenu__divider ds-contextmenu__divider--separator-bottom" id="contextmenu-edit--separator">
 | 
			
		||||
          <li class="d-justify justify-content-start" id="contextmenu-edit">
 | 
			
		||||
            <button type="button" (click)="openSurvey(null)"><fa-icon class="contextmenu__icon" [icon]="faEdit"></fa-icon>Editar</button>
 | 
			
		||||
            <button type="button" data-toggle="modal" data-target="#editarEncuesta">
 | 
			
		||||
              <fa-icon class="contextmenu__icon" [icon]="faEdit"></fa-icon>Editar
 | 
			
		||||
            </button>
 | 
			
		||||
          </li>
 | 
			
		||||
          <li id="contextmenu-preview">
 | 
			
		||||
            <button type="button" (click)="openPreview()">
 | 
			
		||||
| 
						 | 
				
			
			@ -294,8 +296,6 @@
 | 
			
		|||
        <div class="modal-body">
 | 
			
		||||
          <!-- Survey Registration Modal -->
 | 
			
		||||
          <div>
 | 
			
		||||
            <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
 | 
			
		||||
            <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" />
 | 
			
		||||
| 
						 | 
				
			
			@ -403,3 +403,150 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<!-- Modal -->
 | 
			
		||||
<div
 | 
			
		||||
  class="modal fade ds-modal"
 | 
			
		||||
  id="editarEncuesta"
 | 
			
		||||
  tabindex="-1"
 | 
			
		||||
  role="dialog"
 | 
			
		||||
  aria-labelledby="exampleModalCenterTitle"
 | 
			
		||||
  aria-hidden="true"
 | 
			
		||||
>
 | 
			
		||||
  <div class="modal-dialog modal-dialog-centered" role="document">
 | 
			
		||||
    <div class="modal-content">
 | 
			
		||||
      <form
 | 
			
		||||
        autocomplete="off"
 | 
			
		||||
        class="ds-form"
 | 
			
		||||
        name="surveyEditForm"
 | 
			
		||||
        role="form"
 | 
			
		||||
        novalidate
 | 
			
		||||
        (ngSubmit)="editSurvey()"
 | 
			
		||||
        [formGroup]="surveyEditForm"
 | 
			
		||||
      >
 | 
			
		||||
        <div class="modal-header">
 | 
			
		||||
          <h1 class="modal-title" id="exampleModalLongTitle">Modificar Encuesta</h1>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="modal-body">
 | 
			
		||||
          <!-- Survey Modify Modal -->
 | 
			
		||||
          <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="
 | 
			
		||||
                  surveyEditForm.get('nombre')!.invalid && (surveyEditForm.get('nombre')!.dirty || surveyEditForm.get('nombre')!.touched)
 | 
			
		||||
                "
 | 
			
		||||
              >
 | 
			
		||||
                <small
 | 
			
		||||
                  class="form-text text-danger"
 | 
			
		||||
                  *ngIf="surveyEditForm.get('nombre')?.errors?.required"
 | 
			
		||||
                  jhiTranslate="entity.validation.required"
 | 
			
		||||
                >
 | 
			
		||||
                  This field is required.
 | 
			
		||||
                </small>
 | 
			
		||||
                <small
 | 
			
		||||
                  class="form-text text-danger"
 | 
			
		||||
                  *ngIf="surveyEditForm.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="surveyEditForm.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.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="
 | 
			
		||||
                  surveyEditForm.get('acceso')!.invalid && (surveyEditForm.get('acceso')!.dirty || surveyEditForm.get('acceso')!.touched)
 | 
			
		||||
                "
 | 
			
		||||
              >
 | 
			
		||||
                <small
 | 
			
		||||
                  class="form-text text-danger"
 | 
			
		||||
                  *ngIf="surveyEditForm.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.categoria" for="field_categoria">Categoría</label>
 | 
			
		||||
              <select class="form-control" id="field_categoria" data-cy="categoria" name="categoria" formControlName="categoria">
 | 
			
		||||
                <option [ngValue]="null" selected></option>
 | 
			
		||||
                <option
 | 
			
		||||
                  [ngValue]="
 | 
			
		||||
                    categoriaOption.id === surveyEditForm.get('categoria')!.value?.id
 | 
			
		||||
                      ? surveyEditForm.get('categoria')!.value
 | 
			
		||||
                      : categoriaOption
 | 
			
		||||
                  "
 | 
			
		||||
                  *ngFor="let categoriaOption of categoriasSharedCollection; trackBy: trackCategoriaById"
 | 
			
		||||
                >
 | 
			
		||||
                  {{ categoriaOption.nombre }}
 | 
			
		||||
                </option>
 | 
			
		||||
              </select>
 | 
			
		||||
              <div
 | 
			
		||||
                *ngIf="
 | 
			
		||||
                  surveyEditForm.get('categoria')!.invalid &&
 | 
			
		||||
                  (surveyEditForm.get('categoria')!.dirty || surveyEditForm.get('categoria')!.touched)
 | 
			
		||||
                "
 | 
			
		||||
              >
 | 
			
		||||
                <small
 | 
			
		||||
                  class="form-text text-danger"
 | 
			
		||||
                  *ngIf="surveyEditForm.get('categoria')?.errors?.required"
 | 
			
		||||
                  jhiTranslate="entity.validation.required"
 | 
			
		||||
                >
 | 
			
		||||
                  This field is required.
 | 
			
		||||
                </small>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="modal-footer">
 | 
			
		||||
          <button id="cancelEditSurveyBtn" type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal">
 | 
			
		||||
            <fa-icon icon="arrow-left"></fa-icon>  <span jhiTranslate="entity.action.cancel">Cancel</span>
 | 
			
		||||
          </button>
 | 
			
		||||
          <button
 | 
			
		||||
            type="submit"
 | 
			
		||||
            id="save-entity"
 | 
			
		||||
            data-cy="entityCreateSaveButton"
 | 
			
		||||
            class="ds-btn ds-btn--primary"
 | 
			
		||||
            [disabled]="surveyEditForm.invalid || isSaving"
 | 
			
		||||
          >
 | 
			
		||||
            <span jhiTranslate="entity.action.edit">Edit</span>
 | 
			
		||||
          </button>
 | 
			
		||||
        </div>
 | 
			
		||||
      </form>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -99,6 +99,14 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
    // usuarioExtra: [],
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  surveyEditForm = this.fb.group({
 | 
			
		||||
    id: [],
 | 
			
		||||
    nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(50)]],
 | 
			
		||||
    descripcion: [],
 | 
			
		||||
    acceso: [null, [Validators.required]],
 | 
			
		||||
    categoria: [null, [Validators.required]],
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  createAnother: Boolean = false;
 | 
			
		||||
  selectedSurveyId: number | null = null;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -124,12 +132,16 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
  loadAll(): void {
 | 
			
		||||
    this.isLoading = true;
 | 
			
		||||
 | 
			
		||||
    this.usuarioExtraService
 | 
			
		||||
      .retrieveAllPublicUsers()
 | 
			
		||||
      .pipe(finalize(() => this.loadPublicUser()))
 | 
			
		||||
      .subscribe(res => {
 | 
			
		||||
        this.userSharedCollection = res;
 | 
			
		||||
      });
 | 
			
		||||
    if (this.isAdmin()) {
 | 
			
		||||
      this.usuarioExtraService
 | 
			
		||||
        .retrieveAllPublicUsers()
 | 
			
		||||
        .pipe(finalize(() => this.loadPublicUser()))
 | 
			
		||||
        .subscribe(res => {
 | 
			
		||||
          this.userSharedCollection = res;
 | 
			
		||||
        });
 | 
			
		||||
    } else {
 | 
			
		||||
      this.loadEncuestas();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadPublicUser(): void {
 | 
			
		||||
| 
						 | 
				
			
			@ -144,30 +156,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
  loadUserExtras() {
 | 
			
		||||
    this.usuarioExtraService
 | 
			
		||||
      .query()
 | 
			
		||||
      .pipe(
 | 
			
		||||
        finalize(() =>
 | 
			
		||||
          this.encuestaService.query().subscribe(
 | 
			
		||||
            (res: HttpResponse<IEncuesta[]>) => {
 | 
			
		||||
              this.isLoading = false;
 | 
			
		||||
              const tmpEncuestas = res.body ?? [];
 | 
			
		||||
              if (this.isAdmin()) {
 | 
			
		||||
                this.encuestas = tmpEncuestas.filter(e => e.estado !== EstadoEncuesta.DELETED);
 | 
			
		||||
 | 
			
		||||
                this.encuestas.forEach(e => {
 | 
			
		||||
                  e.usuarioExtra = this.usuarioExtrasSharedCollection?.find(pU => pU.id == e.usuarioExtra?.id);
 | 
			
		||||
                });
 | 
			
		||||
              } else {
 | 
			
		||||
                this.encuestas = tmpEncuestas
 | 
			
		||||
                  .filter(e => e.usuarioExtra?.id === this.usuarioExtra?.id)
 | 
			
		||||
                  .filter(e => e.estado !== EstadoEncuesta.DELETED);
 | 
			
		||||
              }
 | 
			
		||||
            },
 | 
			
		||||
            () => {
 | 
			
		||||
              this.isLoading = false;
 | 
			
		||||
            }
 | 
			
		||||
          )
 | 
			
		||||
        )
 | 
			
		||||
      )
 | 
			
		||||
      .pipe(finalize(() => this.loadEncuestas()))
 | 
			
		||||
      .subscribe(
 | 
			
		||||
        (res: HttpResponse<IUsuarioExtra[]>) => {
 | 
			
		||||
          this.isLoading = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -182,6 +171,29 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
      );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadEncuestas() {
 | 
			
		||||
    this.encuestaService.query().subscribe(
 | 
			
		||||
      (res: HttpResponse<IEncuesta[]>) => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        const tmpEncuestas = res.body ?? [];
 | 
			
		||||
        if (this.isAdmin()) {
 | 
			
		||||
          this.encuestas = tmpEncuestas.filter(e => e.estado !== EstadoEncuesta.DELETED);
 | 
			
		||||
 | 
			
		||||
          this.encuestas.forEach(e => {
 | 
			
		||||
            e.usuarioExtra = this.usuarioExtrasSharedCollection?.find(pU => pU.id == e.usuarioExtra?.id);
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          this.encuestas = tmpEncuestas
 | 
			
		||||
            .filter(e => e.usuarioExtra?.id === this.usuarioExtra?.id)
 | 
			
		||||
            .filter(e => e.estado !== EstadoEncuesta.DELETED);
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      () => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.searchString = '';
 | 
			
		||||
    this.accesoEncuesta = '';
 | 
			
		||||
| 
						 | 
				
			
			@ -465,18 +477,22 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
 | 
			
		||||
        let res = await this.encuestaService.find(this.selectedSurveyId).toPromise();
 | 
			
		||||
        this.selectedSurvey = res.body;
 | 
			
		||||
        // Fill in the edit survey
 | 
			
		||||
        this.fillSurveyEditForm();
 | 
			
		||||
        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-edit--separator')!.style.display = 'block';
 | 
			
		||||
        document.getElementById('contextmenu-preview')!.style.display = 'block';
 | 
			
		||||
 | 
			
		||||
        if (!this.isPublished) {
 | 
			
		||||
          document.getElementById('contextmenu-edit--separator')!.style.display = 'block';
 | 
			
		||||
          document.getElementById('contextmenu-edit')!.style.display = 'block';
 | 
			
		||||
          document.getElementById('contextmenu-publish')!.style.display = 'block';
 | 
			
		||||
          document.getElementById('contextmenu-duplicate')!.style.display = 'block';
 | 
			
		||||
        } else {
 | 
			
		||||
          document.getElementById('contextmenu-edit')!.style.display = 'none';
 | 
			
		||||
          document.getElementById('contextmenu-publish')!.style.display = 'none';
 | 
			
		||||
          document.getElementById('contextmenu-duplicate')!.style.display = 'none';
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -508,4 +524,28 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
 | 
			
		|||
    const res = await this.encuestaService.duplicate(this.selectedSurveyId!).toPromise();
 | 
			
		||||
    this.loadAll();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  editSurvey(): void {
 | 
			
		||||
    const survey = { ...this.selectedSurvey };
 | 
			
		||||
    survey.nombre = this.surveyEditForm.get(['nombre'])!.value;
 | 
			
		||||
    survey.descripcion = this.surveyEditForm.get(['descripcion'])!.value;
 | 
			
		||||
    survey.acceso = this.surveyEditForm.get(['acceso'])!.value;
 | 
			
		||||
    survey.categoria = this.surveyEditForm.get(['categoria'])!.value;
 | 
			
		||||
    // Prevent user update by setting to null
 | 
			
		||||
    survey.usuarioExtra!.user = null;
 | 
			
		||||
 | 
			
		||||
    this.encuestaService.updateSurvey(survey).subscribe(res => {
 | 
			
		||||
      this.loadAll();
 | 
			
		||||
      $('#cancelEditSurveyBtn').click();
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  fillSurveyEditForm(): void {
 | 
			
		||||
    this.surveyEditForm.patchValue({
 | 
			
		||||
      nombre: this.selectedSurvey!.nombre,
 | 
			
		||||
      descripcion: this.selectedSurvey!.descripcion,
 | 
			
		||||
      acceso: this.selectedSurvey!.acceso,
 | 
			
		||||
      categoria: this.selectedSurvey!.categoria,
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,6 +15,7 @@ export type EntityArrayResponseType = HttpResponse<IEncuesta[]>;
 | 
			
		|||
@Injectable({ providedIn: 'root' })
 | 
			
		||||
export class EncuestaService {
 | 
			
		||||
  protected resourceUrl = this.applicationConfigService.getEndpointFor('api/encuestas');
 | 
			
		||||
  protected resourceUrlPublish = this.applicationConfigService.getEndpointFor('api/encuestas/publish');
 | 
			
		||||
 | 
			
		||||
  constructor(protected http: HttpClient, protected applicationConfigService: ApplicationConfigService) {}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +29,14 @@ export class EncuestaService {
 | 
			
		|||
  update(encuesta: IEncuesta): Observable<EntityResponseType> {
 | 
			
		||||
    const copy = this.convertDateFromClient(encuesta);
 | 
			
		||||
    return this.http
 | 
			
		||||
      .put<IEncuesta>(`${this.resourceUrl}/${getEncuestaIdentifier(encuesta) as number}`, copy, { observe: 'response' })
 | 
			
		||||
      .put<IEncuesta>(`${this.resourceUrlPublish}/${getEncuestaIdentifier(encuesta) as number}`, copy, { observe: 'response' })
 | 
			
		||||
      .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  updateSurvey(encuesta: IEncuesta): Observable<EntityResponseType> {
 | 
			
		||||
    const copy = this.convertDateFromClient(encuesta);
 | 
			
		||||
    return this.http
 | 
			
		||||
      .put<IEncuesta>(`${this.resourceUrl}/update/${getEncuestaIdentifier(encuesta) as number}`, copy, { observe: 'response' })
 | 
			
		||||
      .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,9 @@
 | 
			
		|||
<div>
 | 
			
		||||
  <h2 id="page-heading" data-cy="EPreguntaCerradaHeading">
 | 
			
		||||
    <div class="d-flex align-items-center">
 | 
			
		||||
      <p class="ds-title">{{ encuesta!.nombre }}</p>
 | 
			
		||||
      <p class="ds-title ds-contenteditable" contenteditable="true" spellcheck="false" (blur)="updateSurveyName($event)">
 | 
			
		||||
        {{ encuesta!.nombre }}
 | 
			
		||||
      </p>
 | 
			
		||||
        <fa-icon
 | 
			
		||||
        class="ds-info--icon"
 | 
			
		||||
        [icon]="faQuestion"
 | 
			
		||||
| 
						 | 
				
			
			@ -10,6 +12,31 @@
 | 
			
		|||
        (click)="loadAplicationParameters()"
 | 
			
		||||
      ></fa-icon>
 | 
			
		||||
        <fa-icon class="ds-info--icon" [icon]="faEye" (click)="openPreview()"></fa-icon>
 | 
			
		||||
      <div class="d-flex px-4">
 | 
			
		||||
        <div class="col-12">
 | 
			
		||||
          <div class="row" style="flex-direction: row-reverse">
 | 
			
		||||
            <div class="col-mb-2 iconos-colab">
 | 
			
		||||
              <div class="add-collab">
 | 
			
		||||
                <fa-icon icon="sync" [icon]="faPlus"></fa-icon>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div
 | 
			
		||||
              class="col-mb-2 iconos-colab"
 | 
			
		||||
              *ngFor="let colaborador of usuariosColaboradores"
 | 
			
		||||
              (click)="selectColaborator(colaborador)"
 | 
			
		||||
              data-toggle="modal"
 | 
			
		||||
              data-target="#modalColaborators"
 | 
			
		||||
            >
 | 
			
		||||
              <img
 | 
			
		||||
                class="photo-collab"
 | 
			
		||||
                *ngIf="colaborador.usuarioExtra"
 | 
			
		||||
                src="../../../../content/profile_icons/C{{ colaborador.usuarioExtra.iconoPerfil }}.png"
 | 
			
		||||
                alt="{{ colaborador.usuarioExtra.nombre }}"
 | 
			
		||||
              />
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <p class="ds-subtitle">Creada el día {{ encuesta!.fechaCreacion | formatShortDatetime | lowercase }}</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +93,18 @@
 | 
			
		|||
            class="ds-survey--question"
 | 
			
		||||
          >
 | 
			
		||||
            <div class="ds-survey--titulo">
 | 
			
		||||
              <span class="ds-survey--titulo--name">{{ i + 1 }}. {{ ePregunta.nombre }}</span>
 | 
			
		||||
              <span class="ds-survey--titulo--name">
 | 
			
		||||
                <span>{{ i + 1 }}.</span> 
 | 
			
		||||
                <span
 | 
			
		||||
                  class="ds-contenteditable"
 | 
			
		||||
                  [attr.data-id]="ePregunta.id"
 | 
			
		||||
                  [attr.data-tipo]="ePregunta.tipo"
 | 
			
		||||
                  contenteditable="true"
 | 
			
		||||
                  spellcheck="false"
 | 
			
		||||
                  (blur)="updateQuestionName($event)"
 | 
			
		||||
                  >{{ ePregunta.nombre }}</span
 | 
			
		||||
                >
 | 
			
		||||
              </span>
 | 
			
		||||
              <fa-icon
 | 
			
		||||
                *ngIf="encuesta!.estado === 'DRAFT'"
 | 
			
		||||
                class="ds-survey--titulo--icon"
 | 
			
		||||
| 
						 | 
				
			
			@ -224,7 +262,7 @@
 | 
			
		|||
        [formGroup]="editFormQuestion"
 | 
			
		||||
      >
 | 
			
		||||
        <div class="modal-header">
 | 
			
		||||
          <h1 class="modal-title" id="exampleModalLongTitle2">Crear Pregunta</h1>
 | 
			
		||||
          <h1 class="modal-title" id="exampleModalLongTitle1">Crear Pregunta</h1>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="modal-body">
 | 
			
		||||
          <!-- Survey Create Question Modal -->
 | 
			
		||||
| 
						 | 
				
			
			@ -367,7 +405,7 @@
 | 
			
		|||
  <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>
 | 
			
		||||
        <h1 class="modal-title" id="exampleModalLongTitle2">Información de Encuesta</h1>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <!-- {
 | 
			
		||||
| 
						 | 
				
			
			@ -400,3 +438,57 @@
 | 
			
		|||
</div>
 | 
			
		||||
 | 
			
		||||
<!-- ------------------------------------------------------------------------------------------------- -->
 | 
			
		||||
 | 
			
		||||
<!-- ------------------------------------------------------------------------------------------------- -->
 | 
			
		||||
 | 
			
		||||
<!-- Survey Parameters Information -->
 | 
			
		||||
<div
 | 
			
		||||
  class="modal fade ds-modal"
 | 
			
		||||
  id="modalColaborators"
 | 
			
		||||
  tabindex="-1"
 | 
			
		||||
  role="dialog"
 | 
			
		||||
  aria-labelledby="verColaboradoresTitle"
 | 
			
		||||
  aria-hidden="true"
 | 
			
		||||
  *ngIf="colaborador && isAutor()"
 | 
			
		||||
>
 | 
			
		||||
  <div class="modal-dialog modal-dialog-centered" role="document">
 | 
			
		||||
    <div class="modal-content">
 | 
			
		||||
      <form class="ds-form" name="editFormUpdateCollab" role="form" (ngSubmit)="saveCollab()" [formGroup]="editFormUpdateCollab">
 | 
			
		||||
        <div class="modal-header">
 | 
			
		||||
          <h1 class="modal-title" id="modalColaboradores">Colaboradores</h1>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="modal-body">
 | 
			
		||||
          <div>
 | 
			
		||||
            <div class="mb-5" *ngIf="colaborador.usuarioExtra">
 | 
			
		||||
              <p class="ds-subtitle">Nombre</p>
 | 
			
		||||
              <p>{{ colaborador!.usuarioExtra.nombre }}</p>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
              <label for="field_update_rol">Rol</label>
 | 
			
		||||
              <select class="form-control" name="rol" formControlName="rol" id="field_update_rol" data-cy="rol">
 | 
			
		||||
                <option value="READ" [selected]="colaborador.rol === 'READ'">Lector</option>
 | 
			
		||||
                <option value="WRITE" [selected]="colaborador.rol === 'WRITE'">Escritor</option>
 | 
			
		||||
              </select>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="modal-footer">
 | 
			
		||||
          <button id="btnCancelUbdateColaboradores" type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal">
 | 
			
		||||
            <fa-icon icon="arrow-left"></fa-icon>  <span>Cancelar</span>
 | 
			
		||||
          </button>
 | 
			
		||||
          <button
 | 
			
		||||
            id="btnUpdateColaboradores"
 | 
			
		||||
            type="submit"
 | 
			
		||||
            class="ds-btn ds-btn--primary"
 | 
			
		||||
            data-cy="entityUpdateButton"
 | 
			
		||||
            [disabled]="isSavingCollab"
 | 
			
		||||
          >
 | 
			
		||||
             <span>Guardar cambios</span>
 | 
			
		||||
          </button>
 | 
			
		||||
        </div>
 | 
			
		||||
      </form>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<!-- ------------------------------------------------------------------------------------------------- -->
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
import { IEPreguntaAbierta } from './../../e-pregunta-abierta/e-pregunta-abierta.model';
 | 
			
		||||
import { EPreguntaAbierta, 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';
 | 
			
		||||
| 
						 | 
				
			
			@ -17,7 +17,7 @@ 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 { IUsuarioExtra, UsuarioExtra } 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';
 | 
			
		||||
| 
						 | 
				
			
			@ -34,6 +34,12 @@ import { ParametroAplicacionService } from './../../parametro-aplicacion/service
 | 
			
		|||
import { IParametroAplicacion } from './../../parametro-aplicacion/parametro-aplicacion.model';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { UsuarioEncuestaService } from 'app/entities/usuario-encuesta/service/usuario-encuesta.service';
 | 
			
		||||
import { IUsuarioEncuesta } from '../../usuario-encuesta/usuario-encuesta.model';
 | 
			
		||||
import { RolColaborador } from '../../enumerations/rol-colaborador.model';
 | 
			
		||||
import { Account } from '../../../core/auth/account.model';
 | 
			
		||||
import { AccountService } from 'app/core/auth/account.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-encuesta-update',
 | 
			
		||||
  templateUrl: './encuesta-update.component.html',
 | 
			
		||||
| 
						 | 
				
			
			@ -47,10 +53,15 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
 | 
			
		||||
  isSaving = false;
 | 
			
		||||
  isSavingQuestion = false;
 | 
			
		||||
 | 
			
		||||
  isSavingCollab = false;
 | 
			
		||||
  public rolSeleccionado: RolColaborador | undefined = undefined;
 | 
			
		||||
  categoriasSharedCollection: ICategoria[] = [];
 | 
			
		||||
  usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
 | 
			
		||||
  usuariosColaboradores: IUsuarioEncuesta[] = [];
 | 
			
		||||
  colaborador: IUsuarioEncuesta | null = null;
 | 
			
		||||
 | 
			
		||||
  account: Account | null = null;
 | 
			
		||||
  usuarioExtra: UsuarioExtra | null = null;
 | 
			
		||||
  // editForm = this.fb.group({
 | 
			
		||||
  //   id: [],
 | 
			
		||||
  //   nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(50)]],
 | 
			
		||||
| 
						 | 
				
			
			@ -83,6 +94,11 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
    tipopregunta: ['CLOSED'],
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  editFormUpdateCollab = this.fb.group({
 | 
			
		||||
    id: [],
 | 
			
		||||
    rol: [null, [Validators.required]],
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  ePreguntas?: any[];
 | 
			
		||||
  ePreguntasOpciones?: any[];
 | 
			
		||||
  encuesta: Encuesta | null = null;
 | 
			
		||||
| 
						 | 
				
			
			@ -105,7 +121,9 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
    protected ePreguntaCerradaOpcionService: EPreguntaCerradaOpcionService,
 | 
			
		||||
    protected parametroAplicacionService: ParametroAplicacionService,
 | 
			
		||||
    protected ePreguntaAbiertaService: EPreguntaAbiertaService,
 | 
			
		||||
    protected router: Router
 | 
			
		||||
    protected usuarioEncuestaService: UsuarioEncuestaService,
 | 
			
		||||
    protected router: Router,
 | 
			
		||||
    protected accountService: AccountService
 | 
			
		||||
  ) {}
 | 
			
		||||
 | 
			
		||||
  loadAll(): void {
 | 
			
		||||
| 
						 | 
				
			
			@ -115,7 +133,6 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
      (res: any) => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        this.ePreguntas = res.body ?? [];
 | 
			
		||||
        console.log(this.ePreguntas);
 | 
			
		||||
      },
 | 
			
		||||
      () => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -131,12 +148,21 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
        this.isLoading = false;
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    this.usuarioEncuestaService.findCollaborators(this.encuesta?.id!).subscribe(
 | 
			
		||||
      (res: any) => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        this.usuariosColaboradores = res.body ?? [];
 | 
			
		||||
      },
 | 
			
		||||
      () => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async loadAplicationParameters(): Promise<void> {
 | 
			
		||||
    const params = await this.parametroAplicacionService.find(1).toPromise();
 | 
			
		||||
    this.parametrosAplicacion = params.body;
 | 
			
		||||
    console.log(this.parametrosAplicacion);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
| 
						 | 
				
			
			@ -157,10 +183,19 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
 | 
			
		||||
      // this.loadRelationshipsOptions();
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    // Get jhi_user and usuario_extra information
 | 
			
		||||
    this.accountService.getAuthenticationState().subscribe(account => {
 | 
			
		||||
      if (account !== null) {
 | 
			
		||||
        this.usuarioExtraService.find(account.id).subscribe(usuarioExtra => {
 | 
			
		||||
          this.usuarioExtra = usuarioExtra.body;
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngAfterViewChecked(): void {
 | 
			
		||||
    this.initListeners();
 | 
			
		||||
    // this.initListeners();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackId(index: number, item: IEPreguntaCerrada): number {
 | 
			
		||||
| 
						 | 
				
			
			@ -178,18 +213,18 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  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');
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  // 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');
 | 
			
		||||
  //       }
 | 
			
		||||
  //     });
 | 
			
		||||
  //   }
 | 
			
		||||
  // }
 | 
			
		||||
 | 
			
		||||
  previousState(): void {
 | 
			
		||||
    window.history.back();
 | 
			
		||||
| 
						 | 
				
			
			@ -332,7 +367,6 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
 | 
			
		||||
  createQuestion(): void {
 | 
			
		||||
    const surveyId = this.encuesta?.id;
 | 
			
		||||
    console.log(surveyId);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  protected createFromFormClosedQuestion(): IEPreguntaCerrada {
 | 
			
		||||
| 
						 | 
				
			
			@ -416,6 +450,57 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
    this.isSavingQuestion = false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  updateSurveyName(event: any) {
 | 
			
		||||
    const updatedSurveyName = event.target.innerText;
 | 
			
		||||
    if (updatedSurveyName !== this.encuesta?.nombre) {
 | 
			
		||||
      const survey = { ...this.encuesta };
 | 
			
		||||
      survey.nombre = updatedSurveyName;
 | 
			
		||||
      // Prevent user update by setting to null
 | 
			
		||||
      survey.usuarioExtra!.user = null;
 | 
			
		||||
 | 
			
		||||
      this.encuestaService.updateSurvey(survey).subscribe(res => {});
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  updateQuestionName(event: any): void {
 | 
			
		||||
    const questionType = event.target.dataset.tipo;
 | 
			
		||||
    const questionId = event.target.dataset.id;
 | 
			
		||||
    const questionName = event.target.innerText;
 | 
			
		||||
    if (questionType) {
 | 
			
		||||
      // Closed question
 | 
			
		||||
      this.ePreguntaCerradaService.find(questionId).subscribe(res => {
 | 
			
		||||
        const ePreguntaCerrada: EPreguntaCerrada | null = res.body ?? null;
 | 
			
		||||
        const updatedEPreguntaCerrada = { ...ePreguntaCerrada };
 | 
			
		||||
        if (questionName !== ePreguntaCerrada?.nombre && ePreguntaCerrada !== null) {
 | 
			
		||||
          updatedEPreguntaCerrada.nombre = questionName;
 | 
			
		||||
          this.ePreguntaCerradaService.update(updatedEPreguntaCerrada).subscribe(updatedQuestion => {
 | 
			
		||||
            console.log(updatedQuestion);
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    } else {
 | 
			
		||||
      // Open question
 | 
			
		||||
      // Closed question
 | 
			
		||||
      this.ePreguntaAbiertaService.find(questionId).subscribe(res => {
 | 
			
		||||
        const ePreguntaAbierta: EPreguntaAbierta | null = res.body ?? null;
 | 
			
		||||
        const updatedEPreguntaAbierta = { ...ePreguntaAbierta };
 | 
			
		||||
        if (questionName !== ePreguntaAbierta?.nombre && ePreguntaAbierta !== null) {
 | 
			
		||||
          updatedEPreguntaAbierta.nombre = questionName;
 | 
			
		||||
          this.ePreguntaAbiertaService.update(updatedEPreguntaAbierta).subscribe(updatedQuestion => {
 | 
			
		||||
            console.log(updatedQuestion);
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    // const questionId = event.target.dataset.id;
 | 
			
		||||
    // const survey = { ...this.encuesta };
 | 
			
		||||
    // survey.nombre = updatedQuestionName;
 | 
			
		||||
    // // Prevent user update by setting to null
 | 
			
		||||
    // survey.usuarioExtra!.user = null;
 | 
			
		||||
 | 
			
		||||
    // this.encuestaService.updateSurvey(survey).subscribe(res => {});
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // previousState(): void {
 | 
			
		||||
  //   window.history.back();
 | 
			
		||||
  // }
 | 
			
		||||
| 
						 | 
				
			
			@ -532,4 +617,49 @@ export class EncuestaUpdateComponent implements OnInit, AfterViewChecked {
 | 
			
		|||
  //     usuarioExtra: this.editForm.get(['usuarioExtra'])!.value,
 | 
			
		||||
  //   };
 | 
			
		||||
  // }
 | 
			
		||||
 | 
			
		||||
  /* methods for colaborators*/
 | 
			
		||||
 | 
			
		||||
  selectColaborator(c: IUsuarioEncuesta) {
 | 
			
		||||
    this.colaborador = c;
 | 
			
		||||
    this.rolSeleccionado = c.rol;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  saveCollab(): void {
 | 
			
		||||
    this.isSavingCollab = true;
 | 
			
		||||
    const collab = this.colaborador;
 | 
			
		||||
    if (collab !== null) {
 | 
			
		||||
      collab.rol = this.editFormUpdateCollab.get('rol')!.value;
 | 
			
		||||
      collab.fechaAgregado = dayjs(this.colaborador?.fechaAgregado, DATE_TIME_FORMAT);
 | 
			
		||||
      /*this.usuarioEncuestaService.update(collab).subscribe(
 | 
			
		||||
        res => {},
 | 
			
		||||
      (error) => {console.log(error)}
 | 
			
		||||
      );*/
 | 
			
		||||
 | 
			
		||||
      this.subscribeToSaveResponseUpdateCollab(this.usuarioEncuestaService.update(collab));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  protected subscribeToSaveResponseUpdateCollab(result: Observable<HttpResponse<IUsuarioEncuesta>>): void {
 | 
			
		||||
    result.pipe(finalize(() => this.onSaveFinalizeUpdateCollab())).subscribe(
 | 
			
		||||
      () => this.onSaveSuccessUpdateCollab(),
 | 
			
		||||
      () => this.onSaveErrorUpdateCollab()
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  protected onSaveSuccessUpdateCollab(): void {
 | 
			
		||||
    this.loadAll();
 | 
			
		||||
    $('#btnCancelUbdateColaboradores').click();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  protected onSaveErrorUpdateCollab(): void {
 | 
			
		||||
    // Api for inheritance.
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  protected onSaveFinalizeUpdateCollab(): void {
 | 
			
		||||
    this.isSavingCollab = false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  isAutor() {
 | 
			
		||||
    return this.usuarioExtra?.id == this.encuesta?.usuarioExtra?.id;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@
 | 
			
		|||
    <span jhiTranslate="dataSurveyApp.plantilla.home.title">Plantillas</span>
 | 
			
		||||
 | 
			
		||||
    <div class="d-flex justify-content-end">
 | 
			
		||||
      <button class="btn btn-info mr-2" (click)="loadAll()" [disabled]="isLoading">
 | 
			
		||||
      <button class="ds-btn btn-info mr-2" (click)="loadAll()" [disabled]="isLoading">
 | 
			
		||||
        <fa-icon icon="sync" [spin]="isLoading"></fa-icon>
 | 
			
		||||
        <span jhiTranslate="dataSurveyApp.plantilla.home.refreshListLabel">Refresh List</span>
 | 
			
		||||
      </button>
 | 
			
		||||
| 
						 | 
				
			
			@ -11,11 +11,11 @@
 | 
			
		|||
      <button
 | 
			
		||||
        id="jh-create-entity"
 | 
			
		||||
        data-cy="entityCreateButton"
 | 
			
		||||
        class="btn btn-primary jh-create-entity create-plantilla"
 | 
			
		||||
        class="ds-btn ds-btn--primary jh-create-entity create-plantilla"
 | 
			
		||||
        [routerLink]="['/plantilla/new']"
 | 
			
		||||
      >
 | 
			
		||||
        <fa-icon icon="plus"></fa-icon>
 | 
			
		||||
        <span jhiTranslate="dataSurveyApp.plantilla.home.createLabel"> Create a new Plantilla </span>
 | 
			
		||||
        <span jhiTranslate="dataSurveyApp.plantilla.home.createLabel"> Create a new Template </span>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </h2>
 | 
			
		||||
| 
						 | 
				
			
			@ -25,14 +25,13 @@
 | 
			
		|||
  <jhi-alert></jhi-alert>
 | 
			
		||||
 | 
			
		||||
  <div class="alert alert-warning" id="no-result" *ngIf="plantillas?.length === 0">
 | 
			
		||||
    <span jhiTranslate="dataSurveyApp.plantilla.home.notFound">No plantillas found</span>
 | 
			
		||||
    <span jhiTranslate="dataSurveyApp.plantilla.home.notFound">No templates found</span>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="table-responsive" id="entities" *ngIf="plantillas && plantillas.length > 0">
 | 
			
		||||
    <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.plantilla.nombre">Nombre</span></th>
 | 
			
		||||
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.descripcion">Descripcion</span></th>
 | 
			
		||||
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.fechaCreacion">Fecha Creacion</span></th>
 | 
			
		||||
| 
						 | 
				
			
			@ -45,9 +44,6 @@
 | 
			
		|||
      </thead>
 | 
			
		||||
      <tbody>
 | 
			
		||||
        <tr *ngFor="let plantilla of plantillas; trackBy: trackId" data-cy="entityTable">
 | 
			
		||||
          <td>
 | 
			
		||||
            <a [routerLink]="['/plantilla', plantilla.id, 'view']">{{ plantilla.id }}</a>
 | 
			
		||||
          </td>
 | 
			
		||||
          <td>{{ plantilla.nombre }}</td>
 | 
			
		||||
          <td>{{ plantilla.descripcion }}</td>
 | 
			
		||||
          <td>{{ plantilla.fechaCreacion | formatMediumDatetime }}</td>
 | 
			
		||||
| 
						 | 
				
			
			@ -64,7 +60,7 @@
 | 
			
		|||
              <button
 | 
			
		||||
                type="submit"
 | 
			
		||||
                [routerLink]="['/plantilla', plantilla.id, 'view']"
 | 
			
		||||
                class="btn btn-info btn-sm"
 | 
			
		||||
                class="ds-btn btn-info btn-sm"
 | 
			
		||||
                data-cy="entityDetailsButton"
 | 
			
		||||
              >
 | 
			
		||||
                <fa-icon icon="eye"></fa-icon>
 | 
			
		||||
| 
						 | 
				
			
			@ -74,14 +70,14 @@
 | 
			
		|||
              <button
 | 
			
		||||
                type="submit"
 | 
			
		||||
                [routerLink]="['/plantilla', plantilla.id, 'edit']"
 | 
			
		||||
                class="btn btn-primary btn-sm"
 | 
			
		||||
                class="ds-btn ds-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(plantilla)" class="btn btn-danger btn-sm" data-cy="entityDeleteButton">
 | 
			
		||||
              <button type="submit" (click)="delete(plantilla)" class="ds-btn ds-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>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,7 +34,7 @@ export class PlantillaComponent implements OnInit {
 | 
			
		|||
    this.loadAll();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackId(index: number, item: IPlantilla): number {
 | 
			
		||||
  trackId(_index: number, item: IPlantilla): number {
 | 
			
		||||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,8 +27,9 @@ export class UsuarioEncuestaService {
 | 
			
		|||
 | 
			
		||||
  update(usuarioEncuesta: IUsuarioEncuesta): Observable<EntityResponseType> {
 | 
			
		||||
    const copy = this.convertDateFromClient(usuarioEncuesta);
 | 
			
		||||
    const url = `${this.resourceUrl}/${getUsuarioEncuestaIdentifier(usuarioEncuesta) as number}`;
 | 
			
		||||
    return this.http
 | 
			
		||||
      .put<IUsuarioEncuesta>(`${this.resourceUrl}/${getUsuarioEncuestaIdentifier(usuarioEncuesta) as number}`, copy, {
 | 
			
		||||
      .put<IUsuarioEncuesta>(url, copy, {
 | 
			
		||||
        observe: 'response',
 | 
			
		||||
      })
 | 
			
		||||
      .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
 | 
			
		||||
| 
						 | 
				
			
			@ -36,8 +37,9 @@ export class UsuarioEncuestaService {
 | 
			
		|||
 | 
			
		||||
  partialUpdate(usuarioEncuesta: IUsuarioEncuesta): Observable<EntityResponseType> {
 | 
			
		||||
    const copy = this.convertDateFromClient(usuarioEncuesta);
 | 
			
		||||
    const url = `${this.resourceUrl}/${getUsuarioEncuestaIdentifier(usuarioEncuesta) as number}`;
 | 
			
		||||
    return this.http
 | 
			
		||||
      .patch<IUsuarioEncuesta>(`${this.resourceUrl}/${getUsuarioEncuestaIdentifier(usuarioEncuesta) as number}`, copy, {
 | 
			
		||||
      .patch<IUsuarioEncuesta>(url, copy, {
 | 
			
		||||
        observe: 'response',
 | 
			
		||||
      })
 | 
			
		||||
      .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
 | 
			
		||||
| 
						 | 
				
			
			@ -49,6 +51,12 @@ export class UsuarioEncuestaService {
 | 
			
		|||
      .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  findCollaborators(id: number): Observable<EntityResponseType> {
 | 
			
		||||
    return this.http
 | 
			
		||||
      .get<any>(`${this.resourceUrl}/encuesta/${id}`, { observe: 'response' })
 | 
			
		||||
      .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  query(req?: any): Observable<EntityArrayResponseType> {
 | 
			
		||||
    const options = createRequestOption(req);
 | 
			
		||||
    return this.http
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -87,14 +87,14 @@
 | 
			
		|||
          </td>-->
 | 
			
		||||
          <td class="text-right">
 | 
			
		||||
            <div class="btn-group">
 | 
			
		||||
              <button
 | 
			
		||||
              <!-- <button
 | 
			
		||||
                type="submit"
 | 
			
		||||
                [routerLink]="['/usuario-extra', usuarioExtra.id, 'view']"
 | 
			
		||||
                class="ds-btn ds-btn--primary btn-sm"
 | 
			
		||||
                data-cy="entityDetailsButton"
 | 
			
		||||
              >
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
 | 
			
		||||
              </button>
 | 
			
		||||
              </button> -->
 | 
			
		||||
 | 
			
		||||
              <button type="submit" (click)="delete(usuarioExtra)" class="ds-btn ds-btn--danger" data-cy="entityDeleteButton">
 | 
			
		||||
                <fa-icon [icon]="faExchangeAlt"></fa-icon>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
  <div class="col">
 | 
			
		||||
    <div class="container-fluid navbar navbar-marketing navbar-expand-lg bg-white navbar-light">
 | 
			
		||||
      <div class="container px-5 py-4">
 | 
			
		||||
        <a class="text-dark" href="index.html"
 | 
			
		||||
        <a class="text-dark" routerLink="login"
 | 
			
		||||
          ><img src="http://datasurvey.org/content/img_datasurvey/datasurvey-logo-text-black.svg" width="300" alt=""
 | 
			
		||||
        /></a>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -10,11 +10,11 @@
 | 
			
		|||
          <!--<a href="#">
 | 
			
		||||
            <button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Encuestas</button>
 | 
			
		||||
          </a>-->
 | 
			
		||||
          <a href="login" [hidden]="!notAccount">
 | 
			
		||||
          <a routerLink="login" [hidden]="!notAccount">
 | 
			
		||||
            <button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Iniciar Sesión</button>
 | 
			
		||||
          </a>
 | 
			
		||||
 | 
			
		||||
          <a href="account/register" [hidden]="!notAccount">
 | 
			
		||||
          <a routerLink="account/register" [hidden]="!notAccount">
 | 
			
		||||
            <button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Registrarse</button>
 | 
			
		||||
          </a>
 | 
			
		||||
        </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -36,7 +36,7 @@
 | 
			
		|||
                </h5>
 | 
			
		||||
                <div class="row" [hidden]="!notAccount">
 | 
			
		||||
                  <div class="col">
 | 
			
		||||
                    <a routerLink="/login">
 | 
			
		||||
                    <a routerLink="pagina-principal">
 | 
			
		||||
                      <button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Comenzar</button>
 | 
			
		||||
                    </a>
 | 
			
		||||
                  </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -98,12 +98,10 @@
 | 
			
		|||
        <h1 class="text-center mb-4">Encuestas</h1>
 | 
			
		||||
        <div class="row gx-5" *ngIf="encuestas && encuestas.length > 0">
 | 
			
		||||
          <div class="col-xl-4 col-lg-4 col-md-6 mb-5" *ngFor="let encuesta of encuestasMostradas; trackBy: trackId">
 | 
			
		||||
            <div
 | 
			
		||||
              class="card-encuesta lift h-100"
 | 
			
		||||
              (dblclick)="openSurvey($event)"
 | 
			
		||||
              (click)="selectSurvey($event)"
 | 
			
		||||
              [attr.data-id]="encuesta.id"
 | 
			
		||||
            >
 | 
			
		||||
            <div class="card-encuesta lift h-100" [attr.data-id]="encuesta.id">
 | 
			
		||||
              <!--(dblclick)="openSurvey($event)"
 | 
			
		||||
              (click)="selectSurvey($event)"-->
 | 
			
		||||
 | 
			
		||||
              <div class="card-body p-3">
 | 
			
		||||
                <div class="card-title mb-0">{{ encuesta.nombre }}</div>
 | 
			
		||||
                <div class="entity-body--row m-2">
 | 
			
		||||
| 
						 | 
				
			
			@ -116,14 +114,14 @@
 | 
			
		|||
                  <div class="entity-body">
 | 
			
		||||
                    <div class="entity-body--row m-2">
 | 
			
		||||
                      <span class="mt-2"
 | 
			
		||||
                        >Fecha Publicada  <fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon>  {{
 | 
			
		||||
                        >Fecha de inicio  <fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon>  {{
 | 
			
		||||
                          encuesta.fechaPublicacion | formatShortDatetime | titlecase
 | 
			
		||||
                        }}</span
 | 
			
		||||
                      >
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="entity-body--row m-2">
 | 
			
		||||
                      <span class="mt-2"
 | 
			
		||||
                        >Fecha de Finalización   <fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon
 | 
			
		||||
                        >Fecha de finalización   <fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon
 | 
			
		||||
                        >  {{ encuesta.fechaFinalizar | formatShortDatetime | titlecase }}</span
 | 
			
		||||
                      >
 | 
			
		||||
                    </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
<div #footer class="footer">
 | 
			
		||||
<div #footer class="footer" [hidden]="!notAccount">
 | 
			
		||||
  <div>
 | 
			
		||||
    <p>
 | 
			
		||||
      Copyright © Derechos reservados - Desarrollado por
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,32 @@
 | 
			
		|||
import { Component } from '@angular/core';
 | 
			
		||||
import { Account } from '../../core/auth/account.model';
 | 
			
		||||
import { takeUntil } from 'rxjs/operators';
 | 
			
		||||
import { AccountService } from '../../core/auth/account.service';
 | 
			
		||||
import { Subject } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-footer',
 | 
			
		||||
  templateUrl: './footer.component.html',
 | 
			
		||||
  styleUrls: ['./footer.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class FooterComponent {}
 | 
			
		||||
export class FooterComponent {
 | 
			
		||||
  account: Account | null = null;
 | 
			
		||||
  notAccount: boolean = true;
 | 
			
		||||
  private readonly destroy$ = new Subject<void>();
 | 
			
		||||
 | 
			
		||||
  constructor(protected accountService: AccountService) {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.accountService
 | 
			
		||||
      .getAuthenticationState()
 | 
			
		||||
      .pipe(takeUntil(this.destroy$))
 | 
			
		||||
      .subscribe(account => {
 | 
			
		||||
        if (account !== null) {
 | 
			
		||||
          this.account = account;
 | 
			
		||||
          this.notAccount = false;
 | 
			
		||||
        } else {
 | 
			
		||||
          this.notAccount = true;
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,18 +22,20 @@ export const ADMIN_ROUTES: RouteInfo[] = [
 | 
			
		|||
  //   type: 'link',
 | 
			
		||||
  //   icontype: 'nc-icon nc-chart-bar-32',
 | 
			
		||||
  // },
 | 
			
		||||
 | 
			
		||||
  { path: '/pagina-principal', title: 'Inicio', type: 'link', icontype: 'nc-icon nc-world-2' },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/encuesta',
 | 
			
		||||
    title: 'Encuestas',
 | 
			
		||||
    type: 'link',
 | 
			
		||||
    icontype: 'nc-icon nc-paper',
 | 
			
		||||
  },
 | 
			
		||||
  // {
 | 
			
		||||
  //   path: '/plantilla',
 | 
			
		||||
  //   title: 'Plantillas',
 | 
			
		||||
  //   type: 'link',
 | 
			
		||||
  //   icontype: 'nc-icon nc-album-2',
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/plantilla',
 | 
			
		||||
    title: 'Plantillas',
 | 
			
		||||
    type: 'link',
 | 
			
		||||
    icontype: 'nc-icon nc-album-2',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/categoria',
 | 
			
		||||
    title: 'Categorías',
 | 
			
		||||
| 
						 | 
				
			
			@ -55,6 +57,7 @@ export const ADMIN_ROUTES: RouteInfo[] = [
 | 
			
		|||
];
 | 
			
		||||
 | 
			
		||||
export const USER_ROUTES: RouteInfo[] = [
 | 
			
		||||
  { path: '/pagina-principal', title: 'Inicio', type: 'link', icontype: 'nc-icon nc-world-2' },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/encuesta',
 | 
			
		||||
    title: 'Encuestas',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -55,7 +55,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
 | 
			
		|||
    // if already authenticated then navigate to home page
 | 
			
		||||
    this.accountService.identity().subscribe(() => {
 | 
			
		||||
      if (this.accountService.isAuthenticated()) {
 | 
			
		||||
        this.router.navigate(['']);
 | 
			
		||||
        this.router.navigate(['/pagina-principal']);
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -90,7 +90,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
 | 
			
		|||
        if (!this.router.getCurrentNavigation()) {
 | 
			
		||||
          this.localStorageService.store('IsGoogle', 'true');
 | 
			
		||||
          // There were no routing during login (eg from navigationToStoredUrl)
 | 
			
		||||
          this.router.navigate(['']);
 | 
			
		||||
          this.router.navigate(['/pagina-principal']);
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      response => {
 | 
			
		||||
| 
						 | 
				
			
			@ -173,7 +173,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
 | 
			
		|||
          this.authenticationError = false;
 | 
			
		||||
          if (!this.router.getCurrentNavigation()) {
 | 
			
		||||
            // There were no routing during login (eg from navigationToStoredUrl)
 | 
			
		||||
            this.router.navigate(['']);
 | 
			
		||||
            this.router.navigate(['/pagina-principal']);
 | 
			
		||||
          }
 | 
			
		||||
          // }
 | 
			
		||||
        },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
import { Route, RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { PaginaPrincipalComponent } from './pagina-principal.component';
 | 
			
		||||
 | 
			
		||||
export const PAGINA_PRINCIPAL_ROUTE: Route = {
 | 
			
		||||
  path: 'pagina-principal',
 | 
			
		||||
  component: PaginaPrincipalComponent,
 | 
			
		||||
  data: {
 | 
			
		||||
    pageTitle: 'paginaPrincipal.title',
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,122 @@
 | 
			
		|||
<div class="row">
 | 
			
		||||
  <div class="col">
 | 
			
		||||
    <div class="container-fluid navbar navbar-marketing navbar-expand-lg bg-white navbar-light">
 | 
			
		||||
      <div class="container px-5 py-4">
 | 
			
		||||
        <h1 class="ds-title" [hidden]="notAccount">Inicio</h1>
 | 
			
		||||
        <a class="text-dark" href=" " [hidden]="!notAccount">
 | 
			
		||||
          <img src="http://datasurvey.org/content/img_datasurvey/datasurvey-logo-text-black.svg" width="300" alt="" />
 | 
			
		||||
        </a>
 | 
			
		||||
 | 
			
		||||
        <a href=" ">
 | 
			
		||||
          <button class="ds-btn btn-outline-secondary fw-500 ms-lg-4">Sobre DataSurvey</button>
 | 
			
		||||
        </a>
 | 
			
		||||
 | 
			
		||||
        <div class="col-6" style="text-align: end">
 | 
			
		||||
          <!--<a routerlink="" [hidden]="!notAccount">
 | 
			
		||||
            <button class="ds-btn btn-light fw-500 ms-lg-4">Sobre DataSurvey</button>
 | 
			
		||||
          </a>-->
 | 
			
		||||
          <a routerLink="/login" [hidden]="!notAccount">
 | 
			
		||||
            <button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Iniciar Sesión</button>
 | 
			
		||||
          </a>
 | 
			
		||||
 | 
			
		||||
          <a routerLink="/account/register" [hidden]="!notAccount">
 | 
			
		||||
            <button class="ds-btn ds-btn--primary fw-500 ms-lg-4">Registrarse</button>
 | 
			
		||||
          </a>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="bg-light py-10 container-encuestas">
 | 
			
		||||
      <div class="container px-0">
 | 
			
		||||
        <!--filtrado-->
 | 
			
		||||
 | 
			
		||||
        <div class="input-group">
 | 
			
		||||
          <div class="ds-filter">
 | 
			
		||||
            <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
            <input class="form-control" type="text" name="searchString" placeholder="Buscar por nombre..." [(ngModel)]="searchString" />
 | 
			
		||||
          </div>
 | 
			
		||||
          <!--<div class="ds-filter">
 | 
			
		||||
            <select name="searchCategoria" class="form-control" [(ngModel)]="searchCategoria" style="width: 200px">
 | 
			
		||||
              <option value="" selected="selected" disabled="disabled">Filtrar por categoría</option>
 | 
			
		||||
              <option value="">Todas las categorías</option>
 | 
			
		||||
              <option  *ngFor="let categoria of categorias" [value]="categoria.nombre">{{categoria.nombre}}</option>
 | 
			
		||||
            </select>
 | 
			
		||||
          </div>-->
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <hr />
 | 
			
		||||
 | 
			
		||||
        <div class="container" *ngIf="encuestas && encuestas.length == 0">
 | 
			
		||||
          <h1 class="ds-title">Encuestas</h1>
 | 
			
		||||
 | 
			
		||||
          <hr />
 | 
			
		||||
          <div class="social-box">
 | 
			
		||||
            <h1>
 | 
			
		||||
              <fa-icon [icon]="faFileAlt"></fa-icon>
 | 
			
		||||
            </h1>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <!--Inicio de los cards-->
 | 
			
		||||
 | 
			
		||||
        <div class="row gx-5" *ngIf="encuestas && encuestas.length > 0">
 | 
			
		||||
          <div
 | 
			
		||||
            class="col-xl-4 col-lg-4 col-md-6 mb-5"
 | 
			
		||||
            *ngFor="
 | 
			
		||||
              let encuesta of encuestas | filter: 'nombre':searchString | filter: 'categoria.nombre':searchCategoria;
 | 
			
		||||
              trackBy: trackId
 | 
			
		||||
            "
 | 
			
		||||
          >
 | 
			
		||||
            <div class="card-encuesta lift h-100" [attr.data-id]="encuesta.id">
 | 
			
		||||
              <!--(dblclick)="openSurvey($event)"
 | 
			
		||||
             (click)="selectSurvey($event)"
 | 
			
		||||
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
              <div class="card-body p-3">
 | 
			
		||||
                <div class="card-title mb-0">{{ encuesta.nombre }}</div>
 | 
			
		||||
                <div class="entity-body--row m-2">
 | 
			
		||||
                  <span class="tag mt-2">{{ encuesta.categoria?.nombre | lowercase }}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="entity-body--row m-2">
 | 
			
		||||
                  <span class="subtitle mt-2">{{ encuesta.descripcion | titlecase }}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="text-xs text-gray-500">
 | 
			
		||||
                  <div class="entity-body">
 | 
			
		||||
                    <div class="entity-body--row m-2">
 | 
			
		||||
                      <span class="mt-2"
 | 
			
		||||
                        >Fecha de inicio  <fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon>  {{
 | 
			
		||||
                          encuesta.fechaPublicacion | formatShortDatetime | titlecase
 | 
			
		||||
                        }}</span
 | 
			
		||||
                      >
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="entity-body--row m-2">
 | 
			
		||||
                      <span class="mt-2"
 | 
			
		||||
                        >Fecha de finalización   <fa-icon class="entity-icon--access" [icon]="faCalendarAlt"></fa-icon
 | 
			
		||||
                        >  {{ encuesta.fechaFinalizar | formatShortDatetime | titlecase }}</span
 | 
			
		||||
                      >
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="entity-body--row m-2">
 | 
			
		||||
                      <p>Calificacion</p>
 | 
			
		||||
                      <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>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="entity-body--row m-2">
 | 
			
		||||
                      <button class="ds-btn btn-card"><fa-icon [icon]="faPollH"></fa-icon>  Completar encuesta</button>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <!--Inicio de cards-->
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
.social-box {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 3em;
 | 
			
		||||
  height: 4em;
 | 
			
		||||
  margin-left: 2.7em;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  font-size: 130px;
 | 
			
		||||
  opacity: 0.3;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.container div:last-child {
 | 
			
		||||
  margin-right: 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,112 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { Account } from '../core/auth/account.model';
 | 
			
		||||
import { takeUntil } from 'rxjs/operators';
 | 
			
		||||
import { EncuestaService } from '../entities/encuesta/service/encuesta.service';
 | 
			
		||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		||||
import { CategoriaService } from '../entities/categoria/service/categoria.service';
 | 
			
		||||
import { UsuarioExtraService } from '../entities/usuario-extra/service/usuario-extra.service';
 | 
			
		||||
import { ActivatedRoute, Router } from '@angular/router';
 | 
			
		||||
import { FormBuilder } from '@angular/forms';
 | 
			
		||||
import { AccountService } from '../core/auth/account.service';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { IEncuesta } from '../entities/encuesta/encuesta.model';
 | 
			
		||||
import { UsuarioExtra } from '../entities/usuario-extra/usuario-extra.model';
 | 
			
		||||
import { Subject } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
import { faPollH, faCalendarAlt, faStar, faListAlt, faFileAlt } from '@fortawesome/free-solid-svg-icons';
 | 
			
		||||
import { ICategoria } from '../entities/categoria/categoria.model';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-pagina-principal',
 | 
			
		||||
  templateUrl: './pagina-principal.component.html',
 | 
			
		||||
  styleUrls: ['./pagina-principal.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class PaginaPrincipalComponent implements OnInit {
 | 
			
		||||
  public searchString: string;
 | 
			
		||||
  public searchCategoria: string;
 | 
			
		||||
  categorias?: ICategoria[];
 | 
			
		||||
  account: Account | null = null;
 | 
			
		||||
  public searchEncuestaPublica: string;
 | 
			
		||||
  notAccount: boolean = true;
 | 
			
		||||
  usuarioExtra: UsuarioExtra | null = null;
 | 
			
		||||
  encuestas?: IEncuesta[];
 | 
			
		||||
 | 
			
		||||
  isLoading = false;
 | 
			
		||||
  private readonly destroy$ = new Subject<void>();
 | 
			
		||||
 | 
			
		||||
  faStar = faStar;
 | 
			
		||||
  faCalendarAlt = faCalendarAlt;
 | 
			
		||||
  faPollH = faPollH;
 | 
			
		||||
  faListAlt = faListAlt;
 | 
			
		||||
  faFileAlt = faFileAlt;
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    protected encuestaService: EncuestaService,
 | 
			
		||||
    protected modalService: NgbModal,
 | 
			
		||||
    protected categoriaService: CategoriaService,
 | 
			
		||||
    protected usuarioExtraService: UsuarioExtraService,
 | 
			
		||||
    protected activatedRoute: ActivatedRoute,
 | 
			
		||||
    protected fb: FormBuilder,
 | 
			
		||||
    protected accountService: AccountService,
 | 
			
		||||
    protected router: Router
 | 
			
		||||
  ) {
 | 
			
		||||
    this.searchEncuestaPublica = '';
 | 
			
		||||
    this.searchString = '';
 | 
			
		||||
    this.searchCategoria = '';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.searchEncuestaPublica = '';
 | 
			
		||||
    this.accountService
 | 
			
		||||
      .getAuthenticationState()
 | 
			
		||||
      .pipe(takeUntil(this.destroy$))
 | 
			
		||||
      .subscribe(account => {
 | 
			
		||||
        if (account !== null) {
 | 
			
		||||
          this.account = account;
 | 
			
		||||
          this.notAccount = false;
 | 
			
		||||
        } else {
 | 
			
		||||
          this.notAccount = true;
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    this.loadAll();
 | 
			
		||||
    this.loadAllCategorias();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnDestroy(): void {
 | 
			
		||||
    this.destroy$.next();
 | 
			
		||||
    this.destroy$.complete();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadAll(): void {
 | 
			
		||||
    this.isLoading = true;
 | 
			
		||||
 | 
			
		||||
    this.encuestaService.query().subscribe(
 | 
			
		||||
      (res: HttpResponse<IEncuesta[]>) => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        const tmpEncuestas = res.body ?? [];
 | 
			
		||||
        this.encuestas = tmpEncuestas.filter(e => e.estado === 'ACTIVE' && e.acceso === 'PUBLIC');
 | 
			
		||||
      },
 | 
			
		||||
      () => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadAllCategorias(): void {
 | 
			
		||||
    this.isLoading = true;
 | 
			
		||||
 | 
			
		||||
    this.categoriaService.query().subscribe(
 | 
			
		||||
      (res: HttpResponse<ICategoria[]>) => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        this.categorias = res.body ?? [];
 | 
			
		||||
      },
 | 
			
		||||
      () => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackId(index: number, item: IEncuesta): number {
 | 
			
		||||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { SharedModule } from 'app/shared/shared.module';
 | 
			
		||||
 | 
			
		||||
import { PAGINA_PRINCIPAL_ROUTE } from './pagina-princial.route';
 | 
			
		||||
import { PaginaPrincipalComponent } from './pagina-principal.component';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [SharedModule, RouterModule.forChild([PAGINA_PRINCIPAL_ROUTE])],
 | 
			
		||||
  declarations: [PaginaPrincipalComponent],
 | 
			
		||||
})
 | 
			
		||||
export class PaginaPrincipalModule {}
 | 
			
		||||
| 
						 | 
				
			
			@ -11,6 +11,21 @@
 | 
			
		|||
  font-size: 1.2rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.ds-contenteditable {
 | 
			
		||||
  border: 2.25px solid transparent;
 | 
			
		||||
  border-radius: 3px;
 | 
			
		||||
  outline: 0;
 | 
			
		||||
  text-transform: none;
 | 
			
		||||
 | 
			
		||||
  &:hover {
 | 
			
		||||
    border: 2.25px solid #e5e5e5;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  &:focus {
 | 
			
		||||
    border: 2.25px solid #2962ff;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.ds-title--small {
 | 
			
		||||
  color: #313747;
 | 
			
		||||
  font-weight: 900;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -162,3 +162,38 @@
 | 
			
		|||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.iconos-colab {
 | 
			
		||||
  margin-right: -8px;
 | 
			
		||||
  z-index: 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.photo-collab {
 | 
			
		||||
  width: 40px;
 | 
			
		||||
  border-radius: 50px;
 | 
			
		||||
  border: 2px solid #fff;
 | 
			
		||||
 | 
			
		||||
  &:hover {
 | 
			
		||||
    margin-top: -4px;
 | 
			
		||||
    cursor: pointer;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.add-collab {
 | 
			
		||||
  background: #c3c2c2;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  width: 40px;
 | 
			
		||||
  height: 40px;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
  padding: 4pt 7pt;
 | 
			
		||||
  border-radius: 50px;
 | 
			
		||||
  border: 2px solid #fff;
 | 
			
		||||
  position: relative;
 | 
			
		||||
  top: 0;
 | 
			
		||||
  transition: all 0.1s ease-in-out;
 | 
			
		||||
  &:hover {
 | 
			
		||||
    /*margin-top: -4px;**/
 | 
			
		||||
    top: -5px;
 | 
			
		||||
    cursor: pointer;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,13 +4,13 @@
 | 
			
		|||
      "home": {
 | 
			
		||||
        "title": "Plantillas",
 | 
			
		||||
        "refreshListLabel": "Refrescar lista",
 | 
			
		||||
        "createLabel": "Crear nuevo Plantilla",
 | 
			
		||||
        "createOrEditLabel": "Crear o editar Plantilla",
 | 
			
		||||
        "notFound": "Ningún Plantillas encontrado"
 | 
			
		||||
        "createLabel": "Crear nueva plantilla",
 | 
			
		||||
        "createOrEditLabel": "Crear o editar plantilla",
 | 
			
		||||
        "notFound": "No se encontró ninguna plantilla"
 | 
			
		||||
      },
 | 
			
		||||
      "created": "Un nuevo Plantilla ha sido creado con el identificador {{ param }}",
 | 
			
		||||
      "updated": "Un Plantilla ha sido actualizado con el identificador {{ param }}",
 | 
			
		||||
      "deleted": "Un Plantilla ha sido eliminado con el identificador {{ param }}",
 | 
			
		||||
      "created": "Una nueva plantilla ha sido creada con el identificador {{ param }}",
 | 
			
		||||
      "updated": "Una plantilla ha sido actualizada con el identificador {{ param }}",
 | 
			
		||||
      "deleted": "Una plantilla ha sido eliminada con el identificador {{ param }}",
 | 
			
		||||
      "delete": {
 | 
			
		||||
        "question": "¿Seguro que quiere eliminar Plantilla {{ id }}?"
 | 
			
		||||
      },
 | 
			
		||||
| 
						 | 
				
			
			@ -19,9 +19,9 @@
 | 
			
		|||
      },
 | 
			
		||||
      "id": "ID",
 | 
			
		||||
      "nombre": "Nombre",
 | 
			
		||||
      "descripcion": "Descripcion",
 | 
			
		||||
      "fechaCreacion": "Fecha Creacion",
 | 
			
		||||
      "fechaPublicacionTienda": "Fecha Publicacion Tienda",
 | 
			
		||||
      "descripcion": "Descripción",
 | 
			
		||||
      "fechaCreacion": "Fecha Creación",
 | 
			
		||||
      "fechaPublicacionTienda": "Fecha Publicación Tienda",
 | 
			
		||||
      "estado": "Estado",
 | 
			
		||||
      "precio": "Precio",
 | 
			
		||||
      "pPreguntaCerrada": "P Pregunta Cerrada",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@
 | 
			
		|||
      "rol": "Rol",
 | 
			
		||||
      "nombre": "Nombre",
 | 
			
		||||
      "iconoPerfil": "Icono",
 | 
			
		||||
      "fechaNacimiento": "Fecha de Nacimiento",
 | 
			
		||||
      "fechaNacimiento": "Fecha de nacimiento",
 | 
			
		||||
      "estado": "Estado",
 | 
			
		||||
      "user": "Usuario",
 | 
			
		||||
      "correo": "Correo electrónico",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,8 @@
 | 
			
		|||
    <meta charset="utf-8" />
 | 
			
		||||
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 | 
			
		||||
    <title>DataSurvey</title>
 | 
			
		||||
    <meta name="description" content="Description for DataSurvey" />
 | 
			
		||||
    <meta http-equiv="Content-Security-Policy" content="script-src-elem * 'self' 'unsafe-inline' 'unsafe-eval' *" />
 | 
			
		||||
    <meta name="description" content="Cree y complete encuestas a nivel mundial" />
 | 
			
		||||
    <meta name="google" content="notranslate" />
 | 
			
		||||
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
 | 
			
		||||
    <meta name="theme-color" content="#000000" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,5 +27,6 @@
 | 
			
		|||
  "background_color": "#e0e0e0",
 | 
			
		||||
  "start_url": ".",
 | 
			
		||||
  "display": "standalone",
 | 
			
		||||
  "orientation": "portrait"
 | 
			
		||||
  "orientation": "portrait",
 | 
			
		||||
  "content_security_policy": "default-src * data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src * data: blob: 'unsafe-inline';  img-src * data: blob: 'unsafe-inline';  frame-src * data: blob: ;  style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';"
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue