From 2f4d0075957f148c6044834f8e47dd2e65a533f4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 5 Apr 2021 11:47:26 -0400 Subject: [PATCH] LPXXX Vandelay Matches grid correctly handles dupe targets Fixes an issue where a queued record matches a bib record via multiple matches and the user is unable to select only one of the matches for overlay. Signed-off-by: Bill Erickson --- .../src/eg2/src/app/staff/cat/vandelay/import.component.ts | 6 +++++- .../app/staff/cat/vandelay/queued-record-matches.component.ts | 11 +++++++---- .../src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts index 08f795d84f..d076bf10d9 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.ts @@ -574,7 +574,11 @@ export class ImportComponent implements OnInit, AfterViewInit, OnDestroy { }; if (this.vandelay.importSelection) { - options.overlay_map = this.vandelay.importSelection.overlayMap; + options.overlay_map = {}; + for (let recId in this.vandelay.importSelection.overlayMap) { + options.overlay_map[recId] = + this.vandelay.importSelection.overlayMap[recId].eg_record(); + } } return options; diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record-matches.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record-matches.component.ts index 10060e05af..447e7c0255 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record-matches.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/queued-record-matches.component.ts @@ -20,7 +20,7 @@ import {VandelayService, VandelayImportSelection} from './vandelay.service'; export class QueuedRecordMatchesComponent implements OnInit { @Input() queueType: string; - @Input() recordId: number; + @Input() recordId: number; // queued record ID @ViewChild('bibGrid', { static: false }) bibGrid: GridComponent; @ViewChild('authGrid', { static: false }) authGrid: GridComponent; @@ -85,15 +85,18 @@ export class QueuedRecordMatchesComponent implements OnInit { this.vandelay.importSelection = selection; } const match = this.matchMap[matchId]; - selection.overlayMap[this.recordId] = match.eg_record(); + selection.overlayMap[this.recordId] = match; } } isOverlayTarget(matchId: number): boolean { const selection = this.vandelay.importSelection; if (selection) { - const match = this.matchMap[matchId]; - return selection.overlayMap[this.recordId] === match.eg_record(); + const forRec: IdlObject = selection.overlayMap[this.recordId]; + if (forRec) { + const match = this.matchMap[matchId]; + return forRec.id() === match.id(); + } } return false; } diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts index cd52d44e1f..3d97ba1d7e 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/vandelay.service.ts @@ -19,7 +19,7 @@ export class VandelayImportSelection { recordIds: number[]; queue: IdlObject; importQueue: boolean; // import the whole queue - overlayMap: {[qrId: number]: /* breId */ number}; + overlayMap: {[qrId: number]: /* match */ IdlObject}; constructor() { this.recordIds = []; -- 2.11.0