Fixed condition deletion
This commit is contained in:
@@ -1525,10 +1525,10 @@ const AngularWorkflow = (props) => {
|
|||||||
<MoreVertIcon />
|
<MoreVertIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Menu
|
<Menu
|
||||||
id="long-menu"
|
id="long-menu"
|
||||||
anchorEl={anchorEl}
|
anchorEl={anchorEl}
|
||||||
keepMounted
|
keepMounted
|
||||||
open={open}
|
open={open}
|
||||||
PaperProps={{
|
PaperProps={{
|
||||||
style: {
|
style: {
|
||||||
backgroundColor: surfaceColor,
|
backgroundColor: surfaceColor,
|
||||||
@@ -2299,7 +2299,7 @@ const AngularWorkflow = (props) => {
|
|||||||
try {
|
try {
|
||||||
JSON.parse(event.target.value)
|
JSON.parse(event.target.value)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
alert.error("Failed to parse json")
|
alert.error("Failed to parse json: ", e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -2939,23 +2939,32 @@ const AngularWorkflow = (props) => {
|
|||||||
<div style={{flex: "10"}}>
|
<div style={{flex: "10"}}>
|
||||||
<b>{data.name} </b>
|
<b>{data.name} </b>
|
||||||
</div>
|
</div>
|
||||||
<div style={{cursor: "pointer", color: staticcolor}} onClick={() => {
|
<Tooltip color="primary" title="Static data" placement="top">
|
||||||
changeActionParameterVariant("STATIC_VALUE")
|
<div style={{cursor: "pointer", color: staticcolor}} onClick={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
changeActionParameterVariant("STATIC_VALUE")
|
||||||
|
}}>
|
||||||
|
<CreateIcon />
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
|
|
||||||
|
<Tooltip color="primary" title="Data from previous action" placement="top">
|
||||||
|
<div style={{cursor: "pointer", color: actioncolor}} onClick={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
changeActionParameterVariant("ACTION_RESULT")
|
||||||
}}>
|
}}>
|
||||||
static
|
<AppsIcon />
|
||||||
</div>
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
|
|
|
||||||
<div style={{cursor: "pointer", color: actioncolor}} onClick={() => {
|
<Tooltip color="primary" title="Use local variable" placement="top">
|
||||||
changeActionParameterVariant("ACTION_RESULT")
|
<div style={{cursor: "pointer", color: varcolor}} onClick={(e) => {
|
||||||
}}>
|
e.preventDefault()
|
||||||
action
|
changeActionParameterVariant("WORKFLOW_VARIABLE")
|
||||||
</div>
|
}}>
|
||||||
|
|
<FavoriteBorderIcon />
|
||||||
<div style={{cursor: "pointer", color: varcolor}} onClick={() => {
|
</div>
|
||||||
changeActionParameterVariant("WORKFLOW_VARIABLE")
|
</Tooltip>
|
||||||
}}>
|
|
||||||
var
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{datafield}
|
{datafield}
|
||||||
</div>
|
</div>
|
||||||
@@ -3091,8 +3100,16 @@ const AngularWorkflow = (props) => {
|
|||||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||||
|
|
||||||
const deleteCondition = (conditionIndex) => {
|
const deleteCondition = (conditionIndex) => {
|
||||||
//selectedEdge.conditions.splice(conditionIndex, 1)
|
console.log(selectedEdge)
|
||||||
//setSelectedEdge(selectedEdge)
|
if (selectedEdge.conditions.length === 1) {
|
||||||
|
selectedEdge.conditions = []
|
||||||
|
} else {
|
||||||
|
selectedEdge.conditions.splice(conditionIndex, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
setSelectedEdge(selectedEdge)
|
||||||
|
setOpen(false)
|
||||||
|
setUpdate("delete "+conditionIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
const paperVariableStyle = {
|
const paperVariableStyle = {
|
||||||
@@ -3108,6 +3125,7 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const menuClick = (event) => {
|
const menuClick = (event) => {
|
||||||
|
console.log("MENU CLICK")
|
||||||
setOpen(!open)
|
setOpen(!open)
|
||||||
setAnchorEl(event.currentTarget);
|
setAnchorEl(event.currentTarget);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user