[Rt-commit] rt branch, 5.0/lifecycle-ui-check-if-actions-exist, created. rt-5.0.0-4-g382c675ef8

Craig Kaiser craig at bestpractical.com
Thu Aug 20 12:13:02 EDT 2020


The branch, 5.0/lifecycle-ui-check-if-actions-exist has been created
        at  382c675ef8891aec5f28eee4357c5e9735d26655 (commit)

- Log -----------------------------------------------------------------
commit 382c675ef8891aec5f28eee4357c5e9735d26655
Author: craig kaiser <craig at bestpractical.com>
Date:   Thu Aug 20 11:02:58 2020 -0400

    Check if the actions config array value exist
    
    When creating a new blank lifecycle the actions array is empty until the
    first node is created.

diff --git a/share/static/js/lifecycleui-model.js b/share/static/js/lifecycleui-model.js
index 9b3df7885f..2a1dae32cf 100644
--- a/share/static/js/lifecycleui-model.js
+++ b/share/static/js/lifecycleui-model.js
@@ -257,12 +257,14 @@ class LifecycleModel {
         }
 
         let actions = [];
-        for ( let i = 0; i < self.config.actions.length; i += 2 ) {
-            let action = self.config.actions[i];
-            let info = self.config.actions[i+1];
-            let updated = action.replace(re_from, nodeUpdated.name + ' ->').replace(re_to, '-> ' + nodeUpdated.name);
-            actions.push(updated);
-            actions.push(info);
+        if ( self.config.actions ) {
+            for ( let i = 0; i < self.config.actions.length; i += 2 ) {
+                let action = self.config.actions[i];
+                let info = self.config.actions[i+1];
+                let updated = action.replace(re_from, nodeUpdated.name + ' ->').replace(re_to, '-> ' + nodeUpdated.name);
+                actions.push(updated);
+                actions.push(info);
+            }
         }
         self.config.actions = actions;
 

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


More information about the rt-commit mailing list