From d88a87a9c54d681f6994bd121d01a6360df23bd6 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Tue, 26 Mar 2019 13:24:16 -0700 Subject: [PATCH] adding a toast message when filtering reservations by invalid patron barcode --- .../eg2/src/app/staff/booking/manage-reservations.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts index f37022b623..2c84add1dd 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts @@ -1,12 +1,13 @@ import {Component, OnInit, ViewChild} from '@angular/core'; +import {Router, ActivatedRoute, ParamMap} from '@angular/router'; import { NgbTabChangeEvent } from '@ng-bootstrap/ng-bootstrap'; import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; import {GridComponent} from '@eg/share/grid/grid.component'; import {PatronService} from '@eg/staff/share/patron.service'; import {PcrudService} from '@eg/core/pcrud.service'; import {ReservationsGridComponent} from './reservations-grid.component'; -import {Router, ActivatedRoute, ParamMap} from '@angular/router'; import {ServerStoreService} from '@eg/core/server-store.service'; +import {ToastService} from '@eg/share/toast/toast.service'; @Component({ selector: 'eg-manage-reservations', @@ -35,7 +36,8 @@ export class ManageReservationsComponent implements OnInit { private router: Router, private pcrud: PcrudService, private patron: PatronService, - private store: ServerStoreService + private store: ServerStoreService, + private toast: ToastService ) { // This is in the constructor, because we need it first thing in ngOnInit this.chooseAppropriateFilter = () => { @@ -95,6 +97,8 @@ export class ManageReservationsComponent implements OnInit { this.patron.bcSearch(this.patronBarcode).subscribe( (response) => { this.router.navigate(['/staff', 'booking', 'manage_reservations', 'by_patron', response[0].id]); + }, (error) => { + this.toast.danger('No patron found with this barcode'); }); } else { this.removeFilters(); -- 2.11.0