From 7237497946bd7ca40c8818a19874ff971468d8cd Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 23 Feb 2021 17:26:38 +0200 Subject: [PATCH] UI: Fixed merge additional info after save entity; Fixed updated alarm rules count --- .../components/entity/entity-details-panel.component.ts | 6 +++++- .../pages/device-profile/device-profile-tabs.component.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts index 1efcc9211e..0eebbc353e 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts @@ -280,7 +280,11 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit saveEntity() { if (this.detailsForm.valid) { - const editingEntity = mergeDeep(this.editingEntity, this.entityComponent.entityFormValue()); + const editingEntity = {...this.editingEntity, ...this.entityComponent.entityFormValue()}; + if (this.editingEntity.hasOwnProperty('additionalInfo')) { + editingEntity.additionalInfo = + mergeDeep((this.editingEntity as any).additionalInfo, this.entityComponent.entityFormValue()?.additionalInfo); + } this.entitiesTableConfig.saveEntity(editingEntity).subscribe( (entity) => { this.entity = entity; diff --git a/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html b/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html index 8022439213..f1a7af1e46 100644 --- a/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html +++ b/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html @@ -42,7 +42,7 @@