From 58eb7cf5c52ebfb0330bf4a24897ca76fc03583b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 22 Jan 2020 10:10:20 -0500 Subject: [PATCH] LP1860468 Org unit admin interface sorting Sort org units by name alphabetically in the Angular Org Unit admin interface navigation tree. Signed-off-by: Bill Erickson Signed-off-by: Lynn Floyd --- Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.ts index 714d7b7e51..a5af71702c 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.ts @@ -96,7 +96,12 @@ export class OrgUnitComponent implements OnInit { 'admin.server.org_unit.treenode', {org: orgNode} ).then(label => treeNode.label = label); - orgNode.children().forEach(childNode => + // 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, b) => a.name() < b.name() ? -1 : 1) + .forEach(childNode => treeNode.children.push(handleNode(childNode)) ); -- 2.11.0