|
6 | 6 | ></app-column-selector> |
7 | 7 |
|
8 | 8 | <div class="mat-elevation-z8"> |
9 | | - <div class="loading-shade" *ngIf="isLoadingResults"> |
| 9 | + <div *ngIf="isLoadingResults" class="loading-shade"> |
10 | 10 | <mat-spinner *ngIf="isLoadingResults"></mat-spinner> |
11 | 11 | </div> |
12 | | - <table mat-table [dataSource]="data" matSort matSortActive="name" matSortDirection="asc" matSortDisableClear> |
| 12 | + <table |
| 13 | + (matSortChange)="announceSortChange($event)" |
| 14 | + [dataSource]="data" |
| 15 | + mat-table |
| 16 | + matSort |
| 17 | + matSortActive="name" |
| 18 | + matSortDirection="asc" |
| 19 | + matSortDisableClear> |
13 | 20 | <ng-template #notSupported> |
14 | 21 | <span>{{ "IOTDEVICE-TABLE-ROW.NOT-SUPPORTED-SHORT" | translate }}</span> |
15 | 22 | </ng-template> |
|
19 | 26 |
|
20 | 27 | <!-- Name Column --> |
21 | 28 | <ng-container matColumnDef="name"> |
22 | | - <th mat-sort-header="name" *matHeaderCellDef mat-header-cell> |
| 29 | + <th *matHeaderCellDef mat-header-cell mat-sort-header="name"> |
23 | 30 | <div [ngClass]="this.sort.active === 'name' ? 'column-title-color' : 'column-title-color-inactive'"> |
24 | 31 | {{ "APPLICATION-TABLE.NAME" | translate }} |
25 | 32 | </div> |
26 | | - <app-table-sort-icon [sortDirection]="getSortDirection('name')" /> |
| 33 | + <app-table-sort-icon [sortDirection]="getSortDirection('name')"/> |
27 | 34 | </th> |
28 | | - <td mat-cell *matCellDef="let iotDevice"> |
29 | | - <a [routerLink]="['../iot-device', iotDevice.id]" routerLinkActive="active" class="device-link">{{ |
30 | | - iotDevice.name |
31 | | - }}</a> |
| 35 | + <td *matCellDef="let iotDevice" mat-cell> |
| 36 | + <a [routerLink]="['../iot-device', iotDevice.id]" class="device-link" routerLinkActive="active">{{ |
| 37 | + iotDevice.name |
| 38 | + }}</a> |
32 | 39 | </td> |
33 | 40 | </ng-container> |
34 | 41 |
|
35 | 42 | <!-- Technology Column --> |
36 | 43 | <ng-container matColumnDef="type"> |
37 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header> |
| 44 | + <th *matHeaderCellDef mat-header-cell mat-sort-header> |
38 | 45 | <div [ngClass]="this.sort.active === 'type' ? 'column-title-color' : 'column-title-color-inactive'"> |
39 | 46 | {{ "IOT-TABLE.NETWORK-TECHNOLOGY" | translate }} |
40 | 47 | </div> |
41 | | - <app-table-sort-icon [sortDirection]="getSortDirection('type')" /> |
| 48 | + <app-table-sort-icon [sortDirection]="getSortDirection('type')"/> |
42 | 49 | </th> |
43 | | - <td mat-cell *matCellDef="let iotDevice">{{ "IOT-DEVICE-TYPES." + iotDevice.type | translate }}</td> |
| 50 | + <td *matCellDef="let iotDevice" mat-cell>{{ "IOT-DEVICE-TYPES." + iotDevice.type | translate }}</td> |
44 | 51 | </ng-container> |
45 | 52 |
|
46 | 53 | <ng-container matColumnDef="commentOnLocation"> |
47 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header> |
| 54 | + <th *matHeaderCellDef mat-header-cell mat-sort-header> |
48 | 55 | <div |
49 | 56 | [ngClass]="this.sort.active === 'commentOnLocation' ? 'column-title-color' : 'column-title-color-inactive'" |
50 | 57 | > |
51 | 58 | {{ "GATEWAY.PLACEMENT-LABEL" | translate }} |
52 | 59 | </div> |
53 | | - <app-table-sort-icon [sortDirection]="getSortDirection('commentOnLocation')" /> |
| 60 | + <app-table-sort-icon [sortDirection]="getSortDirection('commentOnLocation')"/> |
54 | 61 | </th> |
55 | | - <td mat-cell *matCellDef="let iotDevice"> |
| 62 | + <td *matCellDef="let iotDevice" mat-cell> |
56 | 63 | {{ iotDevice.commentOnLocation ? truncateText(iotDevice.commentOnLocation) : "-" }} |
57 | 64 | </td> |
58 | 65 | </ng-container> |
59 | 66 |
|
60 | 67 | <ng-container matColumnDef="deviceModel"> |
61 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header> |
| 68 | + <th *matHeaderCellDef mat-header-cell mat-sort-header> |
62 | 69 | <div [ngClass]="this.sort.active === 'deviceModel' ? 'column-title-color' : 'column-title-color-inactive'"> |
63 | 70 | {{ "IOTDEVICE.DEVICEMODEL" | translate }} |
64 | 71 | </div> |
65 | | - <app-table-sort-icon [sortDirection]="getSortDirection('deviceModel')" /> |
| 72 | + <app-table-sort-icon [sortDirection]="getSortDirection('deviceModel')"/> |
66 | 73 | </th> |
67 | | - <td mat-cell *matCellDef="let iotDevice">{{ iotDevice.deviceModel?.body?.name ?? "-" }}</td> |
| 74 | + <td *matCellDef="let iotDevice" mat-cell>{{ iotDevice.deviceModel?.body?.name ?? "-" }}</td> |
68 | 75 | </ng-container> |
69 | 76 |
|
70 | 77 | <ng-container matColumnDef="deviceProfileName"> |
71 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header> |
| 78 | + <th *matHeaderCellDef mat-header-cell mat-sort-header> |
72 | 79 | <div |
73 | 80 | [ngClass]="this.sort.active === 'deviceProfileName' ? 'column-title-color' : 'column-title-color-inactive'" |
74 | 81 | > |
75 | 82 | {{ "IOTDEVICE.LORA.DEVICEPROFILE" | translate }} |
76 | 83 | </div> |
77 | | - <app-table-sort-icon [sortDirection]="getSortDirection('deviceProfileName')" /> |
| 84 | + <app-table-sort-icon [sortDirection]="getSortDirection('deviceProfileName')"/> |
78 | 85 | </th> |
79 | | - <td mat-cell *matCellDef="let iotDevice">{{ iotDevice.deviceProfileName ?? "-" }}</td> |
| 86 | + <td *matCellDef="let iotDevice" mat-cell>{{ iotDevice.deviceProfileName ?? "-" }}</td> |
80 | 87 | </ng-container> |
81 | 88 |
|
82 | 89 | <ng-container matColumnDef="deviceEUI"> |
83 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header> |
| 90 | + <th *matHeaderCellDef mat-header-cell mat-sort-header> |
84 | 91 | <div [ngClass]="this.sort.active === 'deviceEUI' ? 'column-title-color' : 'column-title-color-inactive'"> |
85 | 92 | {{ "IOT-TABLE.DEV-EUI" | translate }} |
86 | 93 | </div> |
87 | | - <app-table-sort-icon [sortDirection]="getSortDirection('deviceEUI')" /> |
| 94 | + <app-table-sort-icon [sortDirection]="getSortDirection('deviceEUI')"/> |
88 | 95 | </th> |
89 | | - <td mat-cell *matCellDef="let iotDevice">{{ iotDevice.deviceEUI ?? "-" }}</td> |
| 96 | + <td *matCellDef="let iotDevice" mat-cell>{{ iotDevice.deviceEUI ?? "-" }}</td> |
90 | 97 | </ng-container> |
91 | 98 |
|
92 | 99 | <ng-container matColumnDef="OTAAapplicationKey"> |
93 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header> |
| 100 | + <th *matHeaderCellDef mat-header-cell mat-sort-header> |
94 | 101 | <div |
95 | 102 | [ngClass]="this.sort.active === 'OTAAapplicationKey' ? 'column-title-color' : 'column-title-color-inactive'" |
96 | 103 | > |
97 | 104 | {{ "IOT-TABLE.APP-KEY" | translate }} |
98 | 105 | </div> |
99 | | - <app-table-sort-icon [sortDirection]="getSortDirection('OTAAapplicationKey')" /> |
| 106 | + <app-table-sort-icon [sortDirection]="getSortDirection('OTAAapplicationKey')"/> |
100 | 107 | </th> |
101 | | - <td mat-cell *matCellDef="let iotDevice">{{ iotDevice.OTAAapplicationKey ?? "-" }}</td> |
| 108 | + <td *matCellDef="let iotDevice" mat-cell>{{ iotDevice.OTAAapplicationKey ?? "-" }}</td> |
102 | 109 | </ng-container> |
103 | 110 |
|
104 | 111 | <!-- RSSI column --> |
|
107 | 114 | <div [ngClass]="this.sort.active === 'rssi' ? 'column-title-color' : 'column-title-color-inactive'"> |
108 | 115 | {{ "IOT-TABLE.RSSI" | translate }} |
109 | 116 | </div> |
110 | | - <app-table-sort-icon [sortDirection]="getSortDirection('rssi')" /> |
| 117 | + <app-table-sort-icon [sortDirection]="getSortDirection('rssi')"/> |
111 | 118 | </th> |
112 | | - <td mat-cell *matCellDef="let iotDevice"> |
| 119 | + <td *matCellDef="let iotDevice" mat-cell> |
113 | 120 | <ng-container *ngIf="iotDevice.type === 'LORAWAN' || iotDevice.type === 'SIGFOX'; else notSupported"> |
114 | 121 | <div *ngIf="iotDevice.latestReceivedMessage?.rssi; else notAvailable"> |
115 | 122 | {{ iotDevice.latestReceivedMessage.rssi }} |
|
124 | 131 | <div [ngClass]="this.sort.active === 'snr' ? 'column-title-color' : 'column-title-color-inactive'"> |
125 | 132 | {{ "IOT-TABLE.SNR" | translate }} |
126 | 133 | </div> |
127 | | - <app-table-sort-icon [sortDirection]="getSortDirection('snr')" /> |
| 134 | + <app-table-sort-icon [sortDirection]="getSortDirection('snr')"/> |
128 | 135 | </th> |
129 | | - <td mat-cell *matCellDef="let iotDevice"> |
| 136 | + <td *matCellDef="let iotDevice" mat-cell> |
130 | 137 | <ng-container *ngIf="iotDevice.type === 'LORAWAN' || iotDevice.type === 'SIGFOX'; else notSupported"> |
131 | 138 | <div *ngIf="iotDevice.latestReceivedMessage?.snr; else notAvailable"> |
132 | 139 | {{ iotDevice.latestReceivedMessage?.snr }} |
|
136 | 143 | </ng-container> |
137 | 144 |
|
138 | 145 | <ng-container matColumnDef="dataTargets"> |
139 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header> |
| 146 | + <th *matHeaderCellDef mat-header-cell mat-sort-header> |
140 | 147 | <div [ngClass]="this.sort.active === 'dataTargets' ? 'column-title-color' : 'column-title-color-inactive'"> |
141 | 148 | {{ "APPLICATION-TABLE.DATA-TARGETS" | translate }} |
142 | 149 | </div> |
143 | | - <app-table-sort-icon [sortDirection]="getSortDirection('dataTargets')" /> |
| 150 | + <app-table-sort-icon [sortDirection]="getSortDirection('dataTargets')"/> |
144 | 151 | </th> |
145 | | - <td mat-cell *matCellDef="let iotDevice">{{ iotDevice.connections?.length ?? 0 }}</td> |
| 152 | + <td *matCellDef="let iotDevice" mat-cell>{{ iotDevice.connections?.length ?? 0 }}</td> |
146 | 153 | </ng-container> |
147 | 154 |
|
148 | 155 | <!-- Battery Column --> |
149 | 156 | <ng-container matColumnDef="battery"> |
150 | 157 | <th *matHeaderCellDef mat-header-cell> |
151 | 158 | {{ "IOT-TABLE.BATTERY" | translate }} |
152 | 159 | </th> |
153 | | - <td mat-cell *matCellDef="let iotDevice"> |
| 160 | + <td *matCellDef="let iotDevice" mat-cell> |
154 | 161 | <div *ngIf="iotDevice.type === 'LORAWAN'; else noBatteryStatus"> |
155 | 162 | <app-batteri-status [color]="batteryStatusColor" [percentage]="getBatteryProcentage(iotDevice)"> |
156 | 163 | </app-batteri-status> |
|
165 | 172 |
|
166 | 173 | <!-- Active Column --> |
167 | 174 | <ng-container matColumnDef="active"> |
168 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header="active"> |
| 175 | + <th *matHeaderCellDef mat-header-cell mat-sort-header="active"> |
169 | 176 | <div [ngClass]="this.sort.active === 'active' ? 'column-title-color' : 'column-title-color-inactive'"> |
170 | 177 | {{ "IOT-TABLE.ACTIVE" | translate }} |
171 | 178 | </div> |
172 | | - <app-table-sort-icon [sortDirection]="getSortDirection('active')" /> |
| 179 | + <app-table-sort-icon [sortDirection]="getSortDirection('active')"/> |
173 | 180 | </th> |
174 | | - <td mat-cell *matCellDef="let iotDevice">{{ lastActive(iotDevice) }}</td> |
| 181 | + <td *matCellDef="let iotDevice" mat-cell>{{ lastActive(iotDevice) }}</td> |
175 | 182 | </ng-container> |
176 | 183 |
|
177 | 184 | <ng-container matColumnDef="menu"> |
178 | | - <th mat-header-cell *matHeaderCellDef></th> |
179 | | - <td mat-cell *matCellDef="let iotDevice"> |
180 | | - <div class="dropdown" *ngIf="canEdit"> |
| 185 | + <th *matHeaderCellDef mat-header-cell></th> |
| 186 | + <td *matCellDef="let iotDevice" mat-cell> |
| 187 | + <div *ngIf="canEdit" class="dropdown"> |
181 | 188 | <a |
182 | | - href="#" |
183 | | - role="button" |
184 | | - id="tableRowDropdown-{{ iotDevice.id }}" |
| 189 | + [attr.aria-label]="'APPLICATION-TABLE-ROW.SHOW-OPTIONS' | translate" |
| 190 | + aria-expanded="false" |
185 | 191 | class="applicationRow__edit dropdown-toggle" |
186 | 192 | data-toggle="dropdown" |
187 | | - aria-expanded="false" |
188 | | - [attr.aria-label]="'APPLICATION-TABLE-ROW.SHOW-OPTIONS' | translate" |
| 193 | + href="#" |
| 194 | + id="tableRowDropdown-{{ iotDevice.id }}" |
| 195 | + role="button" |
189 | 196 | ></a> |
190 | | - <ul class="dropdown-menu dropdown-menu--table" attr.aria-labelledby="tableRowDropdown-{{ iotDevice.id }}"> |
| 197 | + <ul attr.aria-labelledby="tableRowDropdown-{{ iotDevice.id }}" class="dropdown-menu dropdown-menu--table"> |
191 | 198 | <li class="dropdown-item"> |
192 | 199 | <a [routerLink]="['../iot-device-edit', iotDevice.id]" routerLinkActive="active" |
193 | | - >{{ "IOTDEVICE-TABLE-ROW.EDIT" | translate }} |
| 200 | + >{{ "IOTDEVICE-TABLE-ROW.EDIT" | translate }} |
194 | 201 | </a> |
195 | 202 | </li> |
196 | | - <li class="dropdown-item" *ngIf="iotDevice.type !== deviceTypes.SIGFOX"> |
| 203 | + <li *ngIf="iotDevice.type !== deviceTypes.SIGFOX" class="dropdown-item"> |
197 | 204 | <a (click)="onOpenChangeApplicationDialog(iotDevice.id)" routerLinkActive="active">{{ |
198 | | - "IOTDEVICE.CHANGE-APPLICATION.TITLE" | translate |
199 | | - }}</a> |
| 205 | + "IOTDEVICE.CHANGE-APPLICATION.TITLE" | translate |
| 206 | + }}</a> |
200 | 207 | </li> |
201 | 208 | <li class="dropdown-item"> |
202 | 209 | <a (click)="clickDelete(iotDevice)" [routerLink]="[]">{{ "IOTDEVICE-TABLE-ROW.DELETE" | translate }}</a> |
|
206 | 213 | </td> |
207 | 214 | </ng-container> |
208 | 215 |
|
209 | | - <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
210 | | - <tr mat-row *matRowDef="let row; columns: displayedColumns"></tr> |
| 216 | + <tr *matHeaderRowDef="displayedColumns" mat-header-row></tr> |
| 217 | + <tr *matRowDef="let row; columns: displayedColumns" mat-row></tr> |
211 | 218 | </table> |
212 | 219 | <mat-paginator |
| 220 | + [length]="resultsLength" |
213 | 221 | [pageSizeOptions]="pageSizeOptions" |
214 | 222 | [pageSize]="pageSize" |
215 | | - [length]="resultsLength" |
216 | 223 | showFirstLastButtons |
217 | 224 | > |
218 | 225 | </mat-paginator> |
|
0 commit comments