diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 21320d16..600c9264 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -2844,7 +2844,7 @@ const AngularWorkflow = (props) => { {datafield} {showDropdown && showDropdownNumber === count && data.variant === "STATIC_VALUE" && jsonList.length > 0 ? - Autocomplete + Autocomplete { } return ( - + {data.Name} ) @@ -3433,6 +3433,8 @@ const AngularWorkflow = (props) => { const { tmpdata, type } = props const [data, ] = useState(tmpdata) const [multiline, setMultiline] = useState(false) + const [showAutocomplete, setShowAutocomplete] = React.useState(false) + const [actionlist, setActionlist] = React.useState([]) if (tmpdata === undefined) { return tmpdata @@ -3442,6 +3444,47 @@ const AngularWorkflow = (props) => { data.variant = "STATIC_VALUE" } + + // Set actions based on NEXT node, since it should be able to involve those two + console.log("IN APPACTIONARG: ", selectedEdge) + if (actionlist.length === 0) { + // FIXME: Have previous execution values in here + actionlist.push({"type": "Execution Argument", "name": "Execution Argument", "value": "$exec", "highlight": "exec", "autocomplete": "exec", "example": "hello"}) + + if (workflow.workflow_variables !== null && workflow.workflow_variables !== undefined && workflow.workflow_variables.length > 0) { + for (var key in workflow.workflow_variables) { + const item = workflow.workflow_variables[key] + actionlist.push({"type": "workflow_variable", "name": item.name, "value": item.value, "id": item.id, "autocomplete": `${item.name.split(" ").join("_")}`, "example": item.value}) + } + } + + // FIXME: Add values from previous executions if they exist + if (workflow.execution_variables !== null && workflow.execution_variables !== undefined && workflow.execution_variables.length > 0) { + for (var key in workflow.execution_variables) { + const item = workflow.execution_variables[key] + actionlist.push({"type": "execution_variable", "name": item.name, "value": item.value, "id": item.id, "autocomplete": `${item.name.split(" ").join("_")}`, "example": ""}) + } + } + + const destAction = cy.getElementById(selectedEdge.target) + console.log(destAction.data()) + var parents = getParents(destAction.data()) + if (parents.length > 1) { + for (var key in parents) { + const item = parents[key] + if (item.label === "Execution Argument") { + continue + } + + // 1. Take + const actionvalue = {"type": "action", "id": item.id, "name": item.label, "autocomplete": `${item.label.split(" ").join("_")}`, "example": item.example === undefined ? "" : item.example} + actionlist.push(actionvalue) + } + } + + setActionlist(actionlist) + } + var staticcolor = "inherit" var actioncolor = "inherit" var varcolor = "inherit" @@ -3543,6 +3586,105 @@ const AngularWorkflow = (props) => { {datafield} + {actionlist.length === 0 ? null : + + Autocomplete + + + } ) } @@ -3560,7 +3702,7 @@ const AngularWorkflow = (props) => { style: { backgroundColor: surfaceColor, color: "white", - minWidth: "800px", + minWidth: 800, }, }} onClose={() => { @@ -3574,7 +3716,7 @@ const AngularWorkflow = (props) => {
Condition
-