From: Bill Erickson Date: Fri, 22 Mar 2019 20:41:12 +0000 (-0700) Subject: LP1821409 Ang admin editor clears fields on new X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Flp1821409-ang-editor-clear-values;p=working%2FEvergreen.git LP1821409 Ang admin editor clears fields on new The Angular admin pages re-use an FmEditor component for creating and updating objects. When creating a new object after editing an existing object, reset the editor so it won't load the previously edited object. Signed-off-by: Bill Erickson --- 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 cd6e706660..3d1407ba7d 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 @@ -174,6 +174,10 @@ export class AdminPageComponent implements OnInit { this.createNew = () => { this.editDialog.mode = 'create'; + // We reuse the same editor for all actions. Be sure + // create action does not try to modify an existing record. + this.editDialog.recId = null; + this.editDialog.record = null; this.editDialog.open({size: this.dialogSize}).then( ok => { this.createString.current()