[Rt-commit] rt branch 5.0/fix-lifecycle-new-status-remove created. rt-5.0.3-430-g297706cd2f

BPS Git Server git at git.bestpractical.com
Thu Apr 6 20:46:20 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/fix-lifecycle-new-status-remove has been created
        at  297706cd2f38127a0723e1b28cba43d990463b32 (commit)

- Log -----------------------------------------------------------------
commit 297706cd2f38127a0723e1b28cba43d990463b32
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Thu Apr 6 17:45:44 2023 -0300

    Fix lifecycle new status removal

diff --git a/share/static/js/lifecycleui-model.js b/share/static/js/lifecycleui-model.js
index 2a1dae32cf..8c39bf5fa0 100644
--- a/share/static/js/lifecycleui-model.js
+++ b/share/static/js/lifecycleui-model.js
@@ -114,6 +114,7 @@ class LifecycleModel {
         self.DeleteRights(d);
         self.DeleteDefaults(d);
         self.DeleteActions(d);
+        self.DeleteFromCreateNodes(d);
 
         self.nodes.splice(index, 1);
     }
@@ -139,7 +140,13 @@ class LifecycleModel {
 
         jQuery.each(self.config.defaults, function (key, value) {
             if (value && value.toLowerCase() === d.name.toLowerCase()) {
-                delete self.config.defaults[key];
+                if (key === 'on_create') {
+                    // Check if we have a status after the one to be delete
+                    // to replace the on_create default
+                    self.config.defaults.on_create = self.create_nodes[1] || null;
+                } else {
+                    delete self.config.defaults[key];
+                }
             }
         });
     }
@@ -197,6 +204,14 @@ class LifecycleModel {
         });
     }
 
+    DeleteFromCreateNodes(d) {
+        var self = this;
+        var index = self.create_nodes.findIndex(function(x) { return x == d.name });
+        if ( index >= 0 ) {
+            self.create_nodes.splice(index, 1);
+        }
+    }
+
     UpdateNodeModel(node, args) {
         var self = this;
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list