Removed app sdk debug prints

This commit is contained in:
frikky
2021-08-02 21:40:40 +02:00
parent c75975d7bd
commit a6a18acd3c
6 changed files with 44 additions and 31 deletions
+13 -12
View File
@@ -279,7 +279,7 @@ class AppBase:
#self.action = action
loopnames = []
print(f"Baseparams to check!!: {baseparams}")
#print(f"Baseparams to check!!: {baseparams}")
for key, value in baseparams.items():
check_value = ""
for param in self.action["parameters"]:
@@ -327,11 +327,11 @@ class AppBase:
should_merge = True
# Specific for OpenAPI body replacement
print("\n\n\nDOING STUFF BELOW HERE")
#print("\n\n\nDOING STUFF BELOW HERE")
if not should_merge:
for parameter in self.action["parameters"]:
if parameter["name"] == key:
print("CHECKING BODY FOR VALUE REPLACE DATA!")
#print("CHECKING BODY FOR VALUE REPLACE DATA!")
try:
values = parameter["value_replace"]
if values != None:
@@ -343,7 +343,7 @@ class AppBase:
except:
pass
print(f"MERGE: {should_merge}")
#print(f"MERGE: {should_merge}")
if isinstance(value, list):
print("Item {value} is a list.")
if len(value) <= 1:
@@ -368,7 +368,8 @@ class AppBase:
all_list_keys.append(key)
all_lists.append(baseparams[key])
else:
print(f"{value} is not a list")
#print(f"{value} is not a list")
pass
print("Listlengths: %s" % listlengths)
if len(listlengths) == 0:
@@ -433,7 +434,7 @@ class AppBase:
# Runs recursed versions with inner loops and such
async def run_recursed_items(self, func, baseparams, loop_wrapper):
print(f"RECURSED ITEMS: {baseparams}")
#print(f"RECURSED ITEMS: {baseparams}")
has_loop = False
newparams = {}
@@ -465,7 +466,7 @@ class AppBase:
newparams[key] = value[0]
has_loop = True
else:
print(f"Key {key} is NOT a list within a list. Value: {value}")
#print(f"Key {key} is NOT a list within a list. Value: {value}")
newparams[key] = value
results = []
@@ -473,7 +474,7 @@ class AppBase:
print("[WARNING] Should run inner loop: %s" % newparams)
ret = await self.run_recursed_items(func, newparams, loop_wrapper)
else:
print("[INFO] Should run multiplier check with params (inner): %s" % newparams)
#print("[INFO] Should run multiplier check with params (inner): %s" % newparams)
# 1. Find the loops that are required and create new multipliers
# If here: check for multipliers within this scope.
ret = []
@@ -481,7 +482,7 @@ class AppBase:
# FIXME: This does a deduplication of the data
new_params = self.validate_unique_fields(param_multiplier)
print(f"NEW PARAMS: {new_params}")
#print(f"NEW PARAMS: {new_params}")
if len(new_params) == 0:
print("[WARNING] SHOULD STOP MULTI-EXECUTION BECAUSE FIELDS AREN'T UNIQUE")
action_result = {
@@ -499,7 +500,7 @@ class AppBase:
#return
else:
#subparams = new_params
print(f"NEW PARAMS: {new_params}")
#print(f"NEW PARAMS: {new_params}")
param_multiplier = new_params
#print("Returned with newparams of length %d", len(new_params))
@@ -516,7 +517,7 @@ class AppBase:
print("[INFO] Multiplier length: %d" % len(param_multiplier))
#tmp = ""
for subparams in param_multiplier:
print(f"SUBPARAMS IN MULTI: {subparams}")
#print(f"SUBPARAMS IN MULTI: {subparams}")
try:
#tmp = await func(**subparams)
@@ -549,7 +550,7 @@ class AppBase:
tmp = "An error occured during execution: %s" % e
print("RET from execution: %s" % ret)
#print("RET from execution: %s" % ret)
new_value = tmp
if tmp == None:
new_value = ""
+1 -1
View File
@@ -3,7 +3,7 @@
### DEFAULT
NAME=shuffle-app_sdk
VERSION=0.9.02
VERSION=0.9.05
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
docker build . -f Dockerfile -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
@@ -21,7 +21,7 @@ require (
github.com/docker/go-connections v0.4.0
github.com/docker/go-units v0.4.0 // indirect
github.com/elastic/go-elasticsearch/v7 v7.13.1 // indirect
github.com/frikky/kin-openapi v0.39.0
github.com/frikky/kin-openapi v0.40.0
github.com/frikky/shuffle-shared v0.0.78
github.com/fsouza/go-dockerclient v1.7.2
github.com/ghodss/yaml v1.0.0
+1 -1
View File
@@ -283,7 +283,7 @@ const Header = props => {
}}
value={userdata.active_org.id}
fullWidth
style={{backgroundColor: theme.palette.surfaceColor, marginRight: 15, color: "white", height: 50, width: 200}}
style={{marginTop: 5, backgroundColor: theme.palette.surfaceColor, marginRight: 15, color: "white", height: 50, width: 200}}
onChange={(e) => {
handleClickChangeOrg(e.target.value)
}}
+27 -15
View File
@@ -1914,11 +1914,13 @@ const AngularWorkflow = (props) => {
//console.log("BRANCHES: ", branch)
if (data.type === "ACTION") {
//setSelectedApp({})
//setSelectedAction({})
var curaction = workflow.actions.find(a => a.id === data.id)
//console.log("INSIDE CURACTION: ", curaction)
if (!curaction || curaction === undefined) {
//event.target.unselect()
//alert.error("Action not found. Please remake it.")
alert.error("Action not found. Please remake it.")
return
}
@@ -1989,6 +1991,16 @@ const AngularWorkflow = (props) => {
//setSelectedAction(JSON.parse(JSON.stringify(curaction)))
//console.log("CURAPP: ", curapp, selectedApp)
//console.log("ACTION: ", curaction)
if (curaction.parameters !== undefined && curaction.parameters !== null && curaction.parameters.length > 0) {
//console.log("params: ", curaction.parameters)
for (var key in curaction.parameters) {
if (curaction.parameters[key].options !== undefined && curaction.parameters[key].options !== null && curaction.parameters[key].options.length > 0 && curaction.parameters[key].value == "") {
curaction.parameters[key].value = curaction.parameters[key].options[0]
}
}
}
setSelectedApp(curapp)
setSelectedAction(curaction)
@@ -2759,22 +2771,22 @@ const AngularWorkflow = (props) => {
case 67:
if (previouskey === 17) {
console.log("CTRL+C")
const filteredelements = cy.filter(function(element, i){
return element.hasClass('selected')
})
//const filteredelements = cy.filter(function(element, i){
// return element.hasClass('selected')
//})
for (var key in filteredelements) {
}
//for (var key in filteredelements) {
//}
var copyText = document.getElementById("copy_element_shuffle")
if (copyText !== undefined && copyText !== null) {
const clipboard = navigator.clipboard
if (clipboard === undefined) {
alert.error("Can only copy over HTTPS (port 3443)")
return
}
}
console.log("FILTERED: ", filteredelements)
//var copyText = document.getElementById("copy_element_shuffle")
//if (copyText !== undefined && copyText !== null) {
// const clipboard = navigator.clipboard
// if (clipboard === undefined) {
// alert.error("Can only copy over HTTPS (port 3443)")
// return
// }
//}
//console.log("FILTERED: ", filteredelements)
}
break;
case 86:
+1 -1
View File
@@ -91,7 +91,7 @@ export const GetIconInfo = (action) => {
{"key": "merge", "values": ["join", "merge"]},
{"key": "search", "values": ["search", "find", "locate", "index",]},
{"key": "list", "values": ["list", "head", "options"]},
{"key": "download", "values": ["get", "download", "return", "hello_world", "curl",]},
{"key": "download", "values": ["capture", "get", "download", "return", "hello_world", "curl",]},
{"key": "add", "values": ["add"]},
{"key": "delete", "values": ["delete", "remove", "clear", "clean",]},
{"key": "send", "values": ["send", "dispatch", "mail", "forward", "post", "submit", "mark", "set"]},