LP1904036 Ang Circ Experimental Menu
authorBill Erickson <berickxx@gmail.com>
Thu, 13 Oct 2022 16:05:04 +0000 (12:05 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:43 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
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/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/services/navbar.js

index 1993412..52d7b32 100644 (file)
       </div>
     </div>
 
+    <div class="navbar-nav" *ngIf="showAngularCirc">
+      <div ngbDropdown class="nav-item dropdown">
+        <a ngbDropdownToggle i18n class="nav-link dropdown-toggle">
+         Circulation (Experimental)
+        </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>
+          <a class="dropdown-item" routerLink="/staff/circ/patron/bcsearch"    
+            egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc              
+            keySpec="f1" keyDesc="Checkout">                                   
+            <span class="material-icons" aria-hidden="true">trending_up</span> 
+            <span i18n>Check Out</span>                                        
+          </a>                                                                 
+          <a class="dropdown-item" routerLink="/staff/circ/checkin"            
+            egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc              
+            keySpec="f2" keyDesc="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"    
+            egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc              
+            keySpec="shift+f2" keyDesc="Capture Holds">                        
+            <span class="material-icons" aria-hidden="true">pin_drop</span>    
+            <span i18n>Capture Holds</span>                                    
+          </a>                                                                 
+          <a class="dropdown-item" routerLink="/staff/circ/holds/pull-list">   
+            <span class="material-icons" aria-hidden="true">view_list</span>   
+            <span i18n>Pull List for Hold Requests</span>                      
+          </a>                                                                 
+          <a class="dropdown-item" routerLink="/staff/circ/renew"              
+            egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc              
+            keySpec="ctrl+f2" keyDesc="Renew Items">                           
+            <span class="material-icons" aria-hidden="true">autorenew</span>   
+            <span i18n>Renew Items</span>                                      
+          </a>                                                                 
+          <a class="dropdown-item" routerLink="/staff/circ/patron/register"    
+            egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc              
+            keySpec="shift+f1" keyDesc="Register Patron">                      
+            <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"        
+            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"
+            egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc              
+            keySpec="shift+f4" keyDesc="Retrieve Recent Patrons">              
+            <span class="material-icons" aria-hidden="true">redo</span>        
+            <span i18n>Retrieve Recent Patrons</span>                          
+          </a>                                                                 
+          <a class="dropdown-item" routerLink="/staff/circ/patron/credentials" 
+            egAccessKey keyCtx="navbar" i18n-keySpec i18n-keyDesc              
+            keySpec="alt+c" keyDesc="Verify Patron Credentials">               
+            <span class="material-icons" aria-hidden="true">check_circle</span>
+            <span i18n>Verify Credentials</span>                               
+          </a>  
+        </div>
+      </div>
+    </div>
+
     <!-- CATALOGING -->
     
     <div class="navbar-nav">
index ccd6848..e8246b4 100644 (file)
@@ -10,6 +10,7 @@ import {PrintService} from '@eg/share/print/print.service';
 import {StoreService} from '@eg/core/store.service';
 import {NetRequest, NetService} from '@eg/core/net.service';
 import {OpChangeComponent} from '@eg/staff/share/op-change/op-change.component';
+import {PermService} from '@eg/core/perm.service';
 
 @Component({
     selector: 'eg-staff-nav-bar',
@@ -27,6 +28,7 @@ export class StaffNavComponent implements OnInit, OnDestroy {
     showTraditionalCatalog = true;
     showAngularAcq: boolean;
     curbsideEnabled: boolean;
+    showAngularCirc = false;
 
     @ViewChild('navOpChange', {static: false}) opChange: OpChangeComponent;
     permFailedSub: Subscription;
@@ -37,6 +39,7 @@ export class StaffNavComponent implements OnInit, OnDestroy {
         private net: NetService,
         private org: OrgService,
         private auth: AuthService,
+        private perm: PermService,
         private pcrud: PcrudService,
         private locale: LocaleService,
         private printer: PrintService
@@ -68,6 +71,20 @@ export class StaffNavComponent implements OnInit, OnDestroy {
             this.org.settings('circ.curbside')
             .then(settings => this.curbsideEnabled =
                 Boolean(settings['circ.curbside']));
+
+            // Do we show the angular circ menu?
+            // TODO remove these once Angular Circ takes over.
+            const angSet = 'ui.staff.angular_circ.enabled';
+            const angPerm = 'ACCESS_ANGULAR_CIRC';
+
+            this.org.settings(angSet).then(s => {
+                if (s[angSet]) {
+                    return this.perm.hasWorkPermHere([angPerm])
+                    .then(perms => perms[angPerm]);
+                } else {
+                    return false;
+                }
+            }).then(enable => this.showAngularCirc = enable);
         }
 
         // Wire up our op-change component as the general purpose
index 97e52d6..b8d224c 100644 (file)
@@ -143,7 +143,7 @@ export class StaffResolver implements Resolve<Observable<any>> {
     /**
      * Fetches data common to all staff interfaces.
      */
-    loadStartupData(): Promise<void> {
+    loadStartupData(): Promise<any> {
 
         // Fetch settings needed globally.  This will cache the values
         // in the org service.
@@ -153,6 +153,7 @@ export class StaffResolver implements Resolve<Observable<any>> {
             'webstaff.format.date_and_time',
             'ui.staff.max_recent_patrons',
             'circ.curbside', // navbar
+            'ui.staff.angular_circ.enabled',
             'ui.staff.angular_catalog.enabled' // navbar
         ]).then(settings => {
             // Avoid clobbering defaults
@@ -166,6 +167,10 @@ export class StaffResolver implements Resolve<Observable<any>> {
                 this.format.dateTimeFormat =
                     settings['webstaff.format.date_and_time'];
             }
+            // TODO remove these once Angular Circ takes over.
+            if (settings['ui.staff.angular_circ.enabled']) {
+                return this.perm.hasWorkPermHere(['ACCESS_ANGULAR_CIRC']);
+            }
         });
     }
 }
index 355574b..fb95da0 100644 (file)
         </ul>
       </li><!-- circ -->
 
+
+      <!-- circulation experimental -->
+      <li class="dropdown" uib-dropdown ng-if="showAngularCirc">
+        <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>[% l('Search for Patrons') %]</span>
+            </a>
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/patron/bcsearch">
+              <span class="glyphicon glyphicon-export" aria-hidden="true"></span> 
+              <span>[% l('Check Out') %]</span>                                        
+            </a>                                                                 
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/checkin">
+              <span class="glyphicon glyphicon-import" aria-hidden="true"></span>
+              <span>[% l('Check In') %]</span>                                         
+            </a>                                                                 
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/checkin/capture">
+              <span class="glyphicon glyphicon-pushpin" aria-hidden="true"></span>    
+              <span>[% l('Capture Holds') %]</span>                                    
+            </a>                                                                 
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/holds/pull-list">   
+              <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>   
+              <span>[% l('Pull List for Hold Requests') %]</span>                      
+            </a>                                                                 
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/renew">
+              <span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>   
+              <span>[% l('Renew Items') %]</span>                                      
+            </a>                                                                 
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/patron/register">
+              <span class="glyphicon glyphicon-user" aria-hidden="true"></span>  
+              <span>[% l('Register Patron') %]</span>                                  
+            </a>                                                                 
+          </li>
+          <li>
+            <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>
+            <a href="/eg2/staff/circ/patron/search/recents">
+              <span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>        
+              <span>[% l('Retrieve Recent Patrons') %]</span>                          
+            </a>                                                                 
+          </li>
+          <li>
+            <a href="/eg2/staff/circ/patron/credentials" >
+              <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
+              <span>[% l('Verify Credentials') %]</span>
+            </a>  
+          </li>
+        </ul>
+      </li>
+
       <!-- cataloging -->
       <li class="dropdown" uib-dropdown>
         <a href uib-dropdown-toggle>[% l('Cataloging') %]<b class="caret" 
index feae878..8d10c89 100644 (file)
@@ -11,6 +11,7 @@ angular.module('egCoreMod')
                      egCore , $uibModal , ngToast , egOpChange , $element , egLovefield) {
 
                 $scope.rs = $rootScope;
+                $scope.showAngularCirc = false;
 
                 $scope.reprintLast = function (e) {
                     egCore.print.reprintLast();
@@ -123,6 +124,7 @@ angular.module('egCoreMod')
                             egCore.org.settings([
                                 'ui.staff.max_recent_patrons',
                                 'ui.staff.traditional_catalog.enabled',
+                                'ui.staff.angular_circ.enabled',
                                 'ui.staff.angular_acq_selection.enabled',
                                 'circ.curbside'
                             ]).then(function(s) {
@@ -134,8 +136,12 @@ angular.module('egCoreMod')
                                 $scope.showTraditionalCatalog = (val !== false);
                                 $scope.showAngularAcq =
                                     s['ui.staff.angular_acq_selection.enabled'];
-                                $scope.enableCurbside = 
-                                    s['circ.curbside'];
+                                $scope.enableCurbside = s['circ.curbside'];
+
+                                if (s['ui.staff.angular_circ.enabled']) {
+                                    egCore.perm.hasPermHere('ACCESS_ANGULAR_CIRC')
+                                    .then(function(yes) { $scope.showAngularCirc = yes; });
+                                }
                             }).then(function() {
                                 // need to defer initialization of hotkeys to this point
                                 // as it depends on various settings.