From a130a0eaab9737b86cb3fdc790e2f6c906cb1b54 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 6 Jul 2022 15:32:42 -0400 Subject: [PATCH] LP1884950 Org Unit Admin Scrolling Admin -> Server Admin -> Organizational Units now displays the tree of org units in a vertical-scrollable div which occupies 80% of the vertical window space. Tree is opened to the first level of child nodes. Deeper child nodes are collapsed. Signed-off-by: Bill Erickson Signed-off-by: Dawn Dale Signed-off-by: Chris Sharp --- .../app/staff/admin/server/org-unit.component.html | 4 +++- .../src/app/staff/admin/server/org-unit.component.ts | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html index 294d62c2bf..0955e981ad 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html @@ -22,7 +22,9 @@

Org Units

- +
+ +
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 ff5a1846f4..160e9725e0 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 @@ -19,6 +19,8 @@ export class OrgUnitComponent implements OnInit { tree: Tree; selected: TreeNode; + winHeight = 500; + @ViewChild('editString', { static: true }) editString: StringComponent; @ViewChild('errorString', { static: true }) errorString: StringComponent; @ViewChild('delConfirm', { static: true }) delConfirm: ConfirmDialogComponent; @@ -72,13 +74,16 @@ export class OrgUnitComponent implements OnInit { const node = this.tree.findNode(selectNodeId); this.selected = node; this.tree.selectNode(node); + + // Subtract out the menu bar plus a bit more. + this.winHeight = window.innerHeight * 0.8; }); } // Translate the org unt type tree into a structure EgTree can use. ingestAouTree(aouTree) { - const handleNode = (orgNode: IdlObject): TreeNode => { + const handleNode = (orgNode: IdlObject, expand?: boolean): TreeNode => { if (!orgNode) { return; } if (!orgNode.hours_of_operation()) { @@ -88,7 +93,8 @@ export class OrgUnitComponent implements OnInit { const treeNode = new TreeNode({ id: orgNode.id(), label: orgNode.name(), - callerData: {orgUnit: orgNode} + callerData: {orgUnit: orgNode}, + expanded: expand }); // Apply the compiled label asynchronously @@ -108,7 +114,7 @@ export class OrgUnitComponent implements OnInit { return treeNode; }; - const rootNode = handleNode(aouTree); + const rootNode = handleNode(aouTree, true); this.tree = new Tree(rootNode); } -- 2.43.2