From 1bfa3234d33b028dc87213c1bfb590a5fbe214e0 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 12 Mar 2019 12:56:47 -0400 Subject: [PATCH] LPXXX Catalog title link uses routerLink Signed-off-by: Bill Erickson --- .../app/staff/catalog/result/record.component.html | 16 ++++++++--- .../app/staff/catalog/result/record.component.ts | 31 +++++++++++++--------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.html index 90f066b1e9..f97395afef 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.html @@ -31,10 +31,18 @@
diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts index dd13b9d8f6..cea36a1cf4 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.ts @@ -82,22 +82,27 @@ export class ResultRecordComponent implements OnInit, OnDestroy { this.staffCat.search(); } - /** - * Propagate the search params along when navigating to each record. - */ - navigateToRecord(summary: BibRecordSummary) { + + // Returns the URL parameters for the current page plus the + // "fromMetarecord" param used for linking title links to + // MR constituent result records list. + appendFromMrParam(summary: BibRecordSummary): any { + this.searchContext.termSearch.fromMetarecord = summary.metabibId; const params = this.catUrl.toUrlParams(this.searchContext); + this.searchContext.termSearch.fromMetarecord = null; + return params; + } - // Jump to metarecord constituent records page when a - // MR has more than 1 constituents. - if (summary.metabibId && summary.metabibRecords.length > 1) { - this.searchContext.termSearch.fromMetarecord = summary.metabibId; - this.staffCat.search(); - return; - } + // Returns true if the selected record summary is a metarecord summary + // and it links to more than one constituent bib record. + hasMrConstituentRecords(summary: BibRecordSummary): boolean { + return ( + summary.metabibId && summary.metabibRecords.length > 1 + ); + } - this.router.navigate( - ['/staff/catalog/record/' + summary.id], {queryParams: params}); + currentParams(): any { + return this.catUrl.toUrlParams(this.searchContext); } toggleBasketEntry() { -- 2.11.0