Add datatable step when exist entity datatable checks (#1633)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-01-05 11:58:16 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent cafe8fa73d
commit 3a3d96222e
14 changed files with 70 additions and 191 deletions
@@ -13,7 +13,7 @@ import { ClientsService } from '../../clients.service';
export class DocumentsTabComponent implements OnInit {
entityDocuments: any;
entityId: string;
entityType: string = 'clients';
entityType = 'clients';
constructor(private route: ActivatedRoute,
private clientsService: ClientsService,
+14 -14
View File
@@ -22,24 +22,24 @@
</div>
</div>
<div *ngIf="existsClientsToFilter">
<div [hidden]="!existsClientsToFilter">
<table mat-table [dataSource]="dataSource" matSort>
<!-- Name Column -->
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header="entityName"> Name </th>
<ng-container matColumnDef="entityName">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
<td mat-cell *matCellDef="let row"> {{row.entityName}} </td>
</ng-container>
<!-- Account no Column -->
<ng-container matColumnDef="clientNo">
<th mat-header-cell *matHeaderCellDef mat-sort-header="entityAccountNo"> Account No. </th>
<ng-container matColumnDef="entityAccountNo">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Account No. </th>
<td mat-cell *matCellDef="let row"> {{row.entityAccountNo}} </td>
</ng-container>
<!-- External ID Column -->
<ng-container matColumnDef="externalId">
<th mat-header-cell *matHeaderCellDef mat-sort-header="entityExternalId"> External Id </th>
<ng-container matColumnDef="entityExternalId">
<th mat-header-cell *matHeaderCellDef mat-sort-header> External Id </th>
<td mat-cell *matCellDef="let row">
<mifosx-external-identifier externalId="{{row.entityExternalId}}"></mifosx-external-identifier>
</td>
@@ -47,7 +47,7 @@
<!-- Status Column -->
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef mat-sort-header="entityStatus.value"> Status </th>
<th mat-header-cell *matHeaderCellDef> Status </th>
<td mat-cell *matCellDef="let row">
<div [ngClass]="row.entityStatus.code | statusLookup">
<fa-icon icon="stop"></fa-icon>
@@ -59,14 +59,14 @@
</ng-container>
<!-- Color Column -->
<ng-container matColumnDef="office">
<th mat-header-cell *matHeaderCellDef mat-sort-header="officeName"> Office Name </th>
<ng-container matColumnDef="parentName">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Office Name </th>
<td mat-cell *matCellDef="let row"> {{row.parentName}} </td>
</ng-container>
<!-- ID Column -->
<ng-container matColumnDef="staff">
<th mat-header-cell *matHeaderCellDef mat-sort-header="staffName"> Staff Name </th>
<ng-container matColumnDef="staffName">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Staff Name </th>
<td mat-cell *matCellDef="let row"> {{row.staffName}} </td>
</ng-container>
@@ -75,11 +75,11 @@
</tr>
</table>
<mat-paginator *ngIf="moreClientsToFilter" [pageSize]="50" [pageSizeOptions]="[10, 25, 50, 100]"
<mat-paginator [hidden]="!moreClientsToFilter" [pageSize]="50" [pageSizeOptions]="[50, 100]"
showFirstLastButtons></mat-paginator>
</div>
<div class="alert" *ngIf="notExistsClientsToFilter">
<div class="alert" [hidden]="!notExistsClientsToFilter">
<div class="message">
<i class="fa fa-exclamation-circle alert-check"></i>
No client was found
+3 -1
View File
@@ -17,7 +17,7 @@ import { environment } from 'environments/environment';
export class ClientsComponent implements OnInit {
@ViewChild('showClosedAccounts', { static: true }) showClosedAccounts: MatCheckbox;
displayedColumns = ['name', 'clientNo', 'externalId', 'status', 'office', 'staff'];
displayedColumns = ['entityName', 'entityAccountNo', 'entityExternalId', 'status', 'parentName', 'staffName'];
dataSource: MatTableDataSource<any>;
existsClientsToFilter = false;
@@ -55,6 +55,8 @@ export class ClientsComponent implements OnInit {
private getClients(value: string) {
this.searchService.getSearchResults(value, 'clients').subscribe((data: any) => {
this.dataSource = new MatTableDataSource(data);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.existsClientsToFilter = (data.length > 0);
this.notExistsClientsToFilter = !this.existsClientsToFilter;
this.moreClientsToFilter = (data.length > 50);