diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 62b434ab..3ead58a3 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -774,7 +774,7 @@ func handleWorkflowQueue(resp http.ResponseWriter, request *http.Request) { } } - log.Printf("Checking results %d vs %d", len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)+extraInputs) + //log.Printf("Checking results %d vs %d", len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)+extraInputs) if len(workflowExecution.Results) == len(workflowExecution.Workflow.Actions)+extraInputs { finished := true for _, result := range workflowExecution.Results { @@ -1611,7 +1611,6 @@ func cleanupExecutions(resp http.ResponseWriter, request *http.Request) { func handleExecution(id string, workflow Workflow, request *http.Request) (WorkflowExecution, string, error) { ctx := context.Background() if workflow.ID == "" || workflow.ID != id { - log.Printf("UPDATING WORKFLOW") tmpworkflow, err := getWorkflow(ctx, id) if err != nil { log.Printf("Failed getting the workflow locally: %s", err) @@ -1668,6 +1667,10 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf return WorkflowExecution{}, "", err } + if execution.Start == "" && len(body) > 0 { + execution.ExecutionArgument = string(body) + } + // FIXME - this should have "execution_argument" from executeWorkflow frontend if len(execution.ExecutionArgument) > 0 { workflowExecution.ExecutionArgument = execution.ExecutionArgument @@ -1835,7 +1838,6 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf onpremExecution := false environments := []string{} for _, action := range workflowExecution.Workflow.Actions { - log.Printf("ENV: %#v", action.Environment) if action.Environment != cloudname { found := false for _, env := range environments { @@ -1859,8 +1861,6 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf return WorkflowExecution{}, "Failed getting workflowexecution", err } - log.Printf("Environments: %#v", environments) - // Adds queue for onprem execution // FIXME - add specifics to executionRequest, e.g. specific environment (can run multi onprem) if onpremExecution { diff --git a/frontend/src/AngularWorkflow.js b/frontend/src/AngularWorkflow.js index 775a9ab4..016cbcab 100644 --- a/frontend/src/AngularWorkflow.js +++ b/frontend/src/AngularWorkflow.js @@ -801,7 +801,6 @@ const AngularWorkflow = (props) => { workflow.start = node.data('id') setWorkflow(workflow) } - } const onEdgeRemoved = (event) => { @@ -1642,8 +1641,6 @@ const AngularWorkflow = (props) => { } newNodeId = uuid.v4() - console.log(data) - const newposition = { "x": e.pageX-cycontainer.offsetLeft, "y": e.pageY-cycontainer.offsetTop, @@ -1671,6 +1668,10 @@ const AngularWorkflow = (props) => { position: newposition, } + if (data.trigger_type === "WEBHOOK") { + newAppData.status = "running" + } + // Can all the data be in here? hmm const nodeToBeAdded = { group: "nodes", @@ -1714,6 +1715,10 @@ const AngularWorkflow = (props) => { } setWorkflow(workflow) + if (data.trigger_type === "WEBHOOK") { + newWebhook(newAppData) + saveWorkflow(workflow) + } } } } diff --git a/frontend/src/Workflows.js b/frontend/src/Workflows.js index 209741f5..5a379e06 100644 --- a/frontend/src/Workflows.js +++ b/frontend/src/Workflows.js @@ -575,9 +575,26 @@ const Workflows = (props) => { var starttime = new Date(selectedExecution.started_at*1000) var endtime = new Date(selectedExecution.started_at*1000) + var parsedArgument = selectedExecution.execution_argument + if (selectedExecution.execution_argument !== undefined && selectedExecution.execution_argument.length > 0) { + parsedArgument = replaceAll(parsedArgument, " None", " \"None\""); + } + const arg = selectedExecution.execution_argument !== undefined && selectedExecution.execution_argument.length > 0 ?
- Argument: {selectedExecution.execution_argument} + Execution argument: {(parsedArgument.startsWith("{") && parsedArgument.endsWith("}")) || (parsedArgument.startsWith("[{") && parsedArgument.endsWith("}]")) ? +
+ +
+ : + selectedExecution.execution_argument + }
: null /* @@ -603,9 +620,6 @@ const Workflows = (props) => {
Finished: {endtime.toISOString()}
-
- Result: {selectedExecution.result} -
Last node: {selectedExecution.last_node}