Updated some workflow issues
This commit is contained in:
@@ -20,7 +20,7 @@ require (
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/h2non/filetype v1.1.3
|
||||
github.com/satori/go.uuid v1.2.0
|
||||
github.com/shuffle/shuffle-shared v0.6.47
|
||||
github.com/shuffle/shuffle-shared v0.6.50
|
||||
golang.org/x/crypto v0.22.0
|
||||
google.golang.org/api v0.176.1
|
||||
google.golang.org/grpc v1.63.2
|
||||
|
||||
@@ -1775,7 +1775,7 @@ const Billing = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
variant="contained"
|
||||
variant="outlined"
|
||||
color="primary"
|
||||
style={{ marginTop: 15, textTransform: 'none' }}
|
||||
onClick={addAlertThreshold}
|
||||
@@ -1783,7 +1783,7 @@ const Billing = (props) => {
|
||||
Add Threshold
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
variant="outlined"
|
||||
color="primary"
|
||||
style={{ marginTop: 15, textTransform: 'none', marginLeft: 20 }}
|
||||
onClick={() => { HandleEditOrgForAlertThreshold(selectedOrganization.id) }}
|
||||
|
||||
@@ -554,7 +554,8 @@ const Header = (props) => {
|
||||
aria-haspopup="true"
|
||||
onClick={(event) => { }}
|
||||
>
|
||||
<svg viewBox="0 0 256 199" width="256" height="199" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" style={{height: 30, width: 30, }}><path d="M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z" fill="#5865F2"/></svg>
|
||||
<svg viewBox="0 0 256 199" width="256" height="199" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid" style={{height: 30, width: 30, }}><path d="M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z" fill="#dadae1"/></svg>
|
||||
{/*#f865f2*/}
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</a>
|
||||
|
||||
@@ -823,7 +823,7 @@ const ParsedAction = (props) => {
|
||||
if (selectedAction.app_name === "Shuffle Tools" && selectedAction.name === "filter_list" && data.name === "input_list") {
|
||||
//console.log("FILTER LIST!: ", event, count, data)
|
||||
const parsedvalue = event.target.value
|
||||
if (parsedvalue.includes("#")) {
|
||||
if (parsedvalue.includes(".#")) {
|
||||
const splitparsed = parsedvalue.split(".#.")
|
||||
//console.log("Cant contain #: ", splitparsed)
|
||||
if (splitparsed.length > 1) {
|
||||
@@ -834,8 +834,24 @@ const ParsedAction = (props) => {
|
||||
|
||||
selectedActionParameters[1].value = splitparsed[1]
|
||||
selectedAction.parameters[1].value = splitparsed[1]
|
||||
forceUpdate = true
|
||||
} else {
|
||||
// Remove .# and after
|
||||
const splitparsed = parsedvalue.split(".#")
|
||||
data.value = splitparsed[0]
|
||||
selectedActionParameters[0].value = splitparsed[0]
|
||||
selectedAction.parameters[0].value = splitparsed[0]
|
||||
|
||||
selectedActionParameters[1].value = ""
|
||||
selectedAction.parameters[1].value = ""
|
||||
|
||||
toast.warn("No value found in the list. Please select an item in the list to filter based on.")
|
||||
}
|
||||
|
||||
forceUpdate = true
|
||||
selectedActionParameters[0].autocompleted = true
|
||||
selectedAction.parameters[0].autocompleted = true
|
||||
selectedActionParameters[1].autocompleted = true
|
||||
selectedAction.parameters[1].autocompleted = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -910,6 +926,7 @@ const ParsedAction = (props) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// bad detection mechanism probably
|
||||
if (event.target.value[event.target.value.length-1] === "." && actionlist.length > 0) {
|
||||
console.log("GET THE LAST ARGUMENT FOR NODE!")
|
||||
@@ -3839,7 +3856,8 @@ const ParsedAction = (props) => {
|
||||
newname = newname.slice(0, newname.length-5)
|
||||
}
|
||||
|
||||
selectedActionParameters[count].value += `{{ $${innerdata.name}.${newname} | size }}`
|
||||
//selectedActionParameters[count].value += `{{ $${innerdata.name}.${newname} | size }}`
|
||||
selectedActionParameters[count].value += `$${innerdata.name}.${newname}`
|
||||
selectedAction.parameters[count].value = selectedActionParameters[count].value;
|
||||
setSelectedAction(selectedAction);
|
||||
setUpdate(Math.random());
|
||||
|
||||
@@ -1568,6 +1568,11 @@ If you're interested, please let me know a time that works for you, or set up a
|
||||
responseJson.lead_info !== null
|
||||
) {
|
||||
var leads = [];
|
||||
console.log("LEADINFO: ", responseJson.lead_info)
|
||||
if (responseJson.lead_info.testing_shuffle) {
|
||||
leads.push("testing shuffle");
|
||||
}
|
||||
|
||||
if (responseJson.lead_info.contacted) {
|
||||
leads.push("contacted");
|
||||
}
|
||||
@@ -3572,7 +3577,7 @@ If you're interested, please let me know a time that works for you, or set up a
|
||||
<FormControl sx={{ m: 1, width: 300 }} style={{}}>
|
||||
<InputLabel id="">Status</InputLabel>
|
||||
<Select
|
||||
style={{ minWidth: 150, maxWidth: 150 }}
|
||||
style={{ minWidth: 150, maxWidth: 150, }}
|
||||
labelId="multiselect-status"
|
||||
id="multiselect-status"
|
||||
multiple
|
||||
@@ -3583,9 +3588,10 @@ If you're interested, please let me know a time that works for you, or set up a
|
||||
MenuProps={MenuProps}
|
||||
>
|
||||
{[
|
||||
"testing shuffle",
|
||||
"contacted",
|
||||
"lead",
|
||||
"demo done",
|
||||
//"demo done",
|
||||
"pov",
|
||||
"customer",
|
||||
"open source",
|
||||
|
||||
@@ -5699,15 +5699,16 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
|
||||
// Checks for errors in edges when they're added
|
||||
const onEdgeAdded = (event) => {
|
||||
const edge = event.target.data()
|
||||
//console.log("EDGE ADDED!: ", edge)
|
||||
setLastSaved(false);
|
||||
const edge = event.target.data();
|
||||
|
||||
//console.log("edge added: ", edge)
|
||||
if (edge.source === undefined && edge.target === undefined) {
|
||||
// console.log("Edge source and target is undefined")
|
||||
return
|
||||
}
|
||||
|
||||
if (edge.readded === true) {
|
||||
// console.log("Readded edge - stopping")
|
||||
console.log("Readded edge - stopping")
|
||||
|
||||
event.target.data("readded", false)
|
||||
return
|
||||
@@ -5716,7 +5717,6 @@ 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")
|
||||
} else {
|
||||
//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") {
|
||||
@@ -5729,17 +5729,17 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
|
||||
console.log("Node: ", targetedge)
|
||||
if (targetedge !== -1) {
|
||||
event.target.remove()
|
||||
|
||||
//console.log("Found branch already!")
|
||||
toast.error("Triggers can have exactly one target node")
|
||||
event.target.remove()
|
||||
return
|
||||
|
||||
|
||||
// name: "Shuffle Workflow",
|
||||
// name: "User Input",
|
||||
} else {
|
||||
// console.log("Node doesn't already have one")
|
||||
console.log("Node doesn't already have one")
|
||||
}
|
||||
}, 50)
|
||||
}
|
||||
@@ -5753,10 +5753,6 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
}
|
||||
}
|
||||
|
||||
if (edge.decorator === true) {
|
||||
// console.log("Doing nothing to branch because decorator")
|
||||
return
|
||||
}
|
||||
|
||||
var targetnode = workflow.triggers.findIndex(
|
||||
(data) => data.id === edge.target
|
||||
@@ -5774,7 +5770,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
if (eventTarget.data("isButton") === true) {
|
||||
const parentNode = cy.getElementById(eventTarget.data("attachedTo"))
|
||||
event.target.remove()
|
||||
// console.log("Setting it to parentnode: ", parentNode.data())
|
||||
console.log("Setting it to parentnode: ", parentNode.data())
|
||||
if (parentNode !== undefined && parentNode !== null) {
|
||||
//event.target.data("target", eventTarget.data("attachedTo"))
|
||||
|
||||
@@ -5796,14 +5792,15 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
}
|
||||
}
|
||||
|
||||
if (eventTarget.data("isDescriptor") === true || eventTarget.data("type") === "COMMENT") {
|
||||
// console.log("Removing because of descriptor or comment")
|
||||
event.target.remove()
|
||||
return
|
||||
if (
|
||||
eventTarget.data("isDescriptor") === true ||
|
||||
eventTarget.data("type") === "COMMENT"
|
||||
) {
|
||||
console.log("Removing because of descriptor or comment")
|
||||
event.target.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
setLastSaved(false)
|
||||
targetnode = -1;
|
||||
|
||||
// Check if:
|
||||
@@ -5811,51 +5808,38 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
// dest == dest && source == source
|
||||
// backend: check all children? to stop recursion
|
||||
var found = false;
|
||||
const branches = cy.edges().jsons()
|
||||
|
||||
const startNode = cy.nodes().jsons().find((node) => node.data.isStartNode === true)
|
||||
var startnodeId = workflow.start
|
||||
if (startNode !== undefined && startNode !== null) {
|
||||
startnodeId = startNode.data.id
|
||||
}
|
||||
|
||||
//for (let branchkey in workflow.branches) {
|
||||
for (let branchkey in branches) {
|
||||
const branch = branches[branchkey].data
|
||||
|
||||
//if (workflow.branches[branchkey].destination_id === edge.source && workflow.branches[branchkey].source_id === edge.target) {
|
||||
if (branch.target === edge.source && branch.source === 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) {
|
||||
} else if (branch.target === edge.target && branch.source === edge.source) {
|
||||
|
||||
if (branch.conditions === undefined) {
|
||||
// Edgehandles
|
||||
} else {
|
||||
// console.log("Removing because the same branch already exists")
|
||||
event.target.remove()
|
||||
|
||||
found = true
|
||||
break
|
||||
}
|
||||
} else if (edge.target === startnodeId) {
|
||||
targetnode = workflow.triggers.findIndex((data) => data.id === edge.source)
|
||||
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();
|
||||
|
||||
found = true;
|
||||
break;
|
||||
} else if (edge.target === workflow.start) {
|
||||
targetnode = workflow.triggers.findIndex(
|
||||
(data) => data.id === edge.source
|
||||
);
|
||||
if (targetnode === -1) {
|
||||
if (targetnode.type !== "TRIGGER") {
|
||||
toast("Can't make arrow to starting node")
|
||||
event.target.remove()
|
||||
break
|
||||
toast("Can't make arrow to starting node");
|
||||
event.target.remove();
|
||||
break;
|
||||
}
|
||||
|
||||
found = true;
|
||||
}
|
||||
//} else if (edge.source === workflow.branches[branchkey].source_id) {
|
||||
} else if (edge.source === branch.source) {
|
||||
} else 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
|
||||
@@ -5899,6 +5883,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
newdst !== null
|
||||
) {
|
||||
const dstdata = RunAutocompleter(newdst.data());
|
||||
//console.log("DST Autocompleter: ", dstdata);
|
||||
}
|
||||
|
||||
var newbranch = {
|
||||
@@ -12550,9 +12535,9 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
let mappingWithName = {}
|
||||
let listWithValues = workflow.triggers[selectedTriggerIndex].parameters[5]?.value.split(";").filter(e => e).map(e => e.split("="))
|
||||
console.log("LIST WITH VALUES: ", listWithValues)
|
||||
// if (listWithValues === undefined || listWithValues === null || listWithValues.length === 0) {
|
||||
// return "no-overrides";
|
||||
// }
|
||||
if (listWithValues === undefined || listWithValues === null || listWithValues.length === 0) {
|
||||
return "no-overrides";
|
||||
}
|
||||
|
||||
for (let i = 0; i < listWithValues.length; i++) {
|
||||
mappingWithName[listWithValues[i][0]] = listWithValues[i][1]
|
||||
@@ -15808,6 +15793,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
right: 0,
|
||||
left: isMobile ? 20 : leftBarSize + 20,
|
||||
top: isMobile ? 30 : appBarSize + 20,
|
||||
pointerEvents: "none",
|
||||
}
|
||||
|
||||
|
||||
@@ -15828,14 +15814,17 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
<div style={topBarStyle}>
|
||||
<div style={{
|
||||
margin: "0px 10px 0px 10px",
|
||||
pointerEvents: "auto",
|
||||
}}>
|
||||
<Breadcrumbs
|
||||
aria-label="breadcrumb"
|
||||
separator="›"
|
||||
style={{
|
||||
color: "white"
|
||||
color: "white",
|
||||
pointerEvents: "auto",
|
||||
}}
|
||||
>
|
||||
|
||||
<Link
|
||||
to="/workflows"
|
||||
style={{ textDecoration: "none", color: "inherit" }}
|
||||
@@ -15852,6 +15841,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
</Link>
|
||||
<h2 style={{
|
||||
margin: 0,
|
||||
pointerEvents: "none",
|
||||
}}>{workflow.name}</h2>
|
||||
</Breadcrumbs>
|
||||
|
||||
@@ -15859,7 +15849,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
isCorrectOrg ? null :
|
||||
<Typography variant="body1">
|
||||
<b>Warning</b>: Change <span
|
||||
style={{color: "#f85a3e", cursor: "pointer"}}
|
||||
style={{color: "#f85a3e", cursor: "pointer", pointerEvents: "auto", }}
|
||||
onClick={() => {
|
||||
toast("Changing to correct organisation. Please wait a few seconds.")
|
||||
|
||||
@@ -16160,7 +16150,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
: null}
|
||||
|
||||
</div>
|
||||
<div style={{display: "flex", marginLeft: 10, }}>
|
||||
<div style={{display: "flex", marginLeft: 10, pointerEvents: "auto", }}>
|
||||
{parentWorkflows.slice(0,5).map((wf, index) => {
|
||||
return (
|
||||
<a href={`/workflows/${wf.id}`} target="_blank" rel="noopener noreferrer" key={index}>
|
||||
@@ -18472,7 +18462,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
</div>
|
||||
|
||||
{foundnotifications > 0 ?
|
||||
<Tooltip title={"This workflow created " + foundnotifications + " notification(s). Click to explore them."} placement="top">
|
||||
<Tooltip title={"This workflow created " + foundnotifications + " notification(s)"} placement="top">
|
||||
<ErrorOutlineIcon
|
||||
style={{color: "rgba(255,255,255,0.4)", marginTop: 10, marginRight: 10, }}
|
||||
onClick={(e) => {
|
||||
@@ -21485,10 +21475,6 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
setElements([])
|
||||
}
|
||||
|
||||
// // Remove all edges
|
||||
// cy.edges().remove()
|
||||
// cy.nodes().remove()
|
||||
|
||||
// Remove all cy nodes
|
||||
setTimeout(() => {
|
||||
setupGraph(newrevision)
|
||||
@@ -21725,6 +21711,8 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
|
||||
const changeActionParameterCodeMirror = (event, count, data, actionlist) => {
|
||||
// Check if event.target.value is an array. If it is, split with comma
|
||||
console.log("1 - SELECTED ACTION: ", selectedAction)
|
||||
console.log("1 - DATA: ", data)
|
||||
|
||||
if (data.startsWith("${") && data.endsWith("}")) {
|
||||
// PARAM FIX - Gonna use the ID field, even though it's a hack
|
||||
@@ -21763,8 +21751,6 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
}
|
||||
|
||||
if (event.target.value[event.target.value.length-1] === "." && actionlist.length > 0) {
|
||||
console.log("GET THE LAST ARGUMENT FOR NODE!")
|
||||
|
||||
var curstring = ""
|
||||
var record = false
|
||||
for (let [key,keyval] in Object.entries(selectedAction.parameters[count].value)) {
|
||||
@@ -21779,7 +21765,6 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
}
|
||||
}
|
||||
|
||||
//console.log("CURSTRING: ", curstring)
|
||||
if (curstring.length > 0 && actionlist !== null) {
|
||||
// Search back in the action list
|
||||
curstring = curstring.split(" ").join("_").toLowerCase()
|
||||
@@ -21800,8 +21785,32 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
}
|
||||
}
|
||||
|
||||
console.log("2 - SELECTED ACTION: ", selectedAction)
|
||||
console.log("2 - DATA: ", data)
|
||||
|
||||
if (selectedAction.app_name === "Shuffle Tools" && selectedAction.name === "filter_list" && count === 0) {
|
||||
const parsedvalue = data
|
||||
console.log("Parsed value: ", parsedvalue)
|
||||
if (parsedvalue.includes("#")) {
|
||||
const splitparsed = parsedvalue.split(".#.")
|
||||
//console.log("Cant contain #: ", splitparsed)
|
||||
if (splitparsed.length > 1) {
|
||||
console.log("IN HERE AY")
|
||||
//data.value = splitparsed[0]
|
||||
|
||||
selectedAction.parameters[0].value = splitparsed[0]
|
||||
selectedAction.parameters[1].value = splitparsed[1]
|
||||
|
||||
selectedAction.parameters[0].autocompleted = true
|
||||
selectedAction.parameters[1].autocompleted = true
|
||||
setUpdate(Math.random())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
selectedAction.parameters[count].autocompleted = false
|
||||
selectedAction.parameters[count].value = data
|
||||
}
|
||||
|
||||
setSelectedAction(selectedAction)
|
||||
//setUpdate(Math.random())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user