LP#1855780: adjustments to cloning
authorGalen Charlton <gmc@equinoxOLI.org>
Tue, 9 Nov 2021 15:24:04 +0000 (10:24 -0500)
committerJane Sandberg <sandbergja@gmail.com>
Wed, 17 Nov 2021 19:55:12 +0000 (11:55 -0800)
- set the owning OU to null in the clone
- reduce console noise when cloning environment entries

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Signed-off-by: Jane Sandberg <sandbergja@gmail.com>
Open-ILS/src/eg2/src/app/staff/admin/local/triggers/triggers.component.html
Open-ILS/src/eg2/src/app/staff/admin/local/triggers/triggers.component.ts

index 170dcb2..cb6a701 100644 (file)
@@ -10,6 +10,7 @@
 <eg-fm-record-editor #eventDialog idlClass="atevdef"
     [fieldOptions]="{message_template:{customTemplate:{template:textAreaTemplate}},template:{customTemplate:{template:textAreaTemplate}}}"
     fieldOrder="owner,name,hook,active,delay,delay_field,group_field,reactor,validator,repeat_delay,id,cleanup_failure,granularity,max_delay,message_library_path,message_template,message_title,message_usr_path,opt_in_setting,usr_field,retention_interval,cleanup_success,template"
+    [remainOpenOnError]="true"
     hiddenFields="id">
 </eg-fm-record-editor>
 <eg-fm-record-editor #hookDialog idlClass="ath"></eg-fm-record-editor>        
index 84acf4e..d7183a2 100644 (file)
@@ -253,6 +253,7 @@ export class TriggersComponent implements OnInit {
 
     doClone(eventDef, env_list) {
         eventDef.id(null);
+        eventDef.owner(null);
         this.eventDialog.mode = 'create';
         this.eventDialog.recordId = null;
         this.eventDialog.record = eventDef;
@@ -281,11 +282,10 @@ export class TriggersComponent implements OnInit {
             env.id(null);
         });
         this.pcrud.create(env_list).toPromise().then(
-            ok => {
-                console.debug(ok);
-            },
+            ok => { },
             err => {
-                console.debug(err);
+                this.cloneFailedString.current()
+                    .then(str => this.toast.danger(str));
             }
         );
     }