LP1811288 Basic admin page readonlyFields repair
[evergreen-equinox.git] / Open-ILS / src / eg2 / src / app / staff / admin / basic-admin-page.component.ts
index d0b9224..472245c 100644 (file)
@@ -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) {