add experimental remainOpenOnError to the record editor
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 17 Apr 2020 21:11:29 +0000 (17:11 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 17 Apr 2020 21:11:29 +0000 (17:11 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts

index 71255ed..b65acb3 100644 (file)
@@ -139,6 +139,9 @@ export class FmRecordEditorComponent
     // for displayMode === 'inline'
     @Input() hideBanner: boolean;
 
+    // do not close dialog on error saving record
+    @Input() remainOpenOnError: boolean = false;
+
     // Emit the modified object when the save action completes.
     @Output() recordSaved = new EventEmitter<IdlObject>();
 
@@ -618,7 +621,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); }
             }
         );
     }
@@ -636,7 +639,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); }
                 }
             );
         });