From 17082b62f2329f70d8128677d9bfaccb11896271 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 7 Jul 2015 15:49:59 -0400 Subject: [PATCH] LP#1472380 Display all Vandelay authority matches Ensure a row is added for every authority record match in the Vandelay match grid, even when multiple matches refer to the same authority record. Signed-off-by: Bill Erickson Signed-off-by: Jason Stephenson --- Open-ILS/web/js/ui/default/vandelay/vandelay.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js index 64bef5478e..682bade3be 100644 --- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js +++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js @@ -649,8 +649,26 @@ function vlLoadMatchUI(recId) { currentMatchedRecords = recs; vlMatchGrid.setStructure(vlMatchGridLayout); + var cls = 'bre'; + if (currentType == 'auth') { + cls = 'are'; + + // When fetching authority records from matches, we + // only fetch one instance of each record, even though + // it may be used by multiple matches. Modify the + // array of records so that each match has a + // corresponding authority record in the list. + var new_recs = []; + dojo.forEach(matches, function(match) { + var rec = recs.filter(function(r) { + return r.id() == match.eg_record() })[0]; + new_recs.push(rec); + }); + recs = new_recs; + } + // build the data store of records with match information - var dataStore = bre.toStoreData(recs, null, + var dataStore = fieldmapper[cls].toStoreData(recs, null, {virtualFields:['_id', 'match_score', 'match_quality', 'rec_quality']}); dataStore.identifier = '_id'; -- 2.11.0