Skip to content

Commit 6b08b20

Browse files
Merge branch 'stage' into feature/IoT-1500_GatewayAlarms
2 parents 82d5568 + 6d8cd1f commit 6b08b20

File tree

13 files changed

+80
-41
lines changed

13 files changed

+80
-41
lines changed

src/app/admin/permission/permission-edit/permission-edit.component.html

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
[compareWith]="compare"
7070
#multiSelect
7171
>
72-
<app-mat-select-search [formControl]="userMultiFilterCtrl"></app-mat-select-search>
72+
<app-mat-select-search
73+
[initialValues]="this.permission.userIds"
74+
[formControl]="userMultiFilterCtrl"
75+
></app-mat-select-search>
7376
<mat-option *ngFor="let user of filteredUsersMulti | async" [value]="user.id">
7477
{{ getTextForUser(user) }}
7578
</mat-option>
@@ -102,25 +105,28 @@
102105
</div>
103106

104107
<div class="form-group mt-3 col-12" *ngIf="isOrganizationApplicationPermission()">
105-
<label class="form-label" for="name">{{ "PERMISSION.EDIT.APPS" | translate }}</label>
106-
<div class="col-12">
107-
<mat-select
108-
id="applicationIds"
109-
[formControl]="applicationMultiCtrl"
110-
[multiple]="true"
111-
class="form-control"
112-
panelClass="overflow-x-hidden"
113-
[(value)]="permission.applicationIds"
114-
name="applicationIds"
115-
#multiSelect
116-
[compareWith]="compare"
117-
>
118-
<app-mat-select-search [formControl]="applicationMultiFilterCtrl"></app-mat-select-search>
119-
<mat-option *ngFor="let app of filteredApplicationsMulti | async" [value]="app.id">
120-
{{ app.name }}
121-
</mat-option>
122-
</mat-select>
123-
</div>
108+
<label class="form-label" for="name">{{ "PERMISSION.EDIT.APPS" | translate }}</label>
109+
<div class="col-12">
110+
<mat-select
111+
id="applicationIds"
112+
[formControl]="applicationMultiCtrl"
113+
[multiple]="true"
114+
class="form-control"
115+
panelClass="overflow-x-hidden"
116+
[(value)]="permission.applicationIds"
117+
name="applicationIds"
118+
#multiSelect
119+
[compareWith]="compare"
120+
>
121+
<app-mat-select-search
122+
[initialValues]="this.permission.applicationIds"
123+
[formControl]="applicationMultiFilterCtrl"
124+
></app-mat-select-search>
125+
<mat-option *ngFor="let app of filteredApplicationsMulti | async" [value]="app.id">
126+
{{ app.name }}
127+
</mat-option>
128+
</mat-select>
129+
</div>
124130
</div>
125131

126132
<div *ngIf="isReadOrWrite()">

src/app/admin/users/new-kombit-user-page/new-user.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ <h1>
5050
panelClass="overflow-x-hidden"
5151
aria-required="true"
5252
>
53-
<app-mat-select-search [formControl]="organisationsFilterCtrl"></app-mat-select-search>
53+
<app-mat-select-search
54+
[formControl]="organisationsFilterCtrl"
55+
></app-mat-select-search>
5456

5557
<mat-option *ngFor="let org of filteredOrganisations | async" [value]="org">{{ org.name }}</mat-option>
5658
</mat-select>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.mat-mdc-dialog-title {
2+
padding-left: 20px;
3+
}
4+
.mat-mdc-dialog-content {
5+
padding-left: 20px !important;
6+
}
7+
.mat-mdc-dialog-actions {
8+
padding-left: 20px !important;
9+
gap: 8px;
10+
}
11+
.mat-mdc-button {
12+
margin-left: 0px !important;
13+
}

src/app/applications/iot-devices/iot-device-detail/downlink/downlink-tables/downlink-tables.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h3 class="headerStyle">{{ "IOTDEVICE.DOWNLINK.DOWNLINKQUEUE" | translate }}</h3
1111
{{ "IOTDEVICE.CREATED" | translate }}
1212
</th>
1313
<td mat-cell *matCellDef="let element">
14-
{{ element.createdAt | dkTimeWithSeconds }}
14+
{{ element.createdAt | dkTimeWithSecondsNoPrefix }}
1515
</td>
1616
</ng-container>
1717

@@ -67,7 +67,7 @@ <h3 class="headerStyle">{{ "IOTDEVICE.DOWNLINK.HISTORICQUEUE" | translate }}</h3
6767
{{ "IOTDEVICE.CREATED" | translate }}
6868
</th>
6969
<td mat-cell *matCellDef="let element">
70-
{{ element.createdAt | dkTimeWithSeconds }}
70+
{{ element.createdAt | dkTimeWithSecondsNoPrefix }}
7171
</td>
7272
</ng-container>
7373

@@ -77,7 +77,7 @@ <h3 class="headerStyle">{{ "IOTDEVICE.DOWNLINK.HISTORICQUEUE" | translate }}</h3
7777
{{ "IOTDEVICE.DOWNLINK.SENDAT" | translate }}
7878
</th>
7979
<td mat-cell *matCellDef="let element">
80-
{{ element.sendAt | dkTimeWithSeconds }}
80+
{{ element.sendAt | dkTimeWithSecondsNoPrefix }}
8181
</td>
8282
</ng-container>
8383

@@ -87,7 +87,7 @@ <h3 class="headerStyle">{{ "IOTDEVICE.DOWNLINK.HISTORICQUEUE" | translate }}</h3
8787
<td mat-cell *matCellDef="let element">
8888
{{
8989
element.acknowledgedAt
90-
? (element.acknowledgedAt | dkTimeWithSeconds)
90+
? (element.acknowledgedAt | dkTimeWithSecondsNoPrefix)
9191
: ("IOTDEVICE.DOWNLINK.NOT-RECEIVED" | translate)
9292
}}
9393
</td>

src/app/applications/iot-devices/iot-device-detail/downlink/downlink-tables/downlink-tables.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { MatDialog } from "@angular/material/dialog";
44
import { MatSnackBar } from "@angular/material/snack-bar";
55
import { IotDevice } from "@applications/iot-devices/iot-device.model";
66
import { TranslateService } from "@ngx-translate/core";
7-
import { DeviceType } from "@shared/enums/device-type";
87
import { ErrorMessageService } from "@shared/error-message.service";
98
import { DownlinkService } from "@shared/services/downlink.service";
109
import { DownlinkDialogComponent } from "../downlink-dialog/downlink-dialog.component";
@@ -90,7 +89,10 @@ export class DownlinkTablesComponent implements OnInit {
9089
}
9190

9291
openDownlinkDialog() {
93-
const dialog = this.dialog.open(DownlinkDialogComponent, {});
92+
const dialog = this.dialog.open(DownlinkDialogComponent, {
93+
width: "300px",
94+
height: "200px",
95+
});
9496

9597
dialog.afterClosed().subscribe(result => {
9698
if (result === true) {

src/app/applications/iot-devices/iot-device-detail/downlink/downlinks/downlink.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="jumbotron jumbotron--full-width">
2-
<div *ngIf="device.type === 'LORAWAN' || device.type === 'SIGFOX'; else notImplemented" class="my-2 mx-3">
2+
<div *ngIf="device.type === 'LORAWAN' || device.type === 'SIGFOX'; else notImplemented">
33
<div *ngIf="errorMessages && errorMessages?.length !== 0" class="error-messages p-3">
44
<ul class="mb-0">
55
<li *ngFor="let error of errorMessages">

src/app/gateway/gateway-table/gateway-table.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
</ng-container>
174174

175175
<ng-container matColumnDef="onlineStatus">
176-
<th mat-header-cell *matHeaderCellDef mat-sort-header>
176+
<th mat-header-cell *matHeaderCellDef>
177177
{{ "LORA-GATEWAY-TABLE.STATUS" | translate }}
178178
</th>
179179
<td mat-cell *matCellDef="let gateway">

src/app/shared/components/forms/form-body-application/form-body-application.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@
5454
[(value)]="application.permissionIds"
5555
[compareWith]="compare"
5656
>
57-
<app-mat-select-search [formControl]="permissionMultiFilterCtrl"></app-mat-select-search>
57+
<app-mat-select-search
58+
[initialValues]="this.application.permissionIds"
59+
[formControl]="permissionMultiFilterCtrl"
60+
></app-mat-select-search>
5861
<mat-option *ngFor="let permission of filteredPermissionsMulti | async" [value]="permission.id">
5962
{{ permission.name }}
6063
</mat-option>

src/app/shared/components/mat-select-search/mat-select-search/mat-select-search.component.html

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,7 @@
1010
(blur)="onBlur($event.target.value)"
1111
placeholder="placeholderLabel"
1212
/>
13-
<button
14-
mat-button
15-
*ngIf="value"
16-
mat-icon-button
17-
aria-label="Clear"
18-
(click)="_reset(true)"
19-
class="mat-select-search-clear"
20-
>
13+
<button mat-icon-button *ngIf="value" aria-label="Clear" (click)="_reset(true)" class="mat-select-search-clear">
2114
<mat-icon>close</mat-icon>
2215
</button>
2316
</div>

src/app/shared/components/mat-select-search/mat-select-search/mat-select-search.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import {
88
forwardRef,
99
Inject,
1010
Input,
11+
OnChanges,
1112
OnDestroy,
1213
OnInit,
1314
QueryList,
15+
SimpleChanges,
1416
ViewChild,
1517
} from "@angular/core";
1618
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from "@angular/forms";
@@ -37,12 +39,13 @@ import { MatSelect } from "@angular/material/select";
3739
*
3840
* @see https://github.com/angular/components/issues/5697#issuecomment-493628695
3941
*/
40-
export class MatSelectSearchComponent implements OnInit, OnDestroy, AfterViewInit, ControlValueAccessor {
42+
export class MatSelectSearchComponent implements OnInit, OnDestroy, AfterViewInit, ControlValueAccessor, OnChanges {
4143
/** Label of the search placeholder */
4244
@Input() placeholderLabel = "Søg efter ...";
4345

4446
/** Label to be shown when no entries are found. Set to null if no message should be shown. */
4547
@Input() noEntriesFoundLabel = "Ingen elementer blev fundet";
48+
@Input() initialValues: any[];
4649

4750
/** Reference to the search input field */
4851
@ViewChild("searchSelectInput", { static: false, read: ElementRef })
@@ -125,6 +128,12 @@ export class MatSelectSearchComponent implements OnInit, OnDestroy, AfterViewIni
125128
this.initMultipleHandling();
126129
}
127130

131+
ngOnChanges(changes: SimpleChanges) {
132+
if (changes.initialValues) {
133+
this.previousSelectedValues = this.initialValues;
134+
}
135+
}
136+
128137
ngOnDestroy() {
129138
this._onDestroy.next();
130139
this._onDestroy.complete();

0 commit comments

Comments
 (0)