LP#1980867: optionally remove traditional catalog from staff client menu
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 6 Jul 2022 19:10:41 +0000 (12:10 -0700)
committerJane Sandberg <sandbergja@gmail.com>
Fri, 30 Sep 2022 01:10:27 +0000 (18:10 -0700)
Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Signed-off-by: Gina Monti <gmonti@biblio.org>
Signed-off-by: Jane Sandberg <sandbergja@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/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.hide-trad-catalog-setting.sql [new file with mode: 0644]
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/services/navbar.js
Open-ILS/web/js/ui/default/staff/services/startup.js

index cb86683..2e03b20 100644 (file)
             <span class="material-icons" aria-hidden="true">search</span>
             <span i18n>Search the Catalog</span>
           </a>
-          <a href="/eg/staff/cat/catalog/index" class="dropdown-item">
+          <a *ngIf="showTraditionalCatalog" href="/eg/staff/cat/catalog/index" class="dropdown-item">
             <span class="material-icons" aria-hidden="true">search</span>
             <span i18n>Search the Catalog (Traditional)</span>
           </a>
index 89d98ac..682c0bd 100644 (file)
@@ -23,8 +23,8 @@ export class StaffNavComponent implements OnInit, OnDestroy {
     locales: any[];
     currentLocale: any;
 
-    // When active, show a link to the experimental Angular staff catalog
-    showAngularCatalog: boolean;
+    // When active, show a link to the traditional staff catalog
+    showTraditionalCatalog: boolean;
     curbsideEnabled: boolean;
 
     @ViewChild('navOpChange', {static: false}) opChange: OpChangeComponent;
@@ -58,9 +58,9 @@ export class StaffNavComponent implements OnInit, OnDestroy {
         // Avoid attempts to fetch org settings if the user has not yet
         // logged in (e.g. this is the login page).
         if (this.user()) {
-            this.org.settings('ui.staff.angular_catalog.enabled')
-            .then(settings => this.showAngularCatalog =
-                Boolean(settings['ui.staff.angular_catalog.enabled']));
+            this.org.settings('ui.staff.traditional_catalog.enabled')
+            .then(settings => this.showTraditionalCatalog =
+                Boolean(settings['ui.staff.traditional_catalog.enabled']));
             this.org.settings('circ.curbside')
             .then(settings => this.curbsideEnabled =
                 Boolean(settings['circ.curbside']));
index de0629b..8988dd5 100644 (file)
@@ -22209,3 +22209,20 @@ VALUES (
     )
 );
 
+INSERT into config.org_unit_setting_type
+    (name, datatype, grp, label, description)
+VALUES (
+    'ui.staff.traditional_catalog.enabled', 'bool', 'gui',
+    oils_i18n_gettext(
+        'ui.staff.traditional_catalog.enabled',
+        'GUI: Enable Traditional Staff Catalog',
+        'coust', 'label'
+    ),
+    oils_i18n_gettext(
+        'ui.staff.traditional_catalog.enabled',
+        'Display an entry point in the browser client for the ' ||
+        'traditional staff catalog.',
+        'coust', 'description'
+    )
+);
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.hide-trad-catalog-setting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.hide-trad-catalog-setting.sql
new file mode 100644 (file)
index 0000000..3573f1a
--- /dev/null
@@ -0,0 +1,24 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type
+    (name, datatype, grp, label, description)
+VALUES (
+    'ui.staff.traditional_catalog.enabled', 'bool', 'gui',
+    oils_i18n_gettext(
+        'ui.staff.traditional_catalog.enabled',
+        'GUI: Enable Traditional Staff Catalog',
+        'coust', 'label'
+    ),
+    oils_i18n_gettext(
+        'ui.staff.traditional_catalog.enabled',
+        'Display an entry point in the browser client for the ' ||
+        'traditional staff catalog.',
+        'coust', 'description'
+    )
+);
+
+COMMIT;
+
+
index 7c532eb..03561e2 100644 (file)
               <span>[% l('Search the Catalog') %]</span>
             </a>
           </li>
-          <li>
+          <li ng-if="showTraditionalCatalog">
             <a href="./cat/catalog/index" target="_self">
               <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
               [% l('Search the Catalog (Traditional)') %]
index 58e2d3a..54f9e71 100644 (file)
@@ -122,15 +122,15 @@ angular.module('egCoreMod')
 
                             egCore.org.settings([
                                 'ui.staff.max_recent_patrons',
-                                'ui.staff.angular_catalog.enabled',
+                                'ui.staff.traditional_catalog.enabled',
                                 'circ.curbside'
                             ]).then(function(s) {
                                 var val = s['ui.staff.max_recent_patrons'];
                                 $scope.showRecentPatron = val > 0;
                                 $scope.showRecentPatrons = val > 1;
 
-                                $scope.showAngularCatalog = 
-                                    s['ui.staff.angular_catalog.enabled'];
+                                $scope.showTraditionalCatalog =
+                                    s['ui.staff.traditional_catalog.enabled'];
                                 $scope.enableCurbside = 
                                     s['circ.curbside'];
                             }).then(function() {
index 706bd6f..8592d07 100644 (file)
@@ -36,7 +36,7 @@ function($q,  $rootScope,  $location,  $window,  egIDL,  egAuth,  egEnv , egOrg
                 'webstaff.format.dates',
                 'webstaff.format.date_and_time',
                 'ui.staff.max_recent_patrons', // affects navbar
-                'ui.staff.angular_catalog.enabled', // affects navbar
+                'ui.staff.traditional_catalog.enabled', // affects navbar
                 'lib.timezone'
             ]).then(
                 function(set) {