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.cantidadCalificaciones = parseInt(this.encuesta!.calificacion!.toString().split('.')[1]);
|
||||||
this.sumCalificacion = this.avgCalificacion * this.cantidadCalificaciones;
|
this.sumCalificacion = this.avgCalificacion * this.cantidadCalificaciones;
|
||||||
}
|
}
|
||||||
this.isLocked = this.verifyPassword();
|
this.verifyPassword();
|
||||||
if (this.isLocked) {
|
|
||||||
this.previousState();
|
|
||||||
} else {
|
|
||||||
this.loadAll();
|
this.loadAll();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
for (let pregunta of this.ePreguntas!) {
|
for (let pregunta of this.ePreguntas!) {
|
||||||
if (pregunta.tipo && pregunta.tipo === PreguntaCerradaTipo.SINGLE) {
|
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) {
|
if (this.encuesta!.acceso === AccesoEncuesta.PUBLIC) {
|
||||||
return false;
|
this.isLocked = false;
|
||||||
} else {
|
} else {
|
||||||
const modalRef = this.modalService.open(EncuestaPasswordDialogComponent, { size: 'lg', backdrop: 'static' });
|
const modalRef = this.modalService.open(EncuestaPasswordDialogComponent, { size: 'lg', backdrop: 'static' });
|
||||||
modalRef.componentInstance.encuesta = this.encuesta;
|
modalRef.componentInstance.encuesta = this.encuesta;
|
||||||
modalRef.closed.subscribe(reason => {
|
modalRef.closed.subscribe(reason => {
|
||||||
return reason === 'success';
|
this.isLocked = reason != 'success';
|
||||||
|
if (this.isLocked) {
|
||||||
|
this.previousState();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewChecked(): void {
|
ngAfterViewChecked(): void {
|
||||||
|
@ -194,7 +192,6 @@ export class EncuestaCompleteComponent implements OnInit {
|
||||||
this.getOpenQuestionAnswers();
|
this.getOpenQuestionAnswers();
|
||||||
this.registerOpenQuestionAnswers();
|
this.registerOpenQuestionAnswers();
|
||||||
this.updateEncuestaRating();
|
this.updateEncuestaRating();
|
||||||
|
|
||||||
this.previousState();
|
this.previousState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<form class="ds-form" [formGroup]="passwordForm" name="deleteForm" (ngSubmit)="submitPassword()">
|
<form class="ds-form" name="deleteForm">
|
||||||
<div *ngIf="this.isWrong">
|
<div class="" *ngIf="this.isWrong">
|
||||||
<p>Contraseña incorrecta</p>
|
<p>Contraseña incorrecta</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
@ -15,13 +15,7 @@
|
||||||
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
<fa-icon icon="arrow-left"></fa-icon> <span jhiTranslate="entity.action.cancel">Cancel</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button id="jhi-confirm-delete-option" data-cy="submit" type="submit" class="ds-btn ds-btn--primary" (click)="submitPassword()">
|
||||||
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>
|
<span jhiTranslate="entity.action.submit">Submit</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
[disabled]="isLoading"
|
[disabled]="isLoading"
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
data-target="#crearPregunta"
|
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>
|
<fa-icon icon="sync" [icon]="faPlus"></fa-icon> <span>Crear pregunta</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in New Issue