Fixed issues in ConfigureWorkflow.jsx & AngularWorkflow.jsx
This commit is contained in:
@@ -264,6 +264,7 @@ const ConfigureWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (workflow.workflow_variables !== undefined && workflow.workflow_variables !== null && workflow.workflow_variables.length !== 0) {
|
||||||
for (let [key,keyval] in workflow.workflow_variables.entries()) {
|
for (let [key,keyval] in workflow.workflow_variables.entries()) {
|
||||||
const variable = workflow.workflow_variables[key];
|
const variable = workflow.workflow_variables[key];
|
||||||
if (
|
if (
|
||||||
@@ -276,7 +277,9 @@ const ConfigureWorkflow = (props) => {
|
|||||||
requiredVariables.push(variable);
|
requiredVariables.push(variable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (workflow.triggers !== undefined && workflow.triggers !== null && workflow.triggers.length !== 0) {
|
||||||
for (let [key,keyval] in workflow.triggers.entries()) {
|
for (let [key,keyval] in workflow.triggers.entries()) {
|
||||||
var trigger = workflow.triggers[key];
|
var trigger = workflow.triggers[key];
|
||||||
trigger.index = key;
|
trigger.index = key;
|
||||||
@@ -326,6 +329,7 @@ const ConfigureWorkflow = (props) => {
|
|||||||
|
|
||||||
requiredTriggers.push(trigger);
|
requiredTriggers.push(trigger);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
requiredTriggers.length === 0 &&
|
requiredTriggers.length === 0 &&
|
||||||
|
|||||||
@@ -1103,26 +1103,26 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
var newBranches = [];
|
var newBranches = [];
|
||||||
var newVBranches = [];
|
var newVBranches = [];
|
||||||
var newComments = [];
|
var newComments = [];
|
||||||
for (let [key,keyval] in cyelements.entries()) {
|
for (let cyelementsKey in cyelements) {
|
||||||
if (cyelements[key].data === undefined) {
|
if (cyelements[cyelementsKey].data === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var type = cyelements[key].data()["type"];
|
var type = cyelements[cyelementsKey].data()["type"];
|
||||||
if (type === undefined) {
|
if (type === undefined) {
|
||||||
if (
|
if (
|
||||||
cyelements[key].data().source === undefined ||
|
cyelements[cyelementsKey].data().source === undefined ||
|
||||||
cyelements[key].data().target === undefined
|
cyelements[cyelementsKey].data().target === undefined
|
||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var parsedElement = {
|
var parsedElement = {
|
||||||
id: cyelements[key].data().id,
|
id: cyelements[cyelementsKey].data().id,
|
||||||
source_id: cyelements[key].data().source,
|
source_id: cyelements[cyelementsKey].data().source,
|
||||||
destination_id: cyelements[key].data().target,
|
destination_id: cyelements[cyelementsKey].data().target,
|
||||||
conditions: cyelements[key].data().conditions,
|
conditions: cyelements[cyelementsKey].data().conditions,
|
||||||
decorator: cyelements[key].data().decorator,
|
decorator: cyelements[cyelementsKey].data().decorator,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (parsedElement.decorator) {
|
if (parsedElement.decorator) {
|
||||||
@@ -1132,7 +1132,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (type === "ACTION") {
|
if (type === "ACTION") {
|
||||||
const cyelement = cyelements[key].data();
|
const cyelement = cyelements[cyelementsKey].data();
|
||||||
const elementid =
|
const elementid =
|
||||||
cyelement.id === undefined || cyelement.id === null
|
cyelement.id === undefined || cyelement.id === null
|
||||||
? cyelement["_id"]
|
? cyelement["_id"]
|
||||||
@@ -1144,10 +1144,10 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
(a["id"] === elementid || a["_id"] === elementid)
|
(a["id"] === elementid || a["_id"] === elementid)
|
||||||
);
|
);
|
||||||
if (curworkflowAction === undefined) {
|
if (curworkflowAction === undefined) {
|
||||||
curworkflowAction = cyelements[key].data();
|
curworkflowAction = cyelements[cyelementsKey].data();
|
||||||
}
|
}
|
||||||
|
|
||||||
curworkflowAction.position = cyelements[key].position();
|
curworkflowAction.position = cyelements[cyelementsKey].position();
|
||||||
|
|
||||||
// workaround to fix some edgecases
|
// workaround to fix some edgecases
|
||||||
if (
|
if (
|
||||||
@@ -1162,8 +1162,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
curworkflowAction.example === "" ||
|
curworkflowAction.example === "" ||
|
||||||
curworkflowAction.example === null
|
curworkflowAction.example === null
|
||||||
) {
|
) {
|
||||||
if (cyelements[key].data().example !== undefined) {
|
if (cyelements[cyelementsKey].data().example !== undefined) {
|
||||||
curworkflowAction.example = cyelements[key].data().example;
|
curworkflowAction.example = cyelements[cyelementsKey].data().example;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1173,8 +1173,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
// Cleans up OpenAPI items
|
// Cleans up OpenAPI items
|
||||||
var newparams = [];
|
var newparams = [];
|
||||||
for (let [key,keyval] in curworkflowAction.parameters.entries()) {
|
for (let parametersKey in curworkflowAction.parameters) {
|
||||||
const thisitem = curworkflowAction.parameters[key];
|
const thisitem = curworkflowAction.parameters[parametersKey];
|
||||||
if (thisitem.name.startsWith("${") && thisitem.name.endsWith("}")) {
|
if (thisitem.name.startsWith("${") && thisitem.name.endsWith("}")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1190,13 +1190,13 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var curworkflowTrigger = useworkflow.triggers.find(
|
var curworkflowTrigger = useworkflow.triggers.find(
|
||||||
(a) => a.id === cyelements[key].data()["id"]
|
(a) => a.id === cyelements[cyelementsKey].data()["id"]
|
||||||
);
|
);
|
||||||
if (curworkflowTrigger === undefined) {
|
if (curworkflowTrigger === undefined) {
|
||||||
curworkflowTrigger = cyelements[key].data();
|
curworkflowTrigger = cyelements[cyelementsKey].data();
|
||||||
}
|
}
|
||||||
|
|
||||||
curworkflowTrigger.position = cyelements[key].position();
|
curworkflowTrigger.position = cyelements[cyelementsKey].position();
|
||||||
if (curworkflowTrigger.canConnect === false) {
|
if (curworkflowTrigger.canConnect === false) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -1208,11 +1208,11 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var curworkflowComment = useworkflow.comments.find(
|
var curworkflowComment = useworkflow.comments.find(
|
||||||
(a) => a.id === cyelements[key].data()["id"]
|
(a) => a.id === cyelements[cyelementsKey].data()["id"]
|
||||||
)
|
)
|
||||||
|
|
||||||
if (curworkflowComment === undefined) {
|
if (curworkflowComment === undefined) {
|
||||||
curworkflowComment = cyelements[key].data();
|
curworkflowComment = cyelements[cyelementsKey].data();
|
||||||
try {
|
try {
|
||||||
curworkflowComment.position.x = parseInt(curworkflowComment.position.x)
|
curworkflowComment.position.x = parseInt(curworkflowComment.position.x)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -1240,7 +1240,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
curworkflowComment.width = 200
|
curworkflowComment.width = 200
|
||||||
}
|
}
|
||||||
|
|
||||||
curworkflowComment.position = cyelements[key].position();
|
curworkflowComment.position = cyelements[cyelementsKey].position();
|
||||||
//console.log(curworkflowComment)
|
//console.log(curworkflowComment)
|
||||||
|
|
||||||
newComments.push(curworkflowComment);
|
newComments.push(curworkflowComment);
|
||||||
@@ -1519,6 +1519,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
if (responseJson.success) {
|
if (responseJson.success) {
|
||||||
var newauth = [];
|
var newauth = [];
|
||||||
|
console.log("App auth: ", responseJson.data);
|
||||||
for (let [key,keyval] in responseJson.data.entries()) {
|
for (let [key,keyval] in responseJson.data.entries()) {
|
||||||
if (responseJson.data[key].defined === false) {
|
if (responseJson.data[key].defined === false) {
|
||||||
continue;
|
continue;
|
||||||
@@ -2026,7 +2027,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
// Wait for new node to possibly be selected
|
// Wait for new node to possibly be selected
|
||||||
//setTimeout(() => {
|
//setTimeout(() => {
|
||||||
const typeIds = cy.elements('node:selected').jsons();
|
const typeIds = cy.elements('node:selected').jsons();
|
||||||
for (let [idkey,idkeyval] in typeIds.entries()) {
|
for (var idkey in typeIds) {
|
||||||
const item = typeIds[idkey]
|
const item = typeIds[idkey]
|
||||||
if (item.data.isButton === true) {
|
if (item.data.isButton === true) {
|
||||||
//console.log("Reselect old node & return - or just return?")
|
//console.log("Reselect old node & return - or just return?")
|
||||||
@@ -2234,6 +2235,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const connected = event.target.connectedEdges().jsons()
|
const connected = event.target.connectedEdges().jsons()
|
||||||
|
if (connected.length > 0 && connected !== undefined) {
|
||||||
for (let [key,keyval] in connected.entries()) {
|
for (let [key,keyval] in connected.entries()) {
|
||||||
const edge = connected[key]
|
const edge = connected[key]
|
||||||
//console.log("EDGE:", edge)
|
//console.log("EDGE:", edge)
|
||||||
@@ -2253,6 +2255,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
currentedge.style('control-point-weight', edgeCurve.weight)
|
currentedge.style('control-point-weight', edgeCurve.weight)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (styledElements.length === 1) {
|
if (styledElements.length === 1) {
|
||||||
console.log(
|
console.log(
|
||||||
@@ -2398,8 +2401,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
if (nodedata.app_name !== undefined) {
|
if (nodedata.app_name !== undefined) {
|
||||||
const allNodes = cy.nodes().jsons();
|
const allNodes = cy.nodes().jsons();
|
||||||
for (let [key,keyval] in allNodes.entries()) {
|
for (var key_ in allNodes) {
|
||||||
const currentNode = allNodes[key];
|
const currentNode = allNodes[key_];
|
||||||
if (currentNode.data.attachedTo === nodedata.id) {
|
if (currentNode.data.attachedTo === nodedata.id) {
|
||||||
cy.getElementById(currentNode.data.id).remove();
|
cy.getElementById(currentNode.data.id).remove();
|
||||||
}
|
}
|
||||||
@@ -2481,8 +2484,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
elementMouseIsOver.style.border = newBorder;
|
elementMouseIsOver.style.border = newBorder;
|
||||||
console.log("STYLED: ", styledElements);
|
console.log("STYLED: ", styledElements);
|
||||||
for (let [key,keyval] in styledElements.entries()) {
|
for (var styledElementsKey in styledElements) {
|
||||||
const curElement = document.getElementById(styledElements[key]);
|
const curElement = document.getElementById(styledElements[styledElementsKey]);
|
||||||
if (curElement !== null && curElement !== undefined) {
|
if (curElement !== null && curElement !== undefined) {
|
||||||
curElement.style.border = curElement.style.original_border;
|
curElement.style.border = curElement.style.original_border;
|
||||||
}
|
}
|
||||||
@@ -2494,8 +2497,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
elementMouseIsOver.id === "cytoscape_view" ||
|
elementMouseIsOver.id === "cytoscape_view" ||
|
||||||
elementMouseIsOver.id === ""
|
elementMouseIsOver.id === ""
|
||||||
) {
|
) {
|
||||||
for (let [key,keyval] in styledElements.entries()) {
|
for (var index in styledElements) {
|
||||||
const curElement = document.getElementById(styledElements[key]);
|
const curElement = document.getElementById(styledElements[index]);
|
||||||
if (curElement !== null && curElement !== undefined) {
|
if (curElement !== null && curElement !== undefined) {
|
||||||
curElement.style.border = curElement.style.original_border;
|
curElement.style.border = curElement.style.original_border;
|
||||||
}
|
}
|
||||||
@@ -2636,8 +2639,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
foundbranch.destination_id === parentNode.data("id")
|
foundbranch.destination_id === parentNode.data("id")
|
||||||
);
|
);
|
||||||
|
|
||||||
for (let [key,keyval] in sourcebranches.entries()) {
|
for (var sourceBranchesKey in sourcebranches) {
|
||||||
var newbranch = JSON.parse(JSON.stringify(sourcebranches[key]));
|
var newbranch = JSON.parse(JSON.stringify(sourcebranches[sourceBranchesKey]));
|
||||||
newbranch.id = uuidv4();
|
newbranch.id = uuidv4();
|
||||||
newbranch.source_id = newNodeData.id;
|
newbranch.source_id = newNodeData.id;
|
||||||
|
|
||||||
@@ -2650,9 +2653,9 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let [key,keyval] in destinationbranches.entries()) {
|
for (var destinationBranchesKey in destinationbranches) {
|
||||||
var newbranch = JSON.parse(
|
var newbranch = JSON.parse(
|
||||||
JSON.stringify(destinationbranches[key])
|
JSON.stringify(destinationbranches[destinationBranchesKey])
|
||||||
);
|
);
|
||||||
newbranch.id = uuidv4();
|
newbranch.id = uuidv4();
|
||||||
newbranch.destination_id = newNodeData.id;
|
newbranch.destination_id = newNodeData.id;
|
||||||
@@ -2729,19 +2732,19 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
console.log("FIND AN ACTION AMONG THE APPS THAT MATCHES NAME: ", parsedname)
|
console.log("FIND AN ACTION AMONG THE APPS THAT MATCHES NAME: ", parsedname)
|
||||||
|
|
||||||
curaction.matching_actions = []
|
curaction.matching_actions = []
|
||||||
for (let [key,keyval] in newapps.entries()) {
|
for (var newAppskey in newapps) {
|
||||||
for (let [subkey,subkeyval] in newapps[key].actions.entries()) {
|
for (let actionsSubkey in newapps[newAppskey].actions) {
|
||||||
const tmpaction = newapps[key].actions[subkey]
|
const tmpaction = newapps[newAppskey].actions[actionsSubkey]
|
||||||
if (tmpaction.name.replaceAll(" ", "_").toLowerCase() === parsedname) {
|
if (tmpaction.name.replaceAll(" ", "_").toLowerCase() === parsedname) {
|
||||||
console.log("MATCH!: ", newapps[key])
|
console.log("MATCH!: ", newapps[newAppskey])
|
||||||
curaction.matching_actions.push({
|
curaction.matching_actions.push({
|
||||||
"app_name": newapps[key].name,
|
"app_name": newapps[newAppskey].name,
|
||||||
"app_version": newapps[key].app_version,
|
"app_version": newapps[newAppskey].app_version,
|
||||||
"app_id": newapps[key].id,
|
"app_id": newapps[newAppskey].id,
|
||||||
"action": tmpaction,
|
"action": tmpaction,
|
||||||
"large_image": newapps[key].large_image,
|
"large_image": newapps[newAppskey].large_image,
|
||||||
"app_index": key,
|
"app_index": newAppskey,
|
||||||
"action_index": subkey,
|
"action_index": actionsSubkey,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2801,12 +2804,12 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
const tmpAuth = JSON.parse(JSON.stringify(newAppAuth));
|
const tmpAuth = JSON.parse(JSON.stringify(newAppAuth));
|
||||||
//var tmpAuth = newAppAuth
|
//var tmpAuth = newAppAuth
|
||||||
|
|
||||||
for (let [key,keyval] in tmpAuth.entries()) {
|
for (var tmpAuthKey in tmpAuth) {
|
||||||
var item = tmpAuth[key];
|
var item = tmpAuth[tmpAuthKey];
|
||||||
|
|
||||||
const newfields = {};
|
const newfields = {};
|
||||||
for (let [filterkey,filterkeyval] in item.fields.entries()) {
|
for (var fieldFilterKey in item.fields) {
|
||||||
newfields[item.fields[filterkey].key] = item.fields[filterkey].value;
|
newfields[item.fields[fieldFilterKey].key] = item.fields[fieldFilterKey].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.fields = newfields;
|
item.fields = newfields;
|
||||||
@@ -2837,20 +2840,20 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
curaction.parameters !== null &&
|
curaction.parameters !== null &&
|
||||||
curaction.parameters.length > 0
|
curaction.parameters.length > 0
|
||||||
) {
|
) {
|
||||||
for (let [key,keyval] in curaction.parameters.entries()) {
|
for (var curActionParamKey in curaction.parameters) {
|
||||||
if (
|
if (
|
||||||
curaction.parameters[key].options !== undefined &&
|
curaction.parameters[curActionParamKey].options !== undefined &&
|
||||||
curaction.parameters[key].options !== null &&
|
curaction.parameters[curActionParamKey].options !== null &&
|
||||||
curaction.parameters[key].options.length > 0 &&
|
curaction.parameters[curActionParamKey].options.length > 0 &&
|
||||||
curaction.parameters[key].value === ""
|
curaction.parameters[curActionParamKey].value === ""
|
||||||
) {
|
) {
|
||||||
curaction.parameters[key].value = curaction.parameters[key].options[0];
|
curaction.parameters[curActionParamKey].value = curaction.parameters[curActionParamKey].options[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("Should check APP if it has the same params as ACTION")
|
console.log("Should check APP if it has the same params as ACTION")
|
||||||
for (let [key,keyval] in curapp.actions.entries()) {
|
for (var actionKey in curapp.actions) {
|
||||||
const tmpaction = curapp.actions[key]
|
const tmpaction = curapp.actions[actionKey]
|
||||||
if (tmpaction.name === curaction.name) {
|
if (tmpaction.name === curaction.name) {
|
||||||
console.log("Found action - needs change?", tmpaction)
|
console.log("Found action - needs change?", tmpaction)
|
||||||
if (tmpaction.parameters !== undefined && tmpaction.parameters !== null && tmpaction.parameters.length > 0) {
|
if (tmpaction.parameters !== undefined && tmpaction.parameters !== null && tmpaction.parameters.length > 0) {
|
||||||
@@ -3195,8 +3198,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
// 2. Check parents in order
|
// 2. Check parents in order
|
||||||
var exampledata = GetExampleResult({ id: "exec", name: "exec" });
|
var exampledata = GetExampleResult({ id: "exec", name: "exec" });
|
||||||
var parentlabel = "exec";
|
var parentlabel = "exec";
|
||||||
for (let [paramkey,paramkeyval] in dstdata.parameters.entries()) {
|
for (var dstdataParamKey in dstdata.parameters) {
|
||||||
const param = dstdata.parameters[paramkey];
|
const param = dstdata.parameters[dstdataParamKey];
|
||||||
// Skip authentication params
|
// Skip authentication params
|
||||||
if (param.configuration) {
|
if (param.configuration) {
|
||||||
continue
|
continue
|
||||||
@@ -3210,10 +3213,10 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
const foundresult = GetParamMatch(paramname, exampledata, "");
|
const foundresult = GetParamMatch(paramname, exampledata, "");
|
||||||
if (foundresult.length > 0) {
|
if (foundresult.length > 0) {
|
||||||
console.log("FOUND ReS for field: ", dstdata.parameters[paramkey].name, foundresult)
|
console.log("FOUND ReS for field: ", dstdata.parameters[dstdataParamKey].name, foundresult)
|
||||||
if (dstdata.parameters[paramkey].value.length === 0) {
|
if (dstdata.parameters[dstdataParamKey].value.length === 0) {
|
||||||
dstdata.parameters[paramkey].value = `$${parentlabel}${foundresult}`;
|
dstdata.parameters[dstdataParamKey].value = `$${parentlabel}${foundresult}`;
|
||||||
dstdata.parameters[paramkey].autocompleted = true
|
dstdata.parameters[dstdataParamKey].autocompleted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3765,8 +3768,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
if (data.app_name !== undefined) {
|
if (data.app_name !== undefined) {
|
||||||
const allNodes = cy.nodes().jsons();
|
const allNodes = cy.nodes().jsons();
|
||||||
for (let [key,keyval] in allNodes.entries()) {
|
for (let allNodesKey in allNodes) {
|
||||||
const currentNode = allNodes[key];
|
const currentNode = allNodes[allNodesKey];
|
||||||
if (currentNode.data.attachedTo === data.id) {
|
if (currentNode.data.attachedTo === data.id) {
|
||||||
cy.getElementById(currentNode.data.id).remove();
|
cy.getElementById(currentNode.data.id).remove();
|
||||||
}
|
}
|
||||||
@@ -4048,11 +4051,18 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
const animationDuration = 150;
|
const animationDuration = 150;
|
||||||
const onNodeHoverOut = (event) => {
|
const onNodeHoverOut = (event) => {
|
||||||
|
// console.log("Hover out: ", event.target.data());
|
||||||
|
|
||||||
const nodedata = event.target.data();
|
const nodedata = event.target.data();
|
||||||
|
// console.log("nodedata", nodedata);
|
||||||
|
// console.log("nodedata.app_name: ", nodedata.app_name);
|
||||||
if (nodedata.app_name !== undefined) {
|
if (nodedata.app_name !== undefined) {
|
||||||
|
|
||||||
const allNodes = cy.nodes().jsons();
|
const allNodes = cy.nodes().jsons();
|
||||||
for (let [key,keyval] in allNodes.entries()) {
|
// console.log("allNodes: ", allNodes)
|
||||||
const currentNode = allNodes[key];
|
for (var nodekey in allNodes) {
|
||||||
|
const currentNode = allNodes[nodekey];
|
||||||
|
// console.log("Current node: ", currentNode);
|
||||||
if (
|
if (
|
||||||
currentNode.data.isButton &&
|
currentNode.data.isButton &&
|
||||||
currentNode.data.attachedTo !== nodedata.id
|
currentNode.data.attachedTo !== nodedata.id
|
||||||
@@ -4071,7 +4081,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
// Skipping node editing if it's the selected one
|
// Skipping node editing if it's the selected one
|
||||||
if (cy !== undefined) {
|
if (cy !== undefined) {
|
||||||
const typeIds = cy.elements('node:selected').jsons();
|
const typeIds = cy.elements('node:selected').jsons();
|
||||||
for (let [idkey,idkeyval] in typeIds.entries()) {
|
for (var idkey in typeIds) {
|
||||||
const item = typeIds[idkey]
|
const item = typeIds[idkey]
|
||||||
if (item.data.id === nodedata.id) {
|
if (item.data.id === nodedata.id) {
|
||||||
return
|
return
|
||||||
@@ -4329,8 +4339,9 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
const allNodes = cy.nodes().jsons();
|
const allNodes = cy.nodes().jsons();
|
||||||
|
|
||||||
var found = false;
|
var found = false;
|
||||||
for (let [key,keyval] in allNodes.entries()) {
|
for (var _key in allNodes) {
|
||||||
const currentNode = allNodes[key];
|
const currentNode = allNodes[_key];
|
||||||
|
// console.log("CURRENT NODE: ", currentNode)
|
||||||
if (
|
if (
|
||||||
(currentNode.data.isButton || currentNode.data.isSuggestion) &&
|
(currentNode.data.isButton || currentNode.data.isSuggestion) &&
|
||||||
currentNode.data.attachedTo !== nodedata.id
|
currentNode.data.attachedTo !== nodedata.id
|
||||||
@@ -4380,7 +4391,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const typeIds = cy.elements('node:selected').jsons();
|
const typeIds = cy.elements('node:selected').jsons();
|
||||||
for (let [idkey,idkeyval] in typeIds) {
|
for (var idkey in typeIds) {
|
||||||
const item = typeIds[idkey]
|
const item = typeIds[idkey]
|
||||||
if (item.data.id === nodedata.id) {
|
if (item.data.id === nodedata.id) {
|
||||||
//console.log("items: ", item.data.id, nodedata.id)
|
//console.log("items: ", item.data.id, nodedata.id)
|
||||||
@@ -4791,8 +4802,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
// Verifies if a branch is valid and skips others
|
// Verifies if a branch is valid and skips others
|
||||||
var newedges = [];
|
var newedges = [];
|
||||||
for (let [key,keyval] in edges.entries()) {
|
for (var edgeKey in edges) {
|
||||||
var item = edges[key];
|
var item = edges[edgeKey];
|
||||||
if (item.data === undefined) {
|
if (item.data === undefined) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -4816,6 +4827,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
const removeNode = (nodeId) => {
|
const removeNode = (nodeId) => {
|
||||||
const selectedNode = cy.getElementById(nodeId);
|
const selectedNode = cy.getElementById(nodeId);
|
||||||
|
// console.log("selected node in removenode", selectedNode);
|
||||||
if (selectedNode.data() === undefined) {
|
if (selectedNode.data() === undefined) {
|
||||||
console.log("No node to remove")
|
console.log("No node to remove")
|
||||||
return;
|
return;
|
||||||
@@ -5139,6 +5151,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
var mappedStartnode = ""
|
var mappedStartnode = ""
|
||||||
const alledges = cy.edges().jsons()
|
const alledges = cy.edges().jsons()
|
||||||
|
if (alledges !== undefined && alledges !== null && alledges.length > 0) {
|
||||||
for (let [key,keyval] in alledges.entries()) {
|
for (let [key,keyval] in alledges.entries()) {
|
||||||
const tmp = alledges[key]
|
const tmp = alledges[key]
|
||||||
console.log("TMP: ", tmp, tmp.data.source)
|
console.log("TMP: ", tmp, tmp.data.source)
|
||||||
@@ -5147,6 +5160,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
alert.info("Creating schedule with name " + trigger.name);
|
alert.info("Creating schedule with name " + trigger.name);
|
||||||
const data = {
|
const data = {
|
||||||
@@ -7457,8 +7471,10 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
|
|
||||||
const handleActionHover = (inside, actionId) => {
|
const handleActionHover = (inside, actionId) => {
|
||||||
var node = cy.getElementById(actionId);
|
var node = cy.getElementById(actionId);
|
||||||
|
console.log("Hovering over action: " + actionId)
|
||||||
if (node.length > 0) {
|
if (node.length > 0) {
|
||||||
if (inside) {
|
if (inside) {
|
||||||
|
console.log("Hovering over action: " + actionId)
|
||||||
node.addClass("shuffle-hover-highlight");
|
node.addClass("shuffle-hover-highlight");
|
||||||
} else {
|
} else {
|
||||||
node.removeClass("shuffle-hover-highlight");
|
node.removeClass("shuffle-hover-highlight");
|
||||||
|
|||||||
Reference in New Issue
Block a user