Browse Source

fix(iot-hub): an entity the user had and chose to use is not tracked as the package's

After Back reruns the entity steps, the "use existing" mark of such an entity is gone from the install state, so the
server took it for the package's and a later update or Delete removed the user's own entity. The wizard no longer
tracks it, unless it created that entity itself earlier in the same wizard.
pull/16553/head
dpinkevych 3 weeks ago
parent
commit
4cba073b7c
  1. 5
      ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts

5
ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts

@ -818,7 +818,10 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
this.createdInThisWizard.add(output.id);
}
const entityType = this.stepTypeToEntityType(ep.step.type);
if (entityType && !this.packageEntityIds.some(known => known.id === output.id)) {
// An entity the user had before the install and chose to use is not the package's: a later update or Delete must
// not remove it, even after Back reruns the steps and its "use existing" mark is gone from the install state.
const packageOwned = resolution !== 'use-existing' || this.createdInThisWizard.has(output.id);
if (entityType && packageOwned && !this.packageEntityIds.some(known => known.id === output.id)) {
this.packageEntityIds.push({ entityType, id: output.id });
}
const alias = stepTypeAliasMap[ep.step.type];

Loading…
Cancel
Save