From 31a1af58142c355c0f666f757fdc6e522de80351 Mon Sep 17 00:00:00 2001 From: Sergey Tarnavskiy Date: Fri, 19 Nov 2021 15:18:42 +0200 Subject: [PATCH 1/3] Fixed bug with missing required credential-config for LwM2M device-profiles. --- .../components/wizard/device-wizard-dialog.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts b/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts index fdbc25107f..b40130719a 100644 --- a/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts @@ -252,6 +252,14 @@ export class DeviceWizardDialogComponent extends private deviceProfileTransportTypeChanged(deviceTransportType: DeviceTransportType): void { this.transportConfigFormGroup.patchValue( {transportConfiguration: createDeviceProfileTransportConfiguration(deviceTransportType)}); + const setCredentialBox = this.credentialsFormGroup.get('setCredential'); + if (deviceTransportType === DeviceTransportType.LWM2M) { + setCredentialBox.patchValue(true); + setCredentialBox.disable(); + } else { + setCredentialBox.patchValue(false); + setCredentialBox.enable(); + } } add(): void { From c532bc6508b8ecf2f968e4999db75a9f1d3a0fe9 Mon Sep 17 00:00:00 2001 From: Sergey Tarnavskiy Date: Fri, 19 Nov 2021 16:08:56 +0200 Subject: [PATCH 2/3] Fixed bug with UI updating of bootstrap-config for LwM2M device-profiles --- .../lwm2m-device-profile-transport-configuration.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts index 1fdf6cf8be..89bc65fa0f 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts @@ -14,7 +14,7 @@ /// limitations under the License. /// -import { Component, forwardRef, Input, OnDestroy } from '@angular/core'; +import { ChangeDetectorRef, Component, forwardRef, Input, OnDestroy } from '@angular/core'; import { ControlValueAccessor, FormBuilder, @@ -95,6 +95,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro } constructor(private fb: FormBuilder, + private cd: ChangeDetectorRef, private deviceProfileService: DeviceProfileService) { this.lwm2mDeviceProfileFormGroup = this.fb.group({ objectIds: [null], @@ -236,6 +237,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro this.lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.fwUpdateStrategy').updateValueAndValidity({onlySelf: true}); this.lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.swUpdateStrategy').updateValueAndValidity({onlySelf: true}); } + this.cd.detectChanges(); } private updateModel = (): void => { From a77d4c8dec70470407f254c27d7bf0b5dd4960ec Mon Sep 17 00:00:00 2001 From: Sergey Tarnavskiy Date: Fri, 19 Nov 2021 17:15:27 +0200 Subject: [PATCH 3/3] Minor fixes for main commits --- .../lwm2m-device-profile-transport-configuration.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts index 89bc65fa0f..d16a0eafca 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.ts @@ -237,7 +237,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro this.lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.fwUpdateStrategy').updateValueAndValidity({onlySelf: true}); this.lwm2mDeviceProfileFormGroup.get('clientLwM2mSettings.swUpdateStrategy').updateValueAndValidity({onlySelf: true}); } - this.cd.detectChanges(); + this.cd.markForCheck(); } private updateModel = (): void => {