|
| 1 | +<div class="select-container"> |
| 2 | + <mat-select |
| 3 | + class="form-control table-select" |
| 4 | + multiple="true" |
| 5 | + [(value)]="optionalColumnsSelected" |
| 6 | + (selectionChange)="handleColumnSelection($event)" |
| 7 | + panelClass="tall" |
| 8 | + > |
| 9 | + <mat-option disabled> |
| 10 | + <button |
| 11 | + mat-raised-button |
| 12 | + class="mat-primary fill text-sm" |
| 13 | + (click)="selectAll()"> |
| 14 | + {{'QUESTION.DATATARGET.SELECTALLDEVICES' | translate}} |
| 15 | + </button> |
| 16 | + <button |
| 17 | + mat-raised-button |
| 18 | + class="mat-primary fill text-sm" |
| 19 | + (click)="deSelectAll()"> |
| 20 | + {{'QUESTION.DATATARGET.DESELECTALLDEVICES' | translate}} |
| 21 | + </button> |
| 22 | + </mat-option> |
| 23 | + <mat-option *ngFor="let option of optionalColumnOptions" [value]="option.id"> |
| 24 | + {{option.display | translate}} |
| 25 | + </mat-option> |
| 26 | + </mat-select> |
| 27 | +</div> |
| 28 | + |
1 | 29 | <div class="mat-elevation-z8"> |
2 | 30 | <div class="loading-shade" *ngIf="isLoadingResults"> |
3 | 31 | <mat-spinner *ngIf="isLoadingResults"></mat-spinner> |
|
8 | 36 | </div> |
9 | 37 |
|
10 | 38 | <table mat-table [dataSource]="data" class="example-table" matSort matSortActive="name" matSortDisableClear |
11 | | - matSortDirection="asc"> |
| 39 | + matSortDirection="asc"> |
12 | 40 |
|
13 | 41 | <!-- Name Column --> |
14 | 42 | <ng-container matColumnDef="name"> |
15 | | - <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-6"> |
| 43 | + <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-2"> |
16 | 44 | {{ 'APPLICATION-TABLE.NAME' | translate }} |
17 | 45 | </th> |
18 | 46 | <td mat-cell *matCellDef="let element"> |
19 | 47 | <a [routerLink]="['/applications', element.id]" routerLinkActive="active" |
20 | | - class="application-link">{{element.name}}</a> |
| 48 | + class="application-link">{{element.name}}</a> |
| 49 | + </td> |
| 50 | + </ng-container> |
| 51 | + |
| 52 | + <ng-container matColumnDef="owner"> |
| 53 | + <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-1"> |
| 54 | + {{'APPLICATION-TABLE.OWNER' | translate}} |
| 55 | + </th> |
| 56 | + <td mat-cell *matCellDef="let application"> |
| 57 | + {{application.owner ?? '-'}} |
| 58 | + </td> |
| 59 | + </ng-container> |
| 60 | + |
| 61 | + <ng-container matColumnDef="contactPerson"> |
| 62 | + <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-1"> |
| 63 | + {{'APPLICATION-TABLE.CONTACT-PERSON' | translate}} |
| 64 | + </th> |
| 65 | + <td mat-cell *matCellDef="let application"> |
| 66 | + {{application.contactPerson ?? '-'}} |
21 | 67 | </td> |
22 | 68 | </ng-container> |
23 | 69 |
|
|
26 | 72 | <th mat-header-cell *matHeaderCellDef class="col-2"> |
27 | 73 | {{ 'APPLICATION-TABLE.IOT-DEVICES' | translate }}</th> |
28 | 74 | <td mat-cell *matCellDef="let element"> |
29 | | - {{element ?.iotDevices?.length ? element?.iotDevices?.length : 0}} |
| 75 | + {{element?.iotDevices?.length ?? 0}} |
| 76 | + </td> |
| 77 | + </ng-container> |
| 78 | + |
| 79 | + <ng-container matColumnDef="dataTargets"> |
| 80 | + <th mat-header-cell *matHeaderCellDef class="col-1"> |
| 81 | + {{ 'APPLICATION-TABLE.DATA-TARGETS' | translate}} |
| 82 | + </th> |
| 83 | + <td mat-cell *matCellDef="let application"> |
| 84 | + {{application?.dataTargets?.length ?? 0}} |
| 85 | + </td> |
| 86 | + </ng-container> |
| 87 | + |
| 88 | + <ng-container matColumnDef="openDataDkEnabled"> |
| 89 | + <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-1"> |
| 90 | + {{ 'APPLICATION-TABLE.OPEN-DATA-DK' | translate }} |
| 91 | + </th> |
| 92 | + <td mat-cell *matCellDef="let application"> |
| 93 | + {{isOpenDataDK(application.dataTargets) | yesNo}} |
| 94 | + </td> |
| 95 | + </ng-container> |
| 96 | + |
| 97 | + <ng-container matColumnDef="status"> |
| 98 | + <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-1"> |
| 99 | + {{'APPLICATION-TABLE.STATUS' | translate}} |
| 100 | + </th> |
| 101 | + <td mat-cell *matCellDef="let application"> |
| 102 | + {{'APPLICATION.STATUS.' + application.status | translate}} |
| 103 | + </td> |
| 104 | + </ng-container> |
| 105 | + |
| 106 | + <ng-container matColumnDef="personalData"> |
| 107 | + <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-1"> |
| 108 | + {{'APPLICATION-TABLE.PERSONAL-DATA' | translate}} |
| 109 | + </th> |
| 110 | + <td mat-cell *matCellDef="let application"> |
| 111 | + <fa-icon *ngIf="application.personalData" [icon]="faFlagIcon" class="flag-icon"></fa-icon> |
| 112 | + {{!application.personalData ? '-' : ''}} |
| 113 | + </td> |
| 114 | + </ng-container> |
| 115 | + |
| 116 | + <ng-container matColumnDef="startDate"> |
| 117 | + <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-1"> |
| 118 | + {{'APPLICATION-TABLE.START-DATE' | translate}} |
| 119 | + </th> |
| 120 | + <td mat-cell *matCellDef="let application"> |
| 121 | + {{(application.startDate | dateOnly) ?? '-'}} |
| 122 | + </td> |
| 123 | + </ng-container> |
| 124 | + |
| 125 | + <ng-container matColumnDef="endDate"> |
| 126 | + <th mat-header-cell *matHeaderCellDef mat-sort-header class="col-1"> |
| 127 | + {{'APPLICATION-TABLE.END-DATE' | translate}} |
| 128 | + </th> |
| 129 | + <td mat-cell *matCellDef="let application"> |
| 130 | + {{(application.endDate | dateOnly) ?? '-'}} |
| 131 | + </td> |
| 132 | + </ng-container> |
| 133 | + |
| 134 | + <ng-container matColumnDef="category"> |
| 135 | + <th mat-header-cell *matHeaderCellDef class="col-1"> |
| 136 | + {{'APPLICATION-TABLE.CATEGORY' | translate}} |
| 137 | + </th> |
| 138 | + <td mat-cell *matCellDef="let application"> |
| 139 | + {{application.category ?? '-'}} |
| 140 | + </td> |
| 141 | + </ng-container> |
| 142 | + |
| 143 | + <ng-container matColumnDef="controlledProperties"> |
| 144 | + <th mat-header-cell *matHeaderCellDef class="col-1"> |
| 145 | + {{'APPLICATION-TABLE.CONTROLLED-PROPERTIES' | translate}} |
| 146 | + </th> |
| 147 | + <td mat-cell *matCellDef="let application"> |
| 148 | + {{mapControlledProperties(application.controlledProperties) ?? '-'}} |
| 149 | + </td> |
| 150 | + </ng-container> |
| 151 | + |
| 152 | + <ng-container matColumnDef="deviceTypes"> |
| 153 | + <th mat-header-cell *matHeaderCellDef class="col-1"> |
| 154 | + {{'APPLICATION-TABLE.DEVICE-TYPES' | translate}} |
| 155 | + </th> |
| 156 | + <td mat-cell *matCellDef="let application"> |
| 157 | + {{mapDeviceTypes(application.deviceTypes) ?? '-'}} |
30 | 158 | </td> |
31 | 159 | </ng-container> |
32 | 160 |
|
|
36 | 164 | <td mat-cell *matCellDef="let element"> |
37 | 165 | <div class="dropdown" *ngIf="element?.id | canEditApplication"> |
38 | 166 | <a href="#" role="button" id="tableRowDropdown-{{element.id}}" class="applicationRow__edit dropdown-toggle" |
39 | | - data-toggle="dropdown" aria-expanded="false" |
40 | | - [attr.aria-label]="'APPLICATION-TABLE-ROW.SHOW-OPTIONS' | translate"></a> |
| 167 | + data-toggle="dropdown" aria-expanded="false" |
| 168 | + [attr.aria-label]="'APPLICATION-TABLE-ROW.SHOW-OPTIONS' | translate"></a> |
41 | 169 | <ul class="dropdown-menu dropdown-menu--table" attr.aria-labelledby="tableRowDropdown-{{element.id}}"> |
42 | 170 | <li class="dropdown-item"> |
43 | 171 | <a (click)="navigateToEditPage(element.id)" |
44 | | - routerLinkActive="active">{{ 'APPLICATION-TABLE-ROW.EDIT' | translate }}</a> |
| 172 | + routerLinkActive="active">{{ 'APPLICATION-TABLE-ROW.EDIT' | translate }}</a> |
45 | 173 | </li> |
46 | 174 | <li class="dropdown-item"> |
47 | 175 | <a (click)="deleteApplication(element.id)" |
48 | | - [routerLink]="[]">{{ 'APPLICATION-TABLE-ROW.DELETE' | translate }}</a> |
| 176 | + [routerLink]="[]">{{ 'APPLICATION-TABLE-ROW.DELETE' | translate }}</a> |
49 | 177 | </li> |
50 | 178 | </ul> |
51 | 179 | </div> |
52 | 180 | </td> |
53 | 181 | </ng-container> |
| 182 | + |
54 | 183 | <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
55 | 184 | <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
56 | 185 | </table> |
57 | 186 | </div> |
58 | 187 |
|
59 | | - <mat-paginator [length]="resultsLength" [pageSizeOptions]="pageSizeOptions" [pageSize]="pageSize" showFirstLastButtons> |
| 188 | + <mat-paginator [length]="resultsLength" [pageSizeOptions]="pageSizeOptions" [pageSize]="pageSize" |
| 189 | + showFirstLastButtons> |
60 | 190 | </mat-paginator> |
61 | 191 | </div> |
0 commit comments