Adding 'no records found' when table is empty
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / ei-coordinator / producers-list / producers-list.component.html
1 <!--
2 ========================LICENSE_START=================================
3 O-RAN-SC
4 %%
5 Copyright (C) 2021 Nordix Foundation
6 %%
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ========================LICENSE_END===================================
19 -->
20 <div class="table-container">
21   <mat-table id="producersTable" [dataSource]="producersDataSource" fixedLayout
22     class="ei-coordinator-table mat-elevation-z8" matSort matSortDisableClear matSortDirection="asc"
23     (matSortChange)="sortProducers($event)">
24     <ng-container matColumnDef="id">
25       <mat-header-cell *matHeaderCellDef mat-sort-header>
26         <div (click)="stopSort($event)">
27           <form style="display: flex" [formGroup]="producerForm">
28             <mat-form-field>
29               <input id="producerIdFilter" matInput formControlName="producer_id">
30               <mat-placeholder>Producer ID</mat-placeholder>
31             </mat-form-field>
32           </form>
33         </div>
34       </mat-header-cell>
35       <mat-cell *matCellDef="let producer"> {{producer.producer_id}} </mat-cell>
36     </ng-container>
37
38     <ng-container matColumnDef="types">
39       <mat-header-cell *matHeaderCellDef mat-sort-header>
40         <div (click)="stopSort($event)">
41           <form style="display: flex" [formGroup]="producerForm">
42             <mat-form-field>
43               <input id="producerTypesFilter" matInput formControlName="producer_types">
44               <mat-placeholder>Producer types</mat-placeholder>
45             </mat-form-field>
46           </form>
47         </div>
48       </mat-header-cell>
49       <mat-cell *matCellDef="let producer"> {{this.getProducerTypes(producer)}} </mat-cell>
50     </ng-container>
51
52     <ng-container matColumnDef="status">
53       <mat-header-cell *matHeaderCellDef mat-sort-header>
54         <div (click)="stopSort($event)">
55           <form style="display: flex" [formGroup]="producerForm">
56             <mat-form-field>
57               <input id="producerStatusFilter" matInput formControlName="status">
58               <mat-placeholder>Producer status</mat-placeholder>
59             </mat-form-field>
60           </form>
61         </div>
62       </mat-header-cell>
63       <mat-cell *matCellDef="let producer"> {{this.getProducerStatus(producer)}} </mat-cell>
64     </ng-container>
65
66     <ng-container matColumnDef="noRecordsFound">
67       <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
68     </ng-container>
69
70     <mat-header-row *matHeaderRowDef="['id', 'types', 'status']" [ngClass]="{'display-none': !this.hasProducers()}">
71     </mat-header-row>
72     <mat-row *matRowDef="let row; columns: ['id', 'types', 'status'];"></mat-row>
73
74     <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': this.hasProducers()}">
75     </mat-footer-row>
76
77   </mat-table>
78 </div>