From: Jeff Davis <jdavis@sitka.bclibraries.ca> Date: Wed, 6 Jul 2022 19:10:41 +0000 (-0700) Subject: LP#1980867: optionally remove traditional catalog from staff client menu X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=86771bc5537962841cfc6d321fc3143741040971;p=evergreen%2Fmasslnc.git LP#1980867: optionally remove traditional catalog from staff client menu 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> --- diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.html b/Open-ILS/src/eg2/src/app/staff/nav.component.html index cb8668360f..2e03b20adb 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.html +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.html @@ -165,7 +165,7 @@ <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> diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.ts b/Open-ILS/src/eg2/src/app/staff/nav.component.ts index 89d98ac31e..682c0bded2 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.ts @@ -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'])); diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index de0629bcbb..8988dd553d 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -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 index 0000000000..3573f1afdc --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.hide-trad-catalog-setting.sql @@ -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; + + diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2 index 7c532ebb09..03561e2f09 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -266,7 +266,7 @@ <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)') %] diff --git a/Open-ILS/web/js/ui/default/staff/services/navbar.js b/Open-ILS/web/js/ui/default/staff/services/navbar.js index 58e2d3aaae..54f9e71b15 100644 --- a/Open-ILS/web/js/ui/default/staff/services/navbar.js +++ b/Open-ILS/web/js/ui/default/staff/services/navbar.js @@ -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() { diff --git a/Open-ILS/web/js/ui/default/staff/services/startup.js b/Open-ILS/web/js/ui/default/staff/services/startup.js index 706bd6ffdf..8592d07cb0 100644 --- a/Open-ILS/web/js/ui/default/staff/services/startup.js +++ b/Open-ILS/web/js/ui/default/staff/services/startup.js @@ -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) {