Workflow QOL updatesls

This commit is contained in:
frikky
2020-08-24 11:50:35 +02:00
parent 47993ec030
commit 0fa70c5b37
3 changed files with 47 additions and 60 deletions
-2
View File
@@ -601,8 +601,6 @@ func generateYaml(swagger *openapi3.Swagger, newmd5 string) (*openapi3.Swagger,
actualPath = strings.Replace(actualPath, "\\", "", -1) actualPath = strings.Replace(actualPath, "\\", "", -1)
// FIXME: Handle everything behind questionmark (?) with dots as well. // FIXME: Handle everything behind questionmark (?) with dots as well.
log.Printf("ActualPath: %s", actualPath)
// https://godoc.org/github.com/getkin/kin-openapi/openapi3#PathItem // https://godoc.org/github.com/getkin/kin-openapi/openapi3#PathItem
if path.Get != nil { if path.Get != nil {
action, curCode := handleGet(swagger, api, extraParameters, path, actualPath) action, curCode := handleGet(swagger, api, extraParameters, path, actualPath)
+2
View File
@@ -120,6 +120,8 @@ type WorkflowApp struct {
} `json:"contact_info" datastore:"contact_info" yaml:"contact_info" required:false` } `json:"contact_info" datastore:"contact_info" yaml:"contact_info" required:false`
Actions []WorkflowAppAction `json:"actions" yaml:"actions" required:true datastore:"actions,noindex"` Actions []WorkflowAppAction `json:"actions" yaml:"actions" required:true datastore:"actions,noindex"`
Authentication Authentication `json:"authentication" yaml:"authentication" required:false datastore:"authentication"` Authentication Authentication `json:"authentication" yaml:"authentication" required:false datastore:"authentication"`
Tags []string `json:"tags" yaml:"tags" required:false datastore:"activated"`
Category []string `json:"category" yaml:"category" required:false datastore:"category"`
} }
type WorkflowAppActionParameter struct { type WorkflowAppActionParameter struct {
+45 -58
View File
@@ -29,6 +29,7 @@ import Menu from '@material-ui/core/Menu';
import Input from '@material-ui/core/Input'; import Input from '@material-ui/core/Input';
import FormGroup from '@material-ui/core/FormGroup'; import FormGroup from '@material-ui/core/FormGroup';
import FormControlLabel from '@material-ui/core/FormControlLabel'; import FormControlLabel from '@material-ui/core/FormControlLabel';
import Typography from '@material-ui/core/Typography';
import Checkbox from '@material-ui/core/Checkbox'; import Checkbox from '@material-ui/core/Checkbox';
import Breadcrumbs from '@material-ui/core/Breadcrumbs'; import Breadcrumbs from '@material-ui/core/Breadcrumbs';
import CircularProgress from '@material-ui/core/CircularProgress'; import CircularProgress from '@material-ui/core/CircularProgress';
@@ -106,6 +107,7 @@ const AngularWorkflow = (props) => {
const { globalUrl, isLoggedIn, isLoaded } = props; const { globalUrl, isLoggedIn, isLoaded } = props;
const referenceUrl = globalUrl+"/api/v1/hooks/" const referenceUrl = globalUrl+"/api/v1/hooks/"
const alert = useAlert() const alert = useAlert()
const borderRadius = 3
const [bodyWidth, bodyHeight] = useWindowSize(); const [bodyWidth, bodyHeight] = useWindowSize();
const appBarSize = 74 const appBarSize = 74
@@ -1575,6 +1577,7 @@ const AngularWorkflow = (props) => {
} }
const paperAppStyle = { const paperAppStyle = {
borderRadius: borderRadius,
minHeight: "100px", minHeight: "100px",
maxHeight: "100px", maxHeight: "100px",
minWidth: "100%", minWidth: "100%",
@@ -1587,6 +1590,7 @@ const AngularWorkflow = (props) => {
} }
const paperVariableStyle = { const paperVariableStyle = {
borderRadius: borderRadius,
minHeight: "50px", minHeight: "50px",
maxHeight: "50px", maxHeight: "50px",
minWidth: "100%", minWidth: "100%",
@@ -2207,6 +2211,7 @@ const AngularWorkflow = (props) => {
<div style={appScrollStyle}> <div style={appScrollStyle}>
{/* {/*
<TextField <TextField
style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor}}
InputProps={{ InputProps={{
style:{ style:{
@@ -2258,7 +2263,7 @@ const AngularWorkflow = (props) => {
</div> </div>
<Grid container style={{margin: "10px 10px 10px 10px", flex: "10"}}> <Grid container style={{margin: "10px 10px 10px 10px", flex: "10"}}>
<Grid item> <Grid item>
<div style={{height: 80, width: 80, backgroundImage: image, backgroundSize: "cover", backgroundRepeat: "no-repeat"}} /> <div style={{borderRadius: borderRadius, height: 80, width: 80, backgroundImage: image, backgroundSize: "cover", backgroundRepeat: "no-repeat"}} />
</Grid> </Grid>
<Grid style={{display: "flex", flexDirection: "column", marginLeft: "20px"}}> <Grid style={{display: "flex", flexDirection: "column", marginLeft: "20px"}}>
<Grid item style={{flex: 1}}> <Grid item style={{flex: 1}}>
@@ -2644,7 +2649,7 @@ const AngularWorkflow = (props) => {
var datafield = var datafield =
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -2725,7 +2730,7 @@ const AngularWorkflow = (props) => {
))} ))}
</Select> </Select>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -2874,7 +2879,7 @@ const AngularWorkflow = (props) => {
selectedAction.parameters[count].value = selectedActionParameters[count].value selectedAction.parameters[count].value = selectedActionParameters[count].value
console.log("TARGET: ", selectedActionParameters) console.log("TARGET: ", selectedActionParameters)
setSelectedAction(selectedAction) setSelectedAction(selectedAction)
setUpdate("action"+e.target.value.name) setUpdate(Math.random())
setShowDropdown(false) setShowDropdown(false)
}} }}
@@ -2928,7 +2933,7 @@ const AngularWorkflow = (props) => {
selectedAction.parameters[count].value = selectedActionParameters[count].value selectedAction.parameters[count].value = selectedActionParameters[count].value
console.log("TARGET: ", selectedActionParameters) console.log("TARGET: ", selectedActionParameters)
setSelectedAction(selectedAction) setSelectedAction(selectedAction)
setUpdate("action"+e.target.value.name) setUpdate(Math.random())
setShowDropdown(false) setShowDropdown(false)
}} }}
@@ -3016,8 +3021,8 @@ const AngularWorkflow = (props) => {
flexDirection: "column", flexDirection: "column",
backgroundColor: "#1F2023", backgroundColor: "#1F2023",
color: "white", color: "white",
paddingRight: 10, paddingRight: 15,
paddingLeft: 10, paddingLeft: 15,
minHeight: "100%", minHeight: "100%",
zIndex: 1000, zIndex: 1000,
resize: "vertical", resize: "vertical",
@@ -3080,7 +3085,7 @@ const AngularWorkflow = (props) => {
<div style={{display: "flex", minHeight: 40, marginBottom: 30}}> <div style={{display: "flex", minHeight: 40, marginBottom: 30}}>
<div style={{flex: 1}}> <div style={{flex: 1}}>
<h3 style={{marginBottom: 5}}>{selectedAction.app_name}</h3> <h3 style={{marginBottom: 5}}>{selectedAction.app_name}</h3>
<a href="https://shuffler.io/docs/apps#actions" target="_blank" style={{textDecoration: "none", color: "#f85a3e"}}>What are actions?</a> <a href="https://shuffler.io/docs/workflows#nodes" target="_blank" style={{textDecoration: "none", color: "#f85a3e"}}>What are actions?</a>
{selectedAction.errors !== null && selectedAction.errors.length > 0 ? {selectedAction.errors !== null && selectedAction.errors.length > 0 ?
<div> <div>
Errors: {selectedAction.errors.join("\n")} Errors: {selectedAction.errors.join("\n")}
@@ -3095,17 +3100,17 @@ const AngularWorkflow = (props) => {
</div> </div>
</div> </div>
<Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
<div> <Typography>
Name Name
</div> </Typography>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
minHeight: "50px",
marginLeft: "5px", marginLeft: "5px",
maxWidth: "95%", maxWidth: "95%",
height: "50px",
fontSize: "1em", fontSize: "1em",
}, },
}} }}
@@ -3144,7 +3149,7 @@ const AngularWorkflow = (props) => {
selectedAction.selectedAuthentication = e.target.value selectedAction.selectedAuthentication = e.target.value
selectedAction.authentication_id = e.target.value.id selectedAction.authentication_id = e.target.value.id
setSelectedAction(selectedAction) setSelectedAction(selectedAction)
setUpdate("update auth") setUpdate(Math.random())
}} }}
style={{backgroundColor: inputColor, color: "white", height: "50px"}} style={{backgroundColor: inputColor, color: "white", height: "50px"}}
> >
@@ -3175,12 +3180,15 @@ const AngularWorkflow = (props) => {
: null} : null}
{environments !== undefined && environments !== null && environments.length > 1 ? {environments !== undefined && environments !== null && environments.length > 1 ?
<div style={{marginTop: "20px"}}> <div style={{marginTop: "20px"}}>
Environment <Typography>
Environment
</Typography>
<Select <Select
value={selectedActionEnvironment === undefined || selectedActionEnvironment.Name === undefined ? "" : selectedActionEnvironment.Name} value={selectedActionEnvironment === undefined || selectedActionEnvironment.Name === undefined ? "" : selectedActionEnvironment.Name}
SelectDisplayProps={{ SelectDisplayProps={{
style: { style: {
marginLeft: 10, marginLeft: 10,
} }
}} }}
fullWidth fullWidth
@@ -3225,7 +3233,7 @@ const AngularWorkflow = (props) => {
selectedAction.execution_variable = value selectedAction.execution_variable = value
} }
setSelectedAction(selectedAction) setSelectedAction(selectedAction)
setUpdate("actionname "+e.target.value+selectedAction.Label) setUpdate(Math.random())
}} }}
style={{backgroundColor: inputColor, color: "white", height: "50px"}} style={{backgroundColor: inputColor, color: "white", height: "50px"}}
> >
@@ -3499,7 +3507,7 @@ const AngularWorkflow = (props) => {
var datafield = var datafield =
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -3720,7 +3728,7 @@ const AngularWorkflow = (props) => {
console.log("VALUE: ", conditionValue.configuration) console.log("VALUE: ", conditionValue.configuration)
conditionValue.configuration = !conditionValue.configuration conditionValue.configuration = !conditionValue.configuration
setConditionValue(conditionValue) setConditionValue(conditionValue)
setUpdate("condition "+conditionValue.configuration) setUpdate(Math.random())
}}> }}>
{conditionValue.configuration ? "!" : "="} {conditionValue.configuration ? "!" : "="}
</Button> </Button>
@@ -3847,7 +3855,7 @@ const AngularWorkflow = (props) => {
setSelectedEdge(selectedEdge) setSelectedEdge(selectedEdge)
setOpen(false) setOpen(false)
setUpdate("delete "+conditionIndex) setUpdate(Math.random())
} }
const paperVariableStyle = { const paperVariableStyle = {
@@ -4175,7 +4183,7 @@ const AngularWorkflow = (props) => {
Name Name
</div> </div>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4194,7 +4202,7 @@ const AngularWorkflow = (props) => {
<div style={{marginTop: "20px"}}> <div style={{marginTop: "20px"}}>
Environment: Environment:
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4261,7 +4269,7 @@ const AngularWorkflow = (props) => {
Name Name
</div> </div>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4276,27 +4284,6 @@ const AngularWorkflow = (props) => {
placeholder={selectedTrigger.label} placeholder={selectedTrigger.label}
onChange={selectedTriggerChange} onChange={selectedTriggerChange}
/> />
<div style={{marginTop: "20px"}}>
Environment:
<TextField
style={{backgroundColor: inputColor}}
InputProps={{
style:{
color: "white",
marginLeft: "5px",
maxWidth: "95%",
height: "50px",
fontSize: "1em",
},
}}
required
disabled
fullWidth
color="primary"
value={selectedTrigger.environment}
/>
</div>
<Divider style={{marginTop: "20px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginTop: "20px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
<div style={{flex: "6", marginTop: "20px"}}> <div style={{flex: "6", marginTop: "20px"}}>
<div> <div>
@@ -4308,7 +4295,7 @@ const AngularWorkflow = (props) => {
</div> </div>
</div> </div>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
onClick={() => { onClick={() => {
//alert.info("Saved URI to clipboard") //alert.info("Saved URI to clipboard")
console.log("Copy to clipboooooard") console.log("Copy to clipboooooard")
@@ -4333,7 +4320,7 @@ const AngularWorkflow = (props) => {
/> />
<Divider style={{marginTop: "20px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/> <Divider style={{marginTop: "20px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
<div style={{marginTop: "20px", marginBottom: "7px", display: "flex"}}> <div style={{marginTop: "20px", marginBottom: "7px", display: "flex"}}>
<Button variant="contained" style={{flex: "1",}} disabled={selectedTrigger.status === "running"} onClick={() => { <Button variant="contained" style={{flex: "1",}} disabled={selectedTrigger.status === "running"} onClick={() => {
newWebhook(selectedTrigger) newWebhook(selectedTrigger)
}} color="primary"> }} color="primary">
Start Start
@@ -4594,7 +4581,7 @@ const AngularWorkflow = (props) => {
Name Name
</div> </div>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4613,7 +4600,7 @@ const AngularWorkflow = (props) => {
<div style={{marginTop: "20px"}}> <div style={{marginTop: "20px"}}>
Environment: Environment:
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4640,7 +4627,7 @@ const AngularWorkflow = (props) => {
</div> </div>
</div> </div>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4723,7 +4710,7 @@ const AngularWorkflow = (props) => {
Name Name
</div> </div>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4742,7 +4729,7 @@ const AngularWorkflow = (props) => {
<div style={{marginTop: "20px"}}> <div style={{marginTop: "20px"}}>
Environment: Environment:
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4770,7 +4757,7 @@ const AngularWorkflow = (props) => {
</div> </div>
</div> </div>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4796,7 +4783,7 @@ const AngularWorkflow = (props) => {
</div> </div>
</div> </div>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -4981,7 +4968,7 @@ const AngularWorkflow = (props) => {
<Tooltip color="primary" title="An argument to be used for execution. This is a variable available to every node in your workflow." placement="top"> <Tooltip color="primary" title="An argument to be used for execution. This is a variable available to every node in your workflow." placement="top">
<TextField <TextField
id="execution_argument_input_field" id="execution_argument_input_field"
style={{backgroundColor: inputColor, }} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
height: 50, height: 50,
@@ -5662,13 +5649,13 @@ const AngularWorkflow = (props) => {
return ( return (
<div> <div>
<DialogContent> <DialogContent>
<a href="https://shuffler.io/docs/apps#authentication" style={{textDecoration: "none", color: "#f85a3e"}}>What is this?</a> <a href="https://shuffler.io/docs/apps#authentication" style={{textDecoration: "none", color: "#f85a3e"}}>What is this?</a><div/>
- These are required fields for authenticating with {selectedApp.name} These are required fields for authenticating with {selectedApp.name}
<div style={{marginTop: 15}}/> <div style={{marginTop: 15}}/>
{selectedApp.link.length > 0 ? <EndpointData /> : null} {selectedApp.link.length > 0 ? <EndpointData /> : null}
<b>Label (to remember it)</b> <b>Name - what is this used for?</b>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -5693,7 +5680,7 @@ const AngularWorkflow = (props) => {
<LockOpenIcon style={{marginRight: 10}}/> <LockOpenIcon style={{marginRight: 10}}/>
<b>{data.name}</b> <b>{data.name}</b>
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",
@@ -5739,7 +5726,7 @@ const AngularWorkflow = (props) => {
<div> <div>
The API endpoint to use (URL) - leave this if you're unsure The API endpoint to use (URL) - leave this if you're unsure
<TextField <TextField
style={{backgroundColor: inputColor}} style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
InputProps={{ InputProps={{
style:{ style:{
color: "white", color: "white",