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) 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: try:
json_replacement = json.loads(replacement) json_replacement = json.loads(replacement)
except json.decoder.JSONDecodeError as e: except json.decoder.JSONDecodeError as e:
@@ -1457,6 +1458,21 @@ class AppBase:
if len(json_replacement) > minlength: if len(json_replacement) > minlength:
minlength = len(json_replacement) 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) tmpitem = tmpitem.replace(actualitem[0][0], replacement, 1)
# This code handles files. # This code handles files.
@@ -1483,14 +1499,15 @@ class AppBase:
print("(1) JSON ERROR IN FILE HANDLING: %s" % e) print("(1) JSON ERROR IN FILE HANDLING: %s" % e)
if not isfile: if not isfile:
print("Resultarray (NOT FILE): %s" % resultarray)
params[parameter["name"]] = tmpitem params[parameter["name"]] = tmpitem
multi_parameters[parameter["name"]] = json_replacement multi_parameters[parameter["name"]] = new_replacement
else: else:
print("Resultarray: %s" % resultarray) print("Resultarray (FILE): %s" % resultarray)
params[parameter["name"]] = resultarray params[parameter["name"]] = resultarray
multi_parameters[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) print("MULTI finished: %s" % json_replacement)
else: else:
print("(2) Pre replacement: %s" % actualitem) print("(2) Pre replacement: %s" % actualitem)
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
NAME=shuffle-app_sdk NAME=shuffle-app_sdk
VERSION=0.8.45 VERSION=0.8.46
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force 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 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 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{ defaultResults = append(defaultResults, ActionResult{
Action: action, Action: action,
ExecutionId: workflowExecution.ExecutionId, ExecutionId: workflowExecution.ExecutionId,
+1 -1
View File
@@ -5028,7 +5028,7 @@ const AngularWorkflow = (props) => {
<div style={appApiViewStyle}> <div style={appApiViewStyle}>
<div style={{display: "flex", height: "40px", marginBottom: "30px"}}> <div style={{display: "flex", height: "40px", marginBottom: "30px"}}>
<div style={{flex: "1"}}> <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> <a target="_blank" href="https://shuffler.io/docs/triggers#subflow" style={{textDecoration: "none", color: "#f85a3e"}}>What are subflows?</a>
</div> </div>
</div> </div>