From b951f88a3638735e55f0c3209351109fb50928c4 Mon Sep 17 00:00:00 2001 From: Frederik Christ Vestergaard Date: Tue, 4 Mar 2025 11:24:54 +0100 Subject: [PATCH 1/8] Add pointer to application table-row and tabs --- .../applications-table.component.html | 136 +++++++++--------- .../applications-table.component.scss | 6 +- .../basic-tab-switch.component.scss | 9 +- 3 files changed, 81 insertions(+), 70 deletions(-) diff --git a/src/app/applications/applications-list/applications-table/applications-table.component.html b/src/app/applications/applications-list/applications-table/applications-table.component.html index 8adf062c..43ea5db1 100644 --- a/src/app/applications/applications-list/applications-table/applications-table.component.html +++ b/src/app/applications/applications-list/applications-table/applications-table.component.html @@ -1,4 +1,4 @@ -
+
@@ -8,35 +8,35 @@
- - - - - - - - - - @@ -108,143 +108,145 @@ - - - - - - - - - - - - - - - - - + - - - + +
+
{{ "APPLICATION-TABLE.STATUS" | translate }}
- +
- + + +
{{ "APPLICATION-TABLE.STATE" | translate }}
- +
+
-
+
{{ "APPLICATION-TABLE.NAME" | translate }}
- +
+
{{ element.name }} @@ -66,41 +66,41 @@ -
+
{{ "APPLICATION-TABLE.CONTROLLED-PROPERTIES" | translate }}
- +
+
@for (property of application.controlledProperties; track $index) { - + }
+
{{ "APPLICATION-TABLE.IOT-DEVICES" | translate }}
- +
+ {{ element?.iotDevices?.length ?? 0 }} +
{{ "APPLICATION-TABLE.OWNER" | translate }}
- +
+ {{ application.owner ?? "-" }} +
{{ "APPLICATION-TABLE.CONTACT-PERSON" | translate }}
- +
+ {{ application.contactPerson ?? "-" }} +
{{ "APPLICATION-TABLE.DATA-TARGETS" | translate }}
- +
+ {{ application?.dataTargets?.length ?? 0 }} +
{{ "APPLICATION-TABLE.OPEN-DATA-DK" | translate }}
- +
+ {{ isOpenDataDK(application.dataTargets) | yesNo }} +
{{ "APPLICATION-TABLE.PERSONAL-DATA" | translate }}
- +
+ {{ !application.personalData ? "-" : "" }} +
{{ "APPLICATION-TABLE.START-DATE" | translate }}
- +
+ {{ (application.startDate | dateOnly) ?? "-" }} +
{{ "APPLICATION-TABLE.END-DATE" | translate }}
- +
+ {{ (application.endDate | dateOnly) ?? "-" }} +
{{ "APPLICATION-TABLE.CATEGORY" | translate }}
- +
+ {{ application.category ?? "-" }} +
{{ "APPLICATION-TABLE.DEVICE-TYPES" | translate }}
- +
+ {{ mapDeviceTypes(application.deviceTypes) ?? "-" }} - +
- +
- +
diff --git a/src/app/applications/applications-list/applications-table/applications-table.component.scss b/src/app/applications/applications-list/applications-table/applications-table.component.scss index 3c1d07ea..5ca6a51e 100644 --- a/src/app/applications/applications-list/applications-table/applications-table.component.scss +++ b/src/app/applications/applications-list/applications-table/applications-table.component.scss @@ -55,7 +55,7 @@ } .mat-sort-header-arrow { - display: none !important; + display: none; } .column-title-color { @@ -66,3 +66,7 @@ .column-title-color-inactive { color: $default-icon-color; } + +.table-row-pointer { + cursor: pointer; +} diff --git a/src/app/shared/components/basic-tab-switch/basic-tab-switch.component.scss b/src/app/shared/components/basic-tab-switch/basic-tab-switch.component.scss index bf219076..016caf8a 100644 --- a/src/app/shared/components/basic-tab-switch/basic-tab-switch.component.scss +++ b/src/app/shared/components/basic-tab-switch/basic-tab-switch.component.scss @@ -14,10 +14,15 @@ justify-content: center; font-size: 16px; padding: 0 20px; + cursor: pointer; +} + +.tab-base:hover { + background-color: $white; } .active-tab { - background-color: $white !important; + background-color: $white; color: $default-icon-color; fill: $default-icon-color; } @@ -25,7 +30,7 @@ .inactive-tab { fill: $color-link !important; color: $color-link; - background-color: transparent !important; + background-color: transparent; } .active-tab-icon { From aff72782786500973e9bf31a263db5c5f6a27516 Mon Sep 17 00:00:00 2001 From: Frederik Christ Vestergaard Date: Tue, 4 Mar 2025 11:49:41 +0100 Subject: [PATCH 2/8] Add sort arrow back --- .../applications-table.component.html | 2 +- .../applications-table.component.scss | 6 ++ src/assets/i18n/da.json | 3 +- src/assets/scss/setup/_material-theme.scss | 57 ++++++++++--------- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/app/applications/applications-list/applications-table/applications-table.component.html b/src/app/applications/applications-list/applications-table/applications-table.component.html index 43ea5db1..86bd27e6 100644 --- a/src/app/applications/applications-list/applications-table/applications-table.component.html +++ b/src/app/applications/applications-list/applications-table/applications-table.component.html @@ -5,7 +5,7 @@ {{ errorMessage | translate }}
-
+
Date: Tue, 4 Mar 2025 12:22:02 +0100 Subject: [PATCH 3/8] Fix organization picker not updating from non-applications routes --- src/app/navbar/navbar.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index 285b3f43..b39a0215 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -79,6 +79,7 @@ export class NavbarComponent implements OnInit { public onChange(organizationId: string) { this.sharedVariableService.setValue(+organizationId); this.setLocalPermissionCheck(+organizationId); + this.selected = +organizationId; if (this.route.url === "/" || this.route.url === "/applications") { window.location.reload(); From 0af83ed22b28add441cba0af044b414876066fb4 Mon Sep 17 00:00:00 2001 From: Frederik Christ Vestergaard Date: Tue, 4 Mar 2025 12:32:41 +0100 Subject: [PATCH 4/8] Fix navbar --- src/app/navbar/navbar.component.html | 14 +------------- src/app/navbar/navbar.component.ts | 9 +-------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index 4b8f9d64..02327a19 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -76,19 +76,7 @@ - -
+
{{ "IOTDEVICE-TABLE-ROW.NOT-SUPPORTED-SHORT" | translate }} @@ -19,86 +26,86 @@ - - - - + - - - - + - - + - - + - - + @@ -107,9 +114,9 @@
{{ "IOT-TABLE.RSSI" | translate }}
- + - - + @@ -150,7 +157,7 @@ - - + - - + - - + +
+
{{ "APPLICATION-TABLE.NAME" | translate }}
- +
- {{ - iotDevice.name - }} + + {{ + iotDevice.name + }} +
{{ "IOT-TABLE.NETWORK-TECHNOLOGY" | translate }}
- +
{{ "IOT-DEVICE-TYPES." + iotDevice.type | translate }}{{ "IOT-DEVICE-TYPES." + iotDevice.type | translate }} +
{{ "GATEWAY.PLACEMENT-LABEL" | translate }}
- +
+ {{ iotDevice.commentOnLocation ? truncateText(iotDevice.commentOnLocation) : "-" }} +
{{ "IOTDEVICE.DEVICEMODEL" | translate }}
- +
{{ iotDevice.deviceModel?.body?.name ?? "-" }}{{ iotDevice.deviceModel?.body?.name ?? "-" }} +
{{ "IOTDEVICE.LORA.DEVICEPROFILE" | translate }}
- +
{{ iotDevice.deviceProfileName ?? "-" }}{{ iotDevice.deviceProfileName ?? "-" }} +
{{ "IOT-TABLE.DEV-EUI" | translate }}
- +
{{ iotDevice.deviceEUI ?? "-" }}{{ iotDevice.deviceEUI ?? "-" }} +
{{ "IOT-TABLE.APP-KEY" | translate }}
- +
{{ iotDevice.OTAAapplicationKey ?? "-" }}{{ iotDevice.OTAAapplicationKey ?? "-" }} +
{{ iotDevice.latestReceivedMessage.rssi }} @@ -124,9 +131,9 @@
{{ "IOT-TABLE.SNR" | translate }}
- + -
+
{{ iotDevice.latestReceivedMessage?.snr }} @@ -136,13 +143,13 @@ -
+
{{ "APPLICATION-TABLE.DATA-TARGETS" | translate }}
- +
{{ iotDevice.connections?.length ?? 0 }}{{ iotDevice.connections?.length ?? 0 }} {{ "IOT-TABLE.BATTERY" | translate }} +
@@ -165,38 +172,38 @@ -
+
{{ "IOT-TABLE.ACTIVE" | translate }}
- +
{{ lastActive(iotDevice) }}{{ lastActive(iotDevice) }} - +
diff --git a/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts b/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts index 0db2e3ee..c27b8d5f 100644 --- a/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts +++ b/src/app/applications/iot-devices/iot-devices-table/iot-devices-table.component.ts @@ -263,6 +263,10 @@ export class IotDevicesTableComponent implements AfterViewInit, OnInit { }); } + announceSortChange(event: { active: string; direction: string }) { + this.columnDefinitions.find(column => column.id === event.active).sort = event.direction as "asc" | "desc"; + } + getSortDirection(id: string) { return columnDefinitions.find(c => c.id === id).sort; } diff --git a/src/app/gateway/gateway-table/gateway-table.component.html b/src/app/gateway/gateway-table/gateway-table.component.html index b18b37b1..b4670574 100644 --- a/src/app/gateway/gateway-table/gateway-table.component.html +++ b/src/app/gateway/gateway-table/gateway-table.component.html @@ -8,13 +8,22 @@
- +
{{ "LORA-GATEWAY-TABLE.NAME" | translate }}
- +
- {{ "LORA-GATEWAY-TABLE.GATEWAYID" | translate }} + {{ "LORA-GATEWAY-TABLE.ID" | translate }}
- +
{{ gateway.gatewayId }} @@ -44,7 +53,7 @@
{{ "LORA-GATEWAY-TABLE.ORGANIZATION" | translate }}
- +
{{ gateway.organizationName }} @@ -58,7 +67,7 @@ > {{ "LORA-GATEWAY-TABLE.PACKETS-RECEIVED" | translate }} - + {{ gateway.rxPacketsReceived }} @@ -70,7 +79,7 @@
{{ "LORA-GATEWAY-TABLE.PACKETS-SENT" | translate }}
- +
{{ gateway.txPacketsEmitted }} @@ -80,11 +89,9 @@
- ' - {{ "LORA-GATEWAY-TABLE.PLACEMENT" | translate }}
- +
{{ gateway.placement ? ("GATEWAY.PLACEMENT." + gateway.placement | translate) : "" }} @@ -96,7 +103,7 @@
{{ "LORA-GATEWAY-TABLE.MODEL-NAME" | translate }}
- +
{{ gateway.modelName }} @@ -108,7 +115,7 @@
{{ "LORA-GATEWAY-TABLE.ANTENNA-TYPE" | translate }}
- +
{{ gateway.antennaType }} @@ -120,7 +127,7 @@
{{ "LORA-GATEWAY-TABLE.STATUS" | translate }}
- +
{{ gateway.status ? ("GATEWAY.STATUS." + gateway.status | translate) : "" }} @@ -136,7 +143,7 @@ > {{ "LORA-GATEWAY-TABLE.RESPONSIBLE-NAME" | translate }} - + {{ gateway.gatewayResponsibleName }} @@ -152,7 +159,7 @@ > {{ "LORA-GATEWAY-TABLE.RESPONSIBLE-EMAIL" | translate }} - + {{ gateway.gatewayResponsibleEmail }} @@ -168,7 +175,7 @@ > {{ "LORA-GATEWAY-TABLE.RESPONSIBLE-PHONE-NUMBER" | translate }} - + {{ gateway.gatewayResponsiblePhoneNumber }} @@ -184,7 +191,7 @@ > {{ "LORA-GATEWAY-TABLE.OPERATIONAL-NAME" | translate }} - + {{ gateway.operationalResponsibleName }} @@ -200,7 +207,7 @@ > {{ "LORA-GATEWAY-TABLE.OPERATIONAL-EMAIL" | translate }} - + {{ gateway.operationalResponsibleEmail }} @@ -212,7 +219,7 @@
{{ "LORA-GATEWAY-TABLE.TAGS" | translate }}
- +
{{ gateway.tagsString }} @@ -224,7 +231,7 @@
{{ "LORA-GATEWAY-TABLE.LOCATION" | translate }}
- +
{{ gateway.location.latitude | number : "2.1-6" }}, @@ -237,7 +244,7 @@
{{ "LORA-GATEWAY-TABLE.CREATED-AT" | translate }}
- +
{{ gateway.createdAt | dateOnly }} @@ -249,7 +256,7 @@
{{ "LORA-GATEWAY-TABLE.LAST-SEEN-AT" | translate }}
- +
{{ lastActive(gateway) }} diff --git a/src/app/gateway/gateway-table/gateway-table.component.ts b/src/app/gateway/gateway-table/gateway-table.component.ts index 17a82cd0..bb625e36 100644 --- a/src/app/gateway/gateway-table/gateway-table.component.ts +++ b/src/app/gateway/gateway-table/gateway-table.component.ts @@ -36,7 +36,7 @@ const columnDefinitions: TableColumn[] = [ }, { id: "gatewayId", - display: "LORA-GATEWAY-TABLE.GATEWAYID", + display: "LORA-GATEWAY-TABLE.ID", toggleable: true, default: true, }, @@ -250,8 +250,12 @@ export class GatewayTableComponent implements AfterViewInit, OnDestroy, OnInit { }); } + announceSortChange(event: { active: string; direction: string }) { + this.columnDefinitions.find(column => column.id === event.active).sort = event.direction as "asc" | "desc"; + } + getSortDirection(id: string) { - return columnDefinitions.find(c => c.id === id)?.sort ?? "asc"; + return columnDefinitions.find(c => c.id === id).sort; } private refresh() { From a32a2597a6e531feca8c07d5330b467bca037cf7 Mon Sep 17 00:00:00 2001 From: Frederik Christ Vestergaard Date: Mon, 24 Mar 2025 09:00:16 +0100 Subject: [PATCH 8/8] Added global admin role to username if applicable --- src/app/navbar/navbar.component.html | 6 +++--- src/app/navbar/navbar.component.scss | 4 +++- src/app/shared/components/top-bar/top-bar.component.html | 4 +++- src/app/shared/components/top-bar/top-bar.component.ts | 6 +++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index c341f896..a9e46eda 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -1,7 +1,7 @@ -
+
diff --git a/src/app/navbar/navbar.component.scss b/src/app/navbar/navbar.component.scss index d0ddb631..cb894e94 100644 --- a/src/app/navbar/navbar.component.scss +++ b/src/app/navbar/navbar.component.scss @@ -119,7 +119,7 @@ button:focus, .no-shadow { box-shadow: none; - z-index: 10000; + z-index: 100; } ::ng-deep .mdc-notched-outline__leading { @@ -147,6 +147,7 @@ button:focus, padding: 0 2px 0 0; border-radius: 0 5px 5px 0; transition: left 0.3s ease-in-out, border-radius 0.3s ease-in-out; + z-index: 101; &:hover { background-color: $color-link-active-bg; @@ -160,6 +161,7 @@ button:focus, border-radius: 5px 0 0 5px; left: 248px; padding: 0 0 0 2px; + .icon-arrow-nav { transform: rotate(0deg); } diff --git a/src/app/shared/components/top-bar/top-bar.component.html b/src/app/shared/components/top-bar/top-bar.component.html index 0935053f..b321a9d0 100644 --- a/src/app/shared/components/top-bar/top-bar.component.html +++ b/src/app/shared/components/top-bar/top-bar.component.html @@ -28,7 +28,9 @@
{{ getUsername() }}
- +
{{ 'PERMISSION-TYPE.GlobalAdmin' | translate }} +
diff --git a/src/app/shared/components/top-bar/top-bar.component.ts b/src/app/shared/components/top-bar/top-bar.component.ts index baafed4a..d5aecf3f 100644 --- a/src/app/shared/components/top-bar/top-bar.component.ts +++ b/src/app/shared/components/top-bar/top-bar.component.ts @@ -22,6 +22,7 @@ import { QuickActionButton } from "@shared/models/quick-action-button.model"; import { Sort } from "@shared/models/sort.model"; import { LoggedInService } from "@shared/services/loggedin.service"; import { SharedVariableService } from "@shared/shared-variable/shared-variable.service"; +import { MeService } from "@shared/services/me.service"; @Component({ selector: "app-top-bar", @@ -79,7 +80,8 @@ export class TopBarComponent implements OnInit { private authService: AuthService, private loggedInService: LoggedInService, private matIconRegistry: MatIconRegistry, - private domSanitizer: DomSanitizer + private domSanitizer: DomSanitizer, + public meService: MeService ) { translate.use("da"); @@ -100,8 +102,6 @@ export class TopBarComponent implements OnInit { this.domSanitizer.bypassSecurityTrustResourceUrl("../../../../assets/images/search.svg"), {} ); - - this.sharedVariableService.getUserInfo; } ngOnInit(): void {