'admin.server.org_unit.treenode', {org: orgNode.org_unit()}
).then(label => treeNode.label = label);
- // Tree node labels are "name -- shortname". Sorting
- // by name suffices and bypasses the need the wait
- // for all of the labels to interpolate.
orgNode.children()
- .sort((a: IdlObject, b: IdlObject) => a.org_unit().name() < b.org_unit().name() ? -1 : 1)
+ .sort((a: IdlObject, b: IdlObject) => a.sibling_order() < b.sibling_order() ? -1 : 1)
.forEach((childNode: IdlObject) =>
treeNode.children.push(handleNode(childNode))
);