sort custom tree siblings by sibling_order
authorJason Etheridge <phasefx@gmail.com>
Mon, 15 May 2023 01:32:46 +0000 (21:32 -0400)
committerJason Etheridge <phasefx@gmail.com>
Thu, 25 May 2023 16:45:32 +0000 (12:45 -0400)
Signed-off-by: Jason Etheridge <phasefx@gmail.com>
Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.ts

index 7befd57..95d5958 100644 (file)
@@ -156,11 +156,8 @@ export class CustomOrgUnitTreesComponent implements OnInit {
                 '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))
             );