From 4574eaf3442ee4dc9b0cde6e6e2d941ce9c17eef Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 10 Dec 2018 15:06:23 -0500 Subject: [PATCH] LP#1807461 FM-editor show danger toasts when create/update fails Display a danger toast when update or create attempts fail in the Angular fieldmapper editor dialog. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Dan Wells --- .../staff/share/admin-page/admin-page.component.html | 7 +++++++ .../staff/share/admin-page/admin-page.component.ts | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html index ee9a175976..695a54929e 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html @@ -1,9 +1,16 @@ {{idlClassDef.label}} Update Succeeded +Update of {{idlClassDef.label}} failed + + + {{idlClassDef.label}} Succeessfully Created +Failed to create new {{idlClassDef.label}} + +
diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts index 6e865f1702..2ffcfa7409 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts @@ -66,6 +66,8 @@ export class AdminPageComponent implements OnInit { @ViewChild('editDialog') editDialog: FmRecordEditorComponent; @ViewChild('successString') successString: StringComponent; @ViewChild('createString') createString: StringComponent; + @ViewChild('createErrString') createErrString: StringComponent; + @ViewChild('updateFailedString') updateFailedString: StringComponent; @ViewChild('translator') translator: TranslateComponent; idlClassDef: any; @@ -174,7 +176,10 @@ export class AdminPageComponent implements OnInit { .then(str => this.toast.success(str)); this.grid.reload(); }, - err => {} + err => { + this.createErrString.current() + .then(str => this.toast.danger(str)); + } ); }; @@ -317,7 +322,10 @@ export class AdminPageComponent implements OnInit { .then(str => this.toast.success(str)); this.grid.reload(); }, - err => {} + err => { + this.updateFailedString.current() + .then(str => this.toast.danger(str)); + } ); } -- 2.43.2