From ccf2ad13023a04caa03b41a3e3f235bb9c4864bb Mon Sep 17 00:00:00 2001 From: rusikv Date: Thu, 13 Jun 2024 18:50:17 +0300 Subject: [PATCH 1/2] UI: fixed lwm2m device profile transport configuration object list form field value persistance --- ...ile-transport-configuration.component.html | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html index 22920a609c..fe7a6b81b4 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html @@ -18,18 +18,16 @@
- -
- - - - -
-
+
+ + + + +
From 1ec30b92ea2d5d21844a6dd520205162c5f23a51 Mon Sep 17 00:00:00 2001 From: rusikv Date: Fri, 14 Jun 2024 16:01:43 +0300 Subject: [PATCH 2/2] UI: added workaround for lwm2m object list component propagating array of strings instead of objects --- ...ile-transport-configuration.component.html | 22 ++++++++++--------- .../lwm2m/lwm2m-object-list.component.ts | 14 +++++++----- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html index fe7a6b81b4..22920a609c 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html @@ -18,16 +18,18 @@
-
- - - - -
+ +
+ + + + +
+
diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-object-list.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-object-list.component.ts index 5f3d06a02b..950ac38cdb 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-object-list.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-object-list.component.ts @@ -31,7 +31,7 @@ import { distinctUntilChanged, filter, mergeMap, share, tap } from 'rxjs/operato import { ObjectLwM2M, PAGE_SIZE_LIMIT } from './lwm2m-profile-config.models'; import { DeviceProfileService } from '@core/http/device-profile.service'; import { Direction } from '@shared/models/page/sort-order'; -import { isDefined, isDefinedAndNotNull, isString } from '@core/utils'; +import { isDefined, isDefinedAndNotNull, isObject, isString } from '@core/utils'; import { PageLink } from '@shared/models/page/page-link'; import { TruncatePipe } from '@shared/pipe/truncate.pipe'; @@ -90,12 +90,14 @@ export class Lwm2mObjectListComponent implements ControlValueAccessor, OnInit, V objectsList: [this.objectsList], objectLwm2m: [''] }); - this.lwm2mListFormGroup.valueChanges.subscribe((value) => { - let formValue = null; - if (this.lwm2mListFormGroup.valid) { - formValue = value.objectsList; + this.lwm2mListFormGroup.get('objectsList').valueChanges.subscribe((value) => { + if (!value.length || (value.length && isObject(value[0]))) { + let formValue = null; + if (this.lwm2mListFormGroup.valid) { + formValue = value; + } + this.propagateChange(formValue); } - this.propagateChange(formValue); }); }