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 6c72028..07c6137 100644 --- a/src/main/webapp/app/entities/encuesta/complete/complete.component.ts +++ b/src/main/webapp/app/entities/encuesta/complete/complete.component.ts @@ -76,7 +76,6 @@ export class EncuestaCompleteComponent implements OnInit { this.sumCalificacion = this.avgCalificacion * this.cantidadCalificaciones; } this.verifyPassword(); - this.loadAll(); }); for (let pregunta of this.ePreguntas!) { if (pregunta.tipo && pregunta.tipo === PreguntaCerradaTipo.SINGLE) { @@ -87,6 +86,7 @@ export class EncuestaCompleteComponent implements OnInit { verifyPassword(): void { if (this.encuesta!.acceso === AccesoEncuesta.PUBLIC) { + this.loadAll(); this.isLocked = false; } else { const modalRef = this.modalService.open(EncuestaPasswordDialogComponent, { size: 'lg', backdrop: 'static' }); @@ -95,6 +95,8 @@ export class EncuestaCompleteComponent implements OnInit { this.isLocked = reason != 'success'; if (this.isLocked) { this.previousState(); + } else { + this.loadAll(); } }); } 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 19a1371..3de4280 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,12 +1,12 @@
-
-

ContraseƱa incorrecta

-
@@ -15,7 +15,7 @@  Cancel - diff --git a/src/main/webapp/app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component.ts b/src/main/webapp/app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component.ts index f2514e1..57294af 100644 --- a/src/main/webapp/app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component.ts +++ b/src/main/webapp/app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component.ts @@ -1,5 +1,4 @@ import { Component, OnInit } from '@angular/core'; -import { FormBuilder, Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { IEncuesta } from '../encuesta.model'; @@ -9,21 +8,16 @@ import { IEncuesta } from '../encuesta.model'; 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) {} + constructor(protected activeModal: NgbActiveModal) {} ngOnInit(): void {} submitPassword() { - const password = this.passwordForm.get(['password'])!.value; - - if (this.passwordForm.valid && password === this.encuesta!.contrasenna) { + if (this.passwordInput != undefined && this.passwordInput === this.encuesta!.contrasenna) { this.activeModal.close('success'); } else { this.isWrong = true;