From 3121c0716a898f196cfc74497dc1c32537122b0d Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 10 Jul 2019 11:56:31 -0400 Subject: [PATCH] LP1834665 MARC editor success/fail toasts Indicate to the user when a MARC edit succeeds or fails via toast in the Angular MARC editor component. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- .../app/staff/share/marc-edit/editor.component.html | 3 +++ .../app/staff/share/marc-edit/editor.component.ts | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html index fdaf7e50cd..f8eef36976 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html @@ -14,6 +14,9 @@ dialogBody="Records with holdings attached cannot be deleted."> + + +
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts index cea199052a..fa9fbe1259 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts @@ -5,6 +5,8 @@ import {NetService} from '@eg/core/net.service'; import {AuthService} from '@eg/core/auth.service'; import {OrgService} from '@eg/core/org.service'; import {PcrudService} from '@eg/core/pcrud.service'; +import {ToastService} from '@eg/share/toast/toast.service'; +import {StringComponent} from '@eg/share/string/string.component'; import {MarcRecord} from './marcrecord'; import {ComboboxEntry, ComboboxComponent } from '@eg/share/combobox/combobox.component'; @@ -50,6 +52,8 @@ export class MarcEditorComponent implements OnInit { @ViewChild('confirmDelete') confirmDelete: ConfirmDialogComponent; @ViewChild('confirmUndelete') confirmUndelete: ConfirmDialogComponent; @ViewChild('cannotDelete') cannotDelete: ConfirmDialogComponent; + @ViewChild('successMsg') successMsg: StringComponent; + @ViewChild('failMsg') failMsg: StringComponent; constructor( private evt: EventService, @@ -57,7 +61,8 @@ export class MarcEditorComponent implements OnInit { private net: NetService, private auth: AuthService, private org: OrgService, - private pcrud: PcrudService + private pcrud: PcrudService, + private toast: ToastService ) { this.sources = []; this.recordSaved = new EventEmitter(); @@ -101,10 +106,11 @@ export class MarcEditorComponent implements OnInit { const evt = this.evt.parse(response); if (evt) { console.error(evt); - // TODO: toast + this.failMsg.current().then(msg => this.toast.warning(msg)); + return; } - // TODO: toast + this.successMsg.current().then(msg => this.toast.success(msg)); this.recordSaved.emit(xml); return response; }); -- 2.43.2