Bugfixes for workflows and executions
This commit is contained in:
@@ -1592,16 +1592,15 @@ class AppBase:
|
||||
"matches regex",
|
||||
]
|
||||
|
||||
# FIXME - what should I do here?
|
||||
if not condition["condition"]["value"] in available_checks:
|
||||
self.logger.warning("Skipping %s %s %s because %s is invalid." % (sourcevalue, condition["condition"]["value"], destinationvalue, condition["condition"]["value"]))
|
||||
continue
|
||||
|
||||
#print(destinationvalue)
|
||||
# NEGATE
|
||||
validation = run_validation(sourcevalue, condition["condition"]["value"], destinationvalue)
|
||||
|
||||
# Configuration = negated because of WorkflowAppActionParam..
|
||||
validation = run_validation(sourcevalue, condition["condition"]["value"], destinationvalue)
|
||||
try:
|
||||
if condition["condition"]["configuration"]:
|
||||
validation = not validation
|
||||
@@ -1622,6 +1621,14 @@ class AppBase:
|
||||
# THE START IS ACTUALLY RIGHT HERE :O
|
||||
# Checks whether conditions are met, otherwise set
|
||||
branchcheck, tmpresult = check_branch_conditions(action, fullexecution)
|
||||
if isinstance(tmpresult, object) or isinstance(tmpresult, list):
|
||||
print("Fixing branch return as object -> string")
|
||||
try:
|
||||
tmpresult = tmpresult.replace("'", "\"")
|
||||
tmpresult = json.dumps(tmpresult)
|
||||
except json.decoder.JSONDecodeError as e:
|
||||
print(f"[WARNING] Failed condition parsing {tmpresult} to string")
|
||||
|
||||
if not branchcheck:
|
||||
self.logger.info("Failed one or more branch conditions.")
|
||||
action_result["result"] = tmpresult
|
||||
|
||||
@@ -102,6 +102,8 @@ github.com/frikky/shuffle-shared v0.0.23 h1:Pnlc2M6fHnFRLFd5K1iLTVv4/t4P04Ri1GJ5
|
||||
github.com/frikky/shuffle-shared v0.0.23/go.mod h1:H7SqOta/EAYnfYuWzwzYSh/oWfF0kgnuaJTQNKQBvoQ=
|
||||
github.com/frikky/shuffle-shared v0.0.27 h1:BbibbAv3a5GWR/DfaoSC4D9+fh2cwSEvn9H+EVfd7BM=
|
||||
github.com/frikky/shuffle-shared v0.0.27/go.mod h1:H7SqOta/EAYnfYuWzwzYSh/oWfF0kgnuaJTQNKQBvoQ=
|
||||
github.com/frikky/shuffle-shared v0.0.28 h1:VQqL3+ePwKSUxCOiCC8DpOEgbb2GhXI8XzFB/YlHbps=
|
||||
github.com/frikky/shuffle-shared v0.0.28/go.mod h1:H7SqOta/EAYnfYuWzwzYSh/oWfF0kgnuaJTQNKQBvoQ=
|
||||
github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE=
|
||||
github.com/getkin/kin-openapi v0.8.0/go.mod h1:zZQMFkVgRHCdhgb6ihCTIo9dyDZFvX0k/xAKqw1FhPw=
|
||||
github.com/getkin/kin-openapi v0.52.0 h1:6WqsF5d6PfJ8AscdD+9Rtb2RP2iBWyC7V6GcjssWg7M=
|
||||
|
||||
@@ -81,7 +81,7 @@ const Workflow = (props) => {
|
||||
"app": {},
|
||||
}
|
||||
|
||||
const app = apps.find(app => app.name === action.app_name && (app.app_version === action.app_version || app.loop_versions.includes(action.app_version)))
|
||||
const app = apps.find(app => app.name === action.app_name && (app.app_version === action.app_version || (app.loop_versions !== null && app.loop_versions.includes(action.app_version))))
|
||||
if (app === undefined || app === null) {
|
||||
console.log("App not found!")
|
||||
|
||||
|
||||
@@ -1111,7 +1111,7 @@ const Admin = (props) => {
|
||||
|
||||
|
||||
const generateApikey = (user) => {
|
||||
const userId = isCloud ? user.username : user.id
|
||||
const userId = user.id
|
||||
const data = { "user_id": userId }
|
||||
|
||||
fetch(globalUrl + "/api/v1/generateapikey", {
|
||||
|
||||
@@ -1326,8 +1326,7 @@ const AngularWorkflow = (props) => {
|
||||
return
|
||||
}
|
||||
|
||||
//console.log(apps)
|
||||
const curapp = apps.find(a => a.name === curaction.app_name && (a.app_version === curaction.app_version || a.loop_versions.includes(curaction.app_version)))
|
||||
const curapp = apps.find(a => a.name === curaction.app_name && ((a.app_version === curaction.app_version || (a.loop_versions !== null && a.loop_versions.includes(curaction.app_version)))))
|
||||
if (!curapp || curapp === undefined) {
|
||||
alert.error(`App ${curaction.app_name}:${curaction.app_version} not found. Is it activated?`)
|
||||
|
||||
|
||||
@@ -1461,7 +1461,7 @@ const Apps = (props) => {
|
||||
style={{backgroundColor: inputColor}}
|
||||
variant="outlined"
|
||||
margin="normal"
|
||||
defaultValue={userdata.active_org.defaults.app_download_repo !== undefined && userdata.active_org.defaults.app_download_repo.length > 0 ? userdata.active_org.defaults.app_download_repo : "https://github.com/frikky/shuffle-apps"}
|
||||
defaultValue={"https://github.com/frikky/shuffle-apps"}
|
||||
InputProps={{
|
||||
style:{
|
||||
color: "white",
|
||||
@@ -1479,7 +1479,7 @@ const Apps = (props) => {
|
||||
style={{backgroundColor: inputColor}}
|
||||
variant="outlined"
|
||||
margin="normal"
|
||||
defaultValue={userdata.active_org.defaults.app_download_branch !== undefined && userdata.active_org.defaults.app_download_branch.length > 0 ? userdata.active_org.defaults.app_download_branch : downloadBranch}
|
||||
defaultValue={downloadBranch}
|
||||
InputProps={{
|
||||
style:{
|
||||
color: "white",
|
||||
|
||||
@@ -1802,7 +1802,7 @@ const Workflows = (props) => {
|
||||
style={{backgroundColor: inputColor}}
|
||||
variant="outlined"
|
||||
margin="normal"
|
||||
defaultValue={userdata.active_org.defaults.workflow_download_repo !== undefined && userdata.active_org.defaults.workflow_download_repo.length > 0 ? userdata.active_org.defaults.workflow_download_repo : downloadUrl}
|
||||
defaultValue={downloadUrl}
|
||||
InputProps={{
|
||||
style:{
|
||||
color: "white",
|
||||
@@ -1821,7 +1821,7 @@ const Workflows = (props) => {
|
||||
style={{backgroundColor: inputColor}}
|
||||
variant="outlined"
|
||||
margin="normal"
|
||||
defaultValue={userdata.active_org.defaults.workflow_download_branch !== undefined && userdata.active_org.defaults.workflow_download_branch.length > 0 ? userdata.active_org.defaults.workflow_download_branch : downloadBranch}
|
||||
defaultValue={downloadBranch}
|
||||
InputProps={{
|
||||
style:{
|
||||
color: "white",
|
||||
|
||||
Reference in New Issue
Block a user