LP#1908722: add electronic resource links
authorGalen Charlton <gmc@equinoxOLI.org>
Fri, 9 Jul 2021 21:10:31 +0000 (17:10 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Mon, 12 Jul 2021 21:00:32 +0000 (17:00 -0400)
This patch adds electronic resource links to the Show More Details
view in the Angular staff catalog, above the table of items.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/eg2/src/app/staff/catalog/result/record.component.html
Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.ts

index a8cb874..a48f33c 100644 (file)
         </div>
       </div><!-- col -->
     </div><!-- row -->
-    <div class="row" *ngIf="summary.copies">
+    <div class="row" *ngIf="searchContext.showResultExtras && summary.eResourceUrls.length">
+      <div class="col-lg-12 mt-2">
+        <div class="w-auto ml-2 mr-2">
+          <div class="row p-1 mt-1 mb-1 border-top" *ngFor="let url of summary.eResourceUrls">
+            <div class="col-lg-2">
+              <span class="font-weight-bold">
+                <ng-container [ngSwitch]="url.ind2">
+                  <ng-container *ngSwitchCase="'0'" i18n>Electronic Resource:</ng-container>
+                  <ng-container *ngSwitchCase="'1'" i18n>Version of Resource:</ng-container>
+                  <ng-container *ngSwitchCase="'2'" i18n>Related Resource:</ng-container>
+                  <ng-container *ngSwitchDefault i18n>Electronic Resource</ng-container>
+                  </ng-container>
+               </span>
+            </div>
+            <div class="col-lg"><a href="{{url.href}}">{{url.label}}</a> {{url.note}}</div>
+          </div>
+        </div>
+      </div>
+    </div><!-- row -->
+    <div class="row" *ngIf="searchContext.showResultExtras && summary.copies">
       <div class="col-lg-12 mt-2">
         <div class="w-auto ml-2 mr-2">
           <ng-container *ngIf="summary.copies.length">
               <div class="col-lg-3" i18n>{{copy.copy_status}}</div>
             </div>
           </ng-container>
-          <ng-container *ngIf="!summary.copies.length">
+          <ng-container *ngIf="!summary.copies.length && !summary.eResourceUrls.length">
             <span class="font-italic" i18n>No Items To Display</span>
           </ng-container>
         </div>
index 34706f1..afdcd93 100644 (file)
@@ -127,6 +127,8 @@ export class ResultsComponent implements OnInit, OnDestroy {
             'eg.staff.catalog.results.show_more', this.showMoreDetails)
         .then(_ => {
 
+            this.searchContext.showResultExtras = this.showMoreDetails;
+
             if (this.showMoreDetails) {
                 this.staffCat.search();
             } else {