Commit 7237497946bd7ca40c8818a19874ff971468d8cd
Committed by
Andrew Shvayka
1 parent
0f3d1baa
UI: Fixed merge additional info after save entity; Fixed updated alarm rules count
Showing
2 changed files
with
6 additions
and
2 deletions
... | ... | @@ -280,7 +280,11 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit |
280 | 280 | |
281 | 281 | saveEntity() { |
282 | 282 | if (this.detailsForm.valid) { |
283 | - const editingEntity = mergeDeep(this.editingEntity, this.entityComponent.entityFormValue()); | |
283 | + const editingEntity = {...this.editingEntity, ...this.entityComponent.entityFormValue()}; | |
284 | + if (this.editingEntity.hasOwnProperty('additionalInfo')) { | |
285 | + editingEntity.additionalInfo = | |
286 | + mergeDeep((this.editingEntity as any).additionalInfo, this.entityComponent.entityFormValue()?.additionalInfo); | |
287 | + } | |
284 | 288 | this.entitiesTableConfig.saveEntity(editingEntity).subscribe( |
285 | 289 | (entity) => { |
286 | 290 | this.entity = entity; | ... | ... |
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | </mat-tab> |
43 | 43 | <mat-tab *ngIf="entity" #alarmRules="matTab" |
44 | 44 | label="{{'device-profile.alarm-rules-with-count' | translate: |
45 | - {count: entity.profileData?.alarms?.length ? entity.profileData.alarms.length : 0} | |
45 | + {count: this.detailsForm.get('profileData.alarms').value?.length ? this.detailsForm.get('profileData.alarms').value.length : 0} | |
46 | 46 | }}"> |
47 | 47 | <div class="mat-padding" [formGroup]="detailsForm" *ngIf="alarmRules.isActive"> |
48 | 48 | <div formGroupName="profileData"> | ... | ... |