agregar dialogo para confirmación de contraseña
This commit is contained in:
parent
778aa72837
commit
e2e83e4cb5
|
@ -1 +1,25 @@
|
||||||
<p>encuesta-password-dialog works!</p>
|
<form class="ds-form" name="deleteForm" (ngSubmit)="submitPassword()">
|
||||||
|
<div class="modal-body">
|
||||||
|
<p class="ds-title--small" jhiTranslate="dataSurveyApp.encuesta.password.title">Enter password</p>
|
||||||
|
<p class="ds-subtitle" id="jhi-delete-encuesta-heading" jhiTranslate="dataSurveyApp.encuesta.password.text">
|
||||||
|
This survey is marked as private, please enter the password
|
||||||
|
</p>
|
||||||
|
<input type="password" name="passwordInput" id="passwordInput" placeholder="qwerty..." />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="ds-btn ds-btn--secondary" data-dismiss="modal" (click)="cancel()">
|
||||||
|
<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"
|
||||||
|
>
|
||||||
|
<span jhiTranslate="entity.action.submit">Submit</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
input {
|
||||||
|
margin: 2%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
|
@ -1,4 +1,6 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { FormBuilder, Validators } from '@angular/forms';
|
||||||
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'jhi-encuesta-password-dialog',
|
selector: 'jhi-encuesta-password-dialog',
|
||||||
|
@ -6,7 +8,17 @@ import { Component, OnInit } from '@angular/core';
|
||||||
styleUrls: ['./encuesta-password-dialog.component.scss'],
|
styleUrls: ['./encuesta-password-dialog.component.scss'],
|
||||||
})
|
})
|
||||||
export class EncuestaPasswordDialogComponent implements OnInit {
|
export class EncuestaPasswordDialogComponent implements OnInit {
|
||||||
constructor() {}
|
passwordForm = this.fb.group({
|
||||||
|
password: [null, [Validators.required]],
|
||||||
|
});
|
||||||
|
|
||||||
|
constructor(protected activeModal: NgbActiveModal, protected fb: FormBuilder) {}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {}
|
||||||
|
|
||||||
|
submitPassword() {}
|
||||||
|
|
||||||
|
cancel(): void {
|
||||||
|
this.activeModal.dismiss();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
></fa-icon>
|
></fa-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="entity-body--row m-2">
|
<div class="entity-body--row m-2">
|
||||||
<button routerLink="/encuesta.id/complete" class="ds-btn btn-card">
|
<button (click)="completeEncuesta(encuesta)" class="ds-btn btn-card">
|
||||||
<fa-icon [icon]="faPollH"></fa-icon> Completar encuesta
|
<fa-icon [icon]="faPollH"></fa-icon> Completar encuesta
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,6 +15,8 @@ import { Subject } from 'rxjs';
|
||||||
|
|
||||||
import { faPollH, faCalendarAlt, faStar, faListAlt, faFileAlt } from '@fortawesome/free-solid-svg-icons';
|
import { faPollH, faCalendarAlt, faStar, faListAlt, faFileAlt } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { ICategoria } from '../entities/categoria/categoria.model';
|
import { ICategoria } from '../entities/categoria/categoria.model';
|
||||||
|
import { AccesoEncuesta } from 'app/entities/enumerations/acceso-encuesta.model';
|
||||||
|
import { EncuestaPasswordDialogComponent } from 'app/entities/encuesta/encuesta-password-dialog/encuesta-password-dialog.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'jhi-pagina-principal',
|
selector: 'jhi-pagina-principal',
|
||||||
|
@ -106,7 +108,23 @@ export class PaginaPrincipalComponent implements OnInit {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
trackId(index: number, item: IEncuesta): number {
|
trackId(_index: number, item: IEncuesta): number {
|
||||||
return item.id!;
|
return item.id!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
completeEncuesta(encuesta: IEncuesta): void {
|
||||||
|
if (encuesta.acceso === AccesoEncuesta.PRIVATE) {
|
||||||
|
}
|
||||||
|
this.confirmPassword(encuesta);
|
||||||
|
}
|
||||||
|
|
||||||
|
confirmPassword(encuesta: IEncuesta): void {
|
||||||
|
const modalRef = this.modalService.open(EncuestaPasswordDialogComponent, { size: 'lg', backdrop: 'static' });
|
||||||
|
modalRef.componentInstance.encuesta = encuesta;
|
||||||
|
modalRef.closed.subscribe(isValid => {
|
||||||
|
if (isValid) {
|
||||||
|
// Load the survey
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,11 @@
|
||||||
"ePreguntaAbierta": "Pregunta Abierta",
|
"ePreguntaAbierta": "Pregunta Abierta",
|
||||||
"ePreguntaCerrada": "Pregunta Cerrada",
|
"ePreguntaCerrada": "Pregunta Cerrada",
|
||||||
"categoria": "Categoría",
|
"categoria": "Categoría",
|
||||||
"usuarioExtra": "Correo Usuario"
|
"usuarioExtra": "Correo Usuario",
|
||||||
|
"password": {
|
||||||
|
"title": "Contraseña Requerida",
|
||||||
|
"text": "Esta encuesta es privada, por lo que debe ingresar la contraseña"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,8 @@
|
||||||
"enable": "Habilitar",
|
"enable": "Habilitar",
|
||||||
"disable": "Deshabilitar",
|
"disable": "Deshabilitar",
|
||||||
"toggleStatus": "Cambiar Estado",
|
"toggleStatus": "Cambiar Estado",
|
||||||
"publish": "Publicar"
|
"publish": "Publicar",
|
||||||
|
"submit": "Ingresar"
|
||||||
},
|
},
|
||||||
"detail": {
|
"detail": {
|
||||||
"field": "Campo",
|
"field": "Campo",
|
||||||
|
|
Loading…
Reference in New Issue