id: number; // == record.id() for convenience
metabibId: number; // If present, this is a metabib summary
metabibRecords: number[]; // all constituent bib records
- metabibAttributes: any; // combined attributes for metabib records; would be redundant with attributes if the BibRecordSummary is populated by a metarecord, and so is not populated in that case
+ staffViewMetabibId: number; // to supplement a record summary
+ staffViewMetabibRecords: number[]; // to supplement a record summary
+ staffViewMetabibAttributes: any; // to supplement a record summary
orgId: number;
orgDepth: number;
record: IdlObject;
.pipe(map(bibSummary => {
const summary = new BibRecordSummary(bibSummary.record, orgId);
summary.net = this.net; // inject
- summary.metabibId = Number(bibSummary.metabib_id);
- summary.metabibRecords = bibSummary.metabib_records;
- summary.metabibAttributes = bibSummary.metabib_attributes;
+ summary.staffViewMetabibId = Number(bibSummary.staff_view_metabib_id);
+ summary.staffViewMetabibRecords = bibSummary.staff_view_metabib_records;
+ summary.staffViewMetabibAttributes = bibSummary.staff_view_metabib_attributes;
summary.display = bibSummary.display;
summary.attributes = bibSummary.attributes;
summary.holdCount = bibSummary.hold_count;
<div class="col-lg-4 font-weight-bold" i18n>Formats and Editions:</div>
<div class="col-lg-8 pl-1">
<ul class="list-group">
- <ng-container *ngIf="summary.metabibAttributes.icon_format">
- <li class="list-group-item" *ngFor="let _x of summary.metabibAttributes.icon_format.label | keyvalue">
+ <ng-container *ngIf="summary.staffViewMetabibAttributes.icon_format">
+ <li class="list-group-item" *ngFor="let _x of summary.staffViewMetabibAttributes.icon_format.label | keyvalue">
<span>{{_x.key}} ({{_x.value}})</span>
</li>
</ng-container>
- <ng-container *ngIf="summary.metabibAttributes.item_lang">
- <li class="list-group-item" *ngFor="let _x of summary.metabibAttributes.item_lang.label | keyvalue">
+ <ng-container *ngIf="summary.staffViewMetabibAttributes.item_lang">
+ <li class="list-group-item" *ngFor="let _x of summary.staffViewMetabibAttributes.item_lang.label | keyvalue">
<span>{{_x.key}} ({{_x.value}})</span>
</li>
</ng-container>
desc => q/
Stream of record summary objects including id, record,
hold_count, copy_counts, display (metabib display
- fields), attributes (metabib record attrs), plus
- metabib_id and metabib_records for the metabib variant.
+ fields), and attributes (metabib record attrs). The
+ metabib variant of the call gets metabib_id and
+ metabib_records, and the regular record version also
+ gets some metabib information, but returns them as
+ staff_view_metabib_id, staff_view_metabib_records, and
+ staff_view_metabib_attributes. This is to mitigate the
+ need for code changes elsewhere where assumptions are
+ made when certain fields are returned.
+
/
}
}
# Let's get Formats & Editions data FIXME: consider peer bibs?
unless ($is_meta) {
- # metabib variant of this call already handle $response->{metabib_id} and $response->{metabib_records},
- # and $response->{metabib_attributes} would be redundant with $response->{attributes} in that case, so
- # is not populated unless using the non-metarecord variants of the call
my $meta_search = $e->search_metabib_metarecord_source_map({source => $rec_id});
if ($meta_search) {
- $response->{metabib_id} = $meta_search->[0]->metarecord;
- my $maps = $e->search_metabib_metarecord_source_map({metarecord => $response->{metabib_id}});
+ $response->{staff_view_metabib_id} = $meta_search->[0]->metarecord;
+ my $maps = $e->search_metabib_metarecord_source_map({metarecord => $response->{staff_view_metabib_id}});
my @metabib_records = map { $_->source } @$maps;
- $response->{metabib_records} = \@metabib_records;
+ $response->{staff_view_metabib_records} = \@metabib_records;
my $attributes = $U->get_bre_attrs(\@metabib_records);
# we get "243":{
}
}
}
- $response->{metabib_attributes} = $metabib_attr;
+ $response->{staff_view_metabib_attributes} = $metabib_attr;
}
}