From: Jason Etheridge Date: Mon, 15 May 2023 04:44:03 +0000 (-0400) Subject: we're losing i18n here, but the string process was stopping halfway through the tree... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=762b14f5f863c02c83795782a64527e78092ab70;p=working%2FEvergreen.git we're losing i18n here, but the string process was stopping halfway through the tree, giving us mixed label formatting with a cloned tree Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.html index a9ac6f2de3..f20a56f4e6 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.html @@ -13,12 +13,6 @@ dialogBody="Delete Org Unit {{selected ? selected.label : ''}}?"> - - {{org.name()}} -- {{org.shortname()}} - - -

Full Org Unit Tree

diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.ts index 10fa01d2de..35f09dd1c4 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/custom-org-unit-trees.component.ts @@ -7,7 +7,7 @@ import {OrgService} from '@eg/core/org.service'; import {PcrudService} from '@eg/core/pcrud.service'; //import {ToastService} from '@eg/share/toast/toast.service'; import {StringComponent} from '@eg/share/string/string.component'; -import {StringService} from '@eg/share/string/string.service'; +//import {StringService} from '@eg/share/string/string.service'; import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component'; @Component({ @@ -32,7 +32,7 @@ export class CustomOrgUnitTreesComponent implements OnInit { //private idl: IdlService, private org: OrgService, private pcrud: PcrudService, - private strings: StringService, + //private strings: StringService, //private toast: ToastService ) {} @@ -58,9 +58,9 @@ export class CustomOrgUnitTreesComponent implements OnInit { this.ingestAouTree(tree); // sets this.tree as a side-effect if (!selectNodeId) { selectNodeId = this.org.root().id(); } - const node = this.tree.findNode(selectNodeId); + /*const node = this.tree.findNode(selectNodeId); this.selected = node; - this.tree.selectNode(node); + this.tree.selectNode(node);*/ return this.tree; } catch (E) { @@ -120,16 +120,11 @@ export class CustomOrgUnitTreesComponent implements OnInit { const treeNode = new TreeNode({ id: orgNode.id(), - label: orgNode.name(), + label: orgNode.name() + '--' + orgNode.shortname(), callerData: {orgUnit: orgNode}, expanded: expand }); - // Apply the compiled label asynchronously - this.strings.interpolate( - 'admin.server.org_unit.treenode', {org: orgNode} - ).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. @@ -153,16 +148,11 @@ export class CustomOrgUnitTreesComponent implements OnInit { const treeNode = new TreeNode({ id: orgNode.id(), - label: orgNode.org_unit().name(), + label: orgNode.org_unit().name() + '--' + orgNode.org_unit().shortname(), callerData: {orgUnit: orgNode}, expanded: expand }); - // Apply the compiled label asynchronously - this.strings.interpolate( - 'admin.server.org_unit.treenode', {org: orgNode.org_unit()} - ).then(label => treeNode.label = label); - orgNode.children() .sort((a: IdlObject, b: IdlObject) => a.sibling_order() < b.sibling_order() ? -1 : 1) .forEach((childNode: IdlObject) => @@ -202,20 +192,20 @@ export class CustomOrgUnitTreesComponent implements OnInit { const sourceNodes = this.tree.selectedNodes(); const targetNodes = this.custom_tree.selectedNodes(); if (sourceNodes.length === 0) { - console.log('isCopyNodesAllowed', false); + console.log('isCopyNodesAllowed: no sourceNodes selected', false); return false; } if (targetNodes.length !== 1) { - console.log('isCopyNodesAllowed', false); + console.log('isCopyNodesAllowed: need exactly 1 targetNode selected', false); return false; } for (let sourceNode of sourceNodes) { if (this.custom_tree.findNodesByFieldAndValue('label', sourceNode.label).length > 0) { - console.log('isCopyNodesAllowed', false); + console.log('isCopyNodesAllowed: selected SourceNode already in custom_tree', false); return false; } if (sourceNode === this.tree.rootNode) { - console.log('isCopyNodesAllowed', false); + console.log('isCopyNodesAllowed: rootNode is sacrosanct', false); return false; } }