Skip to content
This repository has been archived by the owner on Jun 25, 2022. It is now read-only.

Commit

Permalink
feat(front-end): Show client state in clients table
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosPavajeau committed Mar 19, 2021
1 parent b7ac44a commit e5507f2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,16 @@ <h1>Clientes registrados</h1>
{{ client.firstPhoneNumber }}
</td>
</ng-container>
<ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef>Estado</th>
<td mat-cell *matCellDef="let client">
<mat-chip-list>
<mat-chip [class]="'client-state-' + client?.state">
{{ client.state | clientState }}
</mat-chip>
</mat-chip-list>
</td>
</ng-container>
<ng-container matColumnDef="options">
<th mat-header-cell *matHeaderCellDef>Opciones</th>
<td mat-cell *matCellDef="let client">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.client-state-0 {
color: white;
background: var(--sizzling_sunrise);
}

.client-state-2 {
color: white;
background: var(--vivid_red);
}

.client-state-3, .client-state-1 {
color: white;
background: var(--forest-green-web);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ClientsComponent implements OnInit, AfterViewInit {
clients$: Observable<Client[]>;

dataSource: MatTableDataSource<Client> = new MatTableDataSource<Client>(this.clients);
displayedColumns: string[] = [ 'id', 'name', 'clientType', 'phonenumber', 'options' ];
displayedColumns: string[] = [ 'id', 'name', 'clientType', 'phonenumber', 'state', 'options' ];

@ViewChild(MatPaginator, { static: true })
paginator: MatPaginator;
Expand Down

0 comments on commit e5507f2

Please sign in to comment.