export class BibRecordSummary {
id: number; // == record.id() for convenience
metabibId: number; // If present, this is a metabib summary
+ metabibRecords: number[]; // all constituent bib records
orgId: number;
orgDepth: number;
record: IdlObject;
this.display = {};
this.attributes = {};
this.bibCallNumber = null;
+ this.metabibRecords = [];
}
ingest() {
this.getBibSummary(metabib.master_record(), orgId, orgDepth)
.subscribe(summary => {
summary.metabibId = metabib.id();
+ summary.metabibRecords =
+ metabib.source_maps().map(map => Number(map.source()))
let promise;
navigatToRecord(summary: BibRecordSummary) {
const params = this.catUrl.toUrlParams(this.searchContext);
- if (summary.metabibId) {
+ // 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;
}
this.router.navigate(
- ['/staff/catalog/record/' + summary.id], {queryParams: params});
+ ['/staff/catalog/record/' + summary.id], {queryParams: params});
}
toggleBasketEntry() {