Synced over files and go.mod

This commit is contained in:
Frikky
2024-03-14 09:47:01 +01:00
parent 98200b7445
commit 625d681fe5
9 changed files with 309 additions and 130 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ require (
github.com/gorilla/mux v1.8.0 github.com/gorilla/mux v1.8.0
github.com/h2non/filetype v1.1.3 github.com/h2non/filetype v1.1.3
github.com/satori/go.uuid v1.2.0 github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.5.88 github.com/shuffle/shuffle-shared v0.5.91
golang.org/x/crypto v0.16.0 golang.org/x/crypto v0.16.0
google.golang.org/api v0.125.0 google.golang.org/api v0.125.0
google.golang.org/grpc v1.55.0 google.golang.org/grpc v1.55.0
+2
View File
@@ -461,6 +461,8 @@ github.com/shuffle/shuffle-shared v0.5.81 h1:pt4lT42FrXN/kd/vlYtm7nXShZI0mOamXUM
github.com/shuffle/shuffle-shared v0.5.81/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk= github.com/shuffle/shuffle-shared v0.5.81/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk=
github.com/shuffle/shuffle-shared v0.5.88 h1:YNM6xtnKg0BoMmw2pqV/LnNAsMWMrAzYIAy+o+ChdfI= github.com/shuffle/shuffle-shared v0.5.88 h1:YNM6xtnKg0BoMmw2pqV/LnNAsMWMrAzYIAy+o+ChdfI=
github.com/shuffle/shuffle-shared v0.5.88/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk= github.com/shuffle/shuffle-shared v0.5.88/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk=
github.com/shuffle/shuffle-shared v0.5.91 h1:CN2K4iDt2zjx7MR9B+u5Yb7tA8IEw5lk8+Ab+Wia11Q=
github.com/shuffle/shuffle-shared v0.5.91/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+95 -1
View File
@@ -49,12 +49,14 @@ import {
} from '@mui/x-date-pickers' } from '@mui/x-date-pickers'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { useStyles } from '../views/AppCreator.jsx'
import { import {
ExpandLess as ExpandLessIcon, ExpandLess as ExpandLessIcon,
ExpandMore as ExpandMoreIcon, ExpandMore as ExpandMoreIcon,
Publish as PublishIcon, Publish as PublishIcon,
OpenInNew as OpenInNewIcon, OpenInNew as OpenInNewIcon,
Add as AddIcon,
} from "@mui/icons-material"; } from "@mui/icons-material";
const EditWorkflow = (props) => { const EditWorkflow = (props) => {
@@ -74,6 +76,10 @@ const EditWorkflow = (props) => {
const [name, setName] = React.useState(workflow.name !== undefined ? workflow.name : "") const [name, setName] = React.useState(workflow.name !== undefined ? workflow.name : "")
const [dueDate, setDueDate] = React.useState(workflow.due_date !== undefined && workflow.due_date !== null && workflow.due_date !== 0 ? dayjs(workflow.due_date*1000) : dayjs().subtract(1, 'day')) const [dueDate, setDueDate] = React.useState(workflow.due_date !== undefined && workflow.due_date !== null && workflow.due_date !== 0 ? dayjs(workflow.due_date*1000) : dayjs().subtract(1, 'day'))
const [inputFields, setInputFields] = React.useState([])
const classes = useStyles();
// Gets the generated workflow // Gets the generated workflow
const getGeneratedWorkflow = (workflow_id) => { const getGeneratedWorkflow = (workflow_id) => {
fetch(globalUrl + "/api/v1/workflows/" + workflow_id, { fetch(globalUrl + "/api/v1/workflows/" + workflow_id, {
@@ -352,6 +358,9 @@ const EditWorkflow = (props) => {
{showMoreClicked === true ? {showMoreClicked === true ?
<span style={{marginTop: 25, }}> <span style={{marginTop: 25, }}>
<div style={{display: "flex"}}> <div style={{display: "flex"}}>
<FormControl style={{marginTop: 15, }}> <FormControl style={{marginTop: 15, }}>
<FormLabel id="demo-row-radio-buttons-group-label">Status</FormLabel> <FormLabel id="demo-row-radio-buttons-group-label">Status</FormLabel>
@@ -467,9 +476,94 @@ const EditWorkflow = (props) => {
margin="dense" margin="dense"
fullWidth fullWidth
/> />
{/*
<Typography variant="h6">
Input fields
</Typography>
<Typography variant="body1">
Input fields are fields that will be used during the startup of the workflow. These will be formatted in JSON and is most commonly used from the <a href={`/workflows/${workflow.id}/run`} rel="noopener noreferrer" target="_blank" style={{ textDecoration: "none", color: "#f86a3e" }}>workflow run page</a>.
</Typography>
{inputFields.length === 0 ?
<Button
color="primary"
style={{ maxWidth: 50, marginLeft: 15 }}
variant="outlined"
onClick={() => {
inputFields.push({
"name": "",
"required": false
})
setInputFields(inputFields)
setUpdate(Math.random());
}}
>
<AddIcon style={{}} />
</Button>
: null}
{inputFields.map((data, index) => {
console.log("Inputfield: ", data)
return (
<div style={{display: "flex", }}>
<TextField
required={data.required}
style={{
height: 50,
flex: 2,
marginTop: 0,
marginBottom: 0,
backgroundColor: theme.palette.inputColor,
marginRight: 5,
}}
fullWidth={true}
placeholder="Name"
id="standard-required"
margin="normal"
variant="outlined"
defaultValue={data.value}
onChange={(e) => {
inputFields[index].name = e.target.value
setInputFields(inputFields)
setUpdate(Math.random());
}}
InputProps={{
classes: {
notchedOutline: classes.notchedOutline,
},
style: {
color: "white",
minHeight: 50,
},
}}
/>
<Button
color="primary"
style={{ maxWidth: 50, marginLeft: 15 }}
variant="outlined"
onClick={() => {
inputFields.push({
"name": "",
"required": false
})
setInputFields(inputFields)
setUpdate(Math.random());
}}
>
<AddIcon style={{}} />
</Button>
</div>
)
})}
*/}
</span> </span>
: null} : null}
<Tooltip color="primary" title={"Add more details"} placement="top">
<Tooltip color="primary" title={"Add more details"} placement="top">
<IconButton <IconButton
style={{ color: "white", margin: "auto", marginTop: 10, textAlign: "center", width: 50,}} style={{ color: "white", margin: "auto", marginTop: 10, textAlign: "center", width: 50,}}
onClick={() => { onClick={() => {
+61 -71
View File
@@ -2234,23 +2234,23 @@ const ParsedAction = (props) => {
parsedPaths = GetParsedPaths(innerdata.example, ""); parsedPaths = GetParsedPaths(innerdata.example, "");
} }
const coverColor = "#82ccc3" const coverColor = "#82ccc3"
//menuPosition.left -= 50 //menuPosition.left -= 50
//menuPosition.top -= 250 //menuPosition.top -= 250
//console.log("POS: ", menuPosition1) //console.log("POS: ", menuPosition1)
var menuPosition1 = menuPosition var menuPosition1 = menuPosition
if (menuPosition1 === null) { if (menuPosition1 === null) {
menuPosition1 = { menuPosition1 = {
"left": 0, "left": 0,
"top": 0, "top": 0,
} }
} else if (menuPosition1.top === null || menuPosition1.top === undefined) { } else if (menuPosition1.top === null || menuPosition1.top === undefined) {
menuPosition1.top = 0 menuPosition1.top = 0
} else if (menuPosition1.left === null || menuPosition1.left === undefined) { } else if (menuPosition1.left === null || menuPosition1.left === undefined) {
menuPosition1.left = 0 menuPosition1.left = 0
} }
//console.log("POS1: ", menuPosition1) //console.log("POS1: ", menuPosition1)
return parsedPaths.length > 0 ? ( return parsedPaths.length > 0 ? (
<NestedMenuItem <NestedMenuItem
@@ -2274,11 +2274,10 @@ const ParsedAction = (props) => {
handleItemClick([innerdata]); handleItemClick([innerdata]);
}} }}
> >
<Paper style={{minHeight: 500, maxHeight: 500, minWidth: 275, maxWidth: 275, position: "fixed", top: menuPosition1.top-200, left: menuPosition1.left-455, padding: "10px 0px 10px 10px", overflow: "hidden", overflowY: "auto", border: "1px solid rgba(255,255,255,0.3)",}}> <Paper style={{minHeight: 500, maxHeight: 500, minWidth: 275, maxWidth: 275, position: "fixed", top: menuPosition1.top-200, left: menuPosition1.left-450, padding: "10px 0px 10px 10px", overflow: "hidden", overflowY: "auto", border: "1px solid rgba(255,255,255,0.3)",}}>
<MenuItem <MenuItem
key={innerdata.name} key={innerdata.name}
style={{ style={{
backgroundColor: theme.palette.inputColor,
marginLeft: 15, marginLeft: 15,
color: "white", color: "white",
minWidth: 250, minWidth: 250,
@@ -2303,29 +2302,28 @@ const ParsedAction = (props) => {
//<VpnKeyIcon style={iconStyle} /> //<VpnKeyIcon style={iconStyle} />
const icon = const icon =
pathdata.type === "value" ? ( pathdata.type === "value" ? (
<span style={{marginLeft: 9, }} /> <span style={{marginLeft: 9, }} />
) : pathdata.type === "list" ? ( ) : pathdata.type === "list" ? (
<FormatListNumberedIcon style={{marginLeft: 9, marginRight: 10, }} /> <FormatListNumberedIcon style={{marginLeft: 9, marginRight: 10, }} />
) : ( ) : (
<CircleIcon style={{marginLeft: 9, marginRight: 10, color: coverColor}}/> <CircleIcon style={{marginLeft: 9, marginRight: 10, color: coverColor}}/>
); );
//<ExpandMoreIcon style={iconStyle} /> //<ExpandMoreIcon style={iconStyle} />
const indentation_count = (pathdata.name.match(/\./g) || []).length+1 const indentation_count = (pathdata.name.match(/\./g) || []).length+1
const baseIndent = <div style={{marginLeft: 20, height: 30, width: 1, backgroundColor: coverColor,}} /> const baseIndent = <div style={{marginLeft: 20, height: 30, width: 1, backgroundColor: coverColor,}} />
//const boxPadding = pathdata.type === "object" ? "10px 0px 0px 0px" : 0 //const boxPadding = pathdata.type === "object" ? "10px 0px 0px 0px" : 0
const boxPadding = 0 const boxPadding = 0
const namesplit = pathdata.name.split(".") const namesplit = pathdata.name.split(".")
const newname = namesplit[namesplit.length-1] const newname = namesplit[namesplit.length-1]
return ( return (
<MenuItem <MenuItem
key={pathdata.name} key={pathdata.name}
style={{ style={{
backgroundColor: theme.palette.inputColor,
color: "white", color: "white",
minWidth: 250, minWidth: 250,
maxWidth: 250, maxWidth: 250,
padding: boxPadding, padding: boxPadding,
}} }}
value={pathdata} value={pathdata}
onMouseOver={() => { onMouseOver={() => {
@@ -2341,35 +2339,31 @@ const ParsedAction = (props) => {
placement="left" placement="left"
> >
<div style={{ display: "flex", height: 30, }}> <div style={{ display: "flex", height: 30, }}>
{Array(indentation_count).fill().map((subdata, subindex) => { {Array(indentation_count).fill().map((subdata, subindex) => {
return ( return (
baseIndent baseIndent
) )
})} })}
{icon} {newname} {icon} {newname}
{pathdata.type === "list" ? <SquareFootIcon style={{marginleft: 10, }} onClick={(e) => { {pathdata.type === "list" ? <SquareFootIcon style={{marginleft: 10, }} onClick={(e) => {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
console.log("INNER: ", innerdata, pathdata) console.log("INNER: ", innerdata, pathdata)
// Removing .list from autocomplete // Removing .list from autocomplete
var newname = pathdata.name var newname = pathdata.name
if (newname.length > 5) { if (newname.length > 5) {
newname = newname.slice(0, newname.length-5) newname = newname.slice(0, newname.length-5)
} }
selectedActionParameters[count].value += `{{ $${innerdata.name}.${newname} | size }}`
selectedAction.parameters[count].value = selectedActionParameters[count].value; selectedActionParameters[count].value += `{{ $${innerdata.name}.${newname} | size }}`
setSelectedAction(selectedAction); selectedAction.parameters[count].value = selectedActionParameters[count].value;
setUpdate(Math.random()); setSelectedAction(selectedAction);
setShowDropdown(false); setUpdate(Math.random());
setMenuPosition(null); setShowDropdown(false);
setMenuPosition(null);
// innerdata.name }} /> : null}
// pathdata.name
//handleItemClick([innerdata, newpathdata])
//console.log("CLICK LENGTH!")
}} /> : null}
</div> </div>
</Tooltip> </Tooltip>
</MenuItem> </MenuItem>
@@ -2747,7 +2741,6 @@ const ParsedAction = (props) => {
paddingRight: 0, paddingRight: 0,
}} }}
onClick={() => { onClick={() => {
console.log("FIND EXAMPLE RESULTS FOR ", selectedAction);
if (workflowExecutions.length > 0) { if (workflowExecutions.length > 0) {
// Look for the ID // Look for the ID
const found = false; const found = false;
@@ -2756,11 +2749,6 @@ const ParsedAction = (props) => {
continue; continue;
} }
// Enforces it to show at least one
//if (workflowExecutions[key].execution_argument.includes("too large") && key !== workflowExecutions.length - 1) {
// continue
//}
var foundResult = workflowExecutions[key].results.find( var foundResult = workflowExecutions[key].results.find(
(result) => result.action.id === selectedAction.id (result) => result.action.id === selectedAction.id
) )
@@ -2769,14 +2757,14 @@ const ParsedAction = (props) => {
continue; continue;
} }
const oldstartnode = cy.getElementById(selectedAction.id); const oldstartnode = cy.getElementById(selectedAction.id);
console.log("FOUND NODe: ", oldstartnode) console.log("FOUND NODe: ", oldstartnode)
if (oldstartnode !== undefined && oldstartnode !== null) { if (oldstartnode !== undefined && oldstartnode !== null) {
const foundname = oldstartnode.data("label") const foundname = oldstartnode.data("label")
if (foundname !== undefined && foundname !== null) { if (foundname !== undefined && foundname !== null) {
foundResult.action.label = foundname foundResult.action.label = foundname
} }
} }
setSelectedResult(foundResult); setSelectedResult(foundResult);
if (setCodeModalOpen !== undefined) { if (setCodeModalOpen !== undefined) {
@@ -3354,6 +3342,8 @@ const ParsedAction = (props) => {
style={{ style={{
backgroundColor: theme.palette.inputColor, backgroundColor: theme.palette.inputColor,
color: "white", color: "white",
maxWidth: 500,
overflowX: "auto",
}} }}
value={data} value={data}
> >
@@ -61,10 +61,11 @@ import { tags as t } from '@lezer/highlight';
const liquidFilters = [ const liquidFilters = [
{"name": "Size", "value": "size", "example": ""}, {"name": "Default", "value": `default: []`, "example": `{{ "" | default: "no input" }}`},
{"name": "Date", "value": `date: "%Y%m%d"`, "example": `{{ "now" | date: "%s" }}`},
{"name": "Split", "value": `split: ","`, "example": `{{ "this,can,become,a,list" | split: "," }}`}, {"name": "Split", "value": `split: ","`, "example": `{{ "this,can,become,a,list" | split: "," }}`},
{"name": "Join", "value": `join: ","`, "example": `{{ ["this","can","become","a","string"] | join: "," }}`}, {"name": "Join", "value": `join: ","`, "example": `{{ ["this","can","become","a","string"] | join: "," }}`},
{"name": "Size", "value": "size", "example": ""},
{"name": "Date", "value": `date: "%Y%m%d"`, "example": `{{ "now" | date: "%s" }}`},
{"name": "Escape String", "value": `{{ \"\"\"'string with weird'" quotes\"\"\" | escape_string }}`, "example": ``}, {"name": "Escape String", "value": `{{ \"\"\"'string with weird'" quotes\"\"\" | escape_string }}`, "example": ``},
{"name": "Flatten", "value": `flatten`, "example": `{{ [1, [1, 2], [2, 3, 4]] | flatten }}`}, {"name": "Flatten", "value": `flatten`, "example": `{{ [1, [1, 2], [2, 3, 4]] | flatten }}`},
{"name": "URL encode", "value": `url_encode`, "example": `{{ "https://www.google.com/search?q=hello world" | url_encode }}`}, {"name": "URL encode", "value": `url_encode`, "example": `{{ "https://www.google.com/search?q=hello world" | url_encode }}`},
+130 -51
View File
@@ -80,6 +80,7 @@ import {
Visibility as VisibilityIcon, Visibility as VisibilityIcon,
Done as DoneIcon, Done as DoneIcon,
Close as CloseIcon, Close as CloseIcon,
DragIndicator as DragIndicatorIcon,
Error as ErrorIcon, Error as ErrorIcon,
Warning as WarningIcon, Warning as WarningIcon,
ArrowLeft as ArrowLeftIcon, ArrowLeft as ArrowLeftIcon,
@@ -250,6 +251,7 @@ function useWindowSize() {
function updateSize() { function updateSize() {
setSize([window.innerWidth, window.innerHeight]); setSize([window.innerWidth, window.innerHeight]);
} }
window.addEventListener("resize", updateSize); window.addEventListener("resize", updateSize);
updateSize(); updateSize();
return () => window.removeEventListener("resize", updateSize); return () => window.removeEventListener("resize", updateSize);
@@ -598,9 +600,29 @@ const AngularWorkflow = (defaultprops) => {
const unloadText = "Are you sure you want to leave without saving (CTRL+S)?"; const unloadText = "Are you sure you want to leave without saving (CTRL+S)?";
const classes = useStyles(); const classes = useStyles();
const [bodyWidth, bodyHeight] = useWindowSize() var [bodyWidth, bodyHeight] = useWindowSize()
//console.log("Mobile: ", isMobile, bodyWidth, bodyHeight)
const cytoscapeWidth = isMobile ? bodyWidth - leftBarSize : bodyWidth - leftBarSize - 25 const cytoscapeWidth = isMobile ? bodyWidth - leftBarSize : bodyWidth - leftBarSize - 25
/*
// Zoom testing to try autofixing for small screens
if (document !== undefined && document !== null && !isMobile) {
const currentZoom = document.body.style.zoom;
if (bodyWidth < 1367 || bodyHeight < 769) {
console.log("LOWER ZOOM")
document.body.style.zoom = "80%"
bodyWidth = bodyWidth*0.8
bodyHeight = bodyHeight*0.8
} else {
console.log("RESET ZOOM")
document.body.style.zoom = "100%"
}
}
console.log("Width, height: ", bodyWidth, bodyHeight)
*/
//console.log("Mobile: ", isMobile, bodyWidth, bodyHeight)
const [elements, setElements] = useState([]); const [elements, setElements] = useState([]);
const [loopRunning, setLoopRunning] = useState(false) const [loopRunning, setLoopRunning] = useState(false)
@@ -7691,7 +7713,7 @@ const AngularWorkflow = (defaultprops) => {
marginTop: 1, marginTop: 1,
overflowY: "auto", overflowY: "auto",
overflowX: "hidden", overflowX: "hidden",
}; }
const handleAppDrag = (e, app) => { const handleAppDrag = (e, app) => {
const cycontainer = cy.container(); const cycontainer = cy.container();
@@ -8426,6 +8448,7 @@ const AngularWorkflow = (defaultprops) => {
</div> </div>
) )
})} })}
{visibleApps.length <= 4 ? ( {visibleApps.length <= 4 ? (
<div <div
style={{ textAlign: "center", width: leftBarSize, marginTop: 40, maxWidth: 340, overflow: "hidden", }} style={{ textAlign: "center", width: leftBarSize, marginTop: 40, maxWidth: 340, overflow: "hidden", }}
@@ -8444,7 +8467,10 @@ const AngularWorkflow = (defaultprops) => {
</Index> </Index>
</InstantSearch> </InstantSearch>
</div> </div>
) : null} ) :
<div
style={{marginTop: 100, }}
/>}
</div> </div>
) : apps.length > 0 ? ( ) : apps.length > 0 ? (
<div <div
@@ -8993,7 +9019,7 @@ const AngularWorkflow = (defaultprops) => {
const AppConditionHandler = (props) => { const AppConditionHandler = (props) => {
const { tmpdata, type } = props; const { tmpdata, type } = props;
const [data] = useState({...tmpdata}); const [data] = useState(tmpdata);
const [multiline, setMultiline] = useState(false); const [multiline, setMultiline] = useState(false);
const [showAutocomplete, setShowAutocomplete] = React.useState(false); const [showAutocomplete, setShowAutocomplete] = React.useState(false);
const [actionlist, setActionlist] = React.useState([]); const [actionlist, setActionlist] = React.useState([]);
@@ -9595,9 +9621,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "equals";
newConditionValue.value = "equals"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"equals"} key={"equals"}
@@ -9607,9 +9632,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "does not equal";
newConditionValue.value = "does not equal"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"does not equal"} key={"does not equal"}
@@ -9619,9 +9643,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "startswith";
newConditionValue.value = "startswith"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"starts with"} key={"starts with"}
@@ -9631,9 +9654,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "endswith";
newConditionValue.value = "endswith"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"ends with"} key={"ends with"}
@@ -9643,9 +9665,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "contains";
newConditionValue.value = "contains"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"contains"} key={"contains"}
@@ -9655,9 +9676,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "contains_any_of";
newConditionValue.value = "contains_any_of"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"contains_any_of"} key={"contains_any_of"}
@@ -9667,9 +9687,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "matches regex";
newConditionValue.value = "matches regex"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"matches regex"} key={"matches regex"}
@@ -9679,9 +9698,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "larger than";
newConditionValue.value = "larger than"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"larger than"} key={"larger than"}
@@ -9691,9 +9709,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "less than";
newConditionValue.value = "less than"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"less than"} key={"less than"}
@@ -9703,9 +9720,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem <MenuItem
style={menuItemStyle} style={menuItemStyle}
onClick={(e) => { onClick={(e) => {
const newConditionValue = { ...conditionValue }; conditionValue.value = "is empty";
newConditionValue.value = "is empty"; setConditionValue(conditionValue);
setConditionValue(newConditionValue);
setVariableAnchorEl(null); setVariableAnchorEl(null);
}} }}
key={"is empty"} key={"is empty"}
@@ -9873,8 +9889,6 @@ const AngularWorkflow = (defaultprops) => {
marginTop: "15px", marginTop: "15px",
marginLeft: "10px", marginLeft: "10px",
overflow: "hidden", overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
maxWidth: 72, maxWidth: 72,
}} }}
> >
@@ -9894,7 +9908,7 @@ const AngularWorkflow = (defaultprops) => {
flex: 1, flex: 1,
textAlign: "center", textAlign: "center",
marginTop: "15px", marginTop: "15px",
overflow: "hidden", overflow: "hidden",
maxWidth: 72, maxWidth: 72,
}} }}
onClick={() => { }} onClick={() => { }}
@@ -9918,8 +9932,6 @@ const AngularWorkflow = (defaultprops) => {
marginBottom: "auto", marginBottom: "auto",
marginLeft: "10px", marginLeft: "10px",
overflow: "hidden", overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
maxWidth: 72, maxWidth: 72,
}} }}
> >
@@ -13582,16 +13594,14 @@ const AngularWorkflow = (defaultprops) => {
}, },
}} }}
disabled={ disabled={
workflow.triggers[selectedTriggerIndex].status === "running" workflow.triggers[selectedTriggerIndex] === null || workflow.triggers[selectedTriggerIndex] === undefined ? false : workflow.triggers[selectedTriggerIndex].status === "running"
} }
fullWidth fullWidth
rows="6" rows="6"
multiline multiline
color="primary" color="primary"
defaultValue={ defaultValue={
workflow.triggers[selectedTriggerIndex] !== undefined && workflow.triggers[selectedTriggerIndex].parameters !== undefined && workflow.triggers[selectedTriggerIndex].parameters !== null && workflow.triggers[selectedTriggerIndex].parameters.length > 1 ? workflow.triggers[selectedTriggerIndex] !== undefined && workflow.triggers[selectedTriggerIndex].parameters !== undefined && workflow.triggers[selectedTriggerIndex].parameters !== null && workflow.triggers[selectedTriggerIndex].parameters.length > 1 ? workflow.triggers[selectedTriggerIndex].parameters[1].value : ""
workflow.triggers[selectedTriggerIndex].parameters[1].value
: ""
} }
placeholder='{"example": {"json": "is cool"}}' placeholder='{"example": {"json": "is cool"}}'
onBlur={(e) => { onBlur={(e) => {
@@ -13661,11 +13671,16 @@ const AngularWorkflow = (defaultprops) => {
top: isMobile ? 30 : appBarSize + 20, top: isMobile ? 30 : appBarSize + 20,
}; };
const TopCytoscapeBar = (props) => { const TopCytoscapeBar = (props) => {
if (workflow.public === true) { if (workflow.public === true) {
return null return null
} }
const isCorrectOrg = workflow.public === true || userdata.active_org.id === undefined || userdata.active_org.id === null || workflow.org_id === null || workflow.org_id === undefined || workflow.org_id.length === 0 || userdata.active_org.id === workflow.org_id
return ( return (
<div style={topBarStyle}> <div style={topBarStyle}>
<div style={{ margin: "0px 10px 0px 10px" }}> <div style={{ margin: "0px 10px 0px 10px" }}>
@@ -13691,7 +13706,7 @@ const AngularWorkflow = (defaultprops) => {
<h2 style={{ margin: 0 }}>{workflow.name}</h2> <h2 style={{ margin: 0 }}>{workflow.name}</h2>
</Breadcrumbs> </Breadcrumbs>
{workflow.public === true || userdata.active_org.id === undefined || userdata.active_org.id === null || workflow.org_id === null || workflow.org_id === undefined || workflow.org_id.length === 0 || userdata.active_org.id === workflow.org_id ? null : {isCorrectOrg ? null :
<Typography variant="body1"> <Typography variant="body1">
<b>Warning</b>: Change <span <b>Warning</b>: Change <span
style={{color: "#f85a3e", cursor: "pointer"}} style={{color: "#f85a3e", cursor: "pointer"}}
@@ -14053,7 +14068,6 @@ const AngularWorkflow = (defaultprops) => {
) )
} }
const showErrors = !isMobile && !workflow.public && workflow.errors !== undefined && workflow.errors !== null && workflow.errors.length > 0 ? const showErrors = !isMobile && !workflow.public && workflow.errors !== undefined && workflow.errors !== null && workflow.errors.length > 0 ?
<div <div
style={{ style={{
@@ -14068,6 +14082,8 @@ const AngularWorkflow = (defaultprops) => {
> >
<Typography variant="body22"> <Typography variant="body22">
{/*<WarningIcon style={{marginRight: 5, height: 15, width: 15, }} />*/} {/*<WarningIcon style={{marginRight: 5, height: 15, width: 15, }} />*/}
<b>Workflow Issues:</b> {workflow.errors.length} <b>Workflow Issues:</b> {workflow.errors.length}
</Typography> </Typography>
<Typography <Typography
@@ -16630,6 +16646,41 @@ const AngularWorkflow = (defaultprops) => {
} }
var draggingDisabled = false; var draggingDisabled = false;
// Should probably put this on the backend instead when notifications are made :))
const getErrorSuggestion = (result) => {
if (result === undefined || result === null) {
return ""
}
if (result.success !== false) {
return ""
}
var stringjson = result
try {
stringjson = JSON.stringify(result)
} catch (e) {
}
console.log("JSON: ", stringjson)
stringjson = stringjson.toLowerCase()
if (stringjson.includes("localhost")) {
return "You can't use localhost in apps. Use the external ip or url of the server instead"
}
if (stringjson.includes("connectionerror")) {
return "Your URL is most likely incorrect."
}
if (stringjson.includes("result too large to handle")) {
return "Execution loading failed. Reload the execution by closing it and clicking it again"
}
return ""
}
const currentSuggestion = getErrorSuggestion(validate.result)
const codePopoutModal = !codeModalOpen ? null : ( const codePopoutModal = !codeModalOpen ? null : (
<Dialog <Dialog
PaperComponent={PaperComponent} PaperComponent={PaperComponent}
@@ -16791,13 +16842,33 @@ const AngularWorkflow = (defaultprops) => {
<VisibilityIcon style={{ color: "white" }} /> <VisibilityIcon style={{ color: "white" }} />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
<Tooltip
title="Move window"
placement="top"
style={{ zIndex: 10011 }}
>
<IconButton
id="draggable-dialog-title"
style={{
zIndex: 5000,
position: "absolute",
top: 4,
right: 34,
cursor: "move",
}}
onClick={(e) => {
}}
>
<DragIndicatorIcon style={{ color: "white" }} />
</IconButton>
</Tooltip>
<Tooltip <Tooltip
title="Close window" title="Close window"
placement="top" placement="top"
style={{ zIndex: 10011 }} style={{ zIndex: 10011 }}
> >
<IconButton <IconButton
style={{ zIndex: 5000, position: "absolute", top: 4, right: 34 }} style={{ zIndex: 5000, position: "absolute", top: 4, right: 4, }}
onClick={(e) => { onClick={(e) => {
e.preventDefault(); e.preventDefault();
setCodeModalOpen(false); setCodeModalOpen(false);
@@ -16836,12 +16907,20 @@ const AngularWorkflow = (defaultprops) => {
> >
<b>{selectedResult.action.label.replaceAll("_", " ")}</b> <b>{selectedResult.action.label.replaceAll("_", " ")}</b>
</div> </div>
<div style={{ fontSize: 14 }}>{selectedResult.action.name}</div> <div style={{ fontSize: 14, color: "rgba(255,255,255,0.6)", }}>{selectedResult.action.name}</div>
</div> </div>
</div> </div>
<div style={{ marginBottom: 5 }}>
<b>Status </b> {selectedResult.status}
</div> {currentSuggestion.length > 0 ?
<div style={{ marginBottom: 5 }}>
<b style={{color: "rgba(214,110,117)", }}>Debug Info:</b> {currentSuggestion}
</div>
:
<div style={{ marginBottom: 5 }}>
<b>Status </b> {selectedResult.status}
</div>
}
{validate.valid ? ( {validate.valid ? (
<ReactJson <ReactJson
+1 -1
View File
@@ -103,7 +103,7 @@ const appIconStyle = {
marginLeft: "5px", marginLeft: "5px",
}; };
const useStyles = makeStyles({ export const useStyles = makeStyles({
notchedOutline: { notchedOutline: {
borderColor: "#f85a3e !important", borderColor: "#f85a3e !important",
}, },
+3 -3
View File
@@ -715,7 +715,7 @@ const Docs = (defaultprops) => {
margin: "auto", margin: "auto",
marginTop: 50, marginTop: 50,
}}> }}>
<Typography variant="h4" style={{ textAlign: "center", }}> <Typography variant="h4" style={{ textAlign: "center", marginTop: 20 }}>
Documentation Documentation
</Typography> </Typography>
<div style={{ display: "flex", marginTop: 25, }}> <div style={{ display: "flex", marginTop: 25, }}>
@@ -938,7 +938,7 @@ const Docs = (defaultprops) => {
<Divider <Divider
style={{ style={{
marginTop: "10px", marginTop: "10px",
marginBottom: "10px", marginBottom: 30,
backgroundColor: dividerColor, backgroundColor: dividerColor,
}} }}
/> />
@@ -957,7 +957,7 @@ const Docs = (defaultprops) => {
// Padding and zIndex etc set because of footer in cloud. // Padding and zIndex etc set because of footer in cloud.
const loadedCheck = ( const loadedCheck = (
<div style={{ minHeight: 1000, paddingBottom: 100, zIndex: 50000, maxWidth: 1920, minWidth: 1366, margin: "auto", }}> <div style={{ minHeight: 1000, paddingBottom: 100, zIndex: 50000, maxWidth: 1920, minWidth: isMobile ? null : 1366, margin: "auto", }}>
<BrowserView>{postDataBrowser}</BrowserView> <BrowserView>{postDataBrowser}</BrowserView>
<MobileView>{postDataMobile}</MobileView> <MobileView>{postDataMobile}</MobileView>
</div> </div>
+13
View File
@@ -333,6 +333,19 @@ const RunWorkflow = (defaultprops) => {
"execution_argument": executionArgument "execution_argument": executionArgument
} }
if (workflow.start !== undefined && workflow.start !== null && workflow.start.length > 0) {
data.start = workflow.start
} else {
if (workflow.actions !== undefined && workflow.actions !== null && workflow.actions.length > 0) {
for (let actionkey in workflow.actions) {
if (workflow.actions[actionkey].isStartNode) {
data.start = workflow.actions[actionkey].id
break
}
}
}
}
var url = `${globalUrl}/api/v1/workflows/${props.match.params.key}/execute` var url = `${globalUrl}/api/v1/workflows/${props.match.params.key}/execute`
var fetchBody = { var fetchBody = {
headers: { headers: {