diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 786a9b3b..06a23496 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -1585,7 +1585,8 @@ func saveWorkflow(resp http.ResponseWriter, request *http.Request) { } // FIXME: Have a good way of tracking errors. ID's or similar. - if !action.IsValid { + if !action.IsValid && len(action.Errors) > 0 { + log.Printf("Node %s is invalid and needs to be remade. Errors: %s", action.Label, strings.Join(action.Errors, "\n")) resp.WriteHeader(401) resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Node %s is invalid and needs to be remade."}`, action.Label))) return @@ -1792,10 +1793,16 @@ func saveWorkflow(resp http.ResponseWriter, request *http.Request) { } if !authFound { - log.Printf("App auth %s doesn't exist", action.AuthenticationId) - resp.WriteHeader(401) - resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "App auth %s doesn't exist"}`, action.AuthenticationId))) - return + log.Printf("App auth %s doesn't exist. Setting error", action.AuthenticationId) + workflow.Errors = append(workflow.Errors, fmt.Sprintf("App authentication for %s doesn't exist!", action.AppName)) + workflow.IsValid = false + + action.Errors = append(action.Errors, "App authentication doesn't exist") + action.IsValid = false + action.AuthenticationId = "" + //resp.WriteHeader(401) + //resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "App auth %s doesn't exist"}`, action.AuthenticationId))) + //return } } @@ -2421,9 +2428,9 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf for _, authparam := range curAuth.Fields { if param.Name == authparam.Key { - log.Printf("Name: %s - value: %s", param.Name, param.Value) param.Value = authparam.Value - log.Printf("Name: %s - value: %s\n", param.Name, param.Value) + //log.Printf("Name: %s - value: %s", param.Name, param.Value) + //log.Printf("Name: %s - value: %s\n", param.Name, param.Value) break } } diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 6ab6e3f3..117d0878 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -558,6 +558,10 @@ const AngularWorkflow = (props) => { } } + // Override just in this place + curworkflowAction.errors = [] + curworkflowAction.isValid = true + newActions.push(curworkflowAction) } else if (type === "TRIGGER") { //console.log("TRIGGER") @@ -2258,6 +2262,7 @@ const AngularWorkflow = (props) => { const ParsedAppPaper = (props) => { const app = props.app + const [hover, setHover] = React.useState(false) // FIXME - add label to apps, as this might be slow with A LOT of apps var newAppname = app.name @@ -2268,6 +2273,10 @@ const AngularWorkflow = (props) => { } const image = "url("+app.large_image+")" + const newAppStyle = JSON.parse(JSON.stringify(paperAppStyle)) + const pixelSize = !hover ? "2px" : "4px" + newAppStyle.borderLeft = app.is_valid ? `${pixelSize} solid green` : `${pixelSize} solid orange` + return ( { y: 0, }} > - -
-
- + {setHover(true)}} onMouseOut={() => {setHover(false)}}> +
@@ -5838,7 +5845,7 @@ const AngularWorkflow = (props) => { } const handleSubmitCheck = () => { - console.log(authenticationOption) + console.log("NEW AUTH: ", authenticationOption) if (authenticationOption.label.length === 0) { alert.info("Label can't be empty") return @@ -5869,6 +5876,8 @@ const AngularWorkflow = (props) => { console.log("FIELDS: ", newFields) newAuthOption.fields = newFields setNewAppAuth(newAuthOption) + appAuthentication.push(newAuthOption) + setAppAuthentication(appAuthentication) setUpdate(authenticationOption.id) }