From 00de31433cc02b1f3233f8ed2aff5ab30f9c24e1 Mon Sep 17 00:00:00 2001
From: Bill Erickson <berickxx@gmail.com>
Date: Wed, 20 Feb 2019 13:51:36 -0500
Subject: [PATCH] LP1811288 Basic admin page readonlyFields repair

Fix a bug in the basic admin page component that prevented the readOnly
fields from successfully propagating to the fieldmapper editor.

To Test:
1. Navigate to /eg2/en-US/staff/admin/booking/resource_type
2. Click "New Resource Type"
3. Confirm the "Bibliographic Record" field is disabled.

Includes ng-lint repair as well.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
---
 Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts | 5 ++---
 1 file changed, 2 insertions(+), 3 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 d0b9224cf6..472245c892 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
@@ -12,7 +12,7 @@ import {IdlService} from '@eg/core/idl.service';
       </eg-title>
       <eg-staff-banner bannerText="{{classLabel}} Configuration" i18n-bannerText>
       </eg-staff-banner>
-      <eg-admin-page persistKeyPfx="{{persistKeyPfx}}" idlClass="{{idlClass}}" 
+      <eg-admin-page persistKeyPfx="{{persistKeyPfx}}" idlClass="{{idlClass}}"
         readonlyFields="{{readonlyFields}}"></eg-admin-page>
     `
 })
@@ -59,12 +59,11 @@ export class BasicAdminPageComponent implements OnInit {
 
         // Pass the readonlyFields param if available
         if (this.route.snapshot.data &&
-            this.route.snapshot.data.length &&
+            this.route.snapshot.data[0] && // snapshot.data is a HASH.
             this.route.snapshot.data[0].readonlyFields) {
             this.readonlyFields = this.route.snapshot.data[0].readonlyFields;
         }
 
-
         Object.keys(this.idl.classes).forEach(class_ => {
             const classDef = this.idl.classes[class_];
             if (classDef.table === fullTable) {
-- 
2.11.0