LP#1901072 Menus Don't Recognize Max Recent Patrons Setting
authorDan Briem <dbriem@wlsmail.org>
Sat, 4 Mar 2023 21:10:44 +0000 (21:10 +0000)
committerJane Sandberg <js7389@princeton.edu>
Wed, 10 May 2023 13:08:34 +0000 (06:08 -0700)
On the Angular menu, both Retrieve Last Patron and Recent Patrons
links appear under Circulation, regardless of what the "Number of
Retrievable Recent Patrons" setting is set to.

On both the AngularJS and Angular menus, both links appear under
Circulation (Experimental).

On the Angular menu, Circulation->Retrieve Recent Patrons links
to the Angular interface instead of the AngularJS interface.

To test this fix:
1. Set Enable Angular Circulation Menu setting to True
2. Set Number of Retrievable Recent Patrons setting to 0
   - Retrieve Last Patron and Recent Patrons links don't appear
3. Set to 1 or unset (default fallback is 1)
   - Retrieve Last Patron link appears only
4. Set to greather than 1
   - both links appear
   - Circulation->Retrieve Recent Patrons loads the AngJS interface

Signed-off-by: Dan Briem <dbriem@wlsmail.org>
Signed-off-by: Susan Morrison <smorrison@georgialibraries.org>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>

Open-ILS/src/eg2/src/app/staff/nav.component.html
Open-ILS/src/eg2/src/app/staff/nav.component.ts
Open-ILS/src/templates/staff/navbar.tt2

index facd33c..d7db8bd 100644 (file)
             <span class="material-icons" aria-hidden="true">person_add</span>
             <span i18n>Register Patron</span>
           </a>
-          <a class="dropdown-item" href="/eg/staff/circ/patron/last"
+          <a *ngIf="maxRecentPatrons" class="dropdown-item" href="/eg/staff/circ/patron/last"
             egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc
             keySpec="f8" keyDesc="Retrieve Last Patron">
             <span class="material-icons" aria-hidden="true">redo</span>
             <span i18n>Retrieve Last Patron</span>
           </a>
-          <a class="dropdown-item" routerLink="/staff/circ/patron/search/recents">
+          <a *ngIf="maxRecentPatrons > 1" class="dropdown-item" href="/eg/staff/circ/patron/search?show_recent=1">
             <span class="material-icons" aria-hidden="true">redo</span>
             <span i18n>Retrieve Recent Patrons</span>
           </a>
             <span class="material-icons" aria-hidden="true">person_add</span>
             <span i18n>Register Patron</span>
           </a>
-          <a class="dropdown-item" routerLink="/staff/circ/patron/last"
+          <a *ngIf="maxRecentPatrons" class="dropdown-item" routerLink="/staff/circ/patron/last"
             egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc
             keySpec="f8" keyDesc="Retrieve Last Patron">
             <span class="material-icons" aria-hidden="true">redo</span>
             <span i18n>Retrieve Last Patron</span>
           </a>
-          <a class="dropdown-item" routerLink="/staff/circ/patron/search/recents"
+          <a *ngIf="maxRecentPatrons > 1" class="dropdown-item" routerLink="/staff/circ/patron/search/recents"
             egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc
             keySpec="shift+f4" keyDesc="Retrieve Recent Patrons">
             <span class="material-icons" aria-hidden="true">redo</span>
index e8246b4..d4201a8 100644 (file)
@@ -29,6 +29,7 @@ export class StaffNavComponent implements OnInit, OnDestroy {
     showAngularAcq: boolean;
     curbsideEnabled: boolean;
     showAngularCirc = false;
+    maxRecentPatrons: number = 1;
 
     @ViewChild('navOpChange', {static: false}) opChange: OpChangeComponent;
     permFailedSub: Subscription;
@@ -72,6 +73,10 @@ export class StaffNavComponent implements OnInit, OnDestroy {
             .then(settings => this.curbsideEnabled =
                 Boolean(settings['circ.curbside']));
 
+            this.org.settings('ui.staff.max_recent_patrons')
+            .then(settings => this.maxRecentPatrons =
+                settings['ui.staff.max_recent_patrons'] ?? 1)
+
             // Do we show the angular circ menu?
             // TODO remove these once Angular Circ takes over.
             const angSet = 'ui.staff.angular_circ.enabled';
index 58ce766..4a6f393 100644 (file)
               <span>[% l('Register Patron') %]</span>
             </a>
           </li>
-          <li>
+          <li ng-if="showRecentPatron">
             <a href="/eg2/staff/circ/patron/last">
               <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
               <span>[% l('Retrieve Last Patron') %]</span>
             </a>
           </li>
-          <li>
+          <li ng-if="showRecentPatrons">
             <a href="/eg2/staff/circ/patron/search/recents">
               <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
               <span>[% l('Retrieve Recent Patrons') %]</span>