From 56185e53e2bba279e7c1a68d7c0e0997178f6db6 Mon Sep 17 00:00:00 2001 From: frikky Date: Fri, 13 Aug 2021 13:14:51 +0200 Subject: [PATCH] #470: Added better error messaging for later debugs --- backend/go-app/walkoff.go | 4 ++-- frontend/src/views/AngularWorkflow.jsx | 30 ++++++++++++++++++++++++++ frontend/src/views/AppCreator.jsx | 29 +++++++++++++++++++++++++ frontend/src/views/Docs.jsx | 4 ++-- 4 files changed, 63 insertions(+), 4 deletions(-) diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 34f6d5bb..88c4b09b 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -1950,8 +1950,8 @@ func handleExecution(id string, workflow shuffle.Workflow, request *http.Request //Org []Org `json:"org,omitempty" datastore:"org"` err = shuffle.SetWorkflowExecution(ctx, workflowExecution, true) if err != nil { - log.Printf("Error saving workflow execution for updates %s: %s", topic, err) - return shuffle.WorkflowExecution{}, "Failed getting workflowexecution", err + log.Printf("[WARNING] Error saving workflow execution for updates %s: %s", topic, err) + return shuffle.WorkflowExecution{}, fmt.Sprintf("Failed setting workflowexecution: %s", err), err } // Adds queue for onprem execution diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index e33c581b..c154d7e6 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -8138,6 +8138,7 @@ const AngularWorkflow = (props) => { // //cf80fa70-65cf-4963-b474-b459a6dead81 //} + console.log(selectedResult) const codePopoutModal = !codeModalOpen ? null : { @@ -8295,6 +8296,35 @@ const AngularWorkflow = (props) => { }}>{selectedResult.result} } +
+ {selectedResult.action.parameters !== null && selectedResult.action.parameters !== undefined ? +
+ + + Variables + + {selectedResult.action.parameters.map((data, index) => { + if (data.value.length === 0) { + return null + } + + if (data.example !== undefined && data.example !== null && data.example.includes("***")) { + return null + } + + return ( +
+ + {data.name}: {data.value} + +
+ ) + })} +
+ : + null + } +
diff --git a/frontend/src/views/AppCreator.jsx b/frontend/src/views/AppCreator.jsx index ad752412..69c787ce 100644 --- a/frontend/src/views/AppCreator.jsx +++ b/frontend/src/views/AppCreator.jsx @@ -1097,9 +1097,16 @@ const AppCreator = (props) => { } if (item.queries.length > 0) { + var skipped = false for (var querykey in item.queries) { const queryitem = item.queries[querykey] + if (queryitem.name.toLowerCase() == "url") { + console.log(item.name+" uses a bad query: url") + skipped = true + break + } + var newitem = { "in": "query", "name": queryitem.name, @@ -1117,12 +1124,27 @@ const AppCreator = (props) => { data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem) //console.log(queryitem) } + + // Bad code as it doesn't allow for "anything". + if (skipped) { + alert.info("Bad configuration of "+item.name+". Skipping because queries are invalid.") + continue + } } //data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem) if (item.paths.length > 0) { for (querykey in item.paths) { const queryitem = item.paths[querykey] + + if (queryitem.toLowerCase() == "url") { + queryitem = "action_url" + } + + if (queryitem.toLowerCase() == "apikey") { + queryitem = "action_apikey" + } + newitem = { "in": "path", "name": queryitem, @@ -1315,6 +1337,13 @@ const AppCreator = (props) => { if (setExtraAuth.length > 0) { for (var key in extraAuth) { const curauth = extraAuth[key] + + if (curauth.name.toLowerCase() == "url") { + alert.error("Can't add extra auth with Name URL") + setAppBuilding(false) + return + } + data.components.securitySchemes[curauth.name] = { "type": "apiKey", "in": curauth.type, diff --git a/frontend/src/views/Docs.jsx b/frontend/src/views/Docs.jsx index 58c2983f..c79e8f4f 100644 --- a/frontend/src/views/Docs.jsx +++ b/frontend/src/views/Docs.jsx @@ -234,7 +234,7 @@ const Docs = (props) => { // ); //} - const postDataBrowser = + const postDataBrowser = list === undefined || list === null ? null :
@@ -278,7 +278,7 @@ const Docs = (props) => { flexDirection: "column", } - const postDataMobile = + const postDataMobile = list === undefined || list === null ? null :