Browse Source

fix: templating return data type

Ahmad Kholid 1 year ago
parent
commit
c61f4a91ee

+ 1 - 0
src/workflowEngine/WorkflowWorker.js

@@ -260,6 +260,7 @@ class WorkflowWorker {
           ? null
           : this.blocksDetail[block.label].refDataKeys,
     });
+
     const blockDelay = this.settings?.blockDelay || 0;
     const addBlockLog = (status, obj = {}) => {
       let { description } = block.data;

+ 2 - 1
src/workflowEngine/templating/mustacheReplacer.js

@@ -103,7 +103,8 @@ function replacer(str, { regex, tagLen, modifyPath, data }) {
         dataKey = dataKey.slice(1);
       }
 
-      result = objectPath.get(data[dataKey], path) ?? match;
+      result = objectPath.get(data[dataKey], path);
+      if (typeof result === 'undefined') result = match;
 
       if (dataKey === 'secrets') {
         result =

+ 1 - 1
src/workflowEngine/utils/testConditions.js

@@ -71,7 +71,7 @@ export default async function (conditionsArr, workflowData) {
         workflowData.isPopup
       );
 
-      copyData[key] = value ?? '';
+      copyData[key] = parseJSON(value, value);
       Object.assign(result.replacedValue, list);
     }