Fix for Issue 869

This excludes the local and avatar entities from what is returns by Entities.getChildrenIDs
to avoid the selection tools of the Zone entities to be considered as Children of it.
This was necessary for the display of the hierarchy status, but also for the "Add Children to Selection".
This commit is contained in:
Alezia Kurdis 2020-11-18 23:14:34 -05:00 committed by GitHub
parent 4c8d8e1b3a
commit 031b3985b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2908,7 +2908,7 @@ function zoneSortOrder(a, b) {
function getParentState(id) {
var state = "NONE";
var properties = Entities.getEntityProperties(id, ["parentID"]);
var children = Entities.getChildrenIDs(id);
var children = getDomainOnlyChildrenIDs(id);
if (properties.parentID !== Uuid.NULL) {
if (children.length > 0) {
state = "PARENT_CHILDREN";
@ -2923,4 +2923,17 @@ function getParentState(id) {
return state;
}
function getDomainOnlyChildrenIDs(id) {
var allChildren = Entities.getChildrenIDs(id);
var domainOnlyChildren = [];
var properties;
for (var i = 0; i < allChildren.length; i++) {
properties = Entities.getEntityProperties(allChildren[i], ["entityHostType"]);
if (properties.entityHostType == "domain") {
domainOnlyChildren.push(allChildren[i]);
}
}
return domainOnlyChildren;
}
}()); // END LOCAL_SCOPE