fm-edit: 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>
Wed, 2 Sep 2020 16:30:20 +0000 (12:30 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts

index e809b7d..aa33f6d 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>();
 
@@ -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); }
                 }
             );
         });