#115: Fixed backend for app options
This commit is contained in:
@@ -131,6 +131,7 @@ type WorkflowAppActionParameter struct {
|
|||||||
Example string `json:"example" datastore:"example" yaml:"example"`
|
Example string `json:"example" datastore:"example" yaml:"example"`
|
||||||
Value string `json:"value" datastore:"value" yaml:"value,omitempty"`
|
Value string `json:"value" datastore:"value" yaml:"value,omitempty"`
|
||||||
Multiline bool `json:"multiline" datastore:"multiline" yaml:"multiline"`
|
Multiline bool `json:"multiline" datastore:"multiline" yaml:"multiline"`
|
||||||
|
Options []string `json:"options" datastore:"options" yaml:"options"`
|
||||||
ActionField string `json:"action_field" datastore:"action_field" yaml:"actionfield,omitempty"`
|
ActionField string `json:"action_field" datastore:"action_field" yaml:"actionfield,omitempty"`
|
||||||
Variant string `json:"variant" datastore:"variant" yaml:"variant,omitempty"`
|
Variant string `json:"variant" datastore:"variant" yaml:"variant,omitempty"`
|
||||||
Required bool `json:"required" datastore:"required" yaml:"required"`
|
Required bool `json:"required" datastore:"required" yaml:"required"`
|
||||||
|
|||||||
@@ -2401,7 +2401,7 @@ const AngularWorkflow = (props) => {
|
|||||||
// {data.name}, {data.description}, {data.required}, {data.schema.type}
|
// {data.name}, {data.description}, {data.required}, {data.schema.type}
|
||||||
const AppActionArguments = (props) => {
|
const AppActionArguments = (props) => {
|
||||||
const [selectedActionParameters, setSelectedActionParameters] = React.useState([])
|
const [selectedActionParameters, setSelectedActionParameters] = React.useState([])
|
||||||
const [selectedVariableParameter, setSelectedVariableParameter] = React.useState()
|
const [selectedVariableParameter, setSelectedVariableParameter] = React.useState("")
|
||||||
const [showDropdown, setShowDropdown] = React.useState(false)
|
const [showDropdown, setShowDropdown] = React.useState(false)
|
||||||
const [showDropdownNumber, setShowDropdownNumber] = React.useState(0)
|
const [showDropdownNumber, setShowDropdownNumber] = React.useState(0)
|
||||||
const [actionlist, setActionlist] = React.useState([])
|
const [actionlist, setActionlist] = React.useState([])
|
||||||
@@ -2538,14 +2538,12 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const changeActionParameterVariable = (fieldvalue, count) => {
|
const changeActionParameterVariable = (fieldvalue, count) => {
|
||||||
setSelectedVariableParameter(fieldvalue)
|
console.log("CALLED THIS ONE WITH VALUE!", fieldvalue)
|
||||||
|
if (selectedVariableParameter === fieldvalue) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// this isn't updated anywhere in the workflow
|
setSelectedVariableParameter(fieldvalue)
|
||||||
// setSelectedActionName({})
|
|
||||||
// setSelectedAction({})
|
|
||||||
// setSelectedTrigger({})
|
|
||||||
// setSelectedApp({})
|
|
||||||
// setSelectedEdge({})
|
|
||||||
|
|
||||||
selectedActionParameters[count].action_field = fieldvalue
|
selectedActionParameters[count].action_field = fieldvalue
|
||||||
selectedAction.parameters = selectedActionParameters
|
selectedAction.parameters = selectedActionParameters
|
||||||
@@ -2693,9 +2691,37 @@ const AngularWorkflow = (props) => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
console.log("PARAM: ", selectedActionParameters[count])
|
||||||
|
if (selectedActionParameters[count].options !== undefined && selectedActionParameters[count].options !== null && selectedActionParameters[count].options.length > 0) {
|
||||||
|
console.log("FOUND OPTIONS!: ", selectedActionParameters[count])
|
||||||
|
if (selectedActionParameters[count].value === "" && selectedActionParameters[count].required) {
|
||||||
|
changeActionParameterVariable(selectedActionParameters[count].options[0], count)
|
||||||
|
}
|
||||||
|
|
||||||
// Remap data based on variant
|
datafield =
|
||||||
if (data.variant === "STATIC_VALUE") {
|
<Select
|
||||||
|
SelectDisplayProps={{
|
||||||
|
style: {
|
||||||
|
marginLeft: 10,
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
value={selectedActionParameters[count].value}
|
||||||
|
fullWidth
|
||||||
|
onChange={(e) => {
|
||||||
|
console.log("VAL: ", e.target.value)
|
||||||
|
changeActionParameterVariable(e.target.value, count)
|
||||||
|
setUpdate(Math.random())
|
||||||
|
}}
|
||||||
|
style={{backgroundColor: surfaceColor, color: "white", height: "50px"}}
|
||||||
|
>
|
||||||
|
{selectedActionParameters[count].options.map(data => (
|
||||||
|
<MenuItem key={data} style={{backgroundColor: inputColor, color: "white"}} value={data}>
|
||||||
|
{data}
|
||||||
|
</MenuItem>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
|
||||||
|
} else if (data.variant === "STATIC_VALUE") {
|
||||||
staticcolor = "#f85a3e"
|
staticcolor = "#f85a3e"
|
||||||
} else if (data.variant === "ACTION_RESULT") {
|
} else if (data.variant === "ACTION_RESULT") {
|
||||||
// Gets the parents of the current node
|
// Gets the parents of the current node
|
||||||
|
|||||||
Reference in New Issue
Block a user