From 9f23887793e02b85322bb1138b9b4d373d906dab Mon Sep 17 00:00:00 2001 From: Eduardo Quiros Date: Tue, 17 Aug 2021 22:25:18 -0600 Subject: [PATCH] apply stash --- .../encuesta/complete/complete.component.ts | 19 ++++++++----------- .../encuesta-password-dialog.component.html | 12 +++--------- .../update/encuesta-update.component.html | 2 +- 3 files changed, 12 insertions(+), 21 deletions(-) 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 1f188b7..6c72028 100644 --- a/src/main/webapp/app/entities/encuesta/complete/complete.component.ts +++ b/src/main/webapp/app/entities/encuesta/complete/complete.component.ts @@ -75,12 +75,8 @@ export class EncuestaCompleteComponent implements OnInit { this.cantidadCalificaciones = parseInt(this.encuesta!.calificacion!.toString().split('.')[1]); this.sumCalificacion = this.avgCalificacion * this.cantidadCalificaciones; } - this.isLocked = this.verifyPassword(); - if (this.isLocked) { - this.previousState(); - } else { - this.loadAll(); - } + this.verifyPassword(); + this.loadAll(); }); for (let pregunta of this.ePreguntas!) { if (pregunta.tipo && pregunta.tipo === PreguntaCerradaTipo.SINGLE) { @@ -89,17 +85,19 @@ export class EncuestaCompleteComponent implements OnInit { } } - verifyPassword(): boolean { + verifyPassword(): void { if (this.encuesta!.acceso === AccesoEncuesta.PUBLIC) { - return false; + this.isLocked = false; } else { const modalRef = this.modalService.open(EncuestaPasswordDialogComponent, { size: 'lg', backdrop: 'static' }); modalRef.componentInstance.encuesta = this.encuesta; modalRef.closed.subscribe(reason => { - return reason === 'success'; + this.isLocked = reason != 'success'; + if (this.isLocked) { + this.previousState(); + } }); } - return true; } ngAfterViewChecked(): void { @@ -194,7 +192,6 @@ export class EncuestaCompleteComponent implements OnInit { this.getOpenQuestionAnswers(); this.registerOpenQuestionAnswers(); this.updateEncuestaRating(); - this.previousState(); } diff --git a/src/main/webapp/app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component.html b/src/main/webapp/app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component.html index 22a1e3c..19a1371 100644 --- a/src/main/webapp/app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component.html +++ b/src/main/webapp/app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component.html @@ -1,5 +1,5 @@ -
-
+ +

ContraseƱa incorrecta

diff --git a/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html b/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html index b857f99..1023b54 100644 --- a/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html +++ b/src/main/webapp/app/entities/encuesta/update/encuesta-update.component.html @@ -58,7 +58,7 @@ [disabled]="isLoading" data-toggle="modal" data-target="#crearPregunta" - *ngIf="encuesta!.estado !== 'FINISHED' && (isAutor() || isEscritor())" + *ngIf="encuesta!.estado !== 'ACTIVE' && encuesta!.estado !== 'FINISHED' && (isAutor() || isEscritor())" >   Crear pregunta