From: Dan Briem Date: Thu, 19 Jan 2023 15:33:00 +0000 (-0500) Subject: LP#1996818 Issues Placing Holds from the Patron Record X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fdbriem%2Flp1996818_holds_from_patron_record;p=working%2FEvergreen.git LP#1996818 Issues Placing Holds from the Patron Record This clears the patron hold target cookie when navigating from the staff/catalog route, when the window is closed, and when holds are successfully placed. This also changes the AngularJS patron interface to set the same session cookie as the Angular interface. Signed-off-by: Dan Briem --- diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts index 340a28dba2..f5d9677695 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit} from '@angular/core'; +import {Component, HostListener, OnDestroy, OnInit} from '@angular/core'; import {IdlObject} from '@eg/core/idl.service'; import {StaffCatalogService} from './catalog.service'; import {BasketService} from '@eg/share/catalog/basket.service'; @@ -6,7 +6,7 @@ import {BasketService} from '@eg/share/catalog/basket.service'; @Component({ templateUrl: 'catalog.component.html' }) -export class CatalogComponent implements OnInit { +export class CatalogComponent implements OnInit, OnDestroy { constructor( private basket: BasketService, @@ -34,5 +34,10 @@ export class CatalogComponent implements OnInit { clearHoldPatron() { this.staffCat.clearHoldPatron(); } + + @HostListener('window:beforeunload') + ngOnDestroy(): void { + this.clearHoldPatron(); + } } diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js index 3173bfdb70..795455df79 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js @@ -146,7 +146,7 @@ function($scope, $q, $routeParams, egCore, egUser, patronSvc, $scope.place_hold = function() { - egCore.hatch.setLocalItem( + egCore.hatch.setLoginSessionItem( 'eg.circ.patron_hold_target', patronSvc.current.card().barcode()); $window.location.href = '/eg2/staff/catalog';