mostrar encuestas en tabla para admin

This commit is contained in:
Eduardo Quiros 2021-07-23 19:25:38 -06:00
parent 593905bf01
commit c5bead0483
No known key found for this signature in database
GPG Key ID: B77F36C3F12720B4
2 changed files with 83 additions and 79 deletions

View File

@ -36,7 +36,7 @@
</div>
<!-- Lista de Encuestas del Usuario -->
<div class="ds-list" (contextmenu)="openContextMenu($event)">
<div class="ds-list" (contextmenu)="openContextMenu($event)" *ngIf="!isAdmin">
<!-- Context Menu -->
<div class="ds-contextmenu ds-contextmenu--closed" id="contextmenu">
<ul id="ds-context-menu__list">
@ -205,7 +205,7 @@
</div>
</div>
<!-- <div class="table-responsive" id="entities" *ngIf="encuestas && encuestas.length > 0">
<div class="table-responsive" id="entities" *ngIf="isAdmin && encuestas && encuestas.length > 0">
<table class="table table-striped" aria-describedby="page-heading">
<thead>
<tr>
@ -281,7 +281,7 @@
</tr>
</tbody>
</table>
</div> -->
</div>
<!-- --------------------------------------------------------------------------------------------- -->
@ -415,7 +415,7 @@
<!-- ------------------------------------------------------------------------------------------------- -->
<!-- <div class="row justify-content-center">
<!-- <div ngIf class="row justify-content-center">
<div class="col-8">
<form name="editForm" role="form" novalidate (ngSubmit)="save()" [formGroup]="editForm">
<h2 id="jhi-encuesta-heading" data-cy="EncuestaCreateUpdateHeading" jhiTranslate="dataSurveyApp.encuesta.home.createOrEditLabel">

View File

@ -106,7 +106,11 @@ export class EncuestaComponent implements OnInit, AfterViewInit {
(res: HttpResponse<IEncuesta[]>) => {
this.isLoading = false;
const tmpEncuestas = res.body ?? [];
if (this.isAdmin()) {
this.encuestas = tmpEncuestas;
} else {
this.encuestas = tmpEncuestas.filter(e => e.usuarioExtra?.id === this.usuarioExtra?.id);
}
},
() => {
this.isLoading = false;