JBAS-2256 Record bucket grid gets static columns
authorBill Erickson <berickxx@gmail.com>
Mon, 24 Jun 2019 15:59:36 +0000 (11:59 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 24 Jun 2019 15:59:38 +0000 (11:59 -0400)
Work around issues with saving changes to auto-generated column lists in
the AngJS grid by defining a fixed set of columns for the 3 record
bucket grids.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/staff/cat/bucket/record/t_pending.tt2
Open-ILS/src/templates/staff/cat/bucket/record/t_search.tt2
Open-ILS/src/templates/staff/cat/bucket/record/t_view.tt2
Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

index ec4473b..cf50d27 100644 (file)
@@ -3,7 +3,6 @@
   features="-sort,-multisort"
   id-field="id"
   idl-class="rmsr"
-  auto-fields="true"
   items-provider="gridDataProvider"
   menu-label="[% l('Buckets') %]"
   persist-key="cat.bucket.record.pending">
   <eg-grid-action label="[% l('Clear List') %]" 
     handler="resetPendingList"></eg-grid-action>
 
+  <eg-grid-field path="id" required hidden></eg-grid-field>
+  <eg-grid-field path="tcn_value" label="[% l('TCN Value') %]"></eg-grid-field>
+  <eg-grid-field path="tcn_source" label="[% l('TCN Source') %]"></eg-grid-field>
+
   <eg-grid-field label="[% l('Title') %]" path="title">
     <a target="_blank" href="[% ctx.base_path %]/staff/cat/catalog/record/{{item.id}}">
     {{item.title}} <span ng-show="item.id" class="glyphicon glyphicon-new-window"/>
     </a>
   </eg-grid-field>
+
+  <eg-grid-field path="author" label="[% l('Author') %]"></eg-grid-field>
+  <eg-grid-field path="pubdate" label="[% l('Publication Year') %]"></eg-grid-field>
+  <eg-grid-field path="isbn" label="[% l('ISBN') %]"></eg-grid-field>
+  <eg-grid-field path="issn" label="[% l('ISSN') %]"></eg-grid-field>
+  <eg-grid-field label="[% l('Deleted?') %]" path="biblio_record.deleted"></eg-grid-field>
+
 </eg-grid>
index 02506bc..69d8914 100644 (file)
@@ -29,7 +29,6 @@
   ng-hide="forbidden"
   id-field="id"
   idl-class="rmsr"
-  auto-fields="true"
   grid-controls="gridControls"
   menu-label="[% l('Buckets') %]"
   persist-key="cat.bucket.record.search">
   <eg-grid-action label="[% l('Add To Bucket') %]" 
     handler="addToBucket"></eg-grid-action>
 
+  <eg-grid-field path="id" required hidden></eg-grid-field>
+  <eg-grid-field path="tcn_value" label="[% l('TCN Value') %]"></eg-grid-field>
+  <eg-grid-field path="tcn_source" label="[% l('TCN Source') %]"></eg-grid-field>
+
   <eg-grid-field label="[% l('Title') %]" path="title">
     <a target="_blank" href="[% ctx.base_path %]/staff/cat/catalog/record/{{item.id}}">
     {{item.title}} <span ng-show="item.id" class="glyphicon glyphicon-new-window"/>
     </a>
   </eg-grid-field>
+
+  <eg-grid-field path="author" label="[% l('Author') %]"></eg-grid-field>
+  <eg-grid-field path="pubdate" label="[% l('Publication Year') %]"></eg-grid-field>
+  <eg-grid-field path="isbn" label="[% l('ISBN') %]"></eg-grid-field>
+  <eg-grid-field path="issn" label="[% l('ISSN') %]"></eg-grid-field>
+  <eg-grid-field label="[% l('Deleted?') %]" path="biblio_record.deleted"></eg-grid-field>
+
 </eg-grid>
index e20d50e..e1ce676 100644 (file)
@@ -2,7 +2,6 @@
   ng-hide="forbidden"
   id-field="id"
   idl-class="rmsr"
-  auto-fields="true"
   grid-controls="gridControls"
   menu-label="[% l('Buckets') %]"
   persist-key="cat.bucket.record.view">
@@ -29,6 +28,8 @@
     handler="openExportBucketDialog"></eg-grid-action>
 
   <eg-grid-field path="id" required hidden></eg-grid-field>
+  <eg-grid-field path="tcn_value" label="[% l('TCN Value') %]"></eg-grid-field>
+  <eg-grid-field path="tcn_source" label="[% l('TCN Source') %]"></eg-grid-field>
 
   <eg-grid-field label="[% l('Title') %]" path="title">
     <a target="_self" href="[% ctx.base_path %]/staff/cat/catalog/record/{{item.id}}">
     </a>
   </eg-grid-field>
 
+  <eg-grid-field path="author" label="[% l('Author') %]"></eg-grid-field>
+  <eg-grid-field path="pubdate" label="[% l('Publication Year') %]"></eg-grid-field>
+  <eg-grid-field path="isbn" label="[% l('ISBN') %]"></eg-grid-field>
+  <eg-grid-field path="issn" label="[% l('ISSN') %]"></eg-grid-field>
+
   <eg-grid-field label="[% l('Deleted?') %]" path="biblio_record.deleted"></eg-grid-field>
 
   <!-- TODO: this adds much delay to call
index 110ace1..4e01561 100644 (file)
@@ -540,8 +540,18 @@ function($scope,  $q , $routeParams,  bucketSvc,  egCore,  $window,
             // is not a full "mwde" object.  Instead it's a single
             // non-multi-field, JSON-encoded value.
             item['biblio_record.wide_display_entry.edition'] =
-                JSON.parse(item['biblio_record.wide_display_entry.edition'])
-                || '';
+                item['biblio_record.wide_display_entry.edition'] ?
+                JSON.parse(item['biblio_record.wide_display_entry.edition']) :
+                '';
+
+            // Clean up PG text[] cruft
+            if (item.isbn) {
+                item.isbn = item.isbn.replace(/(^\{|\}$)/g, '');
+            }
+
+            if (item.issn) {
+                item.issn = item.issn.replace(/(^\{|\}$)/g, '');
+            }
         }
     };