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.
This commit is contained in:
Alezia Kurdis 2020-11-21 15:43:12 -05:00 committed by GitHub
parent 22abf1c2c4
commit 00575ae8f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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