Merge branch 'launch' into master

This commit is contained in:
Frikky
2021-10-31 22:21:17 +01:00
committed by GitHub
33 changed files with 1973 additions and 3782 deletions
+155 -105
View File
@@ -11,7 +11,7 @@ import NestedMenuItem from "material-ui-nested-menu-item";
import ReactMarkdown from 'react-markdown';
import {TextField, Drawer, Button, Paper, Grid, Tabs, InputAdornment, Tab, ButtonBase, Tooltip, Select, MenuItem, Divider, Dialog, Modal, DialogActions, DialogTitle, InputLabel, DialogContent, FormControl, IconButton, Menu, Input, FormGroup, FormControlLabel, Typography, Checkbox, Breadcrumbs, CircularProgress, Switch, Fade} from '@material-ui/core';
import {Slide, TextField, Drawer, Button, Paper, Grid, Tabs, InputAdornment, Tab, ButtonBase, Tooltip, Select, MenuItem, Divider, Dialog, Modal, DialogActions, DialogTitle, InputLabel, DialogContent, FormControl, IconButton, Menu, Input, FormGroup, FormControlLabel, Typography, Checkbox, Breadcrumbs, CircularProgress, Switch, Fade} from '@material-ui/core';
import {OpenInNew as OpenInNewIcon,Undo as UndoIcon, FileCopy as FileCopyIcon, GetApp as GetAppIcon, Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons';
import * as cytoscape from 'cytoscape';
@@ -887,6 +887,8 @@ const AngularWorkflow = (props) => {
//console.log(curworkflowTrigger)
newTriggers.push(curworkflowTrigger)
} else {
alert.info("No handler for type: "+type)
}
}
}
@@ -1258,9 +1260,9 @@ const AngularWorkflow = (props) => {
selectedAction.selectedAuthentication = item
for (var key in workflow.actions) {
console.log(workflow.actions[key].app_name)
//console.log(workflow.actions[key].app_name)
if (workflow.actions[key].app_name == selectedApp.name) {
console.log("Setting auth at: ", workflow.actions[key], item.id)
//console.log("Setting auth at: ", workflow.actions[key], item.id)
workflow.actions[key].selectedAuthentication = item
workflow.actions[key].authentication_id = item.id
appUpdates = true
@@ -1593,6 +1595,19 @@ const AngularWorkflow = (props) => {
if (event.target.data().decorator) {
alert.info("This edge can't be edited.")
} else {
//console.log("DATA: ", event.target.data())
const destinationId = event.target.data("target")
//console.log("DATA: ", event.target.data())
const curaction = workflow.actions.find(a => a.id === destinationId)
//console.log("ACTION: ", curaction)
if (curaction !== undefined && curaction !== null) {
if (curaction.app_name == "Shuffle Tools" && curaction.name === "router") {
alert.info("Router action can't have incoming conditions")
event.target.unselect()
return
}
}
setSelectedEdgeIndex(workflow.branches.findIndex(data => data.id === event.target.data()["id"]))
setSelectedEdge(event.target.data())
}
@@ -1941,6 +1956,7 @@ const AngularWorkflow = (props) => {
}
workflow.start = parentNode.data('id')
setLastSaved(true)
parentNode.data('isStartNode', true)
}
@@ -2476,7 +2492,7 @@ const AngularWorkflow = (props) => {
// Checks for errors in edges when they're added
const onEdgeAdded = (event) => {
const edge = event.target.data()
console.log("EDGE ADDED: ", edge)
//console.log("EDGE ADDED: ", edge)
//setLastSaved(false)
var targetnode = workflow.triggers.findIndex(data => data.id === edge.target)
if (targetnode !== -1) {
@@ -2488,7 +2504,7 @@ const AngularWorkflow = (props) => {
}
}
console.log("TARGET: ", event.target.target().data())
//console.log("TARGET: ", event.target.target().data())
if (event.target.target().data("isButton") === true || event.target.target().data("isDescriptor") === true) {
event.target.remove()
return
@@ -2496,7 +2512,7 @@ const AngularWorkflow = (props) => {
targetnode = -1
var sourcenode = workflow.triggers.findIndex(data => data.id === edge.source)
console.log("SOURCENODE: ", sourcenode)
//console.log("SOURCENODE: ", sourcenode)
if (sourcenode !== -1) {
if (workflow.triggers[sourcenode].app_name === "User Input" || workflow.triggers[sourcenode].app_name === "Shuffle Workflow") {
//console.log("NORMAL TRIGGER")
@@ -3304,6 +3320,16 @@ const AngularWorkflow = (props) => {
}, {
duration: animationDuration,
})
const outgoingEdges = event.target.outgoers('edge')
const incomingEdges = event.target.incomers('edge')
if (outgoingEdges.length > 0) {
outgoingEdges.removeClass('hover-highlight')
}
if (incomingEdges.length > 0) {
outgoingEdges.removeClass('hover-highlight')
}
}
const buttonColor = "rgba(255,255,255,0.9)"
@@ -3479,6 +3505,16 @@ const AngularWorkflow = (props) => {
})
previousnodecolor = event.target.style("border-color")
const outgoingEdges = event.target.outgoers('edge')
const incomingEdges = event.target.incomers('edge')
if (outgoingEdges.length > 0) {
outgoingEdges.addClass('hover-highlight')
}
if (incomingEdges.length > 0) {
outgoingEdges.addClass('hover-highlight')
}
}
const onEdgeHoverOut = (event) => {
@@ -4666,9 +4702,9 @@ const AngularWorkflow = (props) => {
</div>
:
<div style={{textAlign: "center", width: leftBarSize}}>
<CircularProgress style={{marginTop: 25, height: 35, width: 35, marginLeft: "auto", marginRight: "auto", }} />
<CircularProgress style={{marginTop: "27vh", height: 35, width: 35, marginLeft: "auto", marginRight: "auto", }} />
<Typography variant="body1" color="textSecondary">
Loading apps
Loading Apps
</Typography>
</div>
}
@@ -4942,7 +4978,7 @@ const AngularWorkflow = (props) => {
top: appBarSize+25,
right: 25,
height: "80vh",
width: 350,
width: 365,
minWidth: 200,
maxWidth: 600,
maxHeight: "100vh",
@@ -5768,7 +5804,7 @@ const AngularWorkflow = (props) => {
<Button
fullWidth
variant="contained"
style={{flex: 1, marginTop: 10, }}
style={{flex: 1, textTransform: "none", textAlign: "left", justifyContent: "flex-start", marginTop: 10, padding: 0, backgroundColor: "#4285f4", color: "white", }}
color="primary"
onClick={() => {
//const redirectUri = isCloud ? "https%3A%2F%2Fshuffler.io%2Fapi%2Fv1%2Ftriggers%2Foutlook%2Fregister" : "http%3A%2F%2Flocalhost:5001%2Fapi%2Fv1%2Ftriggers%2Fgmail%2Fregister"
@@ -5826,8 +5862,9 @@ const AngularWorkflow = (props) => {
}, 2500)
saveWorkflow(workflow)
}} >
Sign in with Google
}}>
<img style={{margin: 0, }} src="/images/btn_google_light_focus_ios.svg" />
<Typography style={{margin: 0, marginLeft: 10, }} variant="body1">Sign in with Google</Typography>
</Button>
const outlookButton = selectedTrigger.name !== "Office365" ? null :
@@ -6055,12 +6092,12 @@ const AngularWorkflow = (props) => {
<div>
<Divider style={{marginTop: "20px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
<div style={{marginTop: "20px", marginBottom: "7px", display: "flex"}}>
<Button style={{flex: "1",}} disabled={selectedTrigger.status === "running"} onClick={() => {
<Button variant="contained" style={{flex: "1",}} disabled={selectedTrigger.status === "running" || triggerFolders === undefined || triggerFolders === null || triggerFolders.length === 0} onClick={() => {
startMailSub(selectedTrigger, selectedTriggerIndex)
}} color="primary">
Start
</Button>
<Button style={{flex: "1",}} disabled={selectedTrigger.status !== "running" } onClick={() => {
<Button variant="outlined" style={{flex: "1",}} disabled={selectedTrigger.status !== "running" } onClick={() => {
stopMailSub(selectedTrigger, selectedTriggerIndex)
}} color="primary">
Stop
@@ -7798,46 +7835,46 @@ const AngularWorkflow = (props) => {
}
return (
<div id="rightside_actions" style={rightsidebarStyle}>
<ParsedAction
id="rightside_subactions"
getAppAuthentication={getAppAuthentication}
appAuthentication={appAuthentication}
authenticationType={authenticationType}
scrollConfig={scrollConfig}
setScrollConfig={setScrollConfig}
selectedAction={selectedAction}
workflow={workflow}
setWorkflow={setWorkflow}
setSelectedAction={setSelectedAction}
setUpdate={setUpdate}
selectedApp={selectedApp}
workflowExecutions={workflowExecutions}
setSelectedResult={setSelectedResult}
setSelectedApp={setSelectedApp}
setSelectedTrigger={setSelectedTrigger}
setSelectedEdge={setSelectedEdge}
setCurrentView={setCurrentView}
cy={cy}
setAuthenticationModalOpen={setAuthenticationModalOpen}
<div id="rightside_actions" style={rightsidebarStyle}>
<ParsedAction
id="rightside_subactions"
getAppAuthentication={getAppAuthentication}
appAuthentication={appAuthentication}
authenticationType={authenticationType}
scrollConfig={scrollConfig}
setScrollConfig={setScrollConfig}
selectedAction={selectedAction}
workflow={workflow}
setWorkflow={setWorkflow}
setSelectedAction={setSelectedAction}
setUpdate={setUpdate}
selectedApp={selectedApp}
workflowExecutions={workflowExecutions}
setSelectedResult={setSelectedResult}
setSelectedApp={setSelectedApp}
setSelectedTrigger={setSelectedTrigger}
setSelectedEdge={setSelectedEdge}
setCurrentView={setCurrentView}
cy={cy}
setAuthenticationModalOpen={setAuthenticationModalOpen}
setVariablesModalOpen={setVariablesModalOpen}
setLastSaved={setLastSaved}
setCodeModalOpen={setCodeModalOpen}
selectedNameChange={selectedNameChange}
rightsidebarStyle={rightsidebarStyle}
showEnvironment={showEnvironment}
selectedActionEnvironment={selectedActionEnvironment}
environments={environments}
setNewSelectedAction={setNewSelectedAction}
sortByKey={sortByKey}
appApiViewStyle={appApiViewStyle}
globalUrl={globalUrl}
setSelectedActionEnvironment={setSelectedActionEnvironment}
requiresAuthentication={requiresAuthentication}
/>
</div>
setVariablesModalOpen={setVariablesModalOpen}
setLastSaved={setLastSaved}
setCodeModalOpen={setCodeModalOpen}
selectedNameChange={selectedNameChange}
rightsidebarStyle={rightsidebarStyle}
showEnvironment={showEnvironment}
selectedActionEnvironment={selectedActionEnvironment}
environments={environments}
setNewSelectedAction={setNewSelectedAction}
sortByKey={sortByKey}
appApiViewStyle={appApiViewStyle}
globalUrl={globalUrl}
setSelectedActionEnvironment={setSelectedActionEnvironment}
requiresAuthentication={requiresAuthentication}
/>
</div>
)
} else if (Object.getOwnPropertyNames(selectedTrigger).length > 0) {
@@ -8097,7 +8134,7 @@ const AngularWorkflow = (props) => {
}
const executionModal =
<Drawer anchor={"right"} open={executionModalOpen} onClose={() => setExecutionModalOpen(false)} style={{resize: "both", overflow: "auto", zIndex: 10005}} PaperProps={{style: {resize: "both", overflow: "auto", minWidth: 400, maxWidth: 400, backgroundColor: "#1F2023", color: "white", fontSize: 18, zIndex: 10005}}}>
<Drawer anchor={"right"} open={executionModalOpen} onClose={() => setExecutionModalOpen(false)} style={{resize: "both", overflow: "auto", zIndex: 10005}} PaperProps={{style: {resize: "both", overflow: "auto", minWidth: 420, maxWidth: 420, backgroundColor: "#1F2023", color: "white", fontSize: 18, zIndex: 10005}}}>
{executionModalView === 0 ?
<div style={{padding: 25, }}>
<Breadcrumbs aria-label="breadcrumb" separator="" style={{color: "white", fontSize: 16}}>
@@ -8109,6 +8146,7 @@ const AngularWorkflow = (props) => {
<Button
style={{borderRadius: "0px"}}
variant="outlined"
fullWidth
onClick={() => {
getWorkflowExecution(props.match.params.key, "")
}} color="primary">
@@ -8568,6 +8606,7 @@ const AngularWorkflow = (props) => {
maxHeight: 700,
overflowY: "auto",
overflowX: "hidden",
zIndex: 10012,
//boxShadow: "none",
},
}}
@@ -8730,60 +8769,70 @@ const AngularWorkflow = (props) => {
<div style={{color: "white"}}>
<div style={{display: "flex", borderTop: "1px solid rgba(91, 96, 100, 1)"}}>
{leftView}
<CytoscapeComponent
elements={elements}
minZoom={0.35}
maxZoom={2.00}
wheelSensitivity={0.25}
style={{width: bodyWidth-leftBarSize-15, height: bodyHeight-appBarSize-5, backgroundColor: surfaceColor}}
stylesheet={cystyle}
boxSelectionEnabled={true}
autounselectify={false}
showGrid={true}
id="cytoscape_view"
cy={(incy) => {
// FIXME: There's something specific loading when
// you do the first hover of a node. Why is this different?
//console.log("CY: ", incy)
setCy(incy)
}}
/>
{workflow.id === undefined || workflow.id === null || apps.length === 0 ?
<div style={{width: bodyWidth-leftBarSize-15, height: 150, textAlign: "center"}}>
<CircularProgress style={{marginTop: "30vh", height: 35, width: 35, marginLeft: "auto", marginRight: "auto", }} />
<Typography variant="body1" color="textSecondary">
Loading Workflow
</Typography>
</div>
:
<CytoscapeComponent
elements={elements}
minZoom={0.35}
maxZoom={2.00}
wheelSensitivity={0.25}
style={{width: bodyWidth-leftBarSize-15, height: bodyHeight-appBarSize-5, backgroundColor: surfaceColor}}
stylesheet={cystyle}
boxSelectionEnabled={true}
autounselectify={false}
showGrid={true}
id="cytoscape_view"
cy={(incy) => {
// FIXME: There's something specific loading when
// you do the first hover of a node. Why is this different?
//console.log("CY: ", incy)
setCy(incy)
}}
/>
}
</div>
{executionModal}
<RightSideBar
scrollConfig={scrollConfig}
setScrollConfig={setScrollConfig}
selectedAction={selectedAction}
workflow={workflow}
setWorkflow={setWorkflow}
setSelectedAction={setSelectedAction}
setUpdate={setUpdate}
selectedApp={selectedApp}
workflowExecutions={workflowExecutions}
setSelectedResult={setSelectedResult}
setSelectedApp={setSelectedApp}
setSelectedTrigger={setSelectedTrigger}
setSelectedEdge={setSelectedEdge}
setCurrentView={setCurrentView}
cy={cy}
setAuthenticationModalOpen={setAuthenticationModalOpen}
{/*<Slide appear={true} direction="right" timeout={5000} in={true}>*/}
<RightSideBar
scrollConfig={scrollConfig}
setScrollConfig={setScrollConfig}
selectedAction={selectedAction}
workflow={workflow}
setWorkflow={setWorkflow}
setSelectedAction={setSelectedAction}
setUpdate={setUpdate}
selectedApp={selectedApp}
workflowExecutions={workflowExecutions}
setSelectedResult={setSelectedResult}
setSelectedApp={setSelectedApp}
setSelectedTrigger={setSelectedTrigger}
setSelectedEdge={setSelectedEdge}
setCurrentView={setCurrentView}
cy={cy}
setAuthenticationModalOpen={setAuthenticationModalOpen}
setVariablesModalOpen={setVariablesModalOpen}
setLastSaved={setLastSaved}
setCodeModalOpen={setCodeModalOpen}
selectedNameChange={selectedNameChange}
rightsidebarStyle={rightsidebarStyle}
showEnvironment={showEnvironment}
selectedActionEnvironment={selectedActionEnvironment}
environments={environments}
setNewSelectedAction={setNewSelectedAction}
sortByKey={sortByKey}
appApiViewStyle={appApiViewStyle}
globalUrl={globalUrl}
setSelectedActionEnvironment={setSelectedActionEnvironment}
requiresAuthentication={requiresAuthentication}
/>
setVariablesModalOpen={setVariablesModalOpen}
setLastSaved={setLastSaved}
setCodeModalOpen={setCodeModalOpen}
selectedNameChange={selectedNameChange}
rightsidebarStyle={rightsidebarStyle}
showEnvironment={showEnvironment}
selectedActionEnvironment={selectedActionEnvironment}
environments={environments}
setNewSelectedAction={setNewSelectedAction}
sortByKey={sortByKey}
appApiViewStyle={appApiViewStyle}
globalUrl={globalUrl}
setSelectedActionEnvironment={setSelectedActionEnvironment}
requiresAuthentication={requiresAuthentication}
/>
<BottomCytoscapeBar />
<TopCytoscapeBar />
</div>
@@ -9299,6 +9348,7 @@ const AngularWorkflow = (props) => {
maxHeight: 700,
padding: 15,
overflow: "hidden",
zIndex: 10012,
},
}}
>