BUG: Fixed loop bug within JSON

This commit is contained in:
frikky
2021-01-03 18:17:09 +01:00
parent a176ae8eba
commit 2728d4d9dc
4 changed files with 24 additions and 7 deletions
+21 -4
View File
@@ -1444,7 +1444,8 @@ class AppBase:
print("POST replacement: %s" % replacement)
json_replacement = replacement
#json_replacement = tmpitem.replace(actualitem[0][0], replacement, 1)
#print("AFTER POST replacement: %s" % json_replacement)
try:
json_replacement = json.loads(replacement)
except json.decoder.JSONDecodeError as e:
@@ -1456,7 +1457,22 @@ class AppBase:
if len(json_replacement) > minlength:
minlength = len(json_replacement)
# FIXME: Only do this IF they want to loop
new_replacement = []
for i in range(len(json_replacement)):
newvalue = tmpitem.replace(actualitem[0][0], json_replacement[i], 1)
try:
newvalue = json.loads(newvalue)
except json.decoder.JSONDecodeError as e:
print("DECODER ERROR: %s" % e)
pass
new_replacement.append(newvalue)
print("New replacement: %s" % new_replacement)
# New
tmpitem = tmpitem.replace(actualitem[0][0], replacement, 1)
# This code handles files.
@@ -1483,14 +1499,15 @@ class AppBase:
print("(1) JSON ERROR IN FILE HANDLING: %s" % e)
if not isfile:
print("Resultarray (NOT FILE): %s" % resultarray)
params[parameter["name"]] = tmpitem
multi_parameters[parameter["name"]] = json_replacement
multi_parameters[parameter["name"]] = new_replacement
else:
print("Resultarray: %s" % resultarray)
print("Resultarray (FILE): %s" % resultarray)
params[parameter["name"]] = resultarray
multi_parameters[parameter["name"]] = resultarray
multi_execution_lists.append(json_replacement)
multi_execution_lists.append(new_replacement)
print("MULTI finished: %s" % json_replacement)
else:
print("(2) Pre replacement: %s" % actualitem)
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
NAME=shuffle-app_sdk
VERSION=0.8.45
VERSION=0.8.46
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
docker build . -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION
+1 -1
View File
@@ -3007,7 +3007,7 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf
continue
}
log.Printf("[WARNING] Set %s to SKIPPED as it's NOT a childnode of the startnode.", action.ID)
//log.Printf("[WARNING] Set %s to SKIPPED as it's NOT a childnode of the startnode.", action.ID)
defaultResults = append(defaultResults, ActionResult{
Action: action,
ExecutionId: workflowExecution.ExecutionId,
+1 -1
View File
@@ -5028,7 +5028,7 @@ const AngularWorkflow = (props) => {
<div style={appApiViewStyle}>
<div style={{display: "flex", height: "40px", marginBottom: "30px"}}>
<div style={{flex: "1"}}>
<h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}: {selectedTrigger.status}</h3>
<h3 style={{marginBottom: "5px"}}>{selectedTrigger.app_name}</h3>
<a target="_blank" href="https://shuffler.io/docs/triggers#subflow" style={{textDecoration: "none", color: "#f85a3e"}}>What are subflows?</a>
</div>
</div>