#102: Added general NOT feature to conditions
This commit is contained in:
@@ -710,7 +710,17 @@ class AppBase:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
#print(destinationvalue)
|
#print(destinationvalue)
|
||||||
if not run_validation(sourcevalue, condition["condition"]["value"], destinationvalue):
|
# NEGATE
|
||||||
|
validation = run_validation(sourcevalue, condition["condition"]["value"], destinationvalue)
|
||||||
|
|
||||||
|
# Configuration = negated because of WorkflowAppActionParam..
|
||||||
|
try:
|
||||||
|
if condition["condition"]["configuration"]:
|
||||||
|
validation = not validation
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if not validation:
|
||||||
self.logger.info("Failed condition check for %s %s %s." % (sourcevalue, condition["condition"]["value"], destinationvalue))
|
self.logger.info("Failed condition check for %s %s %s." % (sourcevalue, condition["condition"]["value"], destinationvalue))
|
||||||
return False, "Failed condition: %s %s %s" % (sourcevalue, condition["condition"]["value"], destinationvalue)
|
return False, "Failed condition: %s %s %s" % (sourcevalue, condition["condition"]["value"], destinationvalue)
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ type AuthenticationUsage struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// An app inside Shuffle
|
// An app inside Shuffle
|
||||||
|
// Source string `json:"source" datastore:"soure" yaml:"source"` - downloadlocation
|
||||||
type WorkflowApp struct {
|
type WorkflowApp struct {
|
||||||
Name string `json:"name" yaml:"name" required:true datastore:"name"`
|
Name string `json:"name" yaml:"name" required:true datastore:"name"`
|
||||||
IsValid bool `json:"is_valid" yaml:"is_valid" required:true datastore:"is_valid"`
|
IsValid bool `json:"is_valid" yaml:"is_valid" required:true datastore:"is_valid"`
|
||||||
|
|||||||
@@ -3517,14 +3517,6 @@ const AngularWorkflow = (props) => {
|
|||||||
<div style={{flex: "10"}}>
|
<div style={{flex: "10"}}>
|
||||||
<b>{data.name} </b>
|
<b>{data.name} </b>
|
||||||
</div>
|
</div>
|
||||||
<Tooltip color="primary" title="Static data" placement="top">
|
|
||||||
<div style={{cursor: "pointer", color: staticcolor}} onClick={(e) => {
|
|
||||||
e.preventDefault()
|
|
||||||
changeActionParameterVariant("STATIC_VALUE")
|
|
||||||
}}>
|
|
||||||
<CreateIcon />
|
|
||||||
</div>
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
</div>
|
||||||
{datafield}
|
{datafield}
|
||||||
</div>
|
</div>
|
||||||
@@ -3557,11 +3549,21 @@ const AngularWorkflow = (props) => {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<DialogTitle><div style={{color:"white"}}>Condition</div></DialogTitle>
|
<DialogTitle><div style={{color:"white"}}>Condition</div></DialogTitle>
|
||||||
<DialogContent style={{display: "flex"}}>
|
<DialogContent style={{display: "flex"}}>
|
||||||
|
<Tooltip color="primary" title={conditionValue.configuration ? "Negated" : "Default"} placement="top">
|
||||||
|
<Button color="primary" variant={conditionValue.configuration ? "contained" : "outlined"} style={{margin: "auto", height: 50, marginBottom: 0, marginRight: 5}} onClick={(e) => {
|
||||||
|
console.log("VALUE: ", conditionValue.configuration)
|
||||||
|
conditionValue.configuration = !conditionValue.configuration
|
||||||
|
setConditionValue(conditionValue)
|
||||||
|
setUpdate("condition "+conditionValue.configuration)
|
||||||
|
}}>
|
||||||
|
{conditionValue.configuration ? "!" : "="}
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
<div style={{flex: "2"}}>
|
<div style={{flex: "2"}}>
|
||||||
<AppConditionHandler tmpdata={sourceValue} setData={setSourceValue} type={"source"} />
|
<AppConditionHandler tmpdata={sourceValue} setData={setSourceValue} type={"source"} />
|
||||||
</div>
|
</div>
|
||||||
<div style={{flex: "1", margin: "auto", marginBottom: "0px"}}>
|
<div style={{flex: "1", margin: "auto", marginBottom: 0, marginLeft: 5, marginRight: 5,}}>
|
||||||
<Button color="primary" variant="outlined" style={{height: "50px",}} fullWidth aria-haspopup="true" onClick={(e) => {setVariableAnchorEl(e.currentTarget)}}>
|
<Button color="primary" variant="outlined" style={{height: "50px",}} fullWidth aria-haspopup="true" onClick={(e) => {setVariableAnchorEl(e.currentTarget)}}>
|
||||||
{conditionValue.value}
|
{conditionValue.value}
|
||||||
</Button>
|
</Button>
|
||||||
<Menu
|
<Menu
|
||||||
@@ -3625,8 +3627,7 @@ const AngularWorkflow = (props) => {
|
|||||||
setVariableAnchorEl(null)
|
setVariableAnchorEl(null)
|
||||||
}} key={"less than"}>less than</MenuItem>
|
}} key={"less than"}>less than</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
<div style={{flex: "2"}}>
|
<div style={{flex: "2"}}>
|
||||||
<AppConditionHandler tmpdata={destinationValue} setData={setDestinationValue} type={"destination"} />
|
<AppConditionHandler tmpdata={destinationValue} setData={setDestinationValue} type={"destination"} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user