lp1959010 toward Staff View tab
authorJason Etheridge <jason@EquinoxOLI.org>
Thu, 10 Nov 2022 21:01:23 +0000 (16:01 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 28 Mar 2023 14:46:33 +0000 (10:46 -0400)
* link searches for listed genres
* s/Abstract:/Summary:/
* link to View all Formats and Editions
* remove border from staff view
* tweaking what goes where
* add metabib record count next to View all Formats and Editions link
* remove links for what boils down to marc 508 and 511
* made the count off-by-one trying to not make it off-by-one :)
* remove the creator field
* keep just Subject:
* remove the Record is or is not holdable information as it doesn't present the whole truth
* refresh interface on tab change

Signed-off-by: Jason Etheridge <jason@EquinoxOLI.org>
Signed-off-by: Mary Llewellyn <mllewell@biblio.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html
Open-ILS/src/eg2/src/app/staff/share/bib-staff-view/bib-staff-view.component.html
Open-ILS/src/eg2/src/app/staff/share/bib-staff-view/bib-staff-view.component.ts

index c4384a0..114ebca 100644 (file)
@@ -41,7 +41,7 @@
       <li role="presentation" [ngbNavItem]="'staff_view'">
         <a i18n ngbNavLink role="tab">Staff View</a>
         <ng-template ngbNavContent>
-          <eg-bib-staff-view [bibSummary]="summaryForDisplay()">
+          <eg-bib-staff-view [recordId]="recordId" [bibSummary]="summaryForDisplay()">
           </eg-bib-staff-view>
         </ng-template>
       </li>
index 65cbc4d..e69032d 100644 (file)
@@ -1,4 +1,4 @@
-<div class='eg-bib-staff-view card tight-card w-100' *ngIf="summary">
+<div class='eg-bib-staff-view w-100' *ngIf="summary">
     <div class="row"><!-- "table" -->
 
         <!-- 1st column -->
                 </div>
             </div><!-- end Col 1, Author Row -->
 
-            <!-- Col 1, Creator Row -->
-            <div *ngIf="summary.display.creators" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Creator:</div>
-                <div class="col-sm-8 bib-details">
-                    <ul>
-                        <li *ngFor="let _creator of summary.display.creators">
-                            <a href="/eg2/staff/catalog/search?query={{_creator}}&fieldClass=author&joinOp=&matchOp=contains&dateOp=is">
-                                {{_creator}}
-                            </a>
-                        </li>
-                    </ul>
-                </div>
-            </div><!-- end of Col 1, Creator Row -->
-
             <!-- Col 1, Performer Row -->
             <div *ngIf="summary.display.performers" class="row">
                 <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Performer:</div>
                 <div class="col-sm-8 bib-details">
                     <ul>
                         <li *ngFor="let _performer of summary.display.performers">
-                            <a href="/eg2/staff/catalog/search?query={{_performer}}&fieldClass=author&joinOp=&matchOp=contains&dateOp=is">
-                                {{_performer}}
-                            </a>
+                            {{_performer}}
                         </li>
                     </ul>
                 </div>
@@ -88,9 +72,7 @@
                 <div class="col-sm-8 bib-details">
                     <ul>
                         <li *ngFor="let _credit of summary.display.production_credits">
-                            <a href="/eg2/staff/catalog/search?query={{_credit}}&fieldClass=author&joinOp=&matchOp=contains&dateOp=is">
-                                {{_credit}}
-                            </a>
+                            {{_credit}}
                         </li>
                     </ul>
                 </div>
                 </div>
             </div><!-- end of Col 1, Physical Description Row -->
 
-            <!-- Col 1, General Note Row -->
-            <div *ngIf="summary.display.general_note" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>General Note:</div>
-                <div class="col-sm-8 bib-details">
-                    <ul>
-                        <li *ngFor="let _note of summary.display.general_note">
-                            {{_note}}
-                        </li>
-                    </ul>
-                </div>
-            </div><!-- end of Col 1, General Note Row -->
-
-            <!-- Col 1, Bibliography Row -->
-            <div *ngIf="summary.display.bibliography" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Bibliography:</div>
-                <div class="col-sm-8 bib-details">
-                    <ul>
-                        <li *ngFor="let _bibliography of summary.display.bibliography">
-                            {{_bibliography}}
-                        </li>
-                    </ul>
-                </div>
-            </div><!-- end of Col 1, Bibliography Row -->
-
-            <!-- Col 1, TOC Row -->
-            <div *ngIf="summary.display.toc" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Table of Contents:</div>
-                <div class="col-sm-8 bib-details">
-                    {{summary.display.toc}}
-                </div>
-            </div><!-- end of Col 1, TOC Row -->
-
-            <!-- Col 1, Thesis Row -->
-            <div *ngIf="summary.display.thesis" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Thesis:</div>
-                <div class="col-sm-8 bib-details">
-                    <ul>
-                        <li *ngFor="let _thesis of summary.display.thesis">
-                            {{_thesis}}
-                        </li>
-                    </ul>
-                </div>
-            </div><!-- end of Col 1, Thesis Row -->
-
-        </div><!-- 1st column -->
-
-        <div class="col-md-4"><!-- 2nd column -->
-
-            <!-- Col 2, ISBN Row -->
+            <!-- Col 1, ISBN Row -->
             <div *ngIf="summary.display.isbn" class="row">
                 <div class="col-sm-4 font-weight-bold bib-details-title" i18n>ISBN:</div>
                 <div class="col-sm-8 bib-details">
                         </li>
                     </ul>
                 </div>
-            </div><!-- end of Col 2, ISBN Row -->
+            </div><!-- end of Col 1, ISBN Row -->
 
             <!-- Col 1, ISSN Row -->
             <div *ngIf="summary.display.issn" class="row">
                 </div>
             </div><!-- end of Col 1, UPC Row -->
 
-            <!-- Col 1, Hold and Copy Counts Row -->
-            <div class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Hold and Copy Counts:</div>
-                <div class="col-sm-8 bib-details">
-                    <ul>
-                        <li><span i18n>{{summary.holdCount}} hold requests</span></li>
-                        <li>
-                            <span i18n *ngIf=" summary.isHoldable">Record is holdable.</span>
-                            <span i18n *ngIf="!summary.isHoldable">Record is not holdable.</span>
-                        </li>
-                        <li *ngFor="let _count of summary.holdingsSummary">
-                            <span i18n>{{_count.available}} of {{_count.count}} copies available at {{orgName(_count.org_unit)}}.</span>
-                        </li>
-                    </ul>
-                </div>
-            </div><!-- end of Col 1, Hold and Copy Counts Row -->
-
-            <!-- Col 1, Formats and Editions Row -->
-            <div class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Formats and Editions:</div>
-                <div class="col-sm-8 bib-details">
-                    <ul>
-                        <ng-container *ngIf="summary.staffViewMetabibAttributes.icon_format">
-                            <li *ngFor="let _x of summary.staffViewMetabibAttributes.icon_format | keyvalue">
-                                <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}}) icon_format({{_x.key}})">
-                                    {{_x.value.label}}
-                                </a>
-                                    {{_x.value.count}}
-                            </li>
-                        </ng-container>
-                        <ng-container *ngIf="summary.staffViewMetabibAttributes.item_lang">
-                            <li *ngFor="let _x of summary.staffViewMetabibAttributes.item_lang | keyvalue">
-                                <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}}) item_lang({{_x.key}})">
-                                    {{_x.value.label}}
-                                </a>
-                                    {{_x.value.count}}
-                            </li>
-                        </ng-container>
-                    </ul>
-                </div>
-            </div><!-- end of Col 1, Formats and Editions Row -->
-
-        </div><!-- 2nd column -->
+        </div><!-- 1st column -->
 
-        <div class="col-md-4"><!-- 3rd column -->
+        <!-- 2nd column -->
+        <div class="col-md-4">
 
-            <!-- Col 3, Abstract Row -->
+            <!-- Col 2, Abstract Row -->
             <div *ngIf="summary.display.abstract" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Abstract:</div>
+                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Summary:</div>
                 <div class="col-sm-8 bib-details">
                     {{summary.display.abstract}}
                 </div>
-            </div><!-- end of Col 3, Abstract Row -->
+            </div><!-- end of Col 2, Abstract Row -->
 
-            <!-- Col 3, Subject Row -->
-            <div *ngIf="summary.display.subject" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Subject:</div>
+            <!-- Col 2, General Note Row -->
+            <div *ngIf="summary.display.general_note" class="row">
+                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>General Note:</div>
                 <div class="col-sm-8 bib-details">
                     <ul>
-                        <li *ngFor="let _subj of summary.display.subject">
-                            <a href="/eg2/staff/catalog/search?query={{_subj}}&fieldClass=subject&joinOp=&matchOp=contains&dateOp=is">
-                                {{_subj}}
-                            </a>
+                        <li *ngFor="let _note of summary.display.general_note">
+                            {{_note}}
                         </li>
                     </ul>
                 </div>
-            </div><!-- end of Col 3, Subject Row -->
+            </div><!-- end of Col 2, General Note Row -->
 
-            <!-- Col 3, Subject Name Row -->
-            <div *ngIf="summary.display.subject_name" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Subject Name:</div>
+            <!-- Col 2, Bibliography Row -->
+            <div *ngIf="summary.display.bibliography" class="row">
+                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Bibliography:</div>
                 <div class="col-sm-8 bib-details">
                     <ul>
-                        <li *ngFor="let _subj of summary.display.subject_name">
-                            <a href="/eg2/staff/catalog/search?query={{_subj}}&fieldClass=subject&joinOp=&matchOp=contains&dateOp=is">
-                                {{_subj}}
-                            </a>
+                        <li *ngFor="let _bibliography of summary.display.bibliography">
+                            {{_bibliography}}
                         </li>
                     </ul>
                 </div>
-            </div><!-- end of Col 3, Subject Name Row -->
+            </div><!-- end of Col 2, Bibliography Row -->
+
+            <!-- Col 2, TOC Row -->
+            <div *ngIf="summary.display.toc" class="row">
+                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Table of Contents:</div>
+                <div class="col-sm-8 bib-details">
+                    {{summary.display.toc}}
+                </div>
+            </div><!-- end of Col 2, TOC Row -->
 
-            <!-- Col 3, Subject Topic Row -->
-            <div *ngIf="summary.display.subject_topic" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Subject Topic:</div>
+            <!-- Col 2, Thesis Row -->
+            <div *ngIf="summary.display.thesis" class="row">
+                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Thesis:</div>
                 <div class="col-sm-8 bib-details">
                     <ul>
-                        <li *ngFor="let _subj of summary.display.subject_topic">
-                            <a href="/eg2/staff/catalog/search?query={{_subj}}&fieldClass=subject&joinOp=&matchOp=contains&dateOp=is">
-                                {{_subj}}
-                            </a>
+                        <li *ngFor="let _thesis of summary.display.thesis">
+                            {{_thesis}}
                         </li>
                     </ul>
                 </div>
-            </div><!-- end of Col 3, Subject Topic Row -->
+            </div><!-- end of Col 2, Thesis Row -->
+
+        </div><!-- 2nd column -->
+
+        <div class="col-md-4"><!-- 3rd column -->
 
-            <!-- Col 3, Subject Geographic Row -->
-            <div *ngIf="summary.display.subject_geographic" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Subject Geographic:</div>
+            <!-- Col 3, Hold and Copy Counts Row -->
+            <div class="row">
+                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Hold and Copy Counts:</div>
                 <div class="col-sm-8 bib-details">
                     <ul>
-                        <li *ngFor="let _subj of summary.display.subject_geographic">
-                            <a href="/eg2/staff/catalog/search?query={{_subj}}&fieldClass=subject&joinOp=&matchOp=contains&dateOp=is">
-                                {{_subj}}
-                            </a>
+                        <li><span i18n>{{summary.holdCount}} hold requests</span></li>
+                        <li *ngFor="let _count of summary.holdingsSummary">
+                            <span i18n>{{_count.available}} of {{_count.count}} copies available at {{orgName(_count.org_unit)}}.</span>
                         </li>
                     </ul>
                 </div>
-            </div><!-- end of Col 3, Subject Geographic Row -->
+            </div><!-- end of Col 3, Hold and Copy Counts Row -->
+
 
-            <!-- Col 3, Subject Temporal Row -->
-            <div *ngIf="summary.display.subject_temporal" class="row">
-                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Subject Temporal:</div>
+            <!-- Col 3, Subject Row -->
+            <div *ngIf="summary.display.subject" class="row">
+                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Subject:</div>
                 <div class="col-sm-8 bib-details">
                     <ul>
-                        <li *ngFor="let _subj of summary.display.subject_temporal">
+                        <li *ngFor="let _subj of summary.display.subject">
                             <a href="/eg2/staff/catalog/search?query={{_subj}}&fieldClass=subject&joinOp=&matchOp=contains&dateOp=is">
                                 {{_subj}}
                             </a>
                         </li>
                     </ul>
                 </div>
-            </div><!-- end of Col 3, Subject Temporal Row -->
+            </div><!-- end of Col 3, Subject Row -->
 
             <!-- Col 3, Genre Row -->
             <div *ngIf="summary.display.genre" class="row">
                 <div class="col-sm-8 bib-details">
                     <ul>
                         <li *ngFor="let _genre of summary.display.genre">
-                            {{_genre}}
+                            <a href="/eg2/staff/catalog/search?query={{'subject:identifier|genre[' + _genre + ']'}}">
+                                {{_genre}}
+                            </a>
                         </li>
                     </ul>
                 </div>
             </div><!-- end of Col 3, Genre Row -->
 
+            <!-- Col 3, Formats and Editions Row -->
+            <div class="row">
+                <div class="col-sm-4 font-weight-bold bib-details-title" i18n>Formats and Editions:</div>
+                <div class="col-sm-8 bib-details">
+                    <ul>
+                        <ng-container *ngIf="summary.staffViewMetabibAttributes.icon_format">
+                            <li *ngFor="let _x of summary.staffViewMetabibAttributes.icon_format | keyvalue">
+                                <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}}) icon_format({{_x.key}})">
+                                    {{_x.value.label}}
+                                </a>
+                                    {{_x.value.count}}
+                            </li>
+                        </ng-container>
+                        <ng-container *ngIf="summary.staffViewMetabibAttributes.item_lang">
+                            <li *ngFor="let _x of summary.staffViewMetabibAttributes.item_lang | keyvalue">
+                                <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}}) item_lang({{_x.key}})">
+                                    {{_x.value.label}}
+                                </a>
+                                    {{_x.value.count}}
+                            </li>
+                        </ng-container>
+                        <li>
+                            <a href="/eg2/staff/catalog/search?query=from_metarecord({{summary.staffViewMetabibId}})">
+                                <span i18n>View all Formats and Editions</span>
+                            </a>
+                            <span> {{summary.staffViewMetabibRecords.length}}</span>
+                        </li>
+                    </ul>
+                </div>
+            </div><!-- end of Col 3, Formats and Editions Row -->
+
         </div><!-- 3rd column -->
 
     </div><!-- "table" -->
index 2165705..f0418d1 100644 (file)
@@ -12,6 +12,7 @@ import {CatalogService} from '@eg/share/catalog/catalog.service';
 })
 export class BibStaffViewComponent implements OnInit {
 
+    recId: number;
     initDone = false;
 
     // True / false if the display is vertically expanded
@@ -24,8 +25,14 @@ export class BibStaffViewComponent implements OnInit {
     }
     get expand(): boolean { return this._exp; }
 
-    // If provided, the record will be fetched by the component.
-    @Input() recordId: number;
+    @Input() set recordId(id: number) {
+        this.recId = id;
+        // Only force new data collection when recordId()
+        // is invoked after ngInit() has already run.
+        if (this.initDone) {
+            this.loadSummary();
+        }
+    }
 
     // Otherwise, we'll use the provided bib summary object.
     summary: BibRecordSummary;
@@ -49,12 +56,9 @@ export class BibStaffViewComponent implements OnInit {
         .then(value => this.expand = !value)
         .then(_ => this.cat.fetchCcvms())
         .then(_ => {
-            if (this.summary) {
-                return this.summary.getBibCallNumber();
-            } else {
-                if (this.recordId) {
-                    return this.loadSummary();
-                }
+            if (this.recId) {
+                // ignore any existing this.summary, always refetch
+                return this.loadSummary();
             }
         }).then(_ => this.initDone = true);
     }
@@ -65,7 +69,7 @@ export class BibStaffViewComponent implements OnInit {
 
     loadSummary(): Promise<any> {
         return this.bib.getBibSummary(
-            this.recordId,
+            this.recId,
             this.org.root().id(),
             true // isStaff
         ).toPromise()