LP#1641708 Work log avoid storing unneeded data user/berick/lp1641708-webstaff-worklog-lean-data
authorBill Erickson <berickxx@gmail.com>
Mon, 14 Nov 2016 19:36:59 +0000 (14:36 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 15 Feb 2017 15:40:45 +0000 (10:40 -0500)
Avoid storing full transaction data with each work log entry.  Only
store data need for work log display and actions.

Includes the addition of a new field (entry.hold_id) for hold requests
so that the value does not have live in the large data blob.

To test:

1. Peform checkouts, holds placements,  and other log-tracked actions
   in the client.
2. Open Administration -> Workstation -> Stored Preferences and see
   values for key "eg.patron_log".  Values added after the patch will only
   contain ~8 keys with string values, no large nested objects.
3. Open Administration -> Local Administration -> Work Log and confirm
   recent log-tracked actions are all represented in the grid.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/staff/admin/workstation/log.js
Open-ILS/web/js/ui/default/staff/services/ui.js

index b2411e2..9ef44f7 100644 (file)
@@ -73,7 +73,7 @@ function($scope , $q , $routeParams , $window , $timeout , egCore , egGridDataPr
 
     function fetch_hold(deferred,entry) {
         return egCore.pcrud.search('ahr',
-            { 'id' : entry.data.hold_id }, {
+            { 'id' : entry.hold_id }, {
                 'flesh' : 2,
                 'flesh_fields' : {
                     'ahr' : ['usr','current_copy'],
@@ -92,7 +92,7 @@ function($scope , $q , $routeParams , $window , $timeout , egCore , egGridDataPr
 
     function fetch_patron(deferred,entry) {
         return egCore.pcrud.search('au',
-            { 'id' : entry.data.patron_id }, {}
+            { 'id' : entry.patron_id }, {}
         ).then(
             function(usr) {
                 entry.user = usr.family_name();
index 3ed6429..8809ae7 100644 (file)
@@ -622,7 +622,6 @@ function($window , egStrings) {
         var entry = {
             'when' : new Date(),
             'msg' : message,
-            'data' : data,
             'action' : data.action,
             'actor' : egCore.auth.user().usrname()
         };
@@ -651,6 +650,7 @@ function($window , egStrings) {
             || data.action == 'registered_patron'
             || data.action == 'paid_bill') {
             entry['patron_id'] = data.patron_id;
+            entry['hold_id'] = data.hold_id;
         }
         if (data.action == 'paid_bill') {
             entry['amount'] = data.total_amount;