apply stash
This commit is contained in:
parent
4cb626aab7
commit
9f23887793
|
@ -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.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();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<form class="ds-form" [formGroup]="passwordForm" name="deleteForm" (ngSubmit)="submitPassword()">
|
||||
<div *ngIf="this.isWrong">
|
||||
<form class="ds-form" name="deleteForm">
|
||||
<div class="" *ngIf="this.isWrong">
|
||||
<p>Contraseña incorrecta</p>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
@ -15,13 +15,7 @@
|
|||
<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"
|
||||
>
|
||||
<button id="jhi-confirm-delete-option" data-cy="submit" type="submit" class="ds-btn ds-btn--primary" (click)="submitPassword()">
|
||||
<span jhiTranslate="entity.action.submit">Submit</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -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())"
|
||||
>
|
||||
<fa-icon icon="sync" [icon]="faPlus"></fa-icon> <span>Crear pregunta</span>
|
||||
</button>
|
||||
|
|
Loading…
Reference in New Issue