From 194200da49d08cf4ad3d370716d8b969df4fe6e1 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Thu, 1 Jul 2021 10:44:48 +0300 Subject: [PATCH] UI: LwM2M device profile resource fixed disabled observe checkbox --- ...m-observe-attr-telemetry-resources.component.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-observe-attr-telemetry-resources.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-observe-attr-telemetry-resources.component.ts index 8af08d8f36..bca6d927d9 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-observe-attr-telemetry-resources.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-observe-attr-telemetry-resources.component.ts @@ -164,12 +164,14 @@ export class Lwm2mObserveAttrTelemetryResourcesComponent implements ControlValue form.get('attribute').valueChanges.pipe(startWith(resource.attribute), takeUntil(this.destroy$)), form.get('telemetry').valueChanges.pipe(startWith(resource.telemetry), takeUntil(this.destroy$)) ]).subscribe(([attribute, telemetry]) => { - if (attribute || telemetry) { - form.get('observe').enable({emitEvent: false}); - } else { - form.get('observe').disable({emitEvent: false}); - form.get('observe').patchValue(false, {emitEvent: false}); - form.get('attributes').patchValue({}, {emitEvent: false}); + if (!this.disabled) { + if (attribute || telemetry) { + form.get('observe').enable({emitEvent: false}); + } else { + form.get('observe').disable({emitEvent: false}); + form.get('observe').patchValue(false, {emitEvent: false}); + form.get('attributes').patchValue({}, {emitEvent: false}); + } } }); return form;