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