A ton of workflow related & onboarding changes

This commit is contained in:
Frikky
2024-08-15 23:22:25 +02:00
parent eaf8acfec0
commit 7d8a52cfff
18 changed files with 1151 additions and 593 deletions
+49 -10
View File
@@ -2361,7 +2361,7 @@ If you're interested, please let me know a time that works for you, or set up a
1: "cloud_sync",
2: "priorities",
3: "billing",
4: "branding",
4: "partner",
};
const setConfig = (event, inputValue) => {
@@ -3753,7 +3753,7 @@ If you're interested, please let me know a time that works for you, or set up a
>
<Tab label=<span>Edit Details</span> />
<Tab label=<span>Limits & Cloud Sync</span> />
<Tab label=<span>Priorities</span> />
<Tab label=<span>Notifications</span> />
<Tab label=<span>Billing & Stats</span> />
<Tab disabled={!isCloud} label=<span>Partner</span> />
</Tabs>
@@ -4383,9 +4383,11 @@ If you're interested, please let me know a time that works for you, or set up a
<Select
labelId="user-ip-simple-select-label"
id="user-ip-simple-select"
onChange={async (event) => {
onChange={(event) => {
setIpSelected(event.target.value);
await getLogs(event.target.value, userLogViewing.id);
getLogs(event.target.value, userLogViewing.id);
}}
>
{(() => {
@@ -4410,6 +4412,7 @@ If you're interested, please let me know a time that works for you, or set up a
})()}
</Select>
</FormControl>
{logsLoading && ipSelected.length !== 0 ? (
<div
style={{
@@ -4425,7 +4428,38 @@ If you're interested, please let me know a time that works for you, or set up a
) : null}
<List>
{logs.map((data, index) => (
<ListItem>
<ListItemText
primary={
"Timestamp"
}
style={{
minWidth: 200,
maxWidth: 200,
}}
/>
<ListItemText
primary={"Referer"}
style={{
minWidth: 300,
maxWidth: 300,
overflow: "hidden",
}}
/>
<ListItemText
primary={"URL"}
style={{
minWidth: 700,
maxWidth: 700,
overflow: "hidden",
marginLeft: 10,
}}
/>
</ListItem>
{logs.map((data, index) => {
//console.log("LOG: ", data)
return (
// redirect user to logs
// using request id or trace id
<ListItem
@@ -4436,7 +4470,7 @@ If you're interested, please let me know a time that works for you, or set up a
>
<ListItemText
primary={new Date(
data.start_time.seconds * 1000,
data.timestamp * 1000,
).toLocaleString("en-US", {
year: "numeric",
month: "2-digit",
@@ -4452,7 +4486,7 @@ If you're interested, please let me know a time that works for you, or set up a
}}
/>
<ListItemText
primary={data.referrer}
primary={data.referer}
style={{
minWidth: 300,
maxWidth: 300,
@@ -4460,7 +4494,7 @@ If you're interested, please let me know a time that works for you, or set up a
}}
/>
<ListItemText
primary={data.resource}
primary={data.url}
style={{
minWidth: 700,
maxWidth: 700,
@@ -4469,7 +4503,7 @@ If you're interested, please let me know a time that works for you, or set up a
}}
/>
</ListItem>
))}
)})}
</List>
</DialogContent>
</Dialog>
@@ -4567,6 +4601,11 @@ If you're interested, please let me know a time that works for you, or set up a
onClick={() => {
setLogsViewModal(true);
setUserLogViewing(data);
if (userLogViewing.login_info !== undefined && userLogViewing.login_info !== null && userLogViewing.login_info.length > 0) {
getLogs(userLogViewing.login_info[0].ip, userLogViewing.id)
setIpSelected(userLogViewing.login_info[0].ip);
}
}}
>
{data.username}
@@ -6077,7 +6116,7 @@ If you're interested, please let me know a time that works for you, or set up a
</div>
) : null;
const getLogs = async (ip, userId) => {
const getLogs = (ip, userId) => {
setLogsLoading(true);
console.log("logs loading: ", logsLoading);
fetch(`${globalUrl}/api/v1/users/${userId}/audit?user_ip=${ip}`, {
+117 -50
View File
@@ -319,9 +319,12 @@ export function SetJsonDotnotation(jsonInput, inputKey) {
return jsonInput;
}
export const green = "#86c142";
//export const green = "#86c142";
export const green = "#02CB70"
export const yellow = "#FECC00";
export const red = "#ff3632";
//export const red = "#ff3632";
export const red = "#F53434";
export const grey = "#b0b0b0";
export function removeParam(key, sourceURL) {
if (sourceURL === undefined) {
@@ -673,10 +676,16 @@ const releaseToConnectLabel = "Release to Connect"
const loadAppConfig = (appId, select) => {
if (appId === undefined || appId === null || appId.length === 0) {
console.log("No appId to load")
return
}
if (appId === "integration") {
return
}
if (loadedApps.includes(appId)) {
console.log("App already loaded: ", appId)
return
}
@@ -699,8 +708,6 @@ const releaseToConnectLabel = "Release to Connect"
if (responseJson.success === true && responseJson.app !== undefined && responseJson.app !== null && responseJson.app.length > 0) {
// Base64 decode into json
const foundapp = JSON.parse(atob(responseJson.app))
console.log("Checked app: ", foundapp)
const selectedAppActions = selectedApp.actions === undefined || selectedApp.actions === null ? [] : selectedApp.actions
if (foundapp.actions !== undefined && foundapp.actions !== null && foundapp.actions.length > selectedAppActions.length) {
@@ -749,6 +756,7 @@ const releaseToConnectLabel = "Release to Connect"
if (selectedApp.actions === undefined || selectedApp.actions === null || selectedApp.actions.length > 1) {
return
} else {
if (selectedApp.id !== undefined && selectedApp.id !== null && selectedApp.id.length > 0) {
loadAppConfig(selectedApp.id, true)
}
@@ -1241,8 +1249,14 @@ const releaseToConnectLabel = "Release to Connect"
})
.then((response) => {
if (response.status !== 200) {
console.log("Status not 200 for setting app auth :O!");
}
console.log("Status not 200 for setting app auth :O!");
if (response.status === 400) {
toast.error("Failed setting new auth. Please try again", {
"autoClose": true,
})
}
}
return response.json();
})
@@ -1253,8 +1267,6 @@ const releaseToConnectLabel = "Release to Connect"
"autoClose": false,
})
} else {
if (refresh === true) {
getAppAuthentication(true, true, true)
@@ -2153,6 +2165,7 @@ const releaseToConnectLabel = "Release to Connect"
})
.catch((error) => {
setSavingState(0);
setExecutionRequestStarted(false)
console.log("Save workflow error: ", error.toString());
toast.warn("Failed to save the workflow. Is the network down?")
});
@@ -2346,6 +2359,7 @@ const releaseToConnectLabel = "Release to Connect"
//toast(error.toString());
setExecutionRequestStarted(false)
console.log("Execute workflow err: ", error.toString());
toast.warn("Failed to run the workflow. Is the network down?")
});
})
};
@@ -5092,6 +5106,10 @@ const releaseToConnectLabel = "Release to Connect"
}
*/
if (curapp !== undefined && curapp !== null && curapp.id !== undefined && curapp.id !== null && curapp.id.length > 0) {
loadAppConfig(curapp.id, true)
}
if (!curapp || curapp === undefined) {
const tmpapp = {
name: curaction.app_name,
@@ -5753,8 +5771,10 @@ const releaseToConnectLabel = "Release to Connect"
setLastSaved(false);
const edge = event.target.data();
//console.log("edge added: ", edge)
console.log("edge added: ", edge)
if (edge.source === undefined && edge.target === undefined) {
console.log("Edge added without source or target")
return
}
@@ -5768,8 +5788,9 @@ const releaseToConnectLabel = "Release to Connect"
const sourcenode = cy.getElementById(edge.source)
const destinationnode = cy.getElementById(edge.target)
if (sourcenode === undefined || sourcenode === null || destinationnode === undefined || destinationnode === null) {
console.log("Source or destination node is undefined or null: ", sourcenode, destinationnode)
} else {
//console.log("Edge added: Is it a trigger? If so, check if it already has a branch and remove it: ", sourcenode.data())
console.log("Edge added: Is it a trigger? If so, check if it already has a branch and remove it: ", sourcenode.data())
if (sourcenode.data("type") === "TRIGGER") {
if (sourcenode.data("app_name") !== "Shuffle Workflow" && sourcenode.data("app_name") !== "User Input") {
setTimeout(() => {
@@ -5778,7 +5799,6 @@ const releaseToConnectLabel = "Release to Connect"
(data) => data.data.source === edge.source && data.data.id !== edge.id
)
console.log("Node: ", targetedge)
if (targetedge !== -1) {
event.target.remove()
@@ -5810,14 +5830,15 @@ const releaseToConnectLabel = "Release to Connect"
);
if (targetnode !== -1) {
if (workflow.triggers[targetnode].app_name === "User Input" || workflow.triggers[targetnode].app_name === "Shuffle Workflow" || workflow.triggers[targetnode].app_name === "Shuffle Subflow") {
console.log("User Input or Shuffle Workflow")
} else {
toast("Can't have triggers as target of branch");
event.target.remove();
toast("Can't have triggers as target of branch")
event.target.remove()
}
}
const eventTarget = event.target.target()
//console.log("BUTTON ADDED! Find parent from: ", eventTarget)
console.log("BUTTON ADDED! Find parent from: ", eventTarget)
if (eventTarget.data("isButton") === true) {
const parentNode = cy.getElementById(eventTarget.data("attachedTo"))
event.target.remove()
@@ -5843,13 +5864,10 @@ const releaseToConnectLabel = "Release to Connect"
}
}
if (
eventTarget.data("isDescriptor") === true ||
eventTarget.data("type") === "COMMENT"
) {
if (eventTarget.data("isDescriptor") === true || eventTarget.data("type") === "COMMENT") {
console.log("Removing because of descriptor or comment")
event.target.remove();
return;
event.target.remove()
return
}
targetnode = -1;
@@ -5858,26 +5876,33 @@ const releaseToConnectLabel = "Release to Connect"
// dest == source && source == dest
// dest == dest && source == source
// backend: check all children? to stop recursion
//
var found = false;
for (let branchkey in workflow.branches) {
if (
workflow.branches[branchkey].destination_id === edge.source &&
workflow.branches[branchkey].source_id === edge.target
) {
toast("A branch in the opposite direction already exists");
event.target.remove();
found = true;
break;
} else if (
workflow.branches[branchkey].destination_id === edge.target &&
workflow.branches[branchkey].source_id === edge.source
) {
//toast("That branch already exists");
event.target.remove();
if (workflow.branches[branchkey].destination_id === edge.source && workflow.branches[branchkey].source_id === edge.target) {
toast("A branch in the opposite direction already exists")
event.target.remove()
found = true
break
}
found = true;
break;
} else if (edge.target === workflow.start) {
if (workflow.branches[branchkey].destination_id === edge.target && workflow.branches[branchkey].source_id === edge.source) {
console.log("That branch already exists: ", workflow.branches[branchkey])
const foundbranch = cy.getElementById(workflow.branches[branchkey].id)
if (foundbranch !== undefined && foundbranch !== null && foundbranch.data() !== undefined && foundbranch.data() !== null) {
console.log("Removing branch: ", foundbranch.data())
event.target.remove()
found = true
break
} else {
console.log("Old branch didn't exist afterall. Remove.")
}
}
if (edge.target === workflow.start) {
targetnode = workflow.triggers.findIndex(
(data) => data.id === edge.source
);
@@ -5890,7 +5915,9 @@ const releaseToConnectLabel = "Release to Connect"
found = true;
}
} else if (edge.source === workflow.branches[branchkey].source_id) {
}
if (edge.source === workflow.branches[branchkey].source_id) {
// FIXME: Verify multi-target for triggers
// 1. Check if destination exists
// 2. Check if source is a trigger
@@ -7522,7 +7549,7 @@ const releaseToConnectLabel = "Release to Connect"
// Reset cytoscape nodes and branches
if (cy !== undefined && cy !== null) {
if (inputworkflow.actions !== undefined && inputworkflow.actions !== null && inputworkflow.actions.length > 0) {
cy.remove('*')
//cy.remove('*')
}
}
@@ -9181,6 +9208,10 @@ const releaseToConnectLabel = "Release to Connect"
const actionIndex = startIndex < 0 ? 0 : startIndex
if (app.actions[actionIndex] === undefined || app.actions[actionIndex] === null) {
if (app.id !== undefined && app.id !== null) {
loadAppConfig(app.id, false)
}
console.log("No actions found for app: ", app)
return
}
@@ -9409,7 +9440,7 @@ const releaseToConnectLabel = "Release to Connect"
setHover(true)
if (app.actions !== undefined && app.actions !== null && app.actions.length === 1) {
if (app.actions !== undefined && (app.actions === null || app.actions.length === 1)) {
console.log("HOVERING: ", app.id)
loadAppConfig(app.id, false)
}
@@ -10295,6 +10326,10 @@ const releaseToConnectLabel = "Release to Connect"
var handled = [];
var results = [];
if (cy === undefined || cy === null) {
return []
}
// maxiter = max amount of parent nodes to loop
// also handles breaks if there are issues
var iterations = 0;
@@ -10934,6 +10969,10 @@ const releaseToConnectLabel = "Release to Connect"
checked = workflow.auth_groups.includes(data.id)
}
if (data === undefined || data === null || data.app_auths === undefined || data.app_auths === null || data.app_auths.length === 0) {
return null
}
return (
<div
style={{ display: 'flex', alignItems: 'center', marginBottom: '10px', marginLeft: '5px', cursor: "pointer", }}
@@ -12528,7 +12567,7 @@ const releaseToConnectLabel = "Release to Connect"
if (e.target.value.id !== workflow.id && e.target.value.id.length > 0 ) {
console.log("WORKFLOW: ", e.target.value);
const startnode = e.target.value.actions.find((action) => action.id === e.target.value.start);
const startnode = e?.target?.value?.actions?.find((action) => action.id === e.target.value.start);
if (startnode !== undefined && startnode !== null) {
@@ -16643,9 +16682,17 @@ const releaseToConnectLabel = "Release to Connect"
}
const foundnode = cy.nodes().filter((node) => {
return node.data().label === word
const nodelabel = node.data("label")
if (nodelabel === undefined || nodelabel === null) {
return false
}
console.log("Node: ", nodelabel.toLowerCase(), "Word: ", word.toLowerCase())
return nodelabel.toLowerCase() === word.toLowerCase()
})
console.log("FOUND: ", foundnode)
if (foundnode === undefined || foundnode === null || foundnode.length === 0) {
return
}
@@ -18986,7 +19033,7 @@ const releaseToConnectLabel = "Release to Connect"
) : null}
{executionData.workflow !== undefined && executionData.workflow !== null && executionData.status !== "EXECUTING" ?
{userdata.support === true && executionData.workflow !== undefined && executionData.workflow !== null && executionData.status !== "EXECUTING" ?
<div style={{marginTop: 5, marginBottom: 5, }}>
<WorkflowValidationTimeline
originalWorkflow={workflow}
@@ -19110,7 +19157,7 @@ const releaseToConnectLabel = "Release to Connect"
}
}
if (imgSrc.length === 0 && cy !== undefined && cy !== null) {
if ((imgSrc === undefined || imgSrc === null || imgSrc.length === 0) && cy !== undefined && cy !== null) {
const foundnode = cy.getElementById(data.action.id)
if (foundnode !== undefined && foundnode !== null && foundnode.length > 0) {
// FIXME: Find image from cytoscape action
@@ -20837,6 +20884,25 @@ const releaseToConnectLabel = "Release to Connect"
/>
<div />
{selectedApp.authentication.parameters.map((data, index) => {
// FIXME: Look for relevant fields in the action that may already be filled in with the same name
if (data.value === "" || data.value === null || data.value === undefined || data.name === "url") {
if (selectedAction !== undefined && selectedAction !== null && selectedAction.parameters !== undefined && selectedAction.parameters !== null) {
for (var fieldkey in selectedAction.parameters) {
const field = selectedAction.parameters[fieldkey]
if (field.name !== data.name) {
continue
}
if (field.value !== undefined && field.value !== null && field.value.length > 0) {
data.value = field.value
data.autocomplete = true
break
}
}
}
}
return (
<div key={index} style={{ marginTop: 10 }}>
<LockOpenIcon style={{ marginRight: 10 }} />
@@ -21617,8 +21683,8 @@ const releaseToConnectLabel = "Release to Connect"
// Should render if it's not the same as workflow.edited
console.log("Clicked revision: ", newrevision)
setLastSaved(false)
setSelectedVersion(newrevision);
setLastSaved(false)
setSelectedVersion(newrevision);
setWorkflow(newrevision)
setSelectedAction({});
setSelectedApp({})
@@ -21638,18 +21704,19 @@ const releaseToConnectLabel = "Release to Connect"
cy.removeListener("free");
cy.removeListener("cxttap");
//cy.remove('*')
setElements([])
}
// Remove all edges
cy.remove('*')
cy.edges().remove()
cy.nodes().remove()
}
// Remove all cy nodes
setTimeout(() => {
//toast("Running setupgraph with new revision. Actions: " + newrevision.actions.length)
setupGraph(newrevision)
}, 100)
}, 250)
// Re-adding cytoscape triggers
+2
View File
@@ -228,6 +228,8 @@ const parseCurl = (s) => {
};
// Basically CRUD for each category + special
// These are already tracked in the shuffle/shuffle-shared/blobs.go file
// as backend should be used for managing this long-term
export const appCategories = [
{
"name": "Communication",
+4 -1
View File
@@ -1542,12 +1542,15 @@ const Apps = (props) => {
flex: 1,
padding: 15,
margin: 10,
paddingTop: 25,
backgroundColor: hover ? theme.palette.surfaceColor : "transparent",
border: hover ? "1px solid #f85a3e" : "1px solid rgba(255,255,255,0.3)",
cursor: hover ? "pointer" : "default",
textAlign: "center",
minHeight: 150,
maxHeight: 150,
borderRadius: theme.palette.borderRadius,
}}
>
{icon}
@@ -1569,7 +1572,7 @@ const Apps = (props) => {
</h2>
<div style={{display: "flex"}}>
<AppCreateButton
text="Generate from OpenAPI/Swagger"
text="Upload OpenAPI or Swagger"
func={() => {
setOpenApiModal(true)
}}
+187 -62
View File
@@ -2,14 +2,17 @@
import React, {useState, useEffect} from 'react';
import ReactDOM from "react-dom"
import { ToastContainer, toast } from "react-toastify"
import { useInterval } from "react-powerhooks";
import { makeStyles } from '@mui/material/styles';
import { green, yellow, red, grey} from "./AngularWorkflow.jsx";
import { CodeHandler, Img, OuterLink, } from "../views/Docs.jsx";
import { useNavigate, Link, useParams } from "react-router-dom";
import {isMobile} from "react-device-detect";
import theme from '../theme.jsx';
import { validateJson, GetIconInfo } from "./Workflows.jsx";
import { green, yellow } from "./AngularWorkflow.jsx";
import EditWorkflow from "../components/EditWorkflow.jsx"
import { ToastContainer, toast } from "react-toastify"
import { makeStyles } from '@mui/material/styles';
import { useInterval } from "react-powerhooks";
import { isMobile } from "react-device-detect";
import Markdown from "react-markdown";
import theme from '../theme.jsx';
import {
Tooltip,
@@ -21,6 +24,10 @@ import {
Paper,
Typography,
Divider,
Dialog,
DialogTitle,
DialogContent,
} from '@mui/material';
import {
@@ -35,14 +42,15 @@ const hrefStyle = {
const bodyDivStyle = {
margin: "auto",
marginTop: 100,
width: isMobile? "100%":"500px",
position: "relative",
marginTop: 25,
}
const RunWorkflow = (defaultprops) => {
const { globalUrl, isLoaded, isLoggedIn, setIsLoggedIn, setCookie, register, serverside } = defaultprops;
const { globalUrl, userdata, isLoaded, isLoggedIn, setIsLoggedIn, setCookie, register, serverside } = defaultprops;
let navigate = useNavigate();
const [_, setUpdate] = useState(""); // Used to force rendring, don't remove
@@ -58,15 +66,16 @@ const RunWorkflow = (defaultprops) => {
const [apps, setApps] = React.useState([]);
const [buttonClicked, setButtonClicked] = React.useState("");
const [foundSourcenode, setFoundSourcenode] = React.useState(undefined);
const [editWorkflowModalOpen, setEditWorkflowModalOpen] = React.useState(false)
const [sharingOpen, setSharingOpen] = React.useState(false)
const boxStyle = {
color: "white",
paddingLeft: "30px",
paddingRight: "30px",
paddingBottom: "30px",
paddingTop: "30px",
padding: 50,
backgroundColor: theme.palette.surfaceColor,
marginBottom: 150,
borderRadius: 25,
minHeight: 500,
}
const params = useParams();
@@ -74,7 +83,7 @@ const RunWorkflow = (defaultprops) => {
props.match = {}
props.match.params = params
const defaultTitle = "Run Workflow"
const defaultTitle = workflow.name !== undefined ? workflow.name : "Run Workflow"
if (document != undefined && document.title != defaultTitle) {
document.title = defaultTitle
}
@@ -96,16 +105,42 @@ const RunWorkflow = (defaultprops) => {
return true
}
const saveWorkflow = (workflow) => {
const url = `${globalUrl}/api/v1/workflows/${workflow.id}`
fetch(url, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include",
body: JSON.stringify(workflow),
})
.then((response) => {
if (response.status !== 200) {
console.log("Status not 200 for workflows :O!");
}
return response.json();
})
.then((responseJson) => {
toast.success("Saved workflow")
})
.catch((error) => {
toast.error("Save workflow error: " + error)
});
}
const getApps = () => {
fetch(globalUrl + "/api/v1/apps", {
method: "GET",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include",
})
fetch(globalUrl + "/api/v1/apps", {
method: "GET",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include",
})
.then((response) => {
if (response.status !== 200) {
console.log("Status not 200 for apps :O!");
@@ -829,52 +864,75 @@ const RunWorkflow = (defaultprops) => {
const basedata =
<div style={bodyDivStyle}>
<Paper style={boxStyle}>
<form onSubmit={(e) => {onSubmit(e)}} style={{margin: "15px 15px 15px 15px"}}>
<img
alt={workflow.name}
src={image}
style={{
marginRight: 20,
width: 100,
height: 100,
border: `2px solid ${green}`,
borderRadius: 50,
position: "absolute",
top: -50,
left: 200,
}}
/>
{workflow.input_markdown !== undefined && workflow.input_markdown !== null && workflow.input_markdown.length > 0 ?
<div style={{marginBottom: 20, }}>
<Markdown
components={{
img: Img,
code: CodeHandler,
a: OuterLink,
}}
id="markdown_wrapper"
escapeHtml={false}
style={{
maxWidth: "100%", minWidth: "100%",
}}
>
{workflow.input_markdown}
</Markdown>
</div>
: null}
<Typography variant="h6" style={{marginBottom: 10, marginTop: 50, textAlign: "center", }}>
{organization}
</Typography>
<Divider style={{marginTop: 20, marginBottom: 20, }}/>
<form onSubmit={(e) => {onSubmit(e)}} style={{margin: "50px 0px 15px 0px",}}>
{workflow.input_markdown !== undefined && workflow.input_markdown !== null && workflow.input_markdown.length > 0 ? null :
<div>
<img
alt={workflow.name}
src={image}
style={{
marginRight: 20,
width: 100,
height: 100,
border: `2px solid ${green}`,
borderRadius: 50,
position: "absolute",
top: -50,
left: 200,
}}
/>
{disabledButtons && message.length > 0 ? null :
<Typography color="textSecondary" style={{textAlign: "center", }}>
{message}
<Typography variant="h6" style={{marginBottom: 10, marginTop: 50, textAlign: "center", }}>
{organization}
</Typography>
}
<Divider style={{marginTop: 20, marginBottom: 20, }}/>
{answer !== undefined && answer !== null ? null :
<Typography variant="h6" style={{marginBottom: 15, textAlign: "center", }}><b>{workflow.name}</b></Typography>
}
{workflowQuestion.length > 0 ?
<div style={{
backgroundColor: theme.palette.inputColor,
padding: 20,
borderRadius: theme.palette.borderRadius,
marginBottom: 35,
marginTop: 30,
}}>
<Typography variant="body1" style={{ marginRight: 15, textAlign: "center", whiteSpace: "pre-line", }}>
{workflowQuestion}
{disabledButtons && message.length > 0 ? null :
<Typography color="textSecondary" style={{textAlign: "center", }}>
{message}
</Typography>
}
{answer !== undefined && answer !== null ? null :
<Typography variant="h6" style={{marginBottom: 15, textAlign: "center", }}><b>{workflow.name}</b></Typography>
}
{workflowQuestion.length > 0 ?
<div style={{
backgroundColor: theme.palette.inputColor,
padding: 20,
borderRadius: theme.palette.borderRadius,
marginBottom: 35,
marginTop: 30,
}}>
<Typography variant="body1" style={{ marginRight: 15, textAlign: "center", whiteSpace: "pre-line", }}>
{workflowQuestion}
</Typography>
</div>
: null}
</div>
: null}
}
{workflow.input_questions !== undefined && workflow.input_questions !== null && workflow.input_questions.length > 0 ?
<div style={{marginBottom: 5, }}>
{workflow.input_questions.map((question, index) => {
@@ -988,7 +1046,7 @@ const RunWorkflow = (defaultprops) => {
<div style={{display: "flex", marginTop: "15px"}}>
<Button variant="contained" type="submit" color="primary" fullWidth disabled={!handleValidateForm(executionArgument) || executionLoading}>
{executionLoading ?
<CircularProgress color="secondary" style={{color: "white",}} /> : "Run Workflow"}
<CircularProgress color="secondary" style={{color: "white",}} /> : "Submit"}
</Button>
</div>
}
@@ -1018,12 +1076,79 @@ const RunWorkflow = (defaultprops) => {
</Paper>
</div>
// const isCorrectOrg = 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
const loadedCheck = isLoaded ?
<div>
{editWorkflowModalOpen === true ?
<EditWorkflow
saveWorkflow={saveWorkflow}
workflow={workflow}
setWorkflow={setWorkflow}
modalOpen={editWorkflowModalOpen}
setModalOpen={setEditWorkflowModalOpen}
isEditing={true}
userdata={userdata}
usecases={undefined}
expanded={true}
/>
: null}
<Dialog
open={sharingOpen}
onClose={() => {
setSharingOpen(false);
}}
PaperProps={{
style: {
color: "white",
minWidth: isMobile ? "90%" : 400,
maxWidth: isMobile ? "90%" : 400,
minHeight: 350,
paddingTop: 25,
paddingLeft: 50,
//minWidth: isMobile ? "90%" : newWorkflow === true ? 1000 : 550,
//maxWidth: isMobile ? "90%" : newWorkflow === true ? 1000 : 550,
},
}}
>
<DialogTitle style={{padding: 30, paddingBottom: 0, zIndex: 1000,}}>
Share Landingpage
</DialogTitle>
<DialogContent style={{paddingTop: 10, display: "flex", minHeight: 300, zIndex: 1001, paddingBottom: 200, }}>
</DialogContent>
</Dialog>
{isLoggedIn && userdata?.active_org?.id === workflow?.org_id ?
<div style={{position: "fixed", top: 10, right: 20, }}>
<Button
variant={"outlined"}
color={"secondary"}
style={{marginRight: 10, }}
onClick={() => {
setEditWorkflowModalOpen(true)
}}
>
Edit Details
</Button>
<Button
variant={"outlined"}
color={"secondary"}
disabled
onClick={() => {
setSharingOpen(true)
}}
>
Manage Sharing
</Button>
</div>
: null}
{basedata}
</div>
:
<div>
<CircularProgress />
</div>
return (
+6 -3
View File
@@ -21,6 +21,7 @@ import {
Paper,
Chip,
Checkbox,
Fade,
} from "@mui/material";
import {
@@ -1741,9 +1742,11 @@ const Dashboard = (props) => {
</div>
const dataWrapper =
<div style={{ maxWidth: 1366, margin: "auto" }}>
{data}
</div>
<Fade in={true} timeout={1250}>
<div style={{ maxWidth: 1366, margin: "auto" }}>
{data}
</div>
</Fade>
return dataWrapper
+6 -2
View File
@@ -32,7 +32,7 @@ const Welcome = (props) => {
const [inputUsecase, setInputUsecase] = useState({});
const [frameworkData, setFrameworkData] = useState(undefined);
const [discoveryWrapper, setDiscoveryWrapper] = useState(undefined);
const [activeStep, setActiveStep] = React.useState(1);
const [activeStep, setActiveStep] = React.useState(0);
const [apps, setApps] = React.useState([]);
const [defaultSearch, setDefaultSearch] = React.useState("")
const [selectionOpen, setSelectionOpen] = React.useState(false)
@@ -285,6 +285,9 @@ const Welcome = (props) => {
}
setActiveStep(foundTab-1)
//setRenderDone(
}
}
}, [])
@@ -398,6 +401,7 @@ const Welcome = (props) => {
discoveryWrapper={discoveryWrapper}
setDiscoveryWrapper={setDiscoveryWrapper}
appFramework={frameworkData}
setAppFramework={setFrameworkData}
getFramework={getFramework}
steps={steps}
skipped={skipped}
@@ -462,7 +466,7 @@ const Welcome = (props) => {
OR
</Typography> */}
</div>
<Card style={paperObject} onClick={() => {
<Card disabled style={paperObject} onClick={() => {
if (isCloud) {
ReactGA.event({
category: "welcome",