LP1904036 Patron bills tab honors editor change warning
authorBill Erickson <berickxx@gmail.com>
Thu, 26 Aug 2021 19:03:48 +0000 (15:03 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:37 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/eg2/src/app/staff/circ/patron/patron.component.ts

index 4917db2..38af2b8 100644 (file)
@@ -176,8 +176,13 @@ export class PatronComponent implements OnInit, AfterViewInit {
     // The bills tab has various sub-interfaces.  If the user is already
     // on the Bills tab and clicks the tab, return them to the main bills
     // screen.
+    // Avoid the navigate call when not on the bills tab because it
+    // interferes with the pre-tab-change "changes pending" confirm dialog
+    // used by the editor and possibily others.
     billsTabClicked() {
-        this.router.navigate(['/staff/circ/patron', this.patronId, 'bills']);
+        if (this.patronTab === 'bills') {
+            this.router.navigate(['/staff/circ/patron', this.patronId, 'bills']);
+        }
     }
 
     routeToTab() {