From: Bill Erickson Date: Wed, 15 Jan 2020 16:14:06 +0000 (-0500) Subject: LP1859706 Map Angular cat "Patron View" to AngJS "OPAC View" X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e01c8ad84163468fe9c76584e56c90382fe46069;p=contrib%2FConifer.git 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 Signed-off-by: Ruth Frasur --- 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 51d81b330c..cf082f9668 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 @@ -36,7 +36,7 @@ - + @@ -83,7 +83,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 9c0ce9d762..dc8d8dfce8 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 @@ -44,7 +44,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. @@ -58,7 +58,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 f05c363295..491b6ca10b 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'; } @@ -2006,8 +2014,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';