From 00575ae8f88c40f67679277cbdbe6fc8cc8f5996 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 21 Nov 2020 15:43:12 -0500 Subject: [PATCH] Excluding EntityShapeVisualizer from Children list Excluding EntityShapeVisualizer from Children list Now a name is given to the EntityShape of the EntityShapeVisualizer (used to display the zone) so we can now exclude them from the children list when it's time to figure if there are children for an entity. (This is a better approach than excluding al the local entities) The name has been used because it gives better results than trying to use the id map that arrive always too late. The name is unique for a session, it includes a UUID. --- scripts/system/create/edit.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index a8b829c551..3c6f43d3a1 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -117,8 +117,10 @@ var gridTool = new GridTool({ }); gridTool.setVisible(false); +var entityShapeVisualizerSessionName = "SHAPE_VISUALIZER_" + Uuid.generate(); + var EntityShapeVisualizer = Script.require('./modules/entityShapeVisualizer.js'); -var entityShapeVisualizer = new EntityShapeVisualizer(["Zone"]); +var entityShapeVisualizer = new EntityShapeVisualizer(["Zone"], entityShapeVisualizerSessionName); var entityListTool = new EntityListTool(shouldUseEditTabletApp); @@ -2925,15 +2927,15 @@ function getParentState(id) { function getDomainOnlyChildrenIDs(id) { var allChildren = Entities.getChildrenIDs(id); - var domainOnlyChildren = []; + var realChildren = []; var properties; for (var i = 0; i < allChildren.length; i++) { - properties = Entities.getEntityProperties(allChildren[i], ["entityHostType"]); - if (properties.entityHostType == "domain") { - domainOnlyChildren.push(allChildren[i]); + properties = Entities.getEntityProperties(allChildren[i], ["name"]); + if (properties.name !== entityShapeVisualizerSessionName && properties.name !== undefined) { + realChildren.push(allChildren[i]); } } - return domainOnlyChildren; + return realChildren; } }()); // END LOCAL_SCOPE