From b4090249374f07ea931116fc6a0e905b1e2f3433 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 Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- 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 7328e7d015..6f74605082 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -856,7 +856,6 @@ function($window , egStrings) { var entry = { 'when' : new Date(), 'msg' : message, - 'data' : data, 'action' : data.action, 'actor' : egCore.auth.user().usrname() }; @@ -885,6 +884,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