Fixed usecase merging to go through cloud
This commit is contained in:
@@ -54,9 +54,10 @@ if (window.location.port === "3000") {
|
||||
//globalUrl = "http://localhost:5002"
|
||||
}
|
||||
|
||||
if (globalUrl.includes("githubpreview.dev")) {
|
||||
// Development on Github Codespaces
|
||||
if (globalUrl.includes("app.github.dev")) {
|
||||
//globalUrl = globalUrl.replace("3000", "5001")
|
||||
globalUrl = "https://frikky-shuffle-5gvr4xx62w64-5001.githubpreview.dev"
|
||||
globalUrl = "https://frikky-shuffle-5gvr4xx62w64-5001.preview.app.github.dev"
|
||||
}
|
||||
//console.log("global: ", globalUrl)
|
||||
|
||||
|
||||
@@ -786,7 +786,9 @@ const UsecaseSearch = (props) => {
|
||||
}
|
||||
|
||||
const mergeWorkflowUsecases = (usecasedata) => {
|
||||
const url = `${globalUrl}/api/v1/workflows/merge`;
|
||||
//const url = `${globalUrl}/api/v1/workflows/merge`;
|
||||
//const url = `https://0360-178-232-150-183.ngrok.io/api/v1/workflows/merge`;
|
||||
const url = `https://shuffler.io/api/v1/workflows/merge`;
|
||||
fetch(url, {
|
||||
mode: "cors",
|
||||
method: "POST",
|
||||
@@ -802,76 +804,85 @@ const UsecaseSearch = (props) => {
|
||||
response.json().then((responseJson) => {
|
||||
setIsUploading(false)
|
||||
var changed = false
|
||||
if (responseJson.success === false) {
|
||||
if (responseJson.reason !== null && responseJson.reason !== undefined) {
|
||||
//alert.error(responseJson.reason)
|
||||
}
|
||||
|
||||
if (responseJson.source === "") {
|
||||
const appname =
|
||||
usecasedata.source.error = usecasedata.source.app_name === undefined ? "Select a Trigger workflow first" : `${usecasedata.source.app_name} has no public trigger workflow yet. Click this to try another app`
|
||||
changed = true
|
||||
if (responseJson.success === false) {
|
||||
if (responseJson.reason !== null && responseJson.reason !== undefined) {
|
||||
//alert.error(responseJson.reason)
|
||||
}
|
||||
|
||||
if (responseJson.source === "") {
|
||||
const appname =
|
||||
usecasedata.source.error = usecasedata.source.app_name === undefined ? "Select a Trigger workflow first" : `${usecasedata.source.app_name} has no public trigger workflow yet. Click this to try another app`
|
||||
changed = true
|
||||
} else {
|
||||
usecasedata.source.error = ""
|
||||
changed = true
|
||||
}
|
||||
|
||||
if (responseJson.destination === "") {
|
||||
usecasedata.destination.error = usecasedata.destination.app_name === undefined ? "Select a Subflow first" : `${usecasedata.destination.app_name} has no public subflow yet. Click this to try another app`
|
||||
changed = true
|
||||
} else {
|
||||
usecasedata.source.error = ""
|
||||
usecasedata.destination.error = ""
|
||||
changed = true
|
||||
}
|
||||
|
||||
if (responseJson.destination === "") {
|
||||
usecasedata.destination.error = usecasedata.destination.app_name === undefined ? "Select a Subflow first" : `${usecasedata.destination.app_name} has no public subflow yet. Click this to try another app`
|
||||
changed = true
|
||||
} else {
|
||||
usecasedata.destination.error = ""
|
||||
changed = true
|
||||
}
|
||||
if (responseJson.middle !== undefined) {
|
||||
for (var key in responseJson.middle) {
|
||||
for (var subkey in usecasedata.middle) {
|
||||
if (responseJson.middle[key] === usecasedata.middle[key].text) {
|
||||
console.log("Found: ")
|
||||
if (usecasedata.middle[subkey].app_name === undefined || usecasedata.middle[subkey].app_name === "") {
|
||||
usecasedata.middle[subkey].error = `${usecasedata.middle[subkey].type} app must be selected first. Click this to change`
|
||||
} else {
|
||||
usecasedata.middle[subkey].error = `${usecasedata.middle[subkey].app_name} has no public subflow yet. Click this to change`
|
||||
}
|
||||
|
||||
if (responseJson.middle !== undefined) {
|
||||
for (var key in responseJson.middle) {
|
||||
for (var subkey in usecasedata.middle) {
|
||||
if (responseJson.middle[key] === usecasedata.middle[key].text) {
|
||||
console.log("Found: ")
|
||||
if (usecasedata.middle[subkey].app_name === undefined || usecasedata.middle[subkey].app_name === "") {
|
||||
usecasedata.middle[subkey].error = `${usecasedata.middle[subkey].type} app must be selected first. Click this to change`
|
||||
} else {
|
||||
usecasedata.middle[subkey].error = `${usecasedata.middle[subkey].app_name} has no public subflow yet. Click this to change`
|
||||
changed = true
|
||||
break
|
||||
}
|
||||
|
||||
changed = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (responseJson.workflow_id !== null && responseJson.workflow_id !== undefined) {
|
||||
if (responseJson.added_auth !== undefined && responseJson.added_auth !== null && responseJson.added_auth.length > 0) {
|
||||
console.log("SHOULD HANDLE AUTH: ", responseJson.added_auth)
|
||||
setConfigureWorkflowAuth(responseJson.added_auth)
|
||||
|
||||
if (setFoundWorkflowId !== undefined) {
|
||||
console.log("Set found workflow id: ", responseJson.workflow_id)
|
||||
setFoundWorkflowId(responseJson.workflow_id)
|
||||
} else {
|
||||
if (!isCloud) {
|
||||
console.log("Not cloud!")
|
||||
setFoundWorkflowId(responseJson.id)
|
||||
setWorkflow(responseJson)
|
||||
} else if (isCloud) {
|
||||
if (responseJson.workflow_id !== null && responseJson.workflow_id !== undefined) {
|
||||
if (responseJson.added_auth !== undefined && responseJson.added_auth !== null && responseJson.added_auth.length > 0) {
|
||||
console.log("SHOULD HANDLE AUTH: ", responseJson.added_auth)
|
||||
setConfigureWorkflowAuth(responseJson.added_auth)
|
||||
|
||||
if (setFoundWorkflowId !== undefined) {
|
||||
console.log("Set found workflow id: ", responseJson.workflow_id)
|
||||
setFoundWorkflowId(responseJson.workflow_id)
|
||||
}
|
||||
|
||||
getWorkflow(responseJson.workflow_id)
|
||||
getAppAuthentication()
|
||||
} else {
|
||||
if (setFoundWorkflowId !== undefined) {
|
||||
console.log("Set found workflow id: ", responseJson.workflow_id)
|
||||
setFoundWorkflowId(responseJson.workflow_id)
|
||||
}
|
||||
|
||||
setWorkflow({"id": responseJson.workflow_id})
|
||||
}
|
||||
}
|
||||
|
||||
getWorkflow(responseJson.workflow_id)
|
||||
getAppAuthentication()
|
||||
} else {
|
||||
if (setFoundWorkflowId !== undefined) {
|
||||
console.log("Set found workflow id: ", responseJson.workflow_id)
|
||||
setFoundWorkflowId(responseJson.workflow_id)
|
||||
if (responseJson.auth_required === true) {
|
||||
console.log("SET AUTH AS NEXT STEP!")
|
||||
}
|
||||
|
||||
setWorkflow({"id": responseJson.workflow_id})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (responseJson.auth_required === true) {
|
||||
console.log("SET AUTH AS NEXT STEP!")
|
||||
|
||||
if (changed === true) {
|
||||
setAllUsecases([usecasedata])
|
||||
}
|
||||
}
|
||||
|
||||
if (changed === true) {
|
||||
setAllUsecases([usecasedata])
|
||||
}
|
||||
})
|
||||
)
|
||||
.catch((error) => {
|
||||
|
||||
@@ -162,7 +162,6 @@ const WelcomeForm = (props) => {
|
||||
if (foundTab !== null && foundTab !== undefined && !isNaN(foundTab)) {
|
||||
if (foundTab === 3 || foundTab === "3") {
|
||||
console.log("SET SEARCH!!")
|
||||
//setclickdiff(240)
|
||||
}
|
||||
} else {
|
||||
//navigate(`/welcome?tab=1`)
|
||||
@@ -298,7 +297,7 @@ const WelcomeForm = (props) => {
|
||||
|
||||
if (activeStep === 0) {
|
||||
console.log("Should send basic information about org (fetch)")
|
||||
setclickdiff(0)
|
||||
setclickdiff(240)
|
||||
navigate(`/welcome?tab=2`)
|
||||
|
||||
if (isCloud) {
|
||||
@@ -321,8 +320,6 @@ const WelcomeForm = (props) => {
|
||||
console.log("Should send secondary info about apps and other things")
|
||||
setDiscoveryWrapper({})
|
||||
|
||||
setclickdiff(240)
|
||||
//setclickdiff(0)
|
||||
navigate(`/welcome?tab=3`)
|
||||
//handleSetSearch("Enrichment", "2. Enrich")
|
||||
handleSetSearch(usecaseButtons[0].name, usecaseButtons[0].usecase)
|
||||
@@ -356,10 +353,8 @@ const WelcomeForm = (props) => {
|
||||
if (getFramework !== undefined) {
|
||||
getFramework()
|
||||
}
|
||||
setclickdiff(0)
|
||||
navigate("/welcome?tab=2")
|
||||
} else if (activeStep === 1) {
|
||||
//setclickdiff(0)
|
||||
navigate("/welcome?tab=1")
|
||||
}
|
||||
};
|
||||
@@ -376,6 +371,7 @@ const WelcomeForm = (props) => {
|
||||
return newSkipped;
|
||||
});
|
||||
};
|
||||
|
||||
const handleReset = () => {
|
||||
setActiveStep(0);
|
||||
};
|
||||
@@ -384,6 +380,7 @@ const WelcomeForm = (props) => {
|
||||
console.log("Selected app changed (effect)")
|
||||
}, [newSelectedApp])
|
||||
|
||||
console.log("Clickdiff: ", clickdiff)
|
||||
|
||||
//const buttonWidth = 145
|
||||
const buttonWidth = 450
|
||||
@@ -434,7 +431,7 @@ const WelcomeForm = (props) => {
|
||||
</Typography>
|
||||
*/}
|
||||
<Typography variant="body1" style={{marginLeft: 8, marginTop: 10, marginRight: 30, }} color="textSecondary">
|
||||
First, we need some more information in order to understand how we best can help you find relevant Usecases. This is optional, but highly encouraged.
|
||||
In order to understand how we best can help you find relevant Usecases, please provide the information below. This is optional, but highly encouraged.
|
||||
</Typography>
|
||||
<Grid item xs={11} style={{marginTop: 16, padding: 0,}}>
|
||||
<TextField
|
||||
@@ -761,7 +758,7 @@ const WelcomeForm = (props) => {
|
||||
disabled={activeStep === 0}
|
||||
onClick={handleBack}
|
||||
variant={"outlined"}
|
||||
style={{marginLeft: 10, height: 64, width: 100, position: "absolute", top: activeStep === 1 ? -594 : -577, left: activeStep === 1 ? 105+clickdiff : -145+clickdiff, }}
|
||||
style={{marginLeft: 10, height: 64, width: 100, position: "absolute", top: activeStep === 1 ? -600 : -577, left: activeStep === 1 ? 105 : -145+clickdiff, }}
|
||||
>
|
||||
Back
|
||||
</Button>
|
||||
@@ -769,7 +766,7 @@ const WelcomeForm = (props) => {
|
||||
variant={"outlined"}
|
||||
color="primary"
|
||||
onClick={handleNext}
|
||||
style={{marginLeft: 10, height: 64, width: 100, position: "absolute", top: activeStep === 1 ? -594 : -577, left: activeStep === 1 ? 758+clickdiff : 510+clickdiff, }}
|
||||
style={{marginLeft: 10, height: 64, width: 100, position: "absolute", top: activeStep === 1 ? -600: -577, left: activeStep === 1 ? 748 : 510+clickdiff, }}
|
||||
disabled={activeStep === 0 ? orgName.length === 0 || name.length === 0 : false}
|
||||
>
|
||||
{activeStep === steps.length - 1 ? "Finish" : "Next"}
|
||||
@@ -804,7 +801,8 @@ const WelcomeForm = (props) => {
|
||||
color="secondary"
|
||||
onClick={() => {
|
||||
console.log("Skip!")
|
||||
|
||||
|
||||
setclickdiff(240)
|
||||
if (isCloud) {
|
||||
ReactGA.event({
|
||||
category: "welcome",
|
||||
|
||||
@@ -309,7 +309,7 @@ const Welcome = (props) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{width: 1000, margin: "auto", backgroundColor: theme.palette.platformColor, paddingBottom: 150, minHeight: 1500,}}>
|
||||
<div style={{width: 1000, margin: "auto", backgroundColor: theme.palette.platformColor, paddingBottom: 150, minHeight: 1500, }}>
|
||||
{/*
|
||||
<div style={{position: "fixed", bottom: 110, right: 110, display: "flex", }}>
|
||||
<img src="/images/Arrow.png" style={{width: 250, height: "100%",}} />
|
||||
@@ -317,7 +317,7 @@ const Welcome = (props) => {
|
||||
*/}
|
||||
{showWelcome === true ?
|
||||
<div>
|
||||
<div style={{minWidth: 500, maxWidth: 500, margin: "auto",}}>
|
||||
<div style={{minWidth: 500, maxWidth: 500, margin: "auto", marginTop: isCloud ? "auto" : 20, }}>
|
||||
<Stepper
|
||||
activeStep={activeStep}
|
||||
color="primary"
|
||||
@@ -430,6 +430,8 @@ const Welcome = (props) => {
|
||||
action: "click_welcome_continue",
|
||||
label: "",
|
||||
})
|
||||
} else {
|
||||
//setActiveStep(1)
|
||||
}
|
||||
|
||||
setShowWelcome(true)
|
||||
|
||||
@@ -569,7 +569,6 @@ const Workflows = (props) => {
|
||||
|
||||
const sidebarKey = "getting_started_sidebar"
|
||||
if (isLoggedIn === true && gettingStartedItems.length === 0 && (userdata.tutorials !== undefined && userdata.tutorials !== null && userdata.tutorials.length > 0) && workflowDone === true) {
|
||||
|
||||
const activeFiltered = userdata.tutorials.filter((item) => item.active === true)
|
||||
if (activeFiltered.length > 0) {
|
||||
var newfiltered = []
|
||||
@@ -583,6 +582,7 @@ const Workflows = (props) => {
|
||||
|
||||
newfiltered.push(activeFiltered[key])
|
||||
}
|
||||
|
||||
setGettingStartedItems(activeFiltered)
|
||||
|
||||
const doneFiltered = activeFiltered.filter((item) => item.done === true)
|
||||
@@ -1583,7 +1583,7 @@ const Workflows = (props) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Grid item xs={isMobile ? 12 : 4} style={{ padding: "12px 10px 12px 10px" }}>
|
||||
<Grid item xs={isMobile || workflows.length === 0 ? 12 : 4} style={{ padding: "12px 10px 12px 10px" }}>
|
||||
<Paper
|
||||
square
|
||||
style={setupPaperStyle}
|
||||
@@ -3710,7 +3710,7 @@ const Workflows = (props) => {
|
||||
color: "white",
|
||||
fontSize: 18,
|
||||
borderLeft: theme.palette.defaultBorder,
|
||||
marginTop: 64,
|
||||
marginTop: 66,
|
||||
borderRadius: "5px 0px 0px 0px",
|
||||
},
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user