From fb77d2872e00df6c632c3526e1acd9a0bb583346 Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Tue, 3 Aug 2021 21:00:44 -0600 Subject: [PATCH] eliminar codigo innecesario --- .../encuesta/complete/complete.component.html | 34 ------------ .../encuesta/complete/complete.component.ts | 55 ++----------------- 2 files changed, 4 insertions(+), 85 deletions(-) diff --git a/src/main/webapp/app/entities/encuesta/complete/complete.component.html b/src/main/webapp/app/entities/encuesta/complete/complete.component.html index db1881b..66510c2 100644 --- a/src/main/webapp/app/entities/encuesta/complete/complete.component.html +++ b/src/main/webapp/app/entities/encuesta/complete/complete.component.html @@ -11,21 +11,10 @@ - - - - - -
No se encontraron preguntas @@ -71,12 +60,10 @@ name="{{ 'radio' + ePregunta.id }}" id="{{ 'radio' + ePreguntaOpcionFinal.id }}" /> -
-
@@ -111,10 +98,6 @@

{{ ePreguntas?.length }}

- -

Acceso

{{ encuesta.acceso }}

@@ -146,23 +129,6 @@

- -

Fecha de finalizaciĆ³n

diff --git a/src/main/webapp/app/entities/encuesta/complete/complete.component.ts b/src/main/webapp/app/entities/encuesta/complete/complete.component.ts index 715b814..c023f9d 100644 --- a/src/main/webapp/app/entities/encuesta/complete/complete.component.ts +++ b/src/main/webapp/app/entities/encuesta/complete/complete.component.ts @@ -1,35 +1,18 @@ import { Component, OnInit } from '@angular/core'; -import { HttpResponse } from '@angular/common/http'; -import { FormBuilder, Validators } from '@angular/forms'; +import { FormBuilder } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; -import { EstadoEncuesta } from 'app/entities/enumerations/estado-encuesta.model'; - -import { Observable } from 'rxjs'; -import { finalize, map } from 'rxjs/operators'; - -import * as dayjs from 'dayjs'; -import { DATE_TIME_FORMAT } from 'app/config/input.constants'; - -import { IEncuesta, Encuesta } from '../encuesta.model'; +import { finalize } from 'rxjs/operators'; +import { IEncuesta } from '../encuesta.model'; import { EncuestaService } from '../service/encuesta.service'; import { ICategoria } from 'app/entities/categoria/categoria.model'; -import { CategoriaService } from 'app/entities/categoria/service/categoria.service'; import { IUsuarioExtra } from 'app/entities/usuario-extra/usuario-extra.model'; import { UsuarioExtraService } from 'app/entities/usuario-extra/service/usuario-extra.service'; - import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { IEPreguntaCerrada } from 'app/entities/e-pregunta-cerrada/e-pregunta-cerrada.model'; import { EPreguntaCerradaService } from 'app/entities/e-pregunta-cerrada/service/e-pregunta-cerrada.service'; -import { EPreguntaCerradaDeleteDialogComponent } from 'app/entities/e-pregunta-cerrada/delete/e-pregunta-cerrada-delete-dialog.component'; -import { IEPreguntaAbierta } from '../../e-pregunta-abierta/e-pregunta-abierta.model'; -import { EPreguntaCerrada } from '../../e-pregunta-cerrada/e-pregunta-cerrada.model'; -import { EPreguntaCerradaOpcion, IEPreguntaCerradaOpcion } from '../../e-pregunta-cerrada-opcion/e-pregunta-cerrada-opcion.model'; import { EPreguntaAbiertaService } from '../../e-pregunta-abierta/service/e-pregunta-abierta.service'; import { EPreguntaCerradaOpcionService } from '../../e-pregunta-cerrada-opcion/service/e-pregunta-cerrada-opcion.service'; -import { PreguntaCerradaTipo } from 'app/entities/enumerations/pregunta-cerrada-tipo.model'; - -import { faTimes, faPlus, faStar, faQuestion } from '@fortawesome/free-solid-svg-icons'; -import { EncuestaPublishDialogComponent } from '../encuesta-publish-dialog/encuesta-publish-dialog.component'; +import { faStar, faQuestion } from '@fortawesome/free-solid-svg-icons'; @Component({ selector: 'jhi-complete', @@ -38,20 +21,16 @@ import { EncuestaPublishDialogComponent } from '../encuesta-publish-dialog/encue export class EncuestaCompleteComponent implements OnInit { categoriasSharedCollection: ICategoria[] = []; usuarioExtrasSharedCollection: IUsuarioExtra[] = []; - faTimes = faTimes; - faPlus = faPlus; faStar = faStar; faQuestion = faQuestion; encuesta: IEncuesta | null = null; isLoading = false; - successPublished = false; ePreguntas?: any[]; ePreguntasOpciones?: any[]; constructor( protected activatedRoute: ActivatedRoute, protected encuestaService: EncuestaService, - protected categoriaService: CategoriaService, protected usuarioExtraService: UsuarioExtraService, protected fb: FormBuilder, protected modalService: NgbModal, @@ -104,13 +83,8 @@ export class EncuestaCompleteComponent implements OnInit { return item.id!; } - getEncuesta(id: number) { - return this.encuestaService.findEncuesta(id); - } - loadAll(): void { this.isLoading = true; - this.encuestaService .findQuestions(this.encuesta?.id!) .pipe( @@ -135,27 +109,6 @@ export class EncuestaCompleteComponent implements OnInit { this.isLoading = false; } ); - - /* this.encuestaService.findQuestionsOptions(this.encuesta?.id!).subscribe( - (res: any) => { - this.isLoading = false; - this.ePreguntasOpciones = res.body ?? []; - }, - () => { - this.isLoading = false; - } - );*/ - } - publishSurvey(): void { - const modalRef = this.modalService.open(EncuestaPublishDialogComponent, { size: 'lg', backdrop: 'static' }); - modalRef.componentInstance.encuesta = this.encuesta; - // unsubscribe not needed because closed completes on modal close - modalRef.closed.subscribe(reason => { - if (reason === 'published') { - this.successPublished = true; - this.loadAll(); - } - }); } previousState(): void {