Merge branch 'dev' into feature/US-32
This commit is contained in:
		
						commit
						580eded1ce
					
				| 
						 | 
				
			
			@ -64,7 +64,7 @@ public class UsuarioExtra implements Serializable {
 | 
			
		|||
        joinColumns = @JoinColumn(name = "usuario_extra_id"),
 | 
			
		||||
        inverseJoinColumns = @JoinColumn(name = "plantilla_id")
 | 
			
		||||
    )
 | 
			
		||||
    @JsonIgnoreProperties(value = { "pPreguntaCerradas", "pPreguntaAbiertas", "categoria", "usuarioExtras" }, allowSetters = true)
 | 
			
		||||
    @JsonIgnoreProperties(value = { "pPreguntaCerradas", "pPreguntaAbiertas", "usuarioExtras" }, allowSetters = true)
 | 
			
		||||
    private Set<Plantilla> plantillas = new HashSet<>();
 | 
			
		||||
 | 
			
		||||
    // jhipster-needle-entity-add-field - JHipster will add fields here
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -80,6 +80,14 @@ public class EPreguntaCerradaOpcionResource {
 | 
			
		|||
            .body(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/e-pregunta-cerrada-opcions/count/{id}")
 | 
			
		||||
    public ResponseEntity<EPreguntaCerradaOpcion> updateOpcionCount(@PathVariable(value = "id", required = true) final Long id) {
 | 
			
		||||
        EPreguntaCerradaOpcion updatedOpcion = getEPreguntaCerradaOpcion(id).getBody();
 | 
			
		||||
        int cantidad = updatedOpcion.getCantidad();
 | 
			
		||||
        updatedOpcion.setCantidad(cantidad += 1);
 | 
			
		||||
        return ResponseEntity.ok(updatedOpcion);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * {@code PUT  /e-pregunta-cerrada-opcions/:id} : Updates an existing ePreguntaCerradaOpcion.
 | 
			
		||||
     *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,10 +11,7 @@ import java.util.stream.Collectors;
 | 
			
		|||
import java.util.stream.Stream;
 | 
			
		||||
import javax.validation.Valid;
 | 
			
		||||
import javax.validation.constraints.NotNull;
 | 
			
		||||
import org.datasurvey.domain.EPreguntaAbierta;
 | 
			
		||||
import org.datasurvey.domain.EPreguntaCerrada;
 | 
			
		||||
import org.datasurvey.domain.EPreguntaCerradaOpcion;
 | 
			
		||||
import org.datasurvey.domain.Encuesta;
 | 
			
		||||
import org.datasurvey.domain.*;
 | 
			
		||||
import org.datasurvey.domain.enumeration.AccesoEncuesta;
 | 
			
		||||
import org.datasurvey.repository.EncuestaRepository;
 | 
			
		||||
import org.datasurvey.service.*;
 | 
			
		||||
| 
						 | 
				
			
			@ -59,6 +56,14 @@ public class EncuestaResource {
 | 
			
		|||
 | 
			
		||||
    private final EPreguntaCerradaOpcionService ePreguntaCerradaOpcionService;
 | 
			
		||||
 | 
			
		||||
    private final PlantillaService plantillaService;
 | 
			
		||||
 | 
			
		||||
    private final PPreguntaCerradaService pPreguntaCerradaService;
 | 
			
		||||
 | 
			
		||||
    private final PPreguntaAbiertaService pPreguntaAbiertaService;
 | 
			
		||||
 | 
			
		||||
    private final PPreguntaCerradaOpcionService pPreguntaCerradaOpcionService;
 | 
			
		||||
 | 
			
		||||
    public EncuestaResource(
 | 
			
		||||
        EncuestaService encuestaService,
 | 
			
		||||
        EncuestaRepository encuestaRepository,
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +71,11 @@ public class EncuestaResource {
 | 
			
		|||
        MailService mailService,
 | 
			
		||||
        EPreguntaCerradaService ePreguntaCerradaService,
 | 
			
		||||
        EPreguntaAbiertaService ePreguntaAbiertaService,
 | 
			
		||||
        EPreguntaCerradaOpcionService ePreguntaCerradaOpcionService
 | 
			
		||||
        EPreguntaCerradaOpcionService ePreguntaCerradaOpcionService,
 | 
			
		||||
        PlantillaService plantillaService,
 | 
			
		||||
        PPreguntaCerradaService pPreguntaCerradaService,
 | 
			
		||||
        PPreguntaAbiertaService pPreguntaAbiertaService,
 | 
			
		||||
        PPreguntaCerradaOpcionService pPreguntaCerradaOpcionService
 | 
			
		||||
    ) {
 | 
			
		||||
        this.encuestaService = encuestaService;
 | 
			
		||||
        this.encuestaRepository = encuestaRepository;
 | 
			
		||||
| 
						 | 
				
			
			@ -75,6 +84,10 @@ public class EncuestaResource {
 | 
			
		|||
        this.ePreguntaCerradaService = ePreguntaCerradaService;
 | 
			
		||||
        this.ePreguntaAbiertaService = ePreguntaAbiertaService;
 | 
			
		||||
        this.ePreguntaCerradaOpcionService = ePreguntaCerradaOpcionService;
 | 
			
		||||
        this.plantillaService = plantillaService;
 | 
			
		||||
        this.pPreguntaCerradaService = pPreguntaCerradaService;
 | 
			
		||||
        this.pPreguntaAbiertaService = pPreguntaAbiertaService;
 | 
			
		||||
        this.pPreguntaCerradaOpcionService = pPreguntaCerradaOpcionService;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -97,6 +110,78 @@ public class EncuestaResource {
 | 
			
		|||
            .body(result);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/encuestas/{plantillaId}")
 | 
			
		||||
    public ResponseEntity<Encuesta> createEncuestaFromTemplate(
 | 
			
		||||
        @Valid @RequestBody Encuesta encuesta,
 | 
			
		||||
        @PathVariable(value = "plantillaId", required = false) final Long plantillaId
 | 
			
		||||
    ) throws URISyntaxException {
 | 
			
		||||
        log.debug("REST request to save Encuesta : {}", encuesta);
 | 
			
		||||
        if (encuesta.getId() != null) {
 | 
			
		||||
            throw new BadRequestAlertException("A new encuesta cannot already have an ID", ENTITY_NAME, "idexists");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Copy from survey template to survey
 | 
			
		||||
        Optional<Plantilla> plantilla = plantillaService.findOne(plantillaId);
 | 
			
		||||
 | 
			
		||||
        if (plantilla.isPresent()) {
 | 
			
		||||
            encuesta.setNombre(plantilla.get().getNombre());
 | 
			
		||||
            encuesta.setDescripcion(plantilla.get().getDescripcion());
 | 
			
		||||
            encuesta.setCategoria(plantilla.get().getCategoria());
 | 
			
		||||
 | 
			
		||||
            Encuesta encuestaCreated = encuestaService.save(encuesta);
 | 
			
		||||
 | 
			
		||||
            // Preguntas cerradas
 | 
			
		||||
            List<PPreguntaCerrada> preguntasCerradas = pPreguntaCerradaService.findAll();
 | 
			
		||||
            for (PPreguntaCerrada pPreguntaCerrada : preguntasCerradas) {
 | 
			
		||||
                if (pPreguntaCerrada.getPlantilla().getId().equals(plantillaId)) {
 | 
			
		||||
                    EPreguntaCerrada newEPreguntaCerrada = new EPreguntaCerrada();
 | 
			
		||||
                    newEPreguntaCerrada.setNombre(pPreguntaCerrada.getNombre());
 | 
			
		||||
                    newEPreguntaCerrada.setTipo(pPreguntaCerrada.getTipo());
 | 
			
		||||
                    newEPreguntaCerrada.setOpcional(pPreguntaCerrada.getOpcional());
 | 
			
		||||
                    newEPreguntaCerrada.setOrden(pPreguntaCerrada.getOrden());
 | 
			
		||||
                    newEPreguntaCerrada.setEncuesta(encuestaCreated);
 | 
			
		||||
 | 
			
		||||
                    ePreguntaCerradaService.save(newEPreguntaCerrada);
 | 
			
		||||
 | 
			
		||||
                    // Opciones de preguntas cerradas
 | 
			
		||||
                    List<PPreguntaCerradaOpcion> opciones = pPreguntaCerradaOpcionService.findAll();
 | 
			
		||||
                    for (PPreguntaCerradaOpcion pPreguntaCerradaOpcion : opciones) {
 | 
			
		||||
                        if (pPreguntaCerradaOpcion.getPPreguntaCerrada().getId().equals(pPreguntaCerrada.getId())) {
 | 
			
		||||
                            EPreguntaCerradaOpcion newEPreguntaCerradaOpcion = new EPreguntaCerradaOpcion();
 | 
			
		||||
                            newEPreguntaCerradaOpcion.setNombre(pPreguntaCerradaOpcion.getNombre());
 | 
			
		||||
                            newEPreguntaCerradaOpcion.setOrden(pPreguntaCerradaOpcion.getOrden());
 | 
			
		||||
                            newEPreguntaCerradaOpcion.setCantidad(0);
 | 
			
		||||
                            newEPreguntaCerradaOpcion.setEPreguntaCerrada(newEPreguntaCerrada);
 | 
			
		||||
 | 
			
		||||
                            ePreguntaCerradaOpcionService.save(newEPreguntaCerradaOpcion);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Preguntas abiertas
 | 
			
		||||
            List<PPreguntaAbierta> preguntasAbiertas = pPreguntaAbiertaService.findAll();
 | 
			
		||||
            for (PPreguntaAbierta pPreguntaAbierta : preguntasAbiertas) {
 | 
			
		||||
                if (pPreguntaAbierta.getPlantilla().getId().equals(plantillaId)) {
 | 
			
		||||
                    EPreguntaAbierta newEPreguntaAbierta = new EPreguntaAbierta();
 | 
			
		||||
                    newEPreguntaAbierta.setNombre(pPreguntaAbierta.getNombre());
 | 
			
		||||
                    newEPreguntaAbierta.setOpcional(pPreguntaAbierta.getOpcional());
 | 
			
		||||
                    newEPreguntaAbierta.setOrden(pPreguntaAbierta.getOrden());
 | 
			
		||||
                    newEPreguntaAbierta.setEncuesta(encuestaCreated);
 | 
			
		||||
 | 
			
		||||
                    ePreguntaAbiertaService.save(newEPreguntaAbierta);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return ResponseEntity
 | 
			
		||||
                .created(new URI("/api/encuestas/" + encuestaCreated.getId()))
 | 
			
		||||
                .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, encuestaCreated.getId().toString()))
 | 
			
		||||
                .body(encuestaCreated);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return ResponseEntity.ok().body(null);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * {@code PUT  /encuestas/:id} : Updates an existing encuesta.
 | 
			
		||||
     *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -19,7 +19,7 @@
 | 
			
		|||
      <fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
 | 
			
		||||
    </button>
 | 
			
		||||
 | 
			
		||||
    <button id="jhi-confirm-delete-categoria" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--danger">
 | 
			
		||||
    <button id="jhi-confirm-delete-categoria" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--toggle">
 | 
			
		||||
      <fa-icon [icon]="faExchangeAlt"></fa-icon>
 | 
			
		||||
      <span jhiTranslate="entity.action.toggleStatus">Toggle Status</span>
 | 
			
		||||
    </button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@ import { IEncuesta } from 'app/entities/encuesta/encuesta.model';
 | 
			
		|||
import { EncuestaService } from 'app/entities/encuesta/service/encuesta.service';
 | 
			
		||||
import { EstadoCategoria } from 'app/entities/enumerations/estado-categoria.model';
 | 
			
		||||
import { Observable } from 'rxjs';
 | 
			
		||||
import { finalize, map } from 'rxjs/operators';
 | 
			
		||||
import { finalize } from 'rxjs/operators';
 | 
			
		||||
 | 
			
		||||
import { Categoria, ICategoria } from '../categoria.model';
 | 
			
		||||
import { CategoriaService } from '../service/categoria.service';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,7 +44,7 @@
 | 
			
		|||
        <input type="text" name="searchString" placeholder="Buscar..." [(ngModel)]="searchString" />
 | 
			
		||||
      </div>
 | 
			
		||||
    </form>
 | 
			
		||||
    <table class="table table-striped" aria-describedby="page-heading">
 | 
			
		||||
    <table class="ds-table table table-striped" aria-describedby="page-heading">
 | 
			
		||||
      <thead>
 | 
			
		||||
        <tr>
 | 
			
		||||
          <th scope="col"><span jhiTranslate="dataSurveyApp.categoria.nombre">Nombre</span></th>
 | 
			
		||||
| 
						 | 
				
			
			@ -67,7 +67,7 @@
 | 
			
		|||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
 | 
			
		||||
              </button>
 | 
			
		||||
 | 
			
		||||
              <button type="submit" (click)="toggleStatus(categoria)" class="ds-btn ds-btn--danger" data-cy="entityDeleteButton">
 | 
			
		||||
              <button type="submit" (click)="toggleStatus(categoria)" class="ds-btn ds-btn--toggle" data-cy="entityDeleteButton">
 | 
			
		||||
                <fa-icon [icon]="faExchangeAlt"></fa-icon>
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.toggleStatus">Toggle Status</span>
 | 
			
		||||
              </button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
<p>dashboard-admin works!</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { DashboardAdminComponent } from './dashboard-admin.component';
 | 
			
		||||
 | 
			
		||||
describe('DashboardAdminComponent', () => {
 | 
			
		||||
  let component: DashboardAdminComponent;
 | 
			
		||||
  let fixture: ComponentFixture<DashboardAdminComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [DashboardAdminComponent],
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(DashboardAdminComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-dashboard-admin',
 | 
			
		||||
  templateUrl: './dashboard-admin.component.html',
 | 
			
		||||
  styleUrls: ['./dashboard-admin.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class DashboardAdminComponent implements OnInit {
 | 
			
		||||
  constructor() {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
<p>dashboard-user works!</p>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { DashboardUserComponent } from './dashboard-user.component';
 | 
			
		||||
 | 
			
		||||
describe('DashboardUserComponent', () => {
 | 
			
		||||
  let component: DashboardUserComponent;
 | 
			
		||||
  let fixture: ComponentFixture<DashboardUserComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [DashboardUserComponent],
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(DashboardUserComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-dashboard-user',
 | 
			
		||||
  templateUrl: './dashboard-user.component.html',
 | 
			
		||||
  styleUrls: ['./dashboard-user.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class DashboardUserComponent implements OnInit {
 | 
			
		||||
  constructor() {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { CommonModule } from '@angular/common';
 | 
			
		||||
 | 
			
		||||
import { DashboardUserComponent } from './dashboard-user/dashboard-user.component';
 | 
			
		||||
import { DashboardAdminComponent } from './dashboard-admin/dashboard-admin.component';
 | 
			
		||||
import { SharedModule } from '../../shared/shared.module';
 | 
			
		||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
 | 
			
		||||
import { DashboardRoutingModule } from './route/dashboard-routing.module';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  declarations: [DashboardUserComponent, DashboardAdminComponent],
 | 
			
		||||
  imports: [CommonModule, SharedModule, DashboardRoutingModule, FontAwesomeModule],
 | 
			
		||||
})
 | 
			
		||||
export class DashboardModule {}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,25 @@
 | 
			
		|||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { RouterModule, Routes } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { DashboardUserComponent } from '../dashboard-user/dashboard-user.component';
 | 
			
		||||
import { DashboardAdminComponent } from '../dashboard-admin/dashboard-admin.component';
 | 
			
		||||
import { UserRouteAccessService } from '../../../core/auth/user-route-access.service';
 | 
			
		||||
 | 
			
		||||
const dashboardRoute: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
    path: 'admin',
 | 
			
		||||
    component: DashboardAdminComponent,
 | 
			
		||||
    canActivate: [UserRouteAccessService],
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: 'user',
 | 
			
		||||
    component: DashboardUserComponent,
 | 
			
		||||
    canActivate: [UserRouteAccessService],
 | 
			
		||||
  },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [RouterModule.forChild(dashboardRoute)],
 | 
			
		||||
  exports: [RouterModule],
 | 
			
		||||
})
 | 
			
		||||
export class DashboardRoutingModule {}
 | 
			
		||||
| 
						 | 
				
			
			@ -16,6 +16,10 @@ export class EPreguntaCerradaOpcionService {
 | 
			
		|||
 | 
			
		||||
  constructor(protected http: HttpClient, protected applicationConfigService: ApplicationConfigService) {}
 | 
			
		||||
 | 
			
		||||
  updateCount(id: any) {
 | 
			
		||||
    return this.http.post(`${this.resourceUrl}/count/${id}`, id, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  create(ePreguntaCerradaOpcion: IEPreguntaCerradaOpcion, preguntaId?: number): Observable<EntityResponseType> {
 | 
			
		||||
    return this.http.post<IEPreguntaCerradaOpcion>(`${this.resourceUrl}/${preguntaId}`, ePreguntaCerradaOpcion, { observe: 'response' });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,175 @@
 | 
			
		|||
<div class="container-fluid" *ngIf="encuesta">
 | 
			
		||||
  <div>
 | 
			
		||||
    <h2 id="page-heading" data-cy="EPreguntaCerradaHeading">
 | 
			
		||||
      <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()">
 | 
			
		||||
          <fa-icon icon="arrow-left"></fa-icon>  <span jhiTranslate="entity.action.back">Back</span>
 | 
			
		||||
        </button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </h2>
 | 
			
		||||
 | 
			
		||||
    <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
 | 
			
		||||
    <div class="alert alert-warning" id="no-result" *ngIf="ePreguntas?.length === 0">
 | 
			
		||||
      <span>No se encontraron preguntas</span>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="ds-survey preview-survey" id="entities" *ngIf="ePreguntas && ePreguntas.length > 0">
 | 
			
		||||
      <div class="ds-survey--all-question-wrapper col-8">
 | 
			
		||||
        <div class="ds-survey--question-wrapper card-encuesta lift" *ngFor="let ePregunta of ePreguntas; let i = index; trackBy: trackId">
 | 
			
		||||
          <div
 | 
			
		||||
            [attr.data-index]="ePregunta.id"
 | 
			
		||||
            [attr.data-tipo]="ePregunta.tipo"
 | 
			
		||||
            [attr.data-opcional]="ePregunta.opcional"
 | 
			
		||||
            class="ds-survey--question"
 | 
			
		||||
          >
 | 
			
		||||
            <div class="ds-survey--titulo">
 | 
			
		||||
              <span class="ds-survey--titulo--name">{{ i + 1 }}. {{ ePregunta.nombre }}</span>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
              <span *ngIf="ePregunta.tipo === 'SINGLE'" class="ds-subtitle"
 | 
			
		||||
                >Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.SINGLE' | translate | lowercase }}
 | 
			
		||||
                {{ ePregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
              >
 | 
			
		||||
              <span *ngIf="ePregunta.tipo === 'MULTIPLE'" class="ds-subtitle"
 | 
			
		||||
                >Pregunta de respuesta {{ 'dataSurveyApp.PreguntaCerradaTipo.MULTIPLE' | translate | lowercase }}
 | 
			
		||||
                {{ ePregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
              >
 | 
			
		||||
              <span *ngIf="!ePregunta.tipo" class="ds-subtitle"
 | 
			
		||||
                >Pregunta de respuesta abierta {{ ePregunta.opcional ? '(opcional)' : '' }}</span
 | 
			
		||||
              >
 | 
			
		||||
            </div>
 | 
			
		||||
            <ng-container *ngIf="ePregunta.tipo">
 | 
			
		||||
              <ng-container *ngFor="let ePreguntaOpcion of ePreguntasOpciones; let j = index; trackBy: trackId">
 | 
			
		||||
                <ng-container *ngFor="let ePreguntaOpcionFinal of ePreguntaOpcion">
 | 
			
		||||
                  <ng-container *ngIf="ePregunta.id === ePreguntaOpcionFinal.epreguntaCerrada.id">
 | 
			
		||||
                    <div
 | 
			
		||||
                      class="ds-survey--option ds-survey--option--base ds-survey--closed-option can-delete"
 | 
			
		||||
                      [attr.data-id]="ePreguntaOpcionFinal.id"
 | 
			
		||||
                    >
 | 
			
		||||
                      <div class="radio" *ngIf="ePregunta.tipo === 'SINGLE'">
 | 
			
		||||
                        <input
 | 
			
		||||
                          type="radio"
 | 
			
		||||
                          (change)="onCheck(ePreguntaOpcionFinal)"
 | 
			
		||||
                          [value]="ePreguntaOpcionFinal.id"
 | 
			
		||||
                          style="border-radius: 3px"
 | 
			
		||||
                          name="{{ 'radio' + ePregunta.id }}"
 | 
			
		||||
                          id="{{ 'radio' + ePreguntaOpcionFinal.id }}"
 | 
			
		||||
                        />
 | 
			
		||||
                        <label for="{{ 'radio' + ePreguntaOpcionFinal.id }}">{{ ePreguntaOpcionFinal.nombre }}</label>
 | 
			
		||||
                      </div>
 | 
			
		||||
                      <div class="checkbox" *ngIf="ePregunta.tipo === 'MULTIPLE'">
 | 
			
		||||
                        <input
 | 
			
		||||
                          (change)="toggleOption(ePreguntaOpcionFinal)"
 | 
			
		||||
                          type="checkbox"
 | 
			
		||||
                          style="border-radius: 3px"
 | 
			
		||||
                          id="{{ 'checkbox' + ePreguntaOpcionFinal.id }}"
 | 
			
		||||
                        />
 | 
			
		||||
                        <label for="{{ 'checkbox' + ePreguntaOpcionFinal.id }}">{{ ePreguntaOpcionFinal.nombre }}</label>
 | 
			
		||||
                      </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </ng-container>
 | 
			
		||||
                </ng-container>
 | 
			
		||||
              </ng-container>
 | 
			
		||||
            </ng-container>
 | 
			
		||||
            <div class="ds-survey--option ds-survey--option--base ds-survey--open-option" *ngIf="!ePregunta.tipo">
 | 
			
		||||
              <textarea id="{{ ePregunta.id }}" cols="33" rows="10"></textarea>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <button class="ds-btn ds-btn--primary" (click)="finish()">Terminar</button>
 | 
			
		||||
      </div>
 | 
			
		||||
      <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 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 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>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { EncuestaCompleteComponent } from './complete.component';
 | 
			
		||||
 | 
			
		||||
describe('EncuestaCompleteComponent', () => {
 | 
			
		||||
  let component: EncuestaCompleteComponent;
 | 
			
		||||
  let fixture: ComponentFixture<EncuestaCompleteComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [EncuestaCompleteComponent],
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(EncuestaCompleteComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,229 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { FormBuilder } from '@angular/forms';
 | 
			
		||||
import { ActivatedRoute } from '@angular/router';
 | 
			
		||||
import { finalize } from 'rxjs/operators';
 | 
			
		||||
import { IEncuesta } from '../encuesta.model';
 | 
			
		||||
import { EncuestaService } from '../service/encuesta.service';
 | 
			
		||||
import { ICategoria } from 'app/entities/categoria/categoria.model';
 | 
			
		||||
import { IUsuarioExtra } from 'app/entities/usuario-extra/usuario-extra.model';
 | 
			
		||||
import { UsuarioExtraService } from 'app/entities/usuario-extra/service/usuario-extra.service';
 | 
			
		||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		||||
import { IEPreguntaCerrada } from 'app/entities/e-pregunta-cerrada/e-pregunta-cerrada.model';
 | 
			
		||||
import { EPreguntaCerradaService } from 'app/entities/e-pregunta-cerrada/service/e-pregunta-cerrada.service';
 | 
			
		||||
import { EPreguntaAbiertaService } from '../../e-pregunta-abierta/service/e-pregunta-abierta.service';
 | 
			
		||||
import { EPreguntaAbiertaRespuestaService } from '../../e-pregunta-abierta-respuesta/service/e-pregunta-abierta-respuesta.service';
 | 
			
		||||
import { EPreguntaCerradaOpcionService } from '../../e-pregunta-cerrada-opcion/service/e-pregunta-cerrada-opcion.service';
 | 
			
		||||
import { faStar, faQuestion } from '@fortawesome/free-solid-svg-icons';
 | 
			
		||||
import { AccesoEncuesta } from 'app/entities/enumerations/acceso-encuesta.model';
 | 
			
		||||
import { EncuestaPasswordDialogComponent } from '../encuesta-password-dialog/encuesta-password-dialog.component';
 | 
			
		||||
import { PreguntaCerradaTipo } from 'app/entities/enumerations/pregunta-cerrada-tipo.model';
 | 
			
		||||
import { EPreguntaAbiertaRespuesta } from 'app/entities/e-pregunta-abierta-respuesta/e-pregunta-abierta-respuesta.model';
 | 
			
		||||
import { Observable } from 'rxjs/internal/Observable';
 | 
			
		||||
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-complete',
 | 
			
		||||
  templateUrl: './complete.component.html',
 | 
			
		||||
})
 | 
			
		||||
export class EncuestaCompleteComponent implements OnInit {
 | 
			
		||||
  categoriasSharedCollection: ICategoria[] = [];
 | 
			
		||||
  usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
 | 
			
		||||
  faStar = faStar;
 | 
			
		||||
  faQuestion = faQuestion;
 | 
			
		||||
  encuesta?: IEncuesta;
 | 
			
		||||
  isLoading = false;
 | 
			
		||||
  ePreguntas?: any[];
 | 
			
		||||
  ePreguntasOpciones?: any[];
 | 
			
		||||
  isLocked?: boolean;
 | 
			
		||||
  selectedOpenOptions: any;
 | 
			
		||||
  selectedSingleOptions: any;
 | 
			
		||||
  selectedMultiOptions: any;
 | 
			
		||||
  error: boolean;
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    protected activatedRoute: ActivatedRoute,
 | 
			
		||||
    protected encuestaService: EncuestaService,
 | 
			
		||||
    protected usuarioExtraService: UsuarioExtraService,
 | 
			
		||||
    protected fb: FormBuilder,
 | 
			
		||||
    protected modalService: NgbModal,
 | 
			
		||||
    protected ePreguntaCerradaService: EPreguntaCerradaService,
 | 
			
		||||
    protected ePreguntaCerradaOpcionService: EPreguntaCerradaOpcionService,
 | 
			
		||||
    protected ePreguntaAbiertaService: EPreguntaAbiertaService,
 | 
			
		||||
    protected ePreguntaAbiertaRespuestaService: EPreguntaAbiertaRespuestaService
 | 
			
		||||
  ) {
 | 
			
		||||
    this.selectedOpenOptions = {};
 | 
			
		||||
    this.selectedSingleOptions = {};
 | 
			
		||||
    this.selectedMultiOptions = [];
 | 
			
		||||
    this.error = false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.activatedRoute.data.subscribe(({ encuesta }) => {
 | 
			
		||||
      if (encuesta) {
 | 
			
		||||
        this.encuesta = encuesta;
 | 
			
		||||
      }
 | 
			
		||||
      this.isLocked = this.verifyPassword();
 | 
			
		||||
      if (this.isLocked) {
 | 
			
		||||
        this.previousState();
 | 
			
		||||
      } else {
 | 
			
		||||
        this.loadAll();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
    for (let pregunta of this.ePreguntas!) {
 | 
			
		||||
      if (pregunta.tipo && pregunta.tipo === PreguntaCerradaTipo.SINGLE) {
 | 
			
		||||
        this.selectedSingleOptions[pregunta.id] = null;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  verifyPassword(): boolean {
 | 
			
		||||
    if (this.encuesta!.acceso === AccesoEncuesta.PUBLIC) {
 | 
			
		||||
      return false;
 | 
			
		||||
    } else {
 | 
			
		||||
      const modalRef = this.modalService.open(EncuestaPasswordDialogComponent, { size: 'lg', backdrop: 'static' });
 | 
			
		||||
      modalRef.componentInstance.encuesta = this.encuesta;
 | 
			
		||||
      modalRef.closed.subscribe(reason => {
 | 
			
		||||
        return reason === 'success';
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngAfterViewChecked(): void {
 | 
			
		||||
    this.initListeners();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  initListeners(): void {
 | 
			
		||||
    const questions = document.getElementsByClassName('ds-survey--question-wrapper');
 | 
			
		||||
    for (let i = 0; i < questions.length; i++) {
 | 
			
		||||
      if (questions[i].classList.contains('ds-survey--closed-option')) {
 | 
			
		||||
        questions[i].addEventListener('click', e => {
 | 
			
		||||
          if ((e.target as HTMLInputElement).checked) {
 | 
			
		||||
            (e.target as HTMLElement).offsetParent!.classList.add('ds-survey--closed-option--active');
 | 
			
		||||
            (e.target as HTMLElement).id;
 | 
			
		||||
          } else {
 | 
			
		||||
            (e.target as HTMLElement).offsetParent!.classList.remove('ds-survey--closed-option--active');
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackId(_index: number, item: IEPreguntaCerrada): number {
 | 
			
		||||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackEPreguntaCerradaById(_index: number, item: IEPreguntaCerrada): number {
 | 
			
		||||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackCategoriaById(_index: number, item: ICategoria): number {
 | 
			
		||||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackUsuarioExtraById(_index: number, item: IUsuarioExtra): number {
 | 
			
		||||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadAll(): void {
 | 
			
		||||
    this.isLoading = true;
 | 
			
		||||
    this.encuestaService
 | 
			
		||||
      .findQuestions(this.encuesta?.id!)
 | 
			
		||||
      .pipe(
 | 
			
		||||
        finalize(() =>
 | 
			
		||||
          this.encuestaService.findQuestionsOptions(this.encuesta?.id!).subscribe(
 | 
			
		||||
            (res: any) => {
 | 
			
		||||
              this.isLoading = false;
 | 
			
		||||
              this.ePreguntasOpciones = res.body ?? [];
 | 
			
		||||
            },
 | 
			
		||||
            () => {
 | 
			
		||||
              this.isLoading = false;
 | 
			
		||||
            }
 | 
			
		||||
          )
 | 
			
		||||
        )
 | 
			
		||||
      )
 | 
			
		||||
      .subscribe(
 | 
			
		||||
        (res: any) => {
 | 
			
		||||
          this.isLoading = false;
 | 
			
		||||
          this.ePreguntas = res.body ?? [];
 | 
			
		||||
        },
 | 
			
		||||
        () => {
 | 
			
		||||
          this.isLoading = false;
 | 
			
		||||
        }
 | 
			
		||||
      );
 | 
			
		||||
    if (this.ePreguntas!.length == 0) {
 | 
			
		||||
      this.previousState();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  previousState(): void {
 | 
			
		||||
    window.history.back();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  onCheck(preguntaOpcion: { epreguntaCerrada: any; id: any }): void {
 | 
			
		||||
    this.selectedSingleOptions[preguntaOpcion.epreguntaCerrada!.id!] = preguntaOpcion.id;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  toggleOption(ePreguntaOpcionFinal: { id: any }): void {
 | 
			
		||||
    if (this.selectedMultiOptions.includes(ePreguntaOpcionFinal.id)) {
 | 
			
		||||
      for (let i = 0; i < this.selectedMultiOptions.length; i++) {
 | 
			
		||||
        if (this.selectedMultiOptions[i] === ePreguntaOpcionFinal.id) {
 | 
			
		||||
          this.selectedMultiOptions.splice(i, 1);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      this.selectedMultiOptions.push(ePreguntaOpcionFinal.id);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  finish(): void {
 | 
			
		||||
    this.getOpenQuestionAnswers();
 | 
			
		||||
    this.registerOpenQuestionAnswers();
 | 
			
		||||
    this.updateClosedOptionsCount();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  updateClosedOptionsCount() {
 | 
			
		||||
    for (let key in this.selectedSingleOptions) {
 | 
			
		||||
      this.subscribeToSaveResponse(this.ePreguntaCerradaOpcionService.updateCount(this.selectedSingleOptions[key]));
 | 
			
		||||
    }
 | 
			
		||||
    this.selectedMultiOptions.forEach((option: any) => {
 | 
			
		||||
      this.subscribeToSaveResponse(this.ePreguntaCerradaOpcionService.updateCount(option));
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  registerOpenQuestionAnswers() {
 | 
			
		||||
    for (let id in this.selectedOpenOptions) {
 | 
			
		||||
      let pregunta = this.ePreguntas!.find(p => {
 | 
			
		||||
        return p.id == id;
 | 
			
		||||
      });
 | 
			
		||||
      let newRespuesta = new EPreguntaAbiertaRespuesta(0, this.selectedOpenOptions[id], pregunta);
 | 
			
		||||
      this.subscribeToSaveResponse(this.ePreguntaAbiertaRespuestaService.create(newRespuesta));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  protected onSaveFinalize(): void {
 | 
			
		||||
    // this.isSaving = false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  processError(response: HttpErrorResponse): void {
 | 
			
		||||
    if (response.status === 400) {
 | 
			
		||||
      this.error = true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  protected subscribeToSaveResponse(result: Observable<HttpResponse<any>>): void {
 | 
			
		||||
    result.pipe(finalize(() => this.onSaveFinalize())).subscribe(
 | 
			
		||||
      () => this.previousState(),
 | 
			
		||||
      response => this.processError(response)
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getOpenQuestionAnswers() {
 | 
			
		||||
    this.ePreguntas!.forEach(pregunta => {
 | 
			
		||||
      if (!pregunta.tipo) {
 | 
			
		||||
        let textValue = (document.getElementById(pregunta.id) as HTMLInputElement).value;
 | 
			
		||||
        this.selectedOpenOptions[pregunta.id] = textValue;
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +34,7 @@
 | 
			
		|||
          <p class="ds-subtitle text-center">Inicie creando preguntas y opciones para su encuesta.</p>
 | 
			
		||||
        </ng-container>
 | 
			
		||||
 | 
			
		||||
        <div class="ds-survey--question-wrapper card-encuesta lift" *ngFor="let ePregunta of ePreguntas; let i = index; trackBy: trackId">
 | 
			
		||||
        <div class="ds-survey--question-wrapper card-encuesta" *ngFor="let ePregunta of ePreguntas; let i = index; trackBy: trackId">
 | 
			
		||||
          <div
 | 
			
		||||
            [attr.data-index]="ePregunta.id"
 | 
			
		||||
            [attr.data-tipo]="ePregunta.tipo"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,8 @@
 | 
			
		|||
<form *ngIf="encuesta" name="deleteForm" (ngSubmit)="confirmFinalizar(encuesta!)">
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <h4 class="ds-title--small" data-cy="encuestaDeleteDialogHeading">Finalizar encuesta</h4>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-header"></div>
 | 
			
		||||
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
    <p class="ds-title--small" data-cy="encuestaDeleteDialogHeading">Finalizar encuesta</p>
 | 
			
		||||
    <p class="ds-subtitle" id="jhi-delete-encuesta-heading">¿Está seguro de querer finalizar la encuesta?</p>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,28 @@
 | 
			
		|||
<form class="ds-form" [formGroup]="passwordForm" name="deleteForm" (ngSubmit)="submitPassword()">
 | 
			
		||||
  <div *ngIf="this.isWrong">
 | 
			
		||||
    <p>Contraseña incorrecta</p>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
    <p class="ds-title--small" jhiTranslate="dataSurveyApp.encuesta.password.title">Enter password</p>
 | 
			
		||||
    <p class="ds-subtitle" id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.password.text">
 | 
			
		||||
      This survey is marked as private, please enter the password
 | 
			
		||||
    </p>
 | 
			
		||||
    <input [(ngModel)]="passwordInput" type="password" name="passwordInput" id="passwordInput" placeholder="qwerty..." />
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
 | 
			
		||||
      <fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
 | 
			
		||||
    </button>
 | 
			
		||||
 | 
			
		||||
    <button
 | 
			
		||||
      id="jhi-confirm-delete-option"
 | 
			
		||||
      data-cy="submit"
 | 
			
		||||
      type="submit"
 | 
			
		||||
      class="ds-btn ds-btn--primary"
 | 
			
		||||
      [disabled]="passwordForm.get('password')!.invalid"
 | 
			
		||||
    >
 | 
			
		||||
      <span jhiTranslate="entity.action.submit">Submit</span>
 | 
			
		||||
    </button>
 | 
			
		||||
  </div>
 | 
			
		||||
</form>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
input {
 | 
			
		||||
  margin: 2%;
 | 
			
		||||
  width: 100%;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { EncuestaPasswordDialogComponent } from './encuesta-password-dialog.component';
 | 
			
		||||
 | 
			
		||||
describe('EncuestaPasswordDialogComponent', () => {
 | 
			
		||||
  let component: EncuestaPasswordDialogComponent;
 | 
			
		||||
  let fixture: ComponentFixture<EncuestaPasswordDialogComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [EncuestaPasswordDialogComponent],
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(EncuestaPasswordDialogComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,36 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { FormBuilder, Validators } from '@angular/forms';
 | 
			
		||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		||||
import { IEncuesta } from '../encuesta.model';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-encuesta-password-dialog',
 | 
			
		||||
  templateUrl: './encuesta-password-dialog.component.html',
 | 
			
		||||
  styleUrls: ['./encuesta-password-dialog.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class EncuestaPasswordDialogComponent implements OnInit {
 | 
			
		||||
  passwordForm = this.fb.group({
 | 
			
		||||
    password: [null, [Validators.required]],
 | 
			
		||||
  });
 | 
			
		||||
  encuesta?: IEncuesta;
 | 
			
		||||
  isWrong?: boolean;
 | 
			
		||||
  passwordInput?: string;
 | 
			
		||||
 | 
			
		||||
  constructor(protected activeModal: NgbActiveModal, protected fb: FormBuilder) {}
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {}
 | 
			
		||||
 | 
			
		||||
  submitPassword() {
 | 
			
		||||
    const password = this.passwordForm.get(['password'])!.value;
 | 
			
		||||
 | 
			
		||||
    if (this.passwordForm.valid && password === this.encuesta!.contrasenna) {
 | 
			
		||||
      this.activeModal.close('success');
 | 
			
		||||
    } else {
 | 
			
		||||
      this.isWrong = true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  cancel(): void {
 | 
			
		||||
    this.activeModal.close('cancel');
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -10,9 +10,9 @@ import { EncuestaPublishDialogComponent } from './encuesta-publish-dialog/encues
 | 
			
		|||
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';
 | 
			
		||||
 | 
			
		||||
import { EncuestaCompleteComponent } from './complete/complete.component';
 | 
			
		||||
import { EncuestaPasswordDialogComponent } from './encuesta-password-dialog/encuesta-password-dialog.component';
 | 
			
		||||
import { EncuestaFinalizarDialogComponent } from './encuesta-finalizar-dialog/encuesta-finalizar-dialog.component';
 | 
			
		||||
 | 
			
		||||
import { EncuestaDeleteColaboratorDialogComponent } from './encuesta-delete-colaborator-dialog/encuesta-delete-colaborator-dialog.component';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
| 
						 | 
				
			
			@ -26,6 +26,8 @@ import { EncuestaDeleteColaboratorDialogComponent } from './encuesta-delete-cola
 | 
			
		|||
    EncuestaDeleteQuestionDialogComponent,
 | 
			
		||||
    EncuestaDeleteOptionDialogComponent,
 | 
			
		||||
    EncuestaCompartirDialogComponent,
 | 
			
		||||
    EncuestaCompleteComponent,
 | 
			
		||||
    EncuestaPasswordDialogComponent,
 | 
			
		||||
    EncuestaFinalizarDialogComponent,
 | 
			
		||||
    EncuestaDeleteColaboratorDialogComponent,
 | 
			
		||||
  ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,10 +40,6 @@
 | 
			
		|||
    </button>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="alert alert-warning" id="no-result" *ngIf="encuestas?.length === 0">
 | 
			
		||||
    <span jhiTranslate="dataSurveyApp.encuesta.home.notFound">No surveys found</span>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <form class="ds-form">
 | 
			
		||||
    <div class="input-group">
 | 
			
		||||
      <div class="ds-filter">
 | 
			
		||||
| 
						 | 
				
			
			@ -83,8 +79,17 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </form>
 | 
			
		||||
 | 
			
		||||
  <div class="ds-survey" id="entities" *ngIf="encuestas?.length === 0">
 | 
			
		||||
    <div class="ds-survey--all-question-wrapper">
 | 
			
		||||
      <ng-container class="">
 | 
			
		||||
        <p class="ds-title text-center">No posee encuestas</p>
 | 
			
		||||
        <p class="ds-subtitle text-center">Incie a explorar, colaborar y adquirir datos al crear encuestas mundialmente</p>
 | 
			
		||||
      </ng-container>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <!-- Lista de Encuestas del Usuario -->
 | 
			
		||||
  <div class="ds-list" (contextmenu)="openContextMenu($event)" *ngIf="!isAdmin()">
 | 
			
		||||
  <div class="ds-list" (contextmenu)="openContextMenu($event)" *ngIf="!isAdmin() && encuestas?.length !== 0">
 | 
			
		||||
    <!-- Context Menu -->
 | 
			
		||||
    <div class="ds-contextmenu ds-contextmenu--closed" id="contextmenu">
 | 
			
		||||
      <ul id="ds-context-menu__list">
 | 
			
		||||
| 
						 | 
				
			
			@ -208,7 +213,7 @@
 | 
			
		|||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
<div class="table-responsive" id="entities" *ngIf="isAdmin() && encuestas && encuestas.length > 0">
 | 
			
		||||
  <table class="table table-striped" aria-describedby="page-heading">
 | 
			
		||||
  <table class="ds-table table table-striped" aria-describedby="page-heading">
 | 
			
		||||
    <thead>
 | 
			
		||||
      <tr>
 | 
			
		||||
        <th scope="col"><span jhiTranslate="dataSurveyApp.encuesta.nombre">Nombre</span></th>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,6 +6,7 @@ import { EncuestaComponent } from '../list/encuesta.component';
 | 
			
		|||
import { EncuestaDetailComponent } from '../detail/encuesta-detail.component';
 | 
			
		||||
import { EncuestaUpdateComponent } from '../update/encuesta-update.component';
 | 
			
		||||
import { EncuestaRoutingResolveService } from './encuesta-routing-resolve.service';
 | 
			
		||||
import { EncuestaCompleteComponent } from '../complete/complete.component';
 | 
			
		||||
 | 
			
		||||
const encuestaRoute: Routes = [
 | 
			
		||||
  {
 | 
			
		||||
| 
						 | 
				
			
			@ -37,6 +38,14 @@ const encuestaRoute: Routes = [
 | 
			
		|||
    },
 | 
			
		||||
    canActivate: [UserRouteAccessService],
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: ':id/complete',
 | 
			
		||||
    component: EncuestaCompleteComponent,
 | 
			
		||||
    resolve: {
 | 
			
		||||
      encuesta: EncuestaRoutingResolveService,
 | 
			
		||||
    },
 | 
			
		||||
    canActivate: [UserRouteAccessService],
 | 
			
		||||
  },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,6 +26,13 @@ export class EncuestaService {
 | 
			
		|||
      .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  createFromTemplate(encuesta: IEncuesta, plantillaId: Number): Observable<EntityResponseType> {
 | 
			
		||||
    const copy = this.convertDateFromClient(encuesta);
 | 
			
		||||
    return this.http
 | 
			
		||||
      .post<IEncuesta>(`${this.resourceUrl}/${plantillaId}`, copy, { observe: 'response' })
 | 
			
		||||
      .pipe(map((res: EntityResponseType) => this.convertDateFromServer(res)));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //update para publicar
 | 
			
		||||
  update(encuesta: IEncuesta): Observable<EntityResponseType> {
 | 
			
		||||
    const copy = this.convertDateFromClient(encuesta);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,9 +42,6 @@
 | 
			
		|||
    </div>
 | 
			
		||||
 | 
			
		||||
    <p class="ds-subtitle">Creada el día {{ encuesta!.fechaCreacion | formatShortDatetime | lowercase }}</p>
 | 
			
		||||
    <button type="button" class="ds-btn ds-btn--danger" (click)="finalizar()" *ngIf="encuesta!.estado === 'ACTIVE'">
 | 
			
		||||
      <fa-icon icon="sync" [icon]="faTimes"></fa-icon>  <span>Finalizar</span>
 | 
			
		||||
    </button>
 | 
			
		||||
 | 
			
		||||
    <div class="d-flex justify-content-end">
 | 
			
		||||
      <button type="button" class="ds-btn ds-btn--secondary" (click)="previousState()">
 | 
			
		||||
| 
						 | 
				
			
			@ -65,6 +62,10 @@
 | 
			
		|||
      >
 | 
			
		||||
        <fa-icon icon="sync" [icon]="faPlus"></fa-icon>  <span>Crear pregunta</span>
 | 
			
		||||
      </button>
 | 
			
		||||
 | 
			
		||||
      <button type="button" class="ds-btn ds-btn--danger" (click)="finalizar()" *ngIf="encuesta!.estado === 'ACTIVE'">
 | 
			
		||||
        <fa-icon icon="sync" [icon]="faTimes"></fa-icon>  <span>Finalizar</span>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </h2>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -77,6 +77,21 @@ import { RouterModule } from '@angular/router';
 | 
			
		|||
        loadChildren: () =>
 | 
			
		||||
          import('./p-pregunta-cerrada-opcion/p-pregunta-cerrada-opcion.module').then(m => m.PPreguntaCerradaOpcionModule),
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'mis-plantillas',
 | 
			
		||||
        data: { pageTitle: 'dataSurveyApp.usuarioExtra.plantillas.title' },
 | 
			
		||||
        loadChildren: () => import('./usuario-plantillas/usuario-plantillas.module').then(m => m.UsuarioPlantillasModule),
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'dashboard',
 | 
			
		||||
        data: { pageTitle: 'dataSurveyApp.Dashboard.title' },
 | 
			
		||||
        loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule),
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        path: 'dashboard',
 | 
			
		||||
        data: { pageTitle: 'dataSurveyApp.Dashboard.title' },
 | 
			
		||||
        loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule),
 | 
			
		||||
      },
 | 
			
		||||
      /* jhipster-needle-add-entity-route - JHipster will add entity modules routes here */
 | 
			
		||||
    ]),
 | 
			
		||||
  ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,24 +1,23 @@
 | 
			
		|||
<form *ngIf="plantilla" name="deleteForm" (ngSubmit)="confirmDelete(plantilla.id!)">
 | 
			
		||||
  <div class="modal-header">
 | 
			
		||||
    <h4 class="modal-title" data-cy="plantillaDeleteDialogHeading" jhiTranslate="entity.delete.title">Confirm delete operation</h4>
 | 
			
		||||
 | 
			
		||||
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
<form class="ds-form" *ngIf="plantilla" name="deleteForm" (ngSubmit)="confirmDelete(plantilla)">
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
    <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
 | 
			
		||||
    <p id="jhi-delete-plantilla-heading" jhiTranslate="dataSurveyApp.plantilla.delete.question" [translateValues]="{ id: plantilla.id }">
 | 
			
		||||
    <p class="ds-title--small">Eliminar plantilla</p>
 | 
			
		||||
    <p
 | 
			
		||||
      class="ds-subtitle"
 | 
			
		||||
      id="jhi-delete-plantilla-heading"
 | 
			
		||||
      jhiTranslate="dataSurveyApp.plantilla.delete.question"
 | 
			
		||||
      [translateValues]="{ id: plantilla.id }"
 | 
			
		||||
    >
 | 
			
		||||
      Are you sure you want to delete this Plantilla?
 | 
			
		||||
    </p>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
 | 
			
		||||
      <fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
 | 
			
		||||
    <button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
 | 
			
		||||
      <fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
 | 
			
		||||
    </button>
 | 
			
		||||
 | 
			
		||||
    <button id="jhi-confirm-delete-plantilla" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
 | 
			
		||||
    <button id="jhi-confirm-delete-plantilla" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--danger">
 | 
			
		||||
      <fa-icon icon="times"></fa-icon> <span jhiTranslate="entity.action.delete">Delete</span>
 | 
			
		||||
    </button>
 | 
			
		||||
  </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,65 +0,0 @@
 | 
			
		|||
jest.mock('@ng-bootstrap/ng-bootstrap');
 | 
			
		||||
 | 
			
		||||
import { ComponentFixture, TestBed, inject, fakeAsync, tick } from '@angular/core/testing';
 | 
			
		||||
import { HttpResponse } from '@angular/common/http';
 | 
			
		||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		||||
 | 
			
		||||
import { PlantillaService } from '../service/plantilla.service';
 | 
			
		||||
 | 
			
		||||
import { PlantillaDeleteDialogComponent } from './plantilla-delete-dialog.component';
 | 
			
		||||
 | 
			
		||||
describe('Component Tests', () => {
 | 
			
		||||
  describe('Plantilla Management Delete Component', () => {
 | 
			
		||||
    let comp: PlantillaDeleteDialogComponent;
 | 
			
		||||
    let fixture: ComponentFixture<PlantillaDeleteDialogComponent>;
 | 
			
		||||
    let service: PlantillaService;
 | 
			
		||||
    let mockActiveModal: NgbActiveModal;
 | 
			
		||||
 | 
			
		||||
    beforeEach(() => {
 | 
			
		||||
      TestBed.configureTestingModule({
 | 
			
		||||
        imports: [HttpClientTestingModule],
 | 
			
		||||
        declarations: [PlantillaDeleteDialogComponent],
 | 
			
		||||
        providers: [NgbActiveModal],
 | 
			
		||||
      })
 | 
			
		||||
        .overrideTemplate(PlantillaDeleteDialogComponent, '')
 | 
			
		||||
        .compileComponents();
 | 
			
		||||
      fixture = TestBed.createComponent(PlantillaDeleteDialogComponent);
 | 
			
		||||
      comp = fixture.componentInstance;
 | 
			
		||||
      service = TestBed.inject(PlantillaService);
 | 
			
		||||
      mockActiveModal = TestBed.inject(NgbActiveModal);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    describe('confirmDelete', () => {
 | 
			
		||||
      it('Should call delete service on confirmDelete', inject(
 | 
			
		||||
        [],
 | 
			
		||||
        fakeAsync(() => {
 | 
			
		||||
          // GIVEN
 | 
			
		||||
          jest.spyOn(service, 'delete').mockReturnValue(of(new HttpResponse({})));
 | 
			
		||||
 | 
			
		||||
          // WHEN
 | 
			
		||||
          comp.confirmDelete(123);
 | 
			
		||||
          tick();
 | 
			
		||||
 | 
			
		||||
          // THEN
 | 
			
		||||
          expect(service.delete).toHaveBeenCalledWith(123);
 | 
			
		||||
          expect(mockActiveModal.close).toHaveBeenCalledWith('deleted');
 | 
			
		||||
        })
 | 
			
		||||
      ));
 | 
			
		||||
 | 
			
		||||
      it('Should not call delete service on clear', () => {
 | 
			
		||||
        // GIVEN
 | 
			
		||||
        jest.spyOn(service, 'delete');
 | 
			
		||||
 | 
			
		||||
        // WHEN
 | 
			
		||||
        comp.cancel();
 | 
			
		||||
 | 
			
		||||
        // THEN
 | 
			
		||||
        expect(service.delete).not.toHaveBeenCalled();
 | 
			
		||||
        expect(mockActiveModal.close).not.toHaveBeenCalled();
 | 
			
		||||
        expect(mockActiveModal.dismiss).toHaveBeenCalled();
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -3,6 +3,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		|||
 | 
			
		||||
import { IPlantilla } from '../plantilla.model';
 | 
			
		||||
import { PlantillaService } from '../service/plantilla.service';
 | 
			
		||||
import { EstadoPlantilla } from '../../enumerations/estado-plantilla.model';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  templateUrl: './plantilla-delete-dialog.component.html',
 | 
			
		||||
| 
						 | 
				
			
			@ -16,8 +17,9 @@ export class PlantillaDeleteDialogComponent {
 | 
			
		|||
    this.activeModal.dismiss();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  confirmDelete(id: number): void {
 | 
			
		||||
    this.plantillaService.delete(id).subscribe(() => {
 | 
			
		||||
  confirmDelete(pPlantilla: IPlantilla): void {
 | 
			
		||||
    pPlantilla.estado = EstadoPlantilla.DELETED;
 | 
			
		||||
    this.plantillaService.update(pPlantilla).subscribe(() => {
 | 
			
		||||
      this.activeModal.close('deleted');
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,7 +24,7 @@
 | 
			
		|||
          <p class="ds-subtitle text-center">Inicie creando preguntas y opciones para su plantilla.</p>
 | 
			
		||||
        </ng-container>
 | 
			
		||||
 | 
			
		||||
        <div class="ds-survey--question-wrapper card-plantilla lift" *ngFor="let pPregunta of pPreguntas; let i = index; trackBy: trackId">
 | 
			
		||||
        <div class="ds-survey--question-wrapper card-plantilla" *ngFor="let pPregunta of pPreguntas; let i = index; trackBy: trackId">
 | 
			
		||||
          <div
 | 
			
		||||
            [attr.data-index]="pPregunta.id"
 | 
			
		||||
            [attr.data-tipo]="pPregunta.tipo"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,7 +25,36 @@
 | 
			
		|||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </h2>
 | 
			
		||||
  <form class="ds-form" *ngIf="isAdmin() && isAuthenticated()">
 | 
			
		||||
    <div class="input-group">
 | 
			
		||||
      <div class="ds-filter">
 | 
			
		||||
        <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
        <input type="text" name="searchString" placeholder="Buscar por nombre..." [(ngModel)]="searchString" />
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="ds-filter">
 | 
			
		||||
        <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
        <select name="estadoPlantilla" id="estadoPlantilla" [(ngModel)]="estadoPlantilla" style="width: 200px">
 | 
			
		||||
          <option value="" selected="selected" disabled="disabled">Filtrar por estado</option>
 | 
			
		||||
          <option value="">Todos Estados</option>
 | 
			
		||||
          <option value="Draft">Borradores</option>
 | 
			
		||||
          <option value="Active">En tienda</option>
 | 
			
		||||
          <option value="Disabled">Desactivadas</option>
 | 
			
		||||
        </select>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <!--<div class="col-3">
 | 
			
		||||
          <div class="input-group-addon "><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
          <select id="categoriaEncuesta"  name="categoriaEncuesta" [(ngModel)]="categoriaEncuesta">
 | 
			
		||||
            <option [ngValue]="null" selected>Filtre por categoría</option>
 | 
			
		||||
            <option
 | 
			
		||||
              *ngFor="let categoriaOption of categoriasSharedCollection; trackBy: trackCategoriaById"
 | 
			
		||||
              [ngValue]="categoriaOption.nombre"    >
 | 
			
		||||
              {{ categoriaOption.nombre }}
 | 
			
		||||
            </option>
 | 
			
		||||
          </select>
 | 
			
		||||
        </div>-->
 | 
			
		||||
    </div>
 | 
			
		||||
  </form>
 | 
			
		||||
  <!-- <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
 | 
			
		||||
  <jhi-alert></jhi-alert> -->
 | 
			
		||||
| 
						 | 
				
			
			@ -35,11 +64,10 @@
 | 
			
		|||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="table-responsive" id="entities" *ngIf="plantillas && plantillas.length > 0">
 | 
			
		||||
    <table class="table table-striped" aria-describedby="page-heading">
 | 
			
		||||
    <table class="ds-table table table-striped" aria-describedby="page-heading">
 | 
			
		||||
      <thead>
 | 
			
		||||
        <tr>
 | 
			
		||||
          <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> -->
 | 
			
		||||
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.fechaPublicacionTienda">Fecha Publicacion Tienda</span></th>
 | 
			
		||||
          <th scope="col"><span jhiTranslate="dataSurveyApp.plantilla.estado">Estado</span></th>
 | 
			
		||||
| 
						 | 
				
			
			@ -49,9 +77,11 @@
 | 
			
		|||
        </tr>
 | 
			
		||||
      </thead>
 | 
			
		||||
      <tbody>
 | 
			
		||||
        <tr *ngFor="let plantilla of plantillas; trackBy: trackId" data-cy="entityTable">
 | 
			
		||||
        <tr
 | 
			
		||||
          *ngFor="let plantilla of plantillas | filter: 'nombre':searchString | filter: 'estado':estadoPlantilla; trackBy: trackId"
 | 
			
		||||
          data-cy="entityTable"
 | 
			
		||||
        >
 | 
			
		||||
          <td>{{ plantilla.nombre }}</td>
 | 
			
		||||
          <td>{{ plantilla.descripcion }}</td>
 | 
			
		||||
          <!-- <td>{{ plantilla.fechaCreacion | formatMediumDatetime }}</td> -->
 | 
			
		||||
          <td *ngIf="plantilla.fechaPublicacionTienda">{{ plantilla.fechaPublicacionTienda | formatShortDatetime | titlecase }}</td>
 | 
			
		||||
          <td *ngIf="!plantilla.fechaPublicacionTienda">No establecida</td>
 | 
			
		||||
| 
						 | 
				
			
			@ -70,7 +100,6 @@
 | 
			
		|||
                <fa-icon icon="eye"></fa-icon>
 | 
			
		||||
                <span class="d-none d-md-inline">Vista previa</span>
 | 
			
		||||
              </button>
 | 
			
		||||
 | 
			
		||||
              <button
 | 
			
		||||
                type="submit"
 | 
			
		||||
                [routerLink]="['/plantilla', plantilla.id, 'edit']"
 | 
			
		||||
| 
						 | 
				
			
			@ -79,7 +108,10 @@
 | 
			
		|||
              >
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
 | 
			
		||||
              </button>
 | 
			
		||||
 | 
			
		||||
              <button type="submit" (click)="cambiarEstado(plantilla)" class="ds-btn btn-warning btn-sm" data-cy="entityDeleteButton">
 | 
			
		||||
                <fa-icon [icon]="faExchangeAlt"></fa-icon>
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="dataSurveyApp.plantilla.updated.buttonChangeEstado">Change status</span>
 | 
			
		||||
              </button>
 | 
			
		||||
              <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>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,6 +17,9 @@ import { CategoriaService } from 'app/entities/categoria/service/categoria.servi
 | 
			
		|||
 | 
			
		||||
import * as dayjs from 'dayjs';
 | 
			
		||||
import { DATE_TIME_FORMAT } from 'app/config/input.constants';
 | 
			
		||||
import { PlantillaChangeStatusDialogComponent } from '../plantilla-change-status-dialog/plantilla-change-status-dialog.component';
 | 
			
		||||
 | 
			
		||||
import { faExchangeAlt } from '@fortawesome/free-solid-svg-icons';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-plantilla',
 | 
			
		||||
| 
						 | 
				
			
			@ -39,21 +42,31 @@ export class PlantillaComponent implements OnInit {
 | 
			
		|||
    categoria: [null, [Validators.required]],
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  faExchangeAlt = faExchangeAlt;
 | 
			
		||||
 | 
			
		||||
  public searchString: string;
 | 
			
		||||
  public estadoPlantilla: string;
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    protected plantillaService: PlantillaService,
 | 
			
		||||
    protected modalService: NgbModal,
 | 
			
		||||
    protected accountService: AccountService,
 | 
			
		||||
    protected fb: FormBuilder,
 | 
			
		||||
    protected categoriaService: CategoriaService
 | 
			
		||||
  ) {}
 | 
			
		||||
  ) {
 | 
			
		||||
    this.searchString = '';
 | 
			
		||||
    this.estadoPlantilla = '';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadAll(): void {
 | 
			
		||||
    this.isLoading = true;
 | 
			
		||||
 | 
			
		||||
    this.searchString = '';
 | 
			
		||||
    this.estadoPlantilla = '';
 | 
			
		||||
    this.plantillaService.query().subscribe(
 | 
			
		||||
      (res: HttpResponse<IPlantilla[]>) => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        this.plantillas = res.body ?? [];
 | 
			
		||||
        const tempPlantillas = res.body ?? [];
 | 
			
		||||
        this.plantillas = tempPlantillas.filter(p => p.estado !== EstadoPlantilla.DELETED);
 | 
			
		||||
      },
 | 
			
		||||
      () => {
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -81,6 +94,17 @@ export class PlantillaComponent implements OnInit {
 | 
			
		|||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  cambiarEstado(plantilla: IPlantilla): void {
 | 
			
		||||
    const modalRef = this.modalService.open(PlantillaChangeStatusDialogComponent, { size: 'lg', backdrop: 'static' });
 | 
			
		||||
    modalRef.componentInstance.plantilla = plantilla;
 | 
			
		||||
    // unsubscribe not needed because closed completes on modal close
 | 
			
		||||
    modalRef.closed.subscribe(reason => {
 | 
			
		||||
      if (reason === 'updated') {
 | 
			
		||||
        this.loadAll();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  isAdmin(): boolean {
 | 
			
		||||
    return this.accountService.hasAnyAuthority('ROLE_ADMIN');
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,32 @@
 | 
			
		|||
<form *ngIf="plantilla" class="ds-form" name="changeStatusForm" (ngSubmit)="confirmChangeStatus(plantilla)">
 | 
			
		||||
  <div class="modal-body">
 | 
			
		||||
    <p class="ds-title--small">Cambiar estado</p>
 | 
			
		||||
    <p
 | 
			
		||||
      *ngIf="plantilla.estado != 'DISABLED'"
 | 
			
		||||
      class="ds-subtitle"
 | 
			
		||||
      id="jhi-inactive-plantilla-heading"
 | 
			
		||||
      jhiTranslate="dataSurveyApp.plantilla.desactivar.question"
 | 
			
		||||
    >
 | 
			
		||||
      Are you sure you want to delete this option?
 | 
			
		||||
    </p>
 | 
			
		||||
    <p
 | 
			
		||||
      *ngIf="plantilla.estado == 'DISABLED'"
 | 
			
		||||
      class="ds-subtitle"
 | 
			
		||||
      id="jhi-active-plantilla-heading"
 | 
			
		||||
      jhiTranslate="dataSurveyApp.plantilla.activar.question"
 | 
			
		||||
    >
 | 
			
		||||
      Are you sure you want to delete this option?
 | 
			
		||||
    </p>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="modal-footer">
 | 
			
		||||
    <button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
 | 
			
		||||
      <fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
 | 
			
		||||
    </button>
 | 
			
		||||
 | 
			
		||||
    <button id="jhi-confirm-change-status-option" data-cy="entityConfirmChangeButton" type="submit" class="ds-btn btn-warning">
 | 
			
		||||
      <fa-icon [icon]="faExchangeAlt"></fa-icon>
 | 
			
		||||
      <span class="d-none d-md-inline" jhiTranslate="dataSurveyApp.plantilla.updated.buttonChangeEstado">Cambiar estado</span>
 | 
			
		||||
    </button>
 | 
			
		||||
  </div>
 | 
			
		||||
</form>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
 | 
			
		||||
import { PlantillaChangeStatusDialogComponent } from './plantilla-change-status-dialog.component';
 | 
			
		||||
 | 
			
		||||
describe('PlantillaChangeStatusDialogComponent', () => {
 | 
			
		||||
  let component: PlantillaChangeStatusDialogComponent;
 | 
			
		||||
  let fixture: ComponentFixture<PlantillaChangeStatusDialogComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async () => {
 | 
			
		||||
    await TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [PlantillaChangeStatusDialogComponent],
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(PlantillaChangeStatusDialogComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,36 @@
 | 
			
		|||
import { Component } from '@angular/core';
 | 
			
		||||
import { PlantillaService } from '../service/plantilla.service';
 | 
			
		||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		||||
import { EstadoPlantilla } from '../../enumerations/estado-plantilla.model';
 | 
			
		||||
import { IPlantilla } from '../plantilla.model';
 | 
			
		||||
 | 
			
		||||
import { faExchangeAlt } from '@fortawesome/free-solid-svg-icons';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-plantilla-change-status-dialog',
 | 
			
		||||
  templateUrl: './plantilla-change-status-dialog.component.html',
 | 
			
		||||
  styleUrls: ['./plantilla-change-status-dialog.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class PlantillaChangeStatusDialogComponent {
 | 
			
		||||
  plantilla?: IPlantilla;
 | 
			
		||||
 | 
			
		||||
  faExchangeAlt = faExchangeAlt;
 | 
			
		||||
  constructor(protected plantillaService: PlantillaService, protected activeModal: NgbActiveModal) {}
 | 
			
		||||
 | 
			
		||||
  cancel(): void {
 | 
			
		||||
    this.activeModal.dismiss();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  confirmChangeStatus(pPlantilla: IPlantilla) {
 | 
			
		||||
    if (this.plantilla) {
 | 
			
		||||
      if (pPlantilla.estado === EstadoPlantilla.DISABLED) {
 | 
			
		||||
        this.plantilla.estado = EstadoPlantilla.DRAFT;
 | 
			
		||||
      } else {
 | 
			
		||||
        this.plantilla.estado = EstadoPlantilla.DISABLED;
 | 
			
		||||
      }
 | 
			
		||||
      this.plantillaService.update(this.plantilla).subscribe(() => {
 | 
			
		||||
        this.activeModal.close('updated');
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -10,6 +10,7 @@ import { PlantillaDeleteQuestionDialogComponent } from './plantilla-delete-quest
 | 
			
		|||
import { PlantillaDeleteOptionDialogComponent } from './plantilla-delete-option-dialog/plantilla-delete-option-dialog.component';
 | 
			
		||||
import { PlantillaPublishStoreDialogComponent } from './plantilla-publish-store-dialog/plantilla-publish-store-dialog.component';
 | 
			
		||||
import { PlantillaDeleteStoreDialogComponent } from './plantilla-delete-store-dialog/plantilla-delete-store-dialog.component';
 | 
			
		||||
import { PlantillaChangeStatusDialogComponent } from './plantilla-change-status-dialog/plantilla-change-status-dialog.component';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  imports: [SharedModule, PlantillaRoutingModule, FontAwesomeModule],
 | 
			
		||||
| 
						 | 
				
			
			@ -22,6 +23,7 @@ import { PlantillaDeleteStoreDialogComponent } from './plantilla-delete-store-di
 | 
			
		|||
    PlantillaDeleteOptionDialogComponent,
 | 
			
		||||
    PlantillaPublishStoreDialogComponent,
 | 
			
		||||
    PlantillaDeleteStoreDialogComponent,
 | 
			
		||||
    PlantillaChangeStatusDialogComponent,
 | 
			
		||||
  ],
 | 
			
		||||
  entryComponents: [PlantillaDeleteDialogComponent],
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,12 +33,18 @@
 | 
			
		|||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </form>
 | 
			
		||||
  <div class="alert alert-warning" id="no-result" *ngIf="usuarioEncuestas?.length === 0">
 | 
			
		||||
    <span jhiTranslate="dataSurveyApp.usuarioEncuesta.home.notFound">No usuarioEncuestas found</span>
 | 
			
		||||
 | 
			
		||||
  <div class="ds-survey" id="entities" *ngIf="usuarioEncuestas?.length === 0">
 | 
			
		||||
    <div class="ds-survey--all-question-wrapper">
 | 
			
		||||
      <ng-container class="">
 | 
			
		||||
        <p class="ds-title text-center">No posee colaboraciones</p>
 | 
			
		||||
        <p class="ds-subtitle text-center">Inicie colaborando con otros usuarios mundialmente al recibir una invitación</p>
 | 
			
		||||
      </ng-container>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="table-responsive" id="entities" *ngIf="usuarioEncuestas && usuarioEncuestas.length > 0">
 | 
			
		||||
    <table class="table table-striped" aria-describedby="page-heading">
 | 
			
		||||
    <table class="ds-table table table-striped" aria-describedby="page-heading">
 | 
			
		||||
      <thead>
 | 
			
		||||
        <tr>
 | 
			
		||||
          <th scope="col"><span jhiTranslate="dataSurveyApp.usuarioEncuesta.rol">Rol</span></th>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@
 | 
			
		|||
      <fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
 | 
			
		||||
    </button>
 | 
			
		||||
 | 
			
		||||
    <button id="jhi-confirm-delete-usuarioExtra" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--danger">
 | 
			
		||||
    <button id="jhi-confirm-delete-usuarioExtra" data-cy="entityConfirmDeleteButton" type="submit" class="ds-btn ds-btn--toggle">
 | 
			
		||||
      <fa-icon [icon]="faExchangeAlt"></fa-icon>
 | 
			
		||||
      <span jhiTranslate="entity.action.toggleStatus">Cambiar estado</span>
 | 
			
		||||
    </button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,7 @@
 | 
			
		|||
    </div>
 | 
			
		||||
  </form>
 | 
			
		||||
  <div class="table-responsive" id="entities" *ngIf="usuarioExtras && usuarioExtras.length > 0">
 | 
			
		||||
    <table class="table table-striped" aria-describedby="page-heading">
 | 
			
		||||
    <table class="ds-table table table-striped" aria-describedby="page-heading">
 | 
			
		||||
      <thead>
 | 
			
		||||
        <tr>
 | 
			
		||||
          <th scope="col"><span jhiTranslate="dataSurveyApp.usuarioExtra.rol">Rol</span></th>
 | 
			
		||||
| 
						 | 
				
			
			@ -96,7 +96,7 @@
 | 
			
		|||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
 | 
			
		||||
              </button> -->
 | 
			
		||||
 | 
			
		||||
              <button type="submit" (click)="delete(usuarioExtra)" class="ds-btn ds-btn--danger" data-cy="entityDeleteButton">
 | 
			
		||||
              <button type="submit" (click)="delete(usuarioExtra)" class="ds-btn ds-btn--toggle" data-cy="entityDeleteButton">
 | 
			
		||||
                <fa-icon [icon]="faExchangeAlt"></fa-icon>
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="entity.action.toggleStatus">Toggle Status</span>
 | 
			
		||||
              </button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,73 @@
 | 
			
		|||
<div *ngIf="usuarioExtra">
 | 
			
		||||
  <h2 id="page-heading" data-cy="UsuarioEncuestaHeading">
 | 
			
		||||
    <span class="ds-title" jhiTranslate="dataSurveyApp.usuarioExtra.plantillas.title">Mis Plantillas </span>
 | 
			
		||||
    <p class="ds-subtitle">Cree encuestas a partir de las plantillas previamente compradas</p>
 | 
			
		||||
 | 
			
		||||
    <div class="d-flex justify-content-end">
 | 
			
		||||
      <button class="ds-btn ds-btn--secondary mr-2" (click)="loadAll()" [disabled]="isLoading">
 | 
			
		||||
        <fa-icon icon="sync" [spin]="isLoading"></fa-icon>
 | 
			
		||||
        <span jhiTranslate="dataSurveyApp.usuarioExtra.home.refreshListLabel">Refresh List</span>
 | 
			
		||||
      </button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </h2>
 | 
			
		||||
  <jhi-alert-error></jhi-alert-error>
 | 
			
		||||
 | 
			
		||||
  <jhi-alert></jhi-alert>
 | 
			
		||||
 | 
			
		||||
  <form *ngIf="misPlantillas?.length === 0" class="ds-form">
 | 
			
		||||
    <div class="input-group">
 | 
			
		||||
      <div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
 | 
			
		||||
      <input type="text" name="searchString" placeholder="Buscar..." [(ngModel)]="searchString" />
 | 
			
		||||
    </div>
 | 
			
		||||
  </form>
 | 
			
		||||
  <div class="ds-survey" id="entities" *ngIf="misPlantillas?.length === 0">
 | 
			
		||||
    <div class="ds-survey--all-question-wrapper">
 | 
			
		||||
      <ng-container>
 | 
			
		||||
        <p class="ds-title text-center">No posee plantillas</p>
 | 
			
		||||
        <p class="ds-subtitle text-center">Adquiera y compre diferentes plantillas disponibles en nuestra tienda</p>
 | 
			
		||||
      </ng-container>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
  <div class="table-responsive" id="entities" *ngIf="misPlantillas && misPlantillas.length > 0">
 | 
			
		||||
    <table class="ds-table table table-striped" aria-describedby="page-heading">
 | 
			
		||||
      <thead>
 | 
			
		||||
        <tr>
 | 
			
		||||
          <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.categoria">Categoria</span></th>
 | 
			
		||||
          <th scope="col"></th>
 | 
			
		||||
        </tr>
 | 
			
		||||
      </thead>
 | 
			
		||||
      <tbody>
 | 
			
		||||
        <tr *ngFor="let miPlantilla of misPlantillas | filter: 'nombre':searchString; trackBy: trackId" data-cy="entityTable">
 | 
			
		||||
          <td>{{ miPlantilla.nombre }}</td>
 | 
			
		||||
          <td>{{ miPlantilla.descripcion }}</td>
 | 
			
		||||
          <td>{{ miPlantilla.categoria?.nombre }}</td>
 | 
			
		||||
          <td class="text-right">
 | 
			
		||||
            <div class="btn-group">
 | 
			
		||||
              <button
 | 
			
		||||
                type="submit"
 | 
			
		||||
                [routerLink]="['/plantilla', miPlantilla.id, 'preview']"
 | 
			
		||||
                class="ds-btn ds-btn--secondary btn-sm"
 | 
			
		||||
                data-cy="entityDetailsButton"
 | 
			
		||||
              >
 | 
			
		||||
                <fa-icon icon="eye"></fa-icon>
 | 
			
		||||
                <span class="d-none d-md-inline">Vista previa</span>
 | 
			
		||||
              </button>
 | 
			
		||||
 | 
			
		||||
              <button
 | 
			
		||||
                type="submit"
 | 
			
		||||
                class="ds-btn ds-btn--primary btn-sm"
 | 
			
		||||
                data-cy="entityCreateButton"
 | 
			
		||||
                (click)="crearEncuesta(miPlantilla.id)"
 | 
			
		||||
              >
 | 
			
		||||
                <span class="d-none d-md-inline" jhiTranslate="dataSurveyApp.usuarioExtra.plantillas.crearEncuesta">Crear Encuesta</span>
 | 
			
		||||
              </button>
 | 
			
		||||
            </div>
 | 
			
		||||
          </td>
 | 
			
		||||
        </tr>
 | 
			
		||||
      </tbody>
 | 
			
		||||
    </table>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,100 @@
 | 
			
		|||
import { Component, OnInit } from '@angular/core';
 | 
			
		||||
import { UsuarioExtra } from '../../usuario-extra/usuario-extra.model';
 | 
			
		||||
import { IPlantilla } from '../../plantilla/plantilla.model';
 | 
			
		||||
 | 
			
		||||
import { PlantillaService } from '../../plantilla/service/plantilla.service';
 | 
			
		||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
 | 
			
		||||
import { CategoriaService } from '../../categoria/service/categoria.service';
 | 
			
		||||
import { UsuarioExtraService } from '../../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 * as dayjs from 'dayjs';
 | 
			
		||||
import { DATE_TIME_FORMAT } from 'app/config/input.constants';
 | 
			
		||||
import { Account } from '../../../core/auth/account.model';
 | 
			
		||||
import { Encuesta } from './../../encuesta/encuesta.model';
 | 
			
		||||
import { EncuestaService } from 'app/entities/encuesta/service/encuesta.service';
 | 
			
		||||
import { AccesoEncuesta } from 'app/entities/enumerations/acceso-encuesta.model';
 | 
			
		||||
import { EstadoEncuesta } from 'app/entities/enumerations/estado-encuesta.model';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-usuario-plantillas',
 | 
			
		||||
  templateUrl: './usuario-plantillas.component.html',
 | 
			
		||||
  styleUrls: ['./usuario-plantillas.component.scss'],
 | 
			
		||||
})
 | 
			
		||||
export class UsuarioPlantillasComponent implements OnInit {
 | 
			
		||||
  misPlantillas?: IPlantilla[] | null | undefined;
 | 
			
		||||
  isLoading = false;
 | 
			
		||||
  usuarioExtra: UsuarioExtra | null = null;
 | 
			
		||||
  account: Account | null = null;
 | 
			
		||||
  searchString: string;
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    protected plantillaService: PlantillaService,
 | 
			
		||||
    protected modalService: NgbModal,
 | 
			
		||||
    protected categoriaService: CategoriaService,
 | 
			
		||||
    protected usuarioExtraService: UsuarioExtraService,
 | 
			
		||||
    protected activatedRoute: ActivatedRoute,
 | 
			
		||||
    protected fb: FormBuilder,
 | 
			
		||||
    protected accountService: AccountService,
 | 
			
		||||
    protected encuestaService: EncuestaService,
 | 
			
		||||
    protected router: Router
 | 
			
		||||
  ) {
 | 
			
		||||
    this.searchString = '';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit(): void {
 | 
			
		||||
    this.accountService.getAuthenticationState().subscribe(account => {
 | 
			
		||||
      if (account !== null) {
 | 
			
		||||
        this.account = account;
 | 
			
		||||
        this.loadAll();
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  loadAll() {
 | 
			
		||||
    this.isLoading = true;
 | 
			
		||||
    // Get jhi_user and usuario_extra information
 | 
			
		||||
    if (this.account !== null) {
 | 
			
		||||
      this.usuarioExtraService.find(this.account.id).subscribe(usuarioExtra => {
 | 
			
		||||
        this.usuarioExtra = usuarioExtra.body;
 | 
			
		||||
        this.misPlantillas = usuarioExtra.body?.plantillas;
 | 
			
		||||
        this.isLoading = false;
 | 
			
		||||
        if (this.usuarioExtra !== null) {
 | 
			
		||||
          if (this.usuarioExtra.id === undefined) {
 | 
			
		||||
            const today = dayjs().startOf('day');
 | 
			
		||||
            this.usuarioExtra.fechaNacimiento = today;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackId(_index: number, item: IPlantilla): number {
 | 
			
		||||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  crearEncuesta(plantillaId: any): void {
 | 
			
		||||
    const now = dayjs();
 | 
			
		||||
 | 
			
		||||
    const newSurvey = {
 | 
			
		||||
      ...new Encuesta(),
 | 
			
		||||
      id: undefined,
 | 
			
		||||
      nombre: 'This is a survey',
 | 
			
		||||
      descripcion: 'This is a survey',
 | 
			
		||||
      fechaCreacion: dayjs(now, DATE_TIME_FORMAT),
 | 
			
		||||
      calificacion: 5,
 | 
			
		||||
      acceso: AccesoEncuesta.PUBLIC,
 | 
			
		||||
      contrasenna: undefined,
 | 
			
		||||
      estado: EstadoEncuesta.DRAFT,
 | 
			
		||||
      categoria: undefined,
 | 
			
		||||
      usuarioExtra: this.usuarioExtra,
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    console.log(plantillaId, newSurvey);
 | 
			
		||||
 | 
			
		||||
    this.encuestaService.createFromTemplate(newSurvey, plantillaId).subscribe(_res => {
 | 
			
		||||
      this.router.navigate(['/encuesta']);
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,11 @@
 | 
			
		|||
import { Route, RouterModule } from '@angular/router';
 | 
			
		||||
 | 
			
		||||
import { UsuarioPlantillasComponent } from '../list/usuario-plantillas.component';
 | 
			
		||||
 | 
			
		||||
export const USUARIO_PLANTILLAS_ROUTE: Route = {
 | 
			
		||||
  path: '',
 | 
			
		||||
  component: UsuarioPlantillasComponent,
 | 
			
		||||
  data: {
 | 
			
		||||
    pageTitle: 'dataSurveyApp.usuarioExtra.plantillas.title',
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
import { NgModule } from '@angular/core';
 | 
			
		||||
import { CommonModule } from '@angular/common';
 | 
			
		||||
import { UsuarioPlantillasComponent } from './list/usuario-plantillas.component';
 | 
			
		||||
import { RouterModule } from '@angular/router';
 | 
			
		||||
import { USUARIO_PLANTILLAS_ROUTE } from './route/usuario-plantillas.route';
 | 
			
		||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
 | 
			
		||||
import { SharedModule } from '../../shared/shared.module';
 | 
			
		||||
 | 
			
		||||
@NgModule({
 | 
			
		||||
  declarations: [UsuarioPlantillasComponent],
 | 
			
		||||
  imports: [CommonModule, RouterModule.forChild([USUARIO_PLANTILLAS_ROUTE]), FontAwesomeModule, SharedModule],
 | 
			
		||||
})
 | 
			
		||||
export class UsuarioPlantillasModule {}
 | 
			
		||||
| 
						 | 
				
			
			@ -24,6 +24,12 @@ export const ADMIN_ROUTES: RouteInfo[] = [
 | 
			
		|||
  // },
 | 
			
		||||
 | 
			
		||||
  { path: '/pagina-principal', title: 'Inicio', type: 'link', icontype: 'nc-icon nc-world-2' },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/dashboard/admin',
 | 
			
		||||
    title: 'Dashboard',
 | 
			
		||||
    type: 'link',
 | 
			
		||||
    icontype: 'nc-icon nc-chart-bar-32',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/encuesta',
 | 
			
		||||
    title: 'Encuestas',
 | 
			
		||||
| 
						 | 
				
			
			@ -58,6 +64,12 @@ export const ADMIN_ROUTES: RouteInfo[] = [
 | 
			
		|||
 | 
			
		||||
export const USER_ROUTES: RouteInfo[] = [
 | 
			
		||||
  { path: '/pagina-principal', title: 'Inicio', type: 'link', icontype: 'nc-icon nc-world-2' },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/dashboard/user',
 | 
			
		||||
    title: 'Dashboard',
 | 
			
		||||
    type: 'link',
 | 
			
		||||
    icontype: 'nc-icon nc-chart-bar-32',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/encuesta',
 | 
			
		||||
    title: 'Encuestas',
 | 
			
		||||
| 
						 | 
				
			
			@ -71,12 +83,12 @@ export const USER_ROUTES: RouteInfo[] = [
 | 
			
		|||
  //   type: 'link',
 | 
			
		||||
  //   icontype: 'nc-icon nc-cart-simple',
 | 
			
		||||
  // },
 | 
			
		||||
  // {
 | 
			
		||||
  //   path: '/plantilla',
 | 
			
		||||
  //   title: 'Plantillas',
 | 
			
		||||
  //   type: 'link',
 | 
			
		||||
  //   icontype: 'nc-icon nc-album-2',
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/mis-plantillas',
 | 
			
		||||
    title: 'Mis Plantillas',
 | 
			
		||||
    type: 'link',
 | 
			
		||||
    icontype: 'nc-icon nc-album-2',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    path: '/colaboraciones',
 | 
			
		||||
    title: 'Colaboraciones',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -106,7 +106,9 @@
 | 
			
		|||
                      ></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>
 | 
			
		||||
                      <button (click)="completeEncuesta(encuesta)" class="ds-btn btn-card">
 | 
			
		||||
                        <fa-icon [icon]="faPollH"></fa-icon>  Completar encuesta
 | 
			
		||||
                      </button>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,6 +15,8 @@ import { Subject } from 'rxjs';
 | 
			
		|||
 | 
			
		||||
import { faPollH, faCalendarAlt, faStar, faListAlt, faFileAlt } from '@fortawesome/free-solid-svg-icons';
 | 
			
		||||
import { ICategoria } from '../entities/categoria/categoria.model';
 | 
			
		||||
import { AccesoEncuesta } from 'app/entities/enumerations/acceso-encuesta.model';
 | 
			
		||||
import { EncuestaPasswordDialogComponent } from 'app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'jhi-pagina-principal',
 | 
			
		||||
| 
						 | 
				
			
			@ -106,7 +108,21 @@ export class PaginaPrincipalComponent implements OnInit {
 | 
			
		|||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  trackId(index: number, item: IEncuesta): number {
 | 
			
		||||
  trackId(_index: number, item: IEncuesta): number {
 | 
			
		||||
    return item.id!;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  completeEncuesta(encuesta: IEncuesta): void {
 | 
			
		||||
    this.router.navigate(['/encuesta', encuesta.id, 'complete']);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  confirmPassword(encuesta: IEncuesta): void {
 | 
			
		||||
    const modalRef = this.modalService.open(EncuestaPasswordDialogComponent, { size: 'lg', backdrop: 'static' });
 | 
			
		||||
    modalRef.componentInstance.encuesta = encuesta;
 | 
			
		||||
    modalRef.closed.subscribe(isValid => {
 | 
			
		||||
      if (isValid) {
 | 
			
		||||
        // Load the survey
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -102,3 +102,4 @@
 | 
			
		|||
@import 'paper-dashboard/datasurvey-home';
 | 
			
		||||
@import 'paper-dashboard/datasurvey-filter';
 | 
			
		||||
@import 'paper-dashboard/datasurvey-survey';
 | 
			
		||||
@import 'paper-dashboard/datasurvey-switch';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,11 +42,11 @@
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
.ds-btn--toggle {
 | 
			
		||||
  background-color: #ffaa47;
 | 
			
		||||
  background-color: #ff9a27;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
 | 
			
		||||
  &:hover {
 | 
			
		||||
    background-color: #e09935;
 | 
			
		||||
    background-color: #d48020;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,30 @@
 | 
			
		|||
.ds-switch {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  align-items: center;
 | 
			
		||||
  justify-content: space-between;
 | 
			
		||||
 | 
			
		||||
  & input {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  & label {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
    font-size: 0.8rem;
 | 
			
		||||
    color: #757d94;
 | 
			
		||||
    margin: 0;
 | 
			
		||||
 | 
			
		||||
    &::before {
 | 
			
		||||
      top: 2px !important;
 | 
			
		||||
      display: flex;
 | 
			
		||||
      align-items: center;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &::after {
 | 
			
		||||
      top: 3.5px !important;
 | 
			
		||||
      display: flex;
 | 
			
		||||
      align-items: center;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,25 @@
 | 
			
		|||
.ds-table {
 | 
			
		||||
  thead {
 | 
			
		||||
    th span {
 | 
			
		||||
      color: #2f4159;
 | 
			
		||||
      text-transform: uppercase;
 | 
			
		||||
      font-size: 0.9rem;
 | 
			
		||||
      font-weight: 700;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  tbody {
 | 
			
		||||
    tr:nth-child(odd) {
 | 
			
		||||
      background-color: #f1f5f9;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    td {
 | 
			
		||||
      border: 0;
 | 
			
		||||
      color: #2f4159;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.table-responsive {
 | 
			
		||||
  overflow: auto;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
{
 | 
			
		||||
  "dataSurveyApp": {
 | 
			
		||||
    "Dashboard": {
 | 
			
		||||
      "title": "Dashboard"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +34,12 @@
 | 
			
		|||
      "ePreguntaAbierta": "Pregunta Abierta",
 | 
			
		||||
      "ePreguntaCerrada": "Pregunta Cerrada",
 | 
			
		||||
      "categoria": "Categoría",
 | 
			
		||||
      "usuarioExtra": "Correo Usuario"
 | 
			
		||||
      "usuarioExtra": "Correo Usuario",
 | 
			
		||||
      "plantilla": "Plantilla",
 | 
			
		||||
      "password": {
 | 
			
		||||
        "title": "Contraseña Requerida",
 | 
			
		||||
        "text": "Esta encuesta es privada, por lo que debe ingresar la contraseña"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -130,7 +130,8 @@
 | 
			
		|||
      "enable": "Habilitar",
 | 
			
		||||
      "disable": "Deshabilitar",
 | 
			
		||||
      "toggleStatus": "Cambiar Estado",
 | 
			
		||||
      "publish": "Publicar"
 | 
			
		||||
      "publish": "Publicar",
 | 
			
		||||
      "submit": "Ingresar"
 | 
			
		||||
    },
 | 
			
		||||
    "detail": {
 | 
			
		||||
      "field": "Campo",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,10 +9,13 @@
 | 
			
		|||
        "notFound": "No se encontró ninguna plantilla"
 | 
			
		||||
      },
 | 
			
		||||
      "created": "Una nueva plantilla ha sido creada con el identificador {{ param }}",
 | 
			
		||||
      "updated": "Una plantilla ha sido actualizada con el identificador {{ param }}",
 | 
			
		||||
      "updated": {
 | 
			
		||||
        "detail": "Una plantilla ha sido actualizada con el identificador {{ param }}",
 | 
			
		||||
        "buttonChangeEstado": "Cambiar estado"
 | 
			
		||||
      },
 | 
			
		||||
      "deleted": "Una plantilla ha sido eliminada con el identificador {{ param }}",
 | 
			
		||||
      "delete": {
 | 
			
		||||
        "question": "¿Seguro que quiere eliminar Plantilla {{ id }}?",
 | 
			
		||||
        "question": "¿Seguro que quiere eliminar esta plantilla?",
 | 
			
		||||
        "deletefromstore": "¿Seguro que quiere eliminar esta plantilla de la tienda?"
 | 
			
		||||
      },
 | 
			
		||||
      "publish": {
 | 
			
		||||
| 
						 | 
				
			
			@ -21,6 +24,14 @@
 | 
			
		|||
      "detail": {
 | 
			
		||||
        "title": "Plantilla"
 | 
			
		||||
      },
 | 
			
		||||
      "desactivar": {
 | 
			
		||||
        "titulo": "Desactivar plantilla",
 | 
			
		||||
        "question": "¿Seguro que quiere desactivar la plantilla?"
 | 
			
		||||
      },
 | 
			
		||||
      "activar": {
 | 
			
		||||
        "titulo": "Activar plantilla",
 | 
			
		||||
        "question": "¿Seguro que quiere activar la plantilla?. Esta será activada en estado de 'Borrador'"
 | 
			
		||||
      },
 | 
			
		||||
      "id": "ID",
 | 
			
		||||
      "nombre": "Nombre",
 | 
			
		||||
      "descripcion": "Descripción",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,7 +27,12 @@
 | 
			
		|||
      "correo": "Correo electrónico",
 | 
			
		||||
      "encuesta": "Encuesta",
 | 
			
		||||
      "usuarioEncuesta": "Usuario Encuesta",
 | 
			
		||||
      "plantilla": "Plantilla"
 | 
			
		||||
      "plantilla": "Plantilla",
 | 
			
		||||
      "plantillas": {
 | 
			
		||||
        "title": "Mis Plantillas",
 | 
			
		||||
        "notFound": "No tiene plantillas compradas",
 | 
			
		||||
        "crearEncuesta": "Crear encuesta"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue