Minor fixes to bad app viewing

This commit is contained in:
frikky
2023-01-16 00:41:58 +01:00
parent b90a489d74
commit 79d68321e8
+178 -121
View File
@@ -134,6 +134,7 @@ import ParsedAction from "../components/ParsedAction.jsx";
import PaperComponent from "../components/PaperComponent.jsx"
import ExtraApps from "../components/ExtraApps.jsx"
import EditWorkflow from "../components/EditWorkflow.jsx"
import AppStats from "../components/AppStats.jsx";
const surfaceColor = "#27292D";
const inputColor = "#383B40";
@@ -250,11 +251,10 @@ const svgSize = 24;
const searchClient = algoliasearch("JNSS5CFDZZ", "db08e40265e2941b9a7d8f644b6e5240")
const AngularWorkflow = (defaultprops) => {
const { globalUrl, isLoggedIn, isLoaded, userdata } = defaultprops;
const { globalUrl, isLoggedIn, isLoaded, userdata, data_id } = defaultprops;
const referenceUrl = globalUrl + "/api/v1/hooks/";
const alert = useAlert()
let navigate = useNavigate();
const params = useParams();
var props = JSON.parse(JSON.stringify(defaultprops))
props.match = {}
@@ -383,6 +383,7 @@ const AngularWorkflow = (defaultprops) => {
const [userediting, setUserediting] = React.useState(false)
const [lastSaved, setLastSaved] = React.useState(true);
const [selectionOpen, setSelectionOpen] = React.useState(false);
// eslint-disable-next-line no-unused-vars
const [_, setUpdate] = useState(""); // Used for rendring, don't remove
@@ -1685,7 +1686,7 @@ const AngularWorkflow = (defaultprops) => {
.catch((error) => {
setAppsLoaded(true)
//alert.error("App loading error: "+error.toString());
console.log("App loading error: "+error.toString());
console.log("App loading error: " + error.toString());
});
};
@@ -1748,9 +1749,11 @@ const AngularWorkflow = (defaultprops) => {
if (responseJson.files !== undefined && responseJson.files !== null) {
setFiles(responseJson);
} else {
setFiles({"namespaces": [
setFiles({
"namespaces": [
"default"
]});
]
});
}
if (
@@ -1818,7 +1821,7 @@ const AngularWorkflow = (defaultprops) => {
if (parsedAction.large_image === undefined || parsedAction.large_image === null || parsedAction.large_image === "") {
continue
}
if (appsFound.findIndex(data => data.app_name === parsedAction.app_name) < 0){
if (appsFound.findIndex(data => data.app_name === parsedAction.app_name) < 0) {
appsFound.push(parsedAction)
}
}
@@ -1828,7 +1831,7 @@ const AngularWorkflow = (defaultprops) => {
appsFound = []
for (var key in responseJson.triggers) {
const parsedAction = responseJson.triggers[key]
if (appsFound.findIndex(data => data.app_name === parsedAction.app_name) < 0){
if (appsFound.findIndex(data => data.app_name === parsedAction.app_name) < 0) {
appsFound.push(parsedAction)
}
}
@@ -2898,7 +2901,7 @@ const AngularWorkflow = (defaultprops) => {
//console.log("Trigger: ", data, trigger_index)
if (trigger_index === -1) {
workflow.triggers.push(data)
trigger_index = workflow.triggers.length-1
trigger_index = workflow.triggers.length - 1
setWorkflow(workflow)
}
@@ -2917,7 +2920,7 @@ const AngularWorkflow = (defaultprops) => {
getAvailableWorkflows(trigger_index);
getSettings();
} else if (data.app_name === "Webhook") {
if (workflow.triggers[trigger_index].parameters !== undefined) {
if (workflow.triggers[trigger_index].parameters !== undefined && workflow.triggers[trigger_index].parameters !== null && workflow.triggers[trigger_index].parameters.length > 0) {
workflow.triggers[trigger_index].parameters[0] = {
name: "url",
value: referenceUrl + "webhook_" + workflow.triggers[trigger_index].id,
@@ -2961,7 +2964,7 @@ const AngularWorkflow = (defaultprops) => {
}
const activateApp = (appid, refresh) => {
fetch(globalUrl+"/api/v1/apps/"+appid+"/activate", {
fetch(globalUrl + "/api/v1/apps/" + appid + "/activate", {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@@ -4551,7 +4554,7 @@ const AngularWorkflow = (defaultprops) => {
const costheta = xParsed / z;
const alpha = 0.25;
var controlPointDistance = [-alpha * yParsed * costheta, alpha * yParsed * costheta];
var controlPointWeight = [alpha, 1-alpha]
var controlPointWeight = [alpha, 1 - alpha]
//'control-point-weight': ['0.33', '0.66'],
//var controlPointWeight = ["0.33", "0.66"]
@@ -5201,8 +5204,8 @@ const AngularWorkflow = (defaultprops) => {
marginRight: 5,
display: "flex",
flexDirection: "column",
minHeight: isMobile ? bodyHeight-appBarSize*4 : "100%",
maxHeight: isMobile ? bodyHeight-appBarSize*4 : "100%",
minHeight: isMobile ? bodyHeight - appBarSize * 4 : "100%",
maxHeight: isMobile ? bodyHeight - appBarSize * 4 : "100%",
};
const paperAppStyle = {
@@ -5289,7 +5292,7 @@ const AngularWorkflow = (defaultprops) => {
: workflow.workflow_variables.map((variable, index) => {
return (
<div key={index}>
<Paper square style={paperVariableStyle} onClick={() => {}}>
<Paper square style={paperVariableStyle} onClick={() => { }}>
<div
style={{
marginLeft: "10px",
@@ -5422,7 +5425,7 @@ const AngularWorkflow = (defaultprops) => {
: workflow.execution_variables.map((variable, index) => {
return (
<div>
<Paper square style={paperVariableStyle} onClick={() => {}}>
<Paper square style={paperVariableStyle} onClick={() => { }}>
<div
style={{
marginLeft: "10px",
@@ -5570,7 +5573,7 @@ const AngularWorkflow = (defaultprops) => {
marginRight: 5,
};
const parsedHeight = isMobile ? bodyHeight - appBarSize*4 : bodyHeight - appBarSize - 50
const parsedHeight = isMobile ? bodyHeight - appBarSize * 4 : bodyHeight - appBarSize - 50
return (
<div>
<div
@@ -5757,7 +5760,7 @@ const AngularWorkflow = (defaultprops) => {
y: 0,
}}
>
<Paper square style={paperAppStyle} onClick={() => {}}>
<Paper square style={paperAppStyle} onClick={() => { }}>
<div
style={{
marginLeft: isMobile ? 0 : "10px",
@@ -5784,7 +5787,7 @@ const AngularWorkflow = (defaultprops) => {
overflow: "hidden",
}}
>
<Grid item style={{ flex: "1", overflow: "hidden",}}>
<Grid item style={{ flex: "1", overflow: "hidden", }}>
<h3 style={{ marginBottom: "0px", marginTop: "10px", overflow: "hidden" }}>
{trigger.name}
</h3>
@@ -5975,8 +5978,8 @@ const AngularWorkflow = (defaultprops) => {
const appScrollStyle = {
overflow: "scroll",
maxHeight: isMobile ? bodyHeight-appBarSize*4 : bodyHeight - appBarSize - 55 - 50,
minHeight: isMobile ? bodyHeight-appBarSize*4 : bodyHeight - appBarSize - 55 - 50,
maxHeight: isMobile ? bodyHeight - appBarSize * 4 : bodyHeight - appBarSize - 55 - 50,
minHeight: isMobile ? bodyHeight - appBarSize * 4 : bodyHeight - appBarSize - 55 - 50,
marginTop: 1,
overflowY: "auto",
overflowX: "hidden",
@@ -6140,6 +6143,11 @@ const AngularWorkflow = (defaultprops) => {
const app = props.app;
const [hover, setHover] = React.useState(false);
if (app.id === "" || app.name === "") {
console.log("Skipping app: ", app)
return null
}
const maxlen = 24;
var newAppname = app.name;
newAppname = newAppname.charAt(0).toUpperCase() + newAppname.substring(1);
@@ -6149,6 +6157,10 @@ const AngularWorkflow = (defaultprops) => {
newAppname = newAppname.replaceAll("_", " ");
if (app.large_image === undefined || app.large_image === null || app.large_image === "") {
app.large_image = theme.palette.defaultImage
}
const image = app.large_image;
const newAppStyle = JSON.parse(JSON.stringify(paperAppStyle));
const pixelSize = !hover ? "2px" : "4px";
@@ -6374,7 +6386,7 @@ const AngularWorkflow = (defaultprops) => {
}
};
const SearchBox = ({currentRefinement, refine, isSearchStalled, } ) => {
const SearchBox = ({ currentRefinement, refine, isSearchStalled, }) => {
useEffect(() => {
if (document !== undefined) {
@@ -6390,13 +6402,13 @@ const AngularWorkflow = (defaultprops) => {
}, [])
return (
<form id="search_form" noValidate type="searchbox" action="" role="search" style={{margin: 0, display: "none",}} onClick={() => {
<form id="search_form" noValidate type="searchbox" action="" role="search" style={{ margin: 0, display: "none", }} onClick={() => {
}}>
<TextField
fullWidth
style={{backgroundColor: theme.palette.inputColor, borderRadius: theme.palette.borderRadius, maxWidth: leftBarSize-20,}}
style={{ backgroundColor: theme.palette.inputColor, borderRadius: theme.palette.borderRadius, maxWidth: leftBarSize - 20, }}
InputProps={{
style:{
style: {
color: "white",
fontSize: "1em",
height: 50,
@@ -6404,7 +6416,7 @@ const AngularWorkflow = (defaultprops) => {
},
startAdornment: (
<InputAdornment position="start">
<SearchIcon style={{marginLeft: 5}}/>
<SearchIcon style={{ marginLeft: 5 }} />
</InputAdornment>
),
}}
@@ -6459,8 +6471,8 @@ const AngularWorkflow = (defaultprops) => {
const baseImage = <LibraryBooksIcon />
return (
<div style={{position: "relative", marginTop: 15, marginLeft: 0, marginRight: 10, position: "absolute", color: "white", zIndex: 1001, backgroundColor: theme.palette.inputColor, minWidth: leftBarSize-10, maxWidth: leftBarSize-10, boxShadows: "none", overflowX: "hidden", }}>
<List style={{backgroundColor: theme.palette.inputColor, }}>
<div style={{ position: "relative", marginTop: 15, marginLeft: 0, marginRight: 10, position: "absolute", color: "white", zIndex: 1001, backgroundColor: theme.palette.inputColor, minWidth: leftBarSize - 10, maxWidth: leftBarSize - 10, boxShadows: "none", overflowX: "hidden", }}>
<List style={{ backgroundColor: theme.palette.inputColor, }}>
{hits.length === 0 ?
<ListItem style={outerlistitemStyle}>
<ListItemAvatar onClick={() => console.log(hits)}>
@@ -6476,7 +6488,7 @@ const AngularWorkflow = (defaultprops) => {
:
hits.map((hit, index) => {
const innerlistitemStyle = {
width: positionInfo.width+35,
width: positionInfo.width + 35,
overflowX: "hidden",
overflowY: "hidden",
borderBottom: "1px solid rgba(255,255,255,0.4)",
@@ -6492,9 +6504,9 @@ const AngularWorkflow = (defaultprops) => {
const name = hit.name === undefined ?
hit.filename.charAt(0).toUpperCase() + hit.filename.slice(1).replaceAll("_", " ") + " - " + hit.title :
(hit.name.charAt(0).toUpperCase()+hit.name.slice(1)).replaceAll("_", " ")
(hit.name.charAt(0).toUpperCase() + hit.name.slice(1)).replaceAll("_", " ")
var secondaryText = hit.data !== undefined ? hit.data.slice(0, 40)+"..." : ""
var secondaryText = hit.data !== undefined ? hit.data.slice(0, 40) + "..." : ""
const avatar = hit.image_url === undefined ?
baseImage
:
@@ -6505,12 +6517,12 @@ const AngularWorkflow = (defaultprops) => {
//console.log(hit)
if (hit.categories !== undefined && hit.categories !== null && hit.categories.length > 0) {
secondaryText = hit.categories.slice(0,3).map((data, index) => {
secondaryText = hit.categories.slice(0, 3).map((data, index) => {
if (index === 0) {
return data
}
return ", "+data
return ", " + data
/*
<Chip
@@ -6531,7 +6543,7 @@ const AngularWorkflow = (defaultprops) => {
parsedUrl += `?queryID=${hit.__queryID}`
return (
<div style={{textDecoration: "none", color: "white",}} onClick={(event) => {
<div style={{ textDecoration: "none", color: "white", }} onClick={(event) => {
//if (!isCloud) {
// alert.info("Since this is an on-prem instance. You will need to activate the app yourself. Opening link to download it in a new window.")
// setTimeout(() => {
@@ -6590,7 +6602,8 @@ const AngularWorkflow = (defaultprops) => {
*/}
</ListItem>
</div>
)})
)
})
}
</List>
</div>
@@ -6652,7 +6665,7 @@ const AngularWorkflow = (defaultprops) => {
var extraMessage = ""
if (index == 2) {
extraMessage = <div style={{marginTop: 5}} />
extraMessage = <div style={{ marginTop: 5 }} />
}
delay += 75
@@ -7551,7 +7564,7 @@ const AngularWorkflow = (defaultprops) => {
</a>
</span>
<FormControl>
<DialogTitle id="draggable-dialog-title" style={{cursor: "move",}}>
<DialogTitle id="draggable-dialog-title" style={{ cursor: "move", }}>
<span style={{ color: "white" }}>Condition</span>
</DialogTitle>
<DialogContent style={{}}>
@@ -7877,7 +7890,7 @@ const AngularWorkflow = (defaultprops) => {
key={condition.condition.id}
square
style={paperVariableStyle}
onClick={() => {}}
onClick={() => { }}
>
<div
style={{
@@ -7928,7 +7941,7 @@ const AngularWorkflow = (defaultprops) => {
overflow: "hidden",
maxWidth: 72,
}}
onClick={() => {}}
onClick={() => { }}
>
{condition.condition.value}
</div>
@@ -8228,7 +8241,7 @@ const AngularWorkflow = (defaultprops) => {
};
const getTriggerAuth = () => {
fetch(globalUrl + "/api/v1/triggers/" + selectedTrigger.id, {
fetch(`${globalUrl}/api/v1/triggers/${selectedTrigger.id}`, {
method: "GET",
headers: { "content-type": "application/json" },
credentials: "include",
@@ -8309,7 +8322,7 @@ const AngularWorkflow = (defaultprops) => {
console.log("BRANCH: ", branch);
const startnode = branch.destination_id;
const scopes = "https://www.googleapis.com/auth/gmail.readonly";
const url = `https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&client_id=${client_id}&redirect_uri=${redirectUri}&response_type=code&scope=${scopes}&state=workflow_id%3D${props.match.params.key}%26trigger_id%3D${selectedTrigger.id}%26username%3D${username}%26type%3Dgmail%26start%3d${startnode}`;
const url = `https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&prompt=consent&client_id=${client_id}&redirect_uri=${redirectUri}&response_type=code&scope=${scopes}&state=workflow_id%3D${props.match.params.key}%26trigger_id%3D${selectedTrigger.id}%26username%3D${username}%26type%3Dgmail%26start%3d${startnode}`;
console.log("URL: ", url);
var newwin = window.open(url, "", "width=800,height=600");
@@ -8317,7 +8330,7 @@ const AngularWorkflow = (defaultprops) => {
// Check whether we got a callback somewhere
var id = setInterval(function () {
fetch(
globalUrl + "/api/v1/triggers/" + selectedTrigger.id,
`${globalUrl}/api/v1/triggers/${selectedTrigger.id}`,
{
method: "GET",
headers: { "content-type": "application/json" },
@@ -8418,7 +8431,7 @@ const AngularWorkflow = (defaultprops) => {
// Check whether we got a callback somewhere
var id = setInterval(function () {
fetch(
globalUrl + "/api/v1/triggers/ " + selectedTrigger.id,
`${globalUrl}/api/v1/triggers/${selectedTrigger.id}`,
{
method: "GET",
headers: { "content-type": "application/json" },
@@ -8488,8 +8501,8 @@ const AngularWorkflow = (defaultprops) => {
</div>
{outlookButton}
{gmailButton}
<Typography variant="body2" color="textSecondary" style={{marginTop: 5}}>
If you have trouble using this trigger, please <a href="https://shuffler.io/contact" rel="noopener noreferrer" target="_blank" style={{ textDecoration: "none", color: "#f86a3e"}}>contact us</a> to get access
<Typography variant="body2" color="textSecondary" style={{ marginTop: 5 }}>
If you have trouble using this trigger, please <a href="https://shuffler.io/contact" rel="noopener noreferrer" target="_blank" style={{ textDecoration: "none", color: "#f86a3e" }}>contact us</a> to get access
</Typography>
</span>
)}
@@ -8518,14 +8531,14 @@ const AngularWorkflow = (defaultprops) => {
</div>
{triggerFolders.length === 0 ?
<Typography variant="body2">
No folders found. Please authenticate and make sure the user has access folders available. If this persists, <a href="https://shuffler.io/contact" rel="noopener noreferrer" target="_blank" style={{ textDecoration: "none", color: "#f86a3e"}}>contact us</a>.
No folders found. Please authenticate and make sure the user has access folders available. If this persists, <a href="https://shuffler.io/contact" rel="noopener noreferrer" target="_blank" style={{ textDecoration: "none", color: "#f86a3e" }}>contact us</a>.
</Typography>
:
<Select
MenuProps={{
disableScrollLock: true,
sx: {
"&& .MuiMenuItem-root":{
"&& .MuiMenuItem-root": {
backgroundColor: theme.palette.inputColor,
color: "white",
}
@@ -8546,7 +8559,7 @@ const AngularWorkflow = (defaultprops) => {
setTriggerFolderWrapperMulti(e)
}}
fullWidth
input={<Input id="select-multiple-native" style={{backgroundColor: theme.palette.inputColor, color: "white"}} />}
input={<Input id="select-multiple-native" style={{ backgroundColor: theme.palette.inputColor, color: "white" }} />}
key={selectedTrigger}
>
{triggerFolders.map((folder) => {
@@ -8614,8 +8627,8 @@ const AngularWorkflow = (defaultprops) => {
</div>
{outlookButton}
{gmailButton}
<Typography variant="body2" color="textSecondary" style={{marginTop: 5}}>
If you have trouble using this trigger, please <span style={{ textDecoration: "none", color: "#f86a3e"}} onClick={() => {
<Typography variant="body2" color="textSecondary" style={{ marginTop: 5 }}>
If you have trouble using this trigger, please <span style={{ textDecoration: "none", color: "#f86a3e" }} onClick={() => {
if (window.drift !== undefined) {
window.drift.api.startInteraction({ interactionId: 340043 })
} else {
@@ -9046,7 +9059,7 @@ const AngularWorkflow = (defaultprops) => {
minWidth: 250,
}}
value={pathdata}
onMouseOver={() => {}}
onMouseOver={() => { }}
onClick={() => {
handleItemClick([innerdata, pathdata]);
}}
@@ -9295,8 +9308,8 @@ const AngularWorkflow = (defaultprops) => {
backgroundColor: "rgb(91, 96, 100)",
}}
/>
<div style={{display: "flex"}}>
<div style={{flex: 5}}>
<div style={{ display: "flex" }}>
<div style={{ flex: 5 }}>
<Typography>Name</Typography>
<TextField
style={{
@@ -9319,7 +9332,7 @@ const AngularWorkflow = (defaultprops) => {
/>
</div>
<div>
<div style={{flex: 1, marginLeft: 5,}}>
<div style={{ flex: 1, marginLeft: 5, }}>
<Tooltip
color="primary"
title={"Delay before action executes (in seconds)"}
@@ -9404,7 +9417,7 @@ const AngularWorkflow = (defaultprops) => {
/>
<div style={{ flex: "6", marginTop: "20px" }}>
<div>
<div style={{display: "flex"}}>
<div style={{ display: "flex" }}>
<div
style={{
marginTop: "20px",
@@ -9420,7 +9433,7 @@ const AngularWorkflow = (defaultprops) => {
{workflow.triggers[selectedTriggerIndex].parameters[0].value
.length === 0 ? null : workflow.triggers[selectedTriggerIndex]
.parameters[0].value === props.match.params.key ? null : (
<div style={{marginLeft: 5, flex: 1}}>
<div style={{ marginLeft: 5, flex: 1 }}>
<a
rel="noopener noreferrer"
href={`/workflows/${workflow.triggers[selectedTriggerIndex].parameters[0].value}`}
@@ -9475,7 +9488,7 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius,
}}
onChange={(event, newValue) => {
handleWorkflowSelectionUpdate({ target: { value: newValue} })
handleWorkflowSelectionUpdate({ target: { value: newValue } })
}}
renderOption={(data, index) => {
if (data.id === workflow.id) {
@@ -9487,7 +9500,7 @@ const AngularWorkflow = (defaultprops) => {
<Tooltip arrow placement="left" title={
<span style={{}}>
{data.image !== undefined && data.image !== null && data.image.length > 0 ?
<img src={data.image} alt={data.name} style={{backgroundColor: theme.palette.surfaceColor, maxHeight: 200, minHeigth: 200, borderRadius: theme.palette.borderRadius, }} />
<img src={data.image} alt={data.name} style={{ backgroundColor: theme.palette.surfaceColor, maxHeight: 200, minHeigth: 200, borderRadius: theme.palette.borderRadius, }} />
: null}
<Typography>
Choose {data.name}
@@ -9580,7 +9593,7 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius,
}}
onChange={(event, newValue) => {
handleSubflowStartnodeSelection({ target: { value: newValue} })
handleSubflowStartnodeSelection({ target: { value: newValue } })
}}
renderOption={(action) => {
const isParent = getParents(selectedTrigger).find(
@@ -9841,7 +9854,7 @@ const AngularWorkflow = (defaultprops) => {
}}
/>
</div>
<div style={{marginLeft: 5 }}>
<div style={{ marginLeft: 5 }}>
<div>Width</div>
<TextField
style={{
@@ -9895,7 +9908,7 @@ const AngularWorkflow = (defaultprops) => {
}}
/>
</div>
<div style={{marginLeft: 5}}>
<div style={{ marginLeft: 5 }}>
<div>Text Color</div>
<TextField
style={{
@@ -9922,7 +9935,7 @@ const AngularWorkflow = (defaultprops) => {
/>
</div>
</div>
<div style={{marginTop: 15,}}>Background-Image</div>
<div style={{ marginTop: 15, }}>Background-Image</div>
<TextField
style={{
backgroundColor: inputColor,
@@ -10120,7 +10133,7 @@ const AngularWorkflow = (defaultprops) => {
placement="left"
>
<div>
<div style={{ display: "flex", marginBottom: 0,}}>
<div style={{ display: "flex", marginBottom: 0, }}>
<Avatar variant="rounded">
<img
alt={appname}
@@ -10128,7 +10141,7 @@ const AngularWorkflow = (defaultprops) => {
style={{ width: 50, height: 50, }}
/>
</Avatar>
<Typography variant="body1" style={{marginLeft: 15, }}>
<Typography variant="body1" style={{ marginLeft: 15, }}>
{appname}
</Typography>
</div>
@@ -10388,7 +10401,7 @@ const AngularWorkflow = (defaultprops) => {
borderRadius: theme.palette.borderRadius,
}}
id="webhook_uri_header"
onClick={() => {}}
onClick={() => { }}
InputProps={{
style: {
color: "white",
@@ -10438,14 +10451,14 @@ const AngularWorkflow = (defaultprops) => {
<b>Custom Response</b>
</div>
</div>
<div style={{marginBottom: 20, }}>
<div style={{ marginBottom: 20, }}>
<TextField
style={{
backgroundColor: inputColor,
borderRadius: theme.palette.borderRadius,
}}
id="webhook_uri_header"
onClick={() => {}}
onClick={() => { }}
InputProps={{
style: {
color: "white",
@@ -12137,7 +12150,7 @@ const AngularWorkflow = (defaultprops) => {
// console.log(allowList, userdata.public_username)
const leftView = workflow.public === true ?
<div style={{minHeight: "82vh", maxHeight: "82vh", height: "100%", minWidth: leftBarSize-70, maxWidth: leftBarSize-70, zIndex: 0, padding: 35, borderRight: "1px solid rgba(91,96,100,1)", overflowY: "auto",}}>
<div style={{ minHeight: "82vh", maxHeight: "82vh", height: "100%", minWidth: leftBarSize - 70, maxWidth: leftBarSize - 70, zIndex: 0, padding: 35, borderRight: "1px solid rgba(91,96,100,1)", overflowY: "auto", }}>
<Typography variant="h6" color="textPrimary" style={{
margin: "0px 0px 0px 0px",
}}
@@ -12145,30 +12158,30 @@ const AngularWorkflow = (defaultprops) => {
{workflow.name}
</Typography>
<Typography variant="body2" color="textSecondary">
This workflow is public and <span style={{color: "#f86a3e", cursor: "pointer", }} onClick={() => {
This workflow is public and <span style={{ color: "#f86a3e", cursor: "pointer", }} onClick={() => {
saveWorkflow()
}}>must be saved</span> or exported before use.
</Typography>
{Object.getOwnPropertyNames(creatorProfile).length !== 0 && creatorProfile.github_avatar !== undefined && creatorProfile.github_avatar !== null ?
<div style={{display: "flex", marginTop: 10, }}>
<IconButton color="primary" style={{padding: 0, marginRight: 10, }} aria-controls="simple-menu" aria-haspopup="true" onClick={(event) => {
<div style={{ display: "flex", marginTop: 10, }}>
<IconButton color="primary" style={{ padding: 0, marginRight: 10, }} aria-controls="simple-menu" aria-haspopup="true" onClick={(event) => {
}}>
<Link to={`/creators/${creatorProfile.github_username}`} style={{textDecoration: "none", color: "#f86a3e"}}>
<Avatar style={{height: 30, width: 30,}} alt={"Workflow creator"} src={creatorProfile.github_avatar} />
<Link to={`/creators/${creatorProfile.github_username}`} style={{ textDecoration: "none", color: "#f86a3e" }}>
<Avatar style={{ height: 30, width: 30, }} alt={"Workflow creator"} src={creatorProfile.github_avatar} />
</Link>
</IconButton>
<Typography variant="body1" color="textSecondary" style={{color: ""}}>
Shared by <Link to={`/creators/${creatorProfile.github_username}`} style={{textDecoration: "none", color: "#f86a3e"}}>{creatorProfile.github_username}</Link>
<Typography variant="body1" color="textSecondary" style={{ color: "" }}>
Shared by <Link to={`/creators/${creatorProfile.github_username}`} style={{ textDecoration: "none", color: "#f86a3e" }}>{creatorProfile.github_username}</Link>
</Typography>
</div>
: null}
<div style={{marginTop: 15}} />
<div style={{ marginTop: 15 }} />
{workflow.tags !== undefined && workflow.tags !== null && workflow.tags.length > 0 ?
<div style={{display: "flex", overflow: "hidden",marginTop: 5, }}>
<Typography variant="body1" style={{marginRight: 10, }}>
<div style={{ display: "flex", overflow: "hidden", marginTop: 5, }}>
<Typography variant="body1" style={{ marginRight: 10, }}>
Tags
</Typography>
<div style={{display: "flex"}}>
<div style={{ display: "flex" }}>
{workflow.tags.map((tag, index) => {
if (index >= 3) {
return null;
@@ -12177,7 +12190,7 @@ const AngularWorkflow = (defaultprops) => {
return (
<Chip
key={index}
style={{backgroundColor: "#3d3f43", height: 30, marginRight: 5, paddingLeft: 5, paddingRight: 5, height: 28, cursor: "pointer", borderColor: "#3d3f43", color: "white",}}
style={{ backgroundColor: "#3d3f43", height: 30, marginRight: 5, paddingLeft: 5, paddingRight: 5, height: 28, cursor: "pointer", borderColor: "#3d3f43", color: "white", }}
label={tag}
variant="outlined"
color="primary"
@@ -12186,7 +12199,7 @@ const AngularWorkflow = (defaultprops) => {
})}
</div>
</div>
: null }
: null}
{workflow.blogpost !== undefined && workflow.blogpost !== null && workflow.blogpost.length > 0 ?
<div style={{
@@ -12209,31 +12222,33 @@ const AngularWorkflow = (defaultprops) => {
}
{appGroup.length > 0 ?
<div style={{display: "flex", marginTop: 10, }}>
<div style={{ marginTop: 10, }}>
<div style={{ display: "flex" }}>
<Typography variant="body1">
Apps
</Typography>
<AvatarGroup max={6} style={{marginLeft: 10, }}>
<AvatarGroup max={6} style={{ marginLeft: 10, }}>
{appGroup.map((data, index) => {
return (
<Link key={index} to={`/apps/${data.app_id}`}>
<Avatar alt={data.app_name} src={data.large_image} style={{width: 30, height: 30}}/>
<Avatar alt={data.app_name} src={data.large_image} style={{ width: 30, height: 30 }} />
</Link>
)
})}
</AvatarGroup>
</div>
</div>
: null}
{triggerGroup.length > 0 ?
<div style={{display: "flex", marginTop: 10, }}>
<div style={{ display: "flex", marginTop: 10, }}>
<Typography variant="body1">
Triggers
</Typography>
<AvatarGroup max={6} style={{marginLeft: 10, }}>
<AvatarGroup max={6} style={{ marginLeft: 10, }}>
{triggerGroup.map((data, index) => {
return (
<Avatar key={index} alt={data.app_name} src={data.large_image} style={{width: 30, height: 30}}/>
<Avatar key={index} alt={data.app_name} src={data.large_image} style={{ width: 30, height: 30 }} />
)
})}
</AvatarGroup>
@@ -12315,18 +12330,33 @@ const AngularWorkflow = (defaultprops) => {
: null}
{workflow.description !== undefined && workflow.description !== null && workflow.description.length > 0 ?
<div style={{marginTop: 5, }}>
<div style={{ marginTop: 5, }}>
<Typography variant="body1">
Description
</Typography>
<Typography variant="body1" color="textSecondary" style={{maxWidth: "100%", maxHeight: 250, overflowX: "hidden"}}>
<Typography variant="body1" color="textSecondary" style={{ maxWidth: "100%", maxHeight: 250, overflowX: "hidden" }}>
{workflow.description}
</Typography>
</div>
: null}
{/*
<div style={{ display: "flex" }}>
<Button
color="primary"
variant="contained"
fullWidth
style={{ marginTop: 15, display: "flex" }}
onClick={() => {
setSelectionOpen(true)
}}
>
Statistics
</Button>
</div>
*/}
{userdata.avatar !== undefined && (userdata.avatar === creatorProfile.github_avatar || allowList.includes(userdata.public_username)) ?
<div style={{marginTop: 50, }}>
<div style={{ marginTop: 50, }}>
<Typography variant="body2" color="textSecondary">
You can see these buttons because you may have the correct access rights as a creator to help modify this workflow.
</Typography>
@@ -12334,7 +12364,7 @@ const AngularWorkflow = (defaultprops) => {
color="primary"
variant="contained"
fullWidth
style={{marginTop: 15, }}
style={{ marginTop: 15, }}
onClick={() => {
// Further checks are being done on the backend
// Even if the user can "edit" a workflow on the frontend,
@@ -12362,7 +12392,7 @@ const AngularWorkflow = (defaultprops) => {
disabled
variant="outlined"
fullWidth
style={{marginTop: 15, }}
style={{ marginTop: 15, }}
onClick={() => {
// setEditWorkflowDetails(true)
// workflow.public = false
@@ -12444,7 +12474,7 @@ const AngularWorkflow = (defaultprops) => {
}
return (
<div style={{display: "flex"}}>
<div style={{ display: "flex" }}>
<IconButton
style={{
marginTop: "auto",
@@ -12741,11 +12771,11 @@ const AngularWorkflow = (defaultprops) => {
const isFirstRender = React.useRef(true)
useEffect(() => {
console.log("IN useeffectt "+autocomplete)
console.log("IN useeffectt " + autocomplete)
if (isFirstRender.current) {
isFirstRender.current = false;
console.log("IN useeffectt (2)"+collapsed)
console.log("IN useeffectt (2)" + collapsed)
return;
}
})
@@ -12809,7 +12839,7 @@ const AngularWorkflow = (defaultprops) => {
open={open}
anchorReference="anchorPosition"
anchorPosition={anchorPosition}
style={{zIndex: 50000,}}
style={{ zIndex: 50000, }}
onClose={(event) => {
setAnchorPosition({
top: 750,
@@ -12818,7 +12848,7 @@ const AngularWorkflow = (defaultprops) => {
}}
disableRestoreFocus
>
<Typography style={{padding: 5 }}>
<Typography style={{ padding: 5 }}>
Copying
</Typography>
</Popover>
@@ -12887,7 +12917,7 @@ const AngularWorkflow = (defaultprops) => {
style={{ zIndex: 10011 }}
>
<IconButton
style={{ zIndex: 5000, position: "absolute", top: 10 , right: 10 }}
style={{ zIndex: 5000, position: "absolute", top: 10, right: 10 }}
onClick={(e) => {
e.preventDefault();
setExecutionModalOpen(false)
@@ -12981,8 +13011,8 @@ const AngularWorkflow = (defaultprops) => {
key={data.execution_id}
square
style={executionPaperStyle}
onMouseOver={() => {}}
onMouseOut={() => {}}
onMouseOver={() => { }}
onMouseOut={() => { }}
onClick={() => {
if (
(data.result === undefined ||
@@ -13134,13 +13164,13 @@ const AngularWorkflow = (defaultprops) => {
marginTop: "auto",
marginBottom: "auto",
}}
onClick={() => {}}
onClick={() => { }}
>
<ArrowBackIcon style={{ color: "rgba(255,255,255,0.5)" }} />
</IconButton>
<h2
style={{ color: "rgba(255,255,255,0.5)", cursor: "pointer" }}
onClick={() => {}}
onClick={() => { }}
>
See other Executions
</h2>
@@ -13159,7 +13189,7 @@ const AngularWorkflow = (defaultprops) => {
color="primary"
title="Rerun workflow"
placement="top"
style={{ zIndex: 50000}}
style={{ zIndex: 50000 }}
>
<span style={{}}>
<Button
@@ -13329,13 +13359,13 @@ const AngularWorkflow = (defaultprops) => {
(executionData.results.length === 0 && // probably ment to be around the or's
executionData.status === "EXECUTING")
) ? (
<div style={{display: "flex"}}>
<div style={{ display: "flex" }}>
<CircularProgress style={{ height: 45, width: 45, marginLeft: 20, marginRight: 20, }} />
{!isCloud && environments.length > 0 && defaultEnvironmentIndex < environments.length && nonskippedResults.length === 0 ?
<Typography variant="body2" color="textSecondary" style={{}}>
No results yet. Is Orborus running for the "{environments[defaultEnvironmentIndex].Name}" environment? <a href="/admin?tab=environments" rel="noopener noreferrer" target="_blank" style={{ textDecoration: "none", color: "#f86a3e"}}>Learn more</a>
No results yet. Is Orborus running for the "{environments[defaultEnvironmentIndex].Name}" environment? <a href="/admin?tab=environments" rel="noopener noreferrer" target="_blank" style={{ textDecoration: "none", color: "#f86a3e" }}>Learn more</a>
</Typography>
: null}
</div>
@@ -13349,7 +13379,7 @@ const AngularWorkflow = (defaultprops) => {
<CircularProgress />
) : (
executionData.results.map((data, index) => {
if (executionData.results.length !== 1 && !showSkippedActions && (data.status === "SKIPPED") ) {
if (executionData.results.length !== 1 && !showSkippedActions && (data.status === "SKIPPED")) {
return null;
}
@@ -13491,7 +13521,7 @@ const AngularWorkflow = (defaultprops) => {
if (data.similar_actions !== undefined && data.similar_actions !== null) {
var minimumMatch = 85
var matching_executions = []
for (var k in data.similar_actions){
for (var k in data.similar_actions) {
if (data.similar_actions.hasOwnProperty(k)) {
if (data.similar_actions[k].similarity > minimumMatch) {
matching_executions.push(data.similar_actions[k].execution_id)
@@ -13507,7 +13537,7 @@ const AngularWorkflow = (defaultprops) => {
color="primary"
title="See executions with similar results (not identical)"
placement="top"
style={{ zIndex: 50000, marginLeft: 50,}}
style={{ zIndex: 50000, marginLeft: 50, }}
>
<IconButton
style={{
@@ -13521,7 +13551,7 @@ const AngularWorkflow = (defaultprops) => {
navigate(`?execution_highlight=${parsed_url}`)
}}
>
<PreviewIcon style={{ color: "rgba(255,255,255,0.5)" }}/>
<PreviewIcon style={{ color: "rgba(255,255,255,0.5)" }} />
</IconButton>
</Tooltip>
}
@@ -13646,7 +13676,7 @@ const AngularWorkflow = (defaultprops) => {
textDecoration: "none",
color: "#f85a3e",
}}
onClick={(event) => {}}
onClick={(event) => { }}
>
<OpenInNewIcon />
</a>
@@ -13661,7 +13691,7 @@ const AngularWorkflow = (defaultprops) => {
<Typography variant="body1">
<b>Status&nbsp;</b>
</Typography>
<Typography variant="body1" color="textSecondary" style={{marginRight: 15,}}>
<Typography variant="body1" color="textSecondary" style={{ marginRight: 15, }}>
{data.status}
</Typography>
{similarActionsView}
@@ -13748,12 +13778,12 @@ const AngularWorkflow = (defaultprops) => {
validate.result = JSON.parse(validate.result);
}
const AppResultVariable = ({data}) => {
const AppResultVariable = ({ data }) => {
const [open, setOpen] = React.useState(false)
const showVariable = data.value.length < 60
return (
<div style={{maxWidth: 600, overflowX: "hidden", }}>
<div style={{ maxWidth: 600, overflowX: "hidden", }}>
{data.value.length > 60 ?
<IconButton
style={{
@@ -14049,7 +14079,7 @@ const AngularWorkflow = (defaultprops) => {
variant="h6"
style={{ marginBottom: 0, marginTop: 0 }}
>
Variables <span style={{fontSize: 10}}>(click to expand)</span>
Variables <span style={{ fontSize: 10 }}>(click to expand)</span>
</Typography>
{selectedResult.action.parameters.map((data, index) => {
if (data.value.length === 0) {
@@ -14065,7 +14095,7 @@ const AngularWorkflow = (defaultprops) => {
}
return (
<AppResultVariable key={index} data={data}/>
<AppResultVariable key={index} data={data} />
);
})}
</div>
@@ -14231,7 +14261,7 @@ const AngularWorkflow = (defaultprops) => {
}}
>
<FormControl>
<DialogTitle id="draggable-dialog-title" style={{cursor: "move",}}>
<DialogTitle id="draggable-dialog-title" style={{ cursor: "move", }}>
<span style={{ color: "white" }}>Execution Variable</span>
</DialogTitle>
<DialogContent>
@@ -14382,12 +14412,12 @@ const AngularWorkflow = (defaultprops) => {
backgroundColor: surfaceColor,
color: "white",
border: theme.palette.defaultBorder,
maxWidth: isMobile ? bodyWidth-100 : "100%",
maxWidth: isMobile ? bodyWidth - 100 : "100%",
},
}}
>
<FormControl>
<DialogTitle id="draggable-dialog-title" style={{cursor: "move",}}>
<DialogTitle id="draggable-dialog-title" style={{ cursor: "move", }}>
<span style={{ color: "white" }}>Workflow Variable</span>
</DialogTitle>
<DialogContent>
@@ -14543,7 +14573,7 @@ const AngularWorkflow = (defaultprops) => {
) {
return (
<DialogContent style={{ textAlign: "center", marginTop: 50 }}>
<Typography variant="h4" id="draggable-dialog-title" style={{cursor: "move",}}>
<Typography variant="h4" id="draggable-dialog-title" style={{ cursor: "move", }}>
{selectedApp.name} does not require authentication
</Typography>
</DialogContent>
@@ -14647,7 +14677,7 @@ const AngularWorkflow = (defaultprops) => {
return (
<div>
<DialogTitle id="draggable-dialog-title" style={{cursor: "move",}}>
<DialogTitle id="draggable-dialog-title" style={{ cursor: "move", }}>
<div style={{ color: "white" }}>
Authentication for {selectedApp.name}
</div>
@@ -15093,7 +15123,6 @@ const AngularWorkflow = (defaultprops) => {
</div>
</Dialog>
) : null;
const loadedCheck =
isLoaded && workflowDone ? (
<div>
@@ -15118,8 +15147,36 @@ const AngularWorkflow = (defaultprops) => {
/>
: null}
{/*selectionOpen === true ?
<div style={{ borderRadius: theme.palette.borderRadius, backgroundColor: surfaceColor, zIndex: 12501,position:"fixed", left: 190, bottom: 20,top:70, width: 950, overflowY: "scroll"}}>
<div>
<IconButton
style={{
zIndex: 12502,
position: "absolute",
top: 6,
right: 6,
color: "white",
}}
onClick={() => {
setSelectionOpen(false)
}}
>
<CloseIcon />
</IconButton>
</div>
<div style={{marginTop: 60, marginLeft: 55}}>
<AppStats
globalUrl={globalUrl}
workflowId={workflow.id}
{...props}
/>
</div>
</div>
: null*/}
{showVideo !== undefined && showVideo.length > 0 ?
<div style={{borderRadius: theme.palette.borderRadius, zIndex: 12501, position: "fixed", left: 40, bottom: 150, width: 300,}}>
<div style={{ borderRadius: theme.palette.borderRadius, zIndex: 12501, position: "fixed", left: 40, bottom: 150, width: 300, }}>
<IconButton
style={{
zIndex: 12502,