From a10864ab4dd7cade3225e457739a39af3fe3f1ca Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 25 Feb 2020 12:55:19 -0500 Subject: [PATCH] emit toast upon saving a default search Signed-off-by: Galen Charlton --- .../src/app/staff/acq/search/acq-search-form.component.html | 2 ++ .../src/app/staff/acq/search/acq-search-form.component.ts | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html index 91b70c7069..a039578a6a 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html @@ -1,3 +1,5 @@ + +
diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts index d9cbdbe292..eed22271b5 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts @@ -1,9 +1,11 @@ -import {Component, OnInit, AfterViewInit, Input, Output, EventEmitter} from '@angular/core'; +import {Component, OnInit, AfterViewInit, Input, Output, EventEmitter, ViewChild} from '@angular/core'; import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap'; import {Router, ActivatedRoute} from '@angular/router'; import {StaffCommonModule} from '@eg/staff/common.module'; import {IdlService, IdlObject} from '@eg/core/idl.service'; import {PcrudService} from '@eg/core/pcrud.service'; +import {StringComponent} from '@eg/share/string/string.component'; +import {ToastService} from '@eg/share/toast/toast.service'; import {AcqSearchTerm, AcqSearch} from './acq-search.service'; import {ServerStoreService} from '@eg/core/server-store.service'; @@ -22,6 +24,8 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit { @Output() searchSubmitted = new EventEmitter(); + @ViewChild('defaultSearchSavedString', { static: true}) defaultSearchSavedString: StringComponent; + showForm = true; hints = ['jub', 'acqpl', 'acqpo', 'acqinv', 'acqlid']; @@ -42,6 +46,7 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit { private pcrud: PcrudService, private store: ServerStoreService, private idl: IdlService, + private toast: ToastService, ) {} ngOnInit() { @@ -169,7 +174,11 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit { return this.store.setItem(this.defaultSearchSetting, { terms: this.searchTerms, conjunction: this.searchConjunction - }); + }).then(() => + this.defaultSearchSavedString.current().then(msg => + this.toast.success(msg) + ) + ); } saveRunImmediately() { return this.store.setItem(this.runImmediatelySetting, this.runImmediately); -- 2.11.0