From 7a983ef3325fb446a455f594f515666b97aec2d5 Mon Sep 17 00:00:00 2001 From: Frederik Christ Vestergaard Date: Wed, 27 Sep 2023 10:53:58 +0200 Subject: [PATCH 1/2] (IOT-1495) Added new time format pipe with seconds --- .../data-package/data-package.component.html | 4 +- .../data-packages-timestamp.component.html | 2 +- src/app/shared/pipes/custom-date.pipe.ts | 27 +++-- src/app/shared/pipes/pipes.module.ts | 113 +++++++++--------- 4 files changed, 80 insertions(+), 66 deletions(-) diff --git a/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.html b/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.html index e644636df..0e5de9d5b 100644 --- a/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/data-package/data-package.component.html @@ -4,7 +4,7 @@

{{'IOTDEVICE.LATEST-DATAPACKAGE' | translate}} - {{latestReceivedMessage.sentTime | tableDatePipe}} + {{latestReceivedMessage.sentTime | tableDateWithSecondsPipe}}

@@ -18,4 +18,4 @@

{{'IOTDEVICE.NO-DATAPACKAGE' | translate}}

- \ No newline at end of file + diff --git a/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.html b/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.html index ba1515b2a..17f2037ce 100644 --- a/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.html +++ b/src/app/applications/iot-devices/iot-device-detail/data-packages-timestamp/data-packages-timestamp.component.html @@ -20,7 +20,7 @@ let metadata of sortedMetadata; let i = index "> - {{ metadata.sentTime | tableDatePipe }} + {{ metadata.sentTime | tableDateWithSecondsPipe }}

diff --git a/src/app/shared/pipes/custom-date.pipe.ts b/src/app/shared/pipes/custom-date.pipe.ts index 25d14f4e3..4ec3129db 100644 --- a/src/app/shared/pipes/custom-date.pipe.ts +++ b/src/app/shared/pipes/custom-date.pipe.ts @@ -2,22 +2,31 @@ import { Pipe, PipeTransform } from '@angular/core'; import { DatePipe } from '@angular/common'; @Pipe({ - name: 'dkTime' + name: 'dkTime', }) export class CustomDatePipe extends DatePipe implements PipeTransform { - transform(value: any, args?: any): any { - return super.transform(value, ' \'den\' dd-MM-yyyy kl. HH:mm'); - } + transform(value: any, args?: any): any { + return super.transform(value, " 'den' dd-MM-yyyy kl. HH:mm"); + } } - @Pipe({ - name: 'tableDatePipe' + name: 'tableDatePipe', }) export class CustomTableDatePipe extends DatePipe implements PipeTransform { - transform(value: any, args?: any): any { - return super.transform(value, 'dd MMM, yyyy - HH:mm'); - } + transform(value: any, args?: any): any { + return super.transform(value, 'dd MMM, yyyy - HH:mm'); + } +} + +@Pipe({ + name: 'tableDateWithSecondsPipe', +}) +export class CustomTableDateWithSecondsPipe extends DatePipe + implements PipeTransform { + transform(value: any, args?: any): any { + return super.transform(value, 'dd MMM, yyyy - HH:mm:ss'); + } } @Pipe({ diff --git a/src/app/shared/pipes/pipes.module.ts b/src/app/shared/pipes/pipes.module.ts index c31d75fef..c70ba9808 100644 --- a/src/app/shared/pipes/pipes.module.ts +++ b/src/app/shared/pipes/pipes.module.ts @@ -1,54 +1,59 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { YesNoPipe } from './yesNo.pipe'; -import { ActiveDeactivePipe } from './activeDeactive.pipe'; -import { IsGlobalAdminPipe } from './permission/is-global-admin.pipe'; -import { CreatedUpdatedByPipe } from './created-updated-by.pipe'; -import { CustomDatePipe, CustomTableDatePipe, DateOnlyPipe } from './custom-date.pipe'; -import { FilterDevicesPipe } from './filter-devices.pipe'; -import { TranslatePermissionsPipe } from './permission/translate-permissions.pipe'; -import { SortByPipe } from './sort-by.pipe'; -import { GatewayStatusTooltipPipe } from './gateway/gateway-status-tooltip.pipe'; -import { GatewayStatusClassPipe } from './gateway/gateway-status-class.pipe'; -import { CanEditApplicationPipe } from './permission/can-edit-application.pipe'; -import { SortByTranslationPipe } from './sort-by-translation.pipe'; - -@NgModule({ - declarations: [ - IsGlobalAdminPipe, - ActiveDeactivePipe, - YesNoPipe, - CustomDatePipe, - CustomTableDatePipe, - DateOnlyPipe, - CreatedUpdatedByPipe, - FilterDevicesPipe, - TranslatePermissionsPipe, - SortByPipe, - GatewayStatusTooltipPipe, - GatewayStatusClassPipe, - CanEditApplicationPipe, - SortByTranslationPipe, - ], - imports: [CommonModule], - exports: [ - IsGlobalAdminPipe, - ActiveDeactivePipe, - YesNoPipe, - CustomDatePipe, - CustomTableDatePipe, - DateOnlyPipe, - CreatedUpdatedByPipe, - FilterDevicesPipe, - TranslatePermissionsPipe, - SortByPipe, - GatewayStatusTooltipPipe, - GatewayStatusClassPipe, - CanEditApplicationPipe, - SortByTranslationPipe, - ], - providers: [ - DateOnlyPipe - ] -}) -export class PipesModule {} +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { YesNoPipe } from './yesNo.pipe'; +import { ActiveDeactivePipe } from './activeDeactive.pipe'; +import { IsGlobalAdminPipe } from './permission/is-global-admin.pipe'; +import { CreatedUpdatedByPipe } from './created-updated-by.pipe'; +import { + CustomDatePipe, + CustomTableDatePipe, + CustomTableDateWithSecondsPipe, + DateOnlyPipe, +} from './custom-date.pipe'; +import { FilterDevicesPipe } from './filter-devices.pipe'; +import { TranslatePermissionsPipe } from './permission/translate-permissions.pipe'; +import { SortByPipe } from './sort-by.pipe'; +import { GatewayStatusTooltipPipe } from './gateway/gateway-status-tooltip.pipe'; +import { GatewayStatusClassPipe } from './gateway/gateway-status-class.pipe'; +import { CanEditApplicationPipe } from './permission/can-edit-application.pipe'; +import { SortByTranslationPipe } from './sort-by-translation.pipe'; + +@NgModule({ + declarations: [ + IsGlobalAdminPipe, + ActiveDeactivePipe, + YesNoPipe, + CustomDatePipe, + CustomTableDatePipe, + CustomTableDateWithSecondsPipe, + DateOnlyPipe, + CreatedUpdatedByPipe, + FilterDevicesPipe, + TranslatePermissionsPipe, + SortByPipe, + GatewayStatusTooltipPipe, + GatewayStatusClassPipe, + CanEditApplicationPipe, + SortByTranslationPipe, + ], + imports: [CommonModule], + exports: [ + IsGlobalAdminPipe, + ActiveDeactivePipe, + YesNoPipe, + CustomDatePipe, + CustomTableDatePipe, + CustomTableDateWithSecondsPipe, + DateOnlyPipe, + CreatedUpdatedByPipe, + FilterDevicesPipe, + TranslatePermissionsPipe, + SortByPipe, + GatewayStatusTooltipPipe, + GatewayStatusClassPipe, + CanEditApplicationPipe, + SortByTranslationPipe, + ], + providers: [DateOnlyPipe], +}) +export class PipesModule {} From e893b0d80bc576412b159cbae890393dae4ba0f6 Mon Sep 17 00:00:00 2001 From: Frederik Christ Vestergaard Date: Wed, 27 Sep 2023 11:42:39 +0200 Subject: [PATCH 2/2] (IOT-1502) Updated description text for data rate --- .../service-profiles-edit.component.html | 6 +++--- src/assets/i18n/da.json | 4 ++-- src/styles.scss | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/profiles/service-profiles/service-profiles-edit/service-profiles-edit.component.html b/src/app/profiles/service-profiles/service-profiles-edit/service-profiles-edit.component.html index 00e35a66c..7c0c06ac7 100644 --- a/src/app/profiles/service-profiles/service-profiles-edit/service-profiles-edit.component.html +++ b/src/app/profiles/service-profiles/service-profiles-edit/service-profiles-edit.component.html @@ -85,7 +85,7 @@ - +
@@ -94,7 +94,7 @@ - +
@@ -113,4 +113,4 @@ - \ No newline at end of file + diff --git a/src/assets/i18n/da.json b/src/assets/i18n/da.json index e6bf6c8a2..861ab51eb 100644 --- a/src/assets/i18n/da.json +++ b/src/assets/i18n/da.json @@ -963,9 +963,9 @@ "REPORTBATTERYSTATUS": "Rapporter enhedens batteriniveau til applikationsserveren", "REPORTBATTERYMARGIN": "Rapporter device link margin til applikationsserver", "DRRATEMIN": "Min data rate", - "DRRATEMINEXPLAINED": "Minimum tilladte data rate. Brugt til ADR", + "DRRATEMINEXPLAINED": "Minimum tilladte data rate. Skal være et tal fra 0-7. \nBrugt til ADR", "DRRATEMAX": "Max data rate", - "DRRATEMAXEXPLAINED": "Maximum tilladte data rate. Brugt til ADR", + "DRRATEMAXEXPLAINED": "Maximum tilladte data rate. Skal være et tal fra 0-7. \nBrugt til ADR", "SAVE": "Gem", "CANCEL": "Annuller", "GOBACK": "Gå tilbage", diff --git a/src/styles.scss b/src/styles.scss index 642d8c219..633ee025e 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -109,3 +109,7 @@ body { border-color: $color-white-001; } } + +.line-break { + white-space: pre-line; +}