From f926b2173c3c447161acd9d5c1de266f554f153e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 14 Nov 2016 14:36:59 -0500 Subject: [PATCH] LP#1641708 Work log avoid storing unneeded data 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 --- Open-ILS/web/js/ui/default/staff/admin/workstation/log.js | 4 ++-- Open-ILS/web/js/ui/default/staff/services/ui.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/admin/workstation/log.js b/Open-ILS/web/js/ui/default/staff/admin/workstation/log.js index b2411e2bb5..9ef44f7c1b 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/workstation/log.js +++ b/Open-ILS/web/js/ui/default/staff/admin/workstation/log.js @@ -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(); diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js index 3ed642912d..8809ae75de 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -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; -- 2.11.0