From 86771bc5537962841cfc6d321fc3143741040971 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Wed, 6 Jul 2022 12:10:41 -0700 Subject: [PATCH] LP#1980867: optionally remove traditional catalog from staff client menu Signed-off-by: Jeff Davis Signed-off-by: Gina Monti Signed-off-by: Jane Sandberg --- Open-ILS/src/eg2/src/app/staff/nav.component.html | 2 +- Open-ILS/src/eg2/src/app/staff/nav.component.ts | 10 ++++----- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 17 +++++++++++++++ .../XXXX.data.hide-trad-catalog-setting.sql | 24 ++++++++++++++++++++++ Open-ILS/src/templates/staff/navbar.tt2 | 2 +- .../web/js/ui/default/staff/services/navbar.js | 6 +++--- .../web/js/ui/default/staff/services/startup.js | 2 +- 7 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.hide-trad-catalog-setting.sql 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 @@ Search the Catalog - + Search the Catalog (Traditional) 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 @@ [% l('Search the Catalog') %] -
  • +
  • [% 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) { -- 2.11.0