From fe1ff53dba6dffc9fdcbf5665128553e265e5e6b Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 17 Jul 2019 18:02:39 -0400 Subject: [PATCH] LP1837059 Basic admin page can propagate disableOrgFilter Allow admin pages to hide the automagic org unit filter by passing the value in via the route. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- .../app/staff/admin/basic-admin-page.component.ts | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts index 472245c892..ceed28792d 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts @@ -13,7 +13,8 @@ import {IdlService} from '@eg/core/idl.service'; + readonlyFields="{{readonlyFields}}" + [disableOrgFilter]="disableOrgFilter"> ` }) @@ -24,6 +25,9 @@ export class BasicAdminPageComponent implements OnInit { persistKeyPfx: string; readonlyFields = ''; + // Tell the admin page to disable and hide the automagic org unit filter + disableOrgFilter: boolean; + constructor( private route: ActivatedRoute, private idl: IdlService @@ -58,10 +62,17 @@ export class BasicAdminPageComponent implements OnInit { } // Pass the readonlyFields param if available - if (this.route.snapshot.data && - this.route.snapshot.data[0] && // snapshot.data is a HASH. - this.route.snapshot.data[0].readonlyFields) { - this.readonlyFields = this.route.snapshot.data[0].readonlyFields; + if (this.route.snapshot.data && this.route.snapshot.data[0]) { + // snapshot.data is a HASH. + const data = this.route.snapshot.data[0]; + + if (data.readonlyFields) { + this.readonlyFields = data.readonlyFields; + } + + if (data.disableOrgFilter) { + this.disableOrgFilter = true; + } } Object.keys(this.idl.classes).forEach(class_ => { -- 2.11.0