From e4ffd8cc50cfe94333c50d575d5ae4dda01bed9a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 15 Jan 2020 11:14:06 -0500 Subject: [PATCH] LP1859706 Map Angular cat "Patron View" to AngJS "OPAC View" The Angular catalog now treats the "Patron View" tab as the same as the "OPAC View" tab in the AngJS catalog for the purposes of saving a preferred default tab. Similarly, the Angular catalog-only "Item Table" tab maps to the AngJS "OPAC View" tab, since it's the closest analog. Signed-off-by: Bill Erickson --- .../src/app/staff/catalog/record/record.component.html | 4 ++-- .../eg2/src/app/staff/catalog/record/record.component.ts | 4 ++-- Open-ILS/web/js/ui/default/staff/cat/catalog/app.js | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html index 98a270b6d2..ecd94bc12d 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html @@ -27,7 +27,7 @@ - + @@ -74,7 +74,7 @@ - + diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.ts index 83ce9b36c3..061eba4937 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.ts @@ -38,7 +38,7 @@ export class RecordComponent implements OnInit { this.defaultTab = this.store.getLocalItem('eg.cat.default_record_tab') - || 'catalog'; + || 'item_table'; // Watch for URL record ID changes // This includes the initial route. @@ -52,7 +52,7 @@ export class RecordComponent implements OnInit { this.searchContext = this.staffCat.searchContext; if (!this.recordTab) { - this.recordTab = this.defaultTab || 'catalog'; + this.recordTab = this.defaultTab || 'item_table'; } this.loadRecord(); diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 0793e0106b..3b22879748 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -630,6 +630,14 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e }); } + // Map the Angular catalog-only 'item_table' tab to the AngJS + // 'catalog' tab. + function get_default_record_tab() { + var tab = egCore.hatch.getLocalItem('eg.cat.default_record_tab'); + if (!tab || tab === 'item_table') { return 'catalog'; } + return tab; + } + // also set it when the iframe changes to a new record $scope.handle_page = function(url) { @@ -669,8 +677,8 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e // or we didn't change records on the OPAC load if (!$scope.in_opac_call && ($scope.record_id != prev_record_id)) { if ($scope.record_id) { - $scope.default_tab = egCore.hatch.getLocalItem( 'eg.cat.default_record_tab' ); - tab = $routeParams.record_tab || $scope.default_tab || 'catalog'; + $scope.default_tab = get_default_record_tab(); + tab = $routeParams.record_tab || $scope.default_tab; } else { tab = $routeParams.record_tab || 'catalog'; } @@ -1986,8 +1994,8 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e var tab; if ($scope.record_id) { - $scope.default_tab = egCore.hatch.getLocalItem( 'eg.cat.default_record_tab' ); - tab = $routeParams.record_tab || $scope.default_tab || 'catalog'; + $scope.default_tab = get_default_record_tab(); + tab = $routeParams.record_tab || $scope.default_tab; } else { tab = $routeParams.record_tab || 'catalog'; -- 2.11.0