LP1873322: Angular Admin Pages default to workstation OU
authorJane Sandberg <sandbej@linnbenton.edu>
Wed, 10 Feb 2021 19:51:55 +0000 (11:51 -0800)
committerJason Stephenson <jason@sigio.com>
Fri, 19 Mar 2021 18:31:28 +0000 (14:31 -0400)
To test:

1) Apply this patch.
2) Log in using a workstation at a particular org unit.
3) Open some of the following admin pages:

Local Admin > Address Alerts
Local Admin > Carousels
Local Admin > Group Penalty Thresholds
Local Admin > Course Reserves List > Terms Tab
Server Admin > Billing Types
Server Admin > Call Number/Volume Suffixes
Server Admin > Copy Tags
Server Admin > Hard Due Date Configuration
Acquisitions Admin > Cancel Reason Configuration
Acquisitions Admin > Claim Policies
Booking Admin > Resource Types
Booking Admin > Resource Attribute Values

4) Verify that these pages automatically open to your
workstation's org unit.

Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>

Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts

index 3438b47..7cc1650 100644 (file)
@@ -157,7 +157,7 @@ export class AdminPageComponent implements OnInit {
 
         if (this.orgField) {
             this.orgFieldLabel = this.idlClassDef.field_map[this.orgField].label;
-            this.contextOrg = this.org.get(orgId) || this.org.root();
+            this.contextOrg = this.org.get(orgId) || this.org.get(this.auth.user().ws_ou()) || this.org.root();
             this.searchOrgs = {primaryOrgId: this.contextOrg.id()};
         }
     }