Commit 3e28c960d3be57fcd9adfce1f6625ff35d81edb7

Authored by Vladyslav_Prykhodko
1 parent f566bff8

UI: Fixed updated deviceProfile in bulk import devices

@@ -869,7 +869,7 @@ export class EntityService { @@ -869,7 +869,7 @@ export class EntityService {
869 return findEntityObservable.pipe( 869 return findEntityObservable.pipe(
870 mergeMap((entity) => { 870 mergeMap((entity) => {
871 const tasks: Observable<any>[] = []; 871 const tasks: Observable<any>[] = [];
872 - const result: Device | Asset = entity as (Device | Asset); 872 + const result: Device & Asset = entity as (Device | Asset);
873 const additionalInfo = result.additionalInfo || {}; 873 const additionalInfo = result.additionalInfo || {};
874 if (result.label !== entityData.label || 874 if (result.label !== entityData.label ||
875 result.type !== entityData.type || 875 result.type !== entityData.type ||
@@ -882,6 +882,9 @@ export class EntityService { @@ -882,6 +882,9 @@ export class EntityService {
882 if (result.id.entityType === EntityType.DEVICE) { 882 if (result.id.entityType === EntityType.DEVICE) {
883 result.additionalInfo.gateway = entityData.gateway; 883 result.additionalInfo.gateway = entityData.gateway;
884 } 884 }
  885 + if (result.id.entityType === EntityType.DEVICE && result.deviceProfileId) {
  886 + delete result.deviceProfileId;
  887 + }
885 switch (result.id.entityType) { 888 switch (result.id.entityType) {
886 case EntityType.DEVICE: 889 case EntityType.DEVICE:
887 tasks.push(this.deviceService.saveDevice(result, config)); 890 tasks.push(this.deviceService.saveDevice(result, config));