Merge pull request #3885 from vvlladd28/bug/bulk-import/updated-type-device
UI: Fixed updated deviceProfile in bulk import devices
This commit is contained in:
commit
09ed69a568
@ -869,7 +869,7 @@ export class EntityService {
|
|||||||
return findEntityObservable.pipe(
|
return findEntityObservable.pipe(
|
||||||
mergeMap((entity) => {
|
mergeMap((entity) => {
|
||||||
const tasks: Observable<any>[] = [];
|
const tasks: Observable<any>[] = [];
|
||||||
const result: Device | Asset = entity as (Device | Asset);
|
const result: Device & Asset = entity as (Device | Asset);
|
||||||
const additionalInfo = result.additionalInfo || {};
|
const additionalInfo = result.additionalInfo || {};
|
||||||
if (result.label !== entityData.label ||
|
if (result.label !== entityData.label ||
|
||||||
result.type !== entityData.type ||
|
result.type !== entityData.type ||
|
||||||
@ -882,6 +882,9 @@ export class EntityService {
|
|||||||
if (result.id.entityType === EntityType.DEVICE) {
|
if (result.id.entityType === EntityType.DEVICE) {
|
||||||
result.additionalInfo.gateway = entityData.gateway;
|
result.additionalInfo.gateway = entityData.gateway;
|
||||||
}
|
}
|
||||||
|
if (result.id.entityType === EntityType.DEVICE && result.deviceProfileId) {
|
||||||
|
delete result.deviceProfileId;
|
||||||
|
}
|
||||||
switch (result.id.entityType) {
|
switch (result.id.entityType) {
|
||||||
case EntityType.DEVICE:
|
case EntityType.DEVICE:
|
||||||
tasks.push(this.deviceService.saveDevice(result, config));
|
tasks.push(this.deviceService.saveDevice(result, config));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user