add filtro de encuesta por nombre
This commit is contained in:
parent
c905854300
commit
8e22d769f6
|
@ -34,6 +34,13 @@
|
|||
<div class="alert alert-warning" id="no-result" *ngIf="encuestas?.length === 0">
|
||||
<span jhiTranslate="dataSurveyApp.encuesta.home.notFound">No encuestas found</span>
|
||||
</div>
|
||||
<div class="table-responsive" id="entities" *ngIf="encuestas && encuestas.length > 0">
|
||||
<form class="ds-form">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
|
||||
<input type="text" name="searchEncuesta" placeholder="Buscar..." [(ngModel)]="searchEncuesta" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Lista de Encuestas del Usuario -->
|
||||
<div class="ds-list" (contextmenu)="openContextMenu($event)">
|
||||
|
@ -58,7 +65,9 @@
|
|||
<button type="button" id="contextmenu-edit"><fa-icon class="contextmenu__icon" [icon]="faEdit"></fa-icon>Editar</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="contextmenu-duplicate"><fa-icon class="contextmenu__icon" [icon]="faCopy"></fa-icon>Duplicar</button>
|
||||
<button type="button" id="contextmenu-duplicate">
|
||||
<fa-icon class="contextmenu__icon" [icon]="faCopy"></fa-icon>Duplicar
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="contextmenu-rename">
|
||||
|
@ -66,7 +75,9 @@
|
|||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" id="contextmenu-share"><fa-icon class="contextmenu__icon" [icon]="faShareAlt"></fa-icon>Compartir</button>
|
||||
<button type="button" id="contextmenu-share">
|
||||
<fa-icon class="contextmenu__icon" [icon]="faShareAlt"></fa-icon>Compartir
|
||||
</button>
|
||||
</li>
|
||||
</div>
|
||||
<div class="ds-contextmenu__divider" id="contextmenu-delete--separator">
|
||||
|
@ -79,7 +90,7 @@
|
|||
|
||||
<div
|
||||
class="ds-list--entity"
|
||||
*ngFor="let encuesta of encuestas; trackBy: trackId"
|
||||
*ngFor="let encuesta of encuestas | filter: 'nombre':searchEncuesta; trackBy: trackId"
|
||||
(dblclick)="openSurvey($event)"
|
||||
(click)="selectSurvey($event)"
|
||||
[attr.data-id]="encuesta.id"
|
||||
|
@ -89,28 +100,44 @@
|
|||
<div
|
||||
class="entity-state"
|
||||
[ngClass]="
|
||||
encuesta.estado == 'DRAFT' ? 'entity-state--blue' : encuesta.estado == 'ACTIVE' ? 'entity-state--green' : 'entity-state--red'
|
||||
encuesta.estado == 'DRAFT'
|
||||
? 'entity-state--blue'
|
||||
: encuesta.estado == 'ACTIVE'
|
||||
? 'entity-state--green'
|
||||
: 'entity-state--red'
|
||||
"
|
||||
style="animation-delay: 0s"
|
||||
></div>
|
||||
<div
|
||||
class="entity-state"
|
||||
[ngClass]="
|
||||
encuesta.estado == 'DRAFT' ? 'entity-state--blue' : encuesta.estado == 'ACTIVE' ? 'entity-state--green' : 'entity-state--red'
|
||||
encuesta.estado == 'DRAFT'
|
||||
? 'entity-state--blue'
|
||||
: encuesta.estado == 'ACTIVE'
|
||||
? 'entity-state--green'
|
||||
: 'entity-state--red'
|
||||
"
|
||||
style="animation-delay: 1s"
|
||||
></div>
|
||||
<div
|
||||
class="entity-state entity-state--blue"
|
||||
[ngClass]="
|
||||
encuesta.estado == 'DRAFT' ? 'entity-state--blue' : encuesta.estado == 'ACTIVE' ? 'entity-state--green' : 'entity-state--red'
|
||||
encuesta.estado == 'DRAFT'
|
||||
? 'entity-state--blue'
|
||||
: encuesta.estado == 'ACTIVE'
|
||||
? 'entity-state--green'
|
||||
: 'entity-state--red'
|
||||
"
|
||||
style="animation-delay: 2s"
|
||||
></div>
|
||||
<div
|
||||
class="entity-state entity-state--blue"
|
||||
[ngClass]="
|
||||
encuesta.estado == 'DRAFT' ? 'entity-state--blue' : encuesta.estado == 'ACTIVE' ? 'entity-state--green' : 'entity-state--red'
|
||||
encuesta.estado == 'DRAFT'
|
||||
? 'entity-state--blue'
|
||||
: encuesta.estado == 'ACTIVE'
|
||||
? 'entity-state--green'
|
||||
: 'entity-state--red'
|
||||
"
|
||||
style="animation-delay: 3s"
|
||||
></div>
|
||||
|
@ -203,6 +230,7 @@
|
|||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="table-responsive" id="entities" *ngIf="encuestas && encuestas.length > 0">
|
||||
|
|
|
@ -66,6 +66,8 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
categoriasSharedCollection: ICategoria[] = [];
|
||||
usuarioExtrasSharedCollection: IUsuarioExtra[] = [];
|
||||
|
||||
public searchEncuesta: string;
|
||||
|
||||
editForm = this.fb.group({
|
||||
id: [],
|
||||
nombre: [null, [Validators.required, Validators.minLength(1), Validators.maxLength(50)]],
|
||||
|
@ -93,7 +95,9 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
protected fb: FormBuilder,
|
||||
protected accountService: AccountService,
|
||||
protected router: Router
|
||||
) {}
|
||||
) {
|
||||
this.searchEncuesta = '';
|
||||
}
|
||||
|
||||
resetForm(): void {
|
||||
this.editForm.reset();
|
||||
|
@ -115,6 +119,7 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
|
|||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.searchEncuesta = '';
|
||||
document.body.addEventListener('click', e => {
|
||||
document.getElementById('contextmenu')!.classList.add('ds-contextmenu--closed');
|
||||
document.getElementById('contextmenu')!.classList.remove('ds-contextmenu--open');
|
||||
|
|
Loading…
Reference in New Issue