From dae947366c27a328074543de65ec8278e64431b9 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 17 Apr 2020 17:11:29 -0400 Subject: [PATCH] LP#1857150: eg-fm-record-editor: add remainOpenOnError option Give eg-fm-record-editor an option controlled by the boolean remainOpenOnError attribute to, when used as a dialog, keep the dialog open if an error is encountered upon saving the record. Sponsored-by: Evergreen Community Development Initiative Signed-off-by: Galen Charlton Signed-off-by: Ruth Frasur Signed-off-by: Bill Erickson Signed-off-by: Jason Etheridge --- Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts index e809b7d72d..a396fd44ef 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts @@ -139,6 +139,9 @@ export class FmRecordEditorComponent // for displayMode === 'inline' @Input() hideBanner: boolean; + // do not close dialog on error saving record + @Input() remainOpenOnError: false; + // Emit the modified object when the save action completes. @Output() recordSaved = new EventEmitter(); @@ -621,7 +624,7 @@ export class FmRecordEditorComponent error => { this.recordError.emit(error); this.failStr.current().then(msg => this.toast.warning(msg)); - if (this.isDialog()) { this.error(error); } + if (this.isDialog() && !this.remainOpenOnError) { this.error(error); } } ); } @@ -639,7 +642,7 @@ export class FmRecordEditorComponent error => { this.recordError.emit(error); this.failStr.current().then(msg => this.toast.warning(msg)); - if (this.isDialog()) { this.error(error); } + if (this.isDialog() && !this.remainOpenOnError) { this.error(error); } } ); }); -- 2.11.0