LP1904036 Separate Circulation (Experimental) Menu
authorBill Erickson <berickxx@gmail.com>
Mon, 7 Jun 2021 16:49:54 +0000 (12:49 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 19 Jan 2022 17:01:15 +0000 (12:01 -0500)
Move all new experimental Angular Circulation interfaces into a single
menu entry which can be enabled via a new org setting:
ui.staff.angular_circ.enabled

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/nav.component.html
Open-ILS/src/eg2/src/app/staff/nav.component.ts
Open-ILS/src/eg2/src/app/staff/resolver.service.ts
Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts
Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-patron.sql
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/services/navbar.js

index 9378ff4..a2c43ff 100644 (file)
             <span class="material-icons" aria-hidden="true">person</span>
             <span i18n>Search for Patrons</span>
           </a>
-          <a class="dropdown-item" routerLink="/staff/circ/patron/search">
-            <span class="material-icons" aria-hidden="true">person</span>
-            <span i18n>Search for Patrons (Experimental)</span>
-          </a>
           <a class="dropdown-item" href="/eg/staff/cat/item/search">
             <span class="material-icons" aria-hidden="true">assignment</span>
             <span i18n>Search for Items by Barcode</span>
             <span class="material-icons" aria-hidden="true">trending_down</span>
             <span i18n>Check In</span>
           </a>
-          <a class="dropdown-item" routerLink="/staff/circ/checkin"
-            egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc
-            keySpec="alt+f2" keyDesc="Checkin">
-            <span class="material-icons" aria-hidden="true">trending_down</span>
-            <span i18n>Check In (Experimental)</span>
-          </a>
           <a class="dropdown-item" href="/eg/staff/circ/checkin/capture"
             egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc
             keySpec="shift+f2" keyDesc="Capture Holds">
             <span class="material-icons" aria-hidden="true">autorenew</span>
             <span i18n>Renew Items</span>
           </a>
-          <a class="dropdown-item" routerLink="/staff/circ/renew">
-            <span class="material-icons" aria-hidden="true">autorenew</span>
-            <span i18n>Renew Items (Experimental)</span>
-          </a>
           <a class="dropdown-item" href="/eg/staff/circ/patron/register"
             egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc
             keySpec="shift+f1" keyDesc="Register 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 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>
       </div>
     </div>
 
+    <!-- 
+      Experimental Circulation Interfaces.
+      Note when these are upgraded to be the real thing, access key
+      attributes will need to be applied
+    -->
+    <div class="navbar-nav" *ngIf="showAngularCirc">
+      <div ngbDropdown class="nav-item dropdown">
+        <a ngbDropdownToggle class="nav-link dropdown-toggle">
+         <span i18n>Circulation (Experimental)</span>
+        </a>
+        <div class="dropdown-menu" ngbDropdownMenu>
+          <a class="dropdown-item" routerLink="/staff/circ/patron/search">
+            <span class="material-icons" aria-hidden="true">person</span>
+            <span i18n>Search for Patrons</span>
+          </a>
+          <div class="dropdown-divider"></div>
+          <a class="dropdown-item" routerLink="/staff/circ/patron/bcsearch">
+            <span class="material-icons" aria-hidden="true">trending_up</span>
+            <span i18n>Check Out</span>
+          </a>
+          <a class="dropdown-item" routerLink="/staff/circ/checkin">
+            <span class="material-icons" aria-hidden="true">trending_down</span>
+            <span i18n>Check In</span>
+          </a>
+          <a class="dropdown-item" routerLink="/staff/circ/checkin/capture">
+            <span class="material-icons" aria-hidden="true">pin_drop</span>
+            <span i18n>Capture Holds</span>
+          </a>
+          <a class="dropdown-item" routerLink="/staff/circ/renew">
+            <span class="material-icons" aria-hidden="true">autorenew</span>
+            <span i18n>Renew Items</span>
+          </a>
+          <a class="dropdown-item" routerLink="/staff/circ/patron/register">
+            <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"
+            *ngIf="showRecentPatron">
+            <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"
+            *ngIf="showRecentPatrons">
+            <span class="material-icons" aria-hidden="true">redo</span>
+            <span i18n>Retrieve Recent Patrons</span>
+          </a>
+        </div>
+      </div>
+    </div>
+
     <!-- CATALOGING -->
     
     <div class="navbar-nav">
index 89d98ac..84c93a9 100644 (file)
@@ -26,6 +26,9 @@ export class StaffNavComponent implements OnInit, OnDestroy {
     // When active, show a link to the experimental Angular staff catalog
     showAngularCatalog: boolean;
     curbsideEnabled: boolean;
+    showAngularCirc = false; // ui.staff.angular_circ.enabled
+    showRecentPatron = false;
+    showRecentPatrons = false;
 
     @ViewChild('navOpChange', {static: false}) opChange: OpChangeComponent;
     permFailedSub: Subscription;
@@ -72,6 +75,17 @@ export class StaffNavComponent implements OnInit, OnDestroy {
         this.permFailedSub =
             this.net.permFailed$.subscribe(
                 (req: NetRequest) => this.opChange.escalateRequest(req));
+
+        this.org.settings([
+            'ui.staff.angular_circ.enabled',
+            'ui.staff.max_recent_patrons'
+        ])
+        .then(sets => {
+            this.showAngularCirc = sets['ui.staff.angular_circ.enabled'];
+            const maxRecent = Number(sets['ui.staff.max_recent_patrons']);
+            this.showRecentPatron = maxRecent > 0;
+            this.showRecentPatrons = maxRecent > 1;
+        });
     }
 
     ngOnDestroy() {
index de6252b..ad9dc10 100644 (file)
@@ -141,6 +141,7 @@ export class StaffResolver implements Resolve<Observable<any>> {
             'webstaff.format.dates',
             'webstaff.format.date_and_time',
             'ui.staff.max_recent_patrons',
+            'ui.staff.angular_circ.enabled',
             'ui.staff.angular_catalog.enabled' // navbar
         ]).then(settings => {
             // Avoid clobbering defaults
index 1891887..ffe0d38 100644 (file)
@@ -1187,7 +1187,7 @@ export class CircService {
         return this.components.badBarcodeDialog.open().toPromise()
         // Avoid prompting again on an override
         .then(response => {
-            params._checkbarcode = false
+            params._checkbarcode = false;
             return response;
         });
     }
index 58abf7c..98e668b 100644 (file)
@@ -422,7 +422,7 @@ UPDATE config.print_template SET template = $TEMPLATE$
   <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
 </div>
 
-$TEMPLATE$ WHERE name = 'transit_slip';
+$TEMPLATE$ WHERE name = 'hold_transit_slip';
 
 INSERT INTO config.print_template 
     (name, label, owner, active, locale, content_type, template)
@@ -641,6 +641,22 @@ UPDATE config.print_template SET template = $TEMPLATE$
 
 $TEMPLATE$ WHERE name = 'renew';
 
+INSERT into config.org_unit_setting_type (name, grp, label, description, datatype)
+VALUES ( 
+    'ui.staff.angular_circ.enabled', 'gui',
+    oils_i18n_gettext(
+        'ui.staff.angular_circ.enabled',
+        'Enable Angular Circulation Menu',
+        'coust', 'label'
+    ), 
+    oils_i18n_gettext(
+        'ui.staff.angular_circ.enabled',
+        'Enable the Circulation menu for the experimental Angular Circulation UIs',
+        'coust', 'description'
+    ),
+    'bool'
+);
+
 COMMIT;
 
 
index 6dd8803..87914a8 100644 (file)
             </a>
           </li>
           <li>
-            <a href="/eg2/staff/circ/patron/search">
-              <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
-              <span eg-accesskey-label>[% l('Search for Patrons (Experimental)') %]</span>
-            </a>
-          </li>
-          <li>
             <a href="./cat/item/search" target="_self"
               eg-accesskey="[% l('f5') %]" 
               eg-accesskey-desc="[% l('Item Status') %]">
               [% l('Check In') %]
             </a>
           </li>
-          <li ng-if="username">
-            <a href="/eg2/staff/circ/checkin">
-              <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
-              [% l('Check In (Experimental)') %]
-            </a>
-          </li>
           <li ng-if="!username">
             <a href="" ng-click="rs.active_tab('checkin')" target="_self"
               eg-accesskey="[% l('f2') %]" 
               [% l('Renew Items') %]
             </a>
           </li>
-          <li ng-if="username">
-            <a href="/eg2/staff/circ/renew">
-              <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
-              [% l('Renew Items (Experimental)') %]
-            </a>
-          </li>
-
           <li ng-if="!username">
             <a href="" ng-click="rs.active_tab('renew')" target="_self"
               eg-accesskey="[% l('ctrl+f2') %]" 
         </ul>
       </li><!-- circ -->
 
+      <!-- 
+        Experimental Circulation Interfaces.
+        Note when these are upgraded to be the real thing, access key
+        attributes will need to be applied
+      -->
+      <li class="dropdown" uib-dropdown ng-if="showAngularCirc && username">
+        <a href uib-dropdown-toggle>[% l('Circulation (Experimental)') %]
+          <b class="caret" aria-hidden="true"></b>
+        </a>
+        <ul uib-dropdown-menu>
+          <li>
+            <a href="/eg2/staff/circ/patron/search">
+              <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
+              <span eg-accesskey-label>[% l('Search for Patrons') %]</span>
+            </a>
+          </li>
+          <li class="divider"></li>
+          <li>
+            <a href="/eg2/staff/circ/patron/bcsearch">
+              <span class="glyphicon glyphicon-export" aria-hidden="true"></span>
+              [% l('Check Out') %]
+            </a>
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/checkin">
+              <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
+              [% l('Check In') %]
+            </a>
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/checkin/capture">
+              <span class="glyphicon glyphicon-pushpin" aria-hidden="true"></span>
+              [% l('Capture Holds') %]
+            </a>
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/renew">
+              <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
+              [% l('Renew Items') %]
+            </a>
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/patron/register">
+              <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
+              [% l('Register Patron') %]
+            </a>
+          </li>
+          <li ng-if="showRecentPatron">
+            <a href="/eg2/staff/circ/patron/last">
+              <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
+              [% l('Retrieve Last Patron') %]
+            </a>
+          </li>
+          <li ng-if="showRecentPatrons">
+            <a href="/eg2/staff/circ/patron/search/recents">
+              <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
+              [% l('Retrieve Recent Patrons') %]
+            </a>
+          </li>
+        </ul>
+      </li>
+
       <!-- cataloging -->
       <li class="dropdown" uib-dropdown>
         <a href uib-dropdown-toggle>[% l('Cataloging') %]<b class="caret" 
index 58e2d3a..696a7ff 100644 (file)
@@ -123,6 +123,7 @@ angular.module('egCoreMod')
                             egCore.org.settings([
                                 'ui.staff.max_recent_patrons',
                                 'ui.staff.angular_catalog.enabled',
+                                'ui.staff.angular_circ.enabled',
                                 'circ.curbside'
                             ]).then(function(s) {
                                 var val = s['ui.staff.max_recent_patrons'];
@@ -131,6 +132,8 @@ angular.module('egCoreMod')
 
                                 $scope.showAngularCatalog = 
                                     s['ui.staff.angular_catalog.enabled'];
+                                $scope.showAngularCirc = 
+                                    s['ui.staff.angular_circ.enabled'];
                                 $scope.enableCurbside = 
                                     s['circ.curbside'];
                             }).then(function() {