beta-glozic-workflow 1.26.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -4
- package/dist/utils/taskConfig.js +22 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67,6 +67,7 @@ class Designer extends _react.Component {
|
|
|
67
67
|
this.onUpdateNodes(props);
|
|
68
68
|
});
|
|
69
69
|
_defineProperty(this, "onUpdateNodes", props => {
|
|
70
|
+
const self = this;
|
|
70
71
|
if (props.Nodes && props.Nodes.length != 0) {
|
|
71
72
|
const oldNodes = this.flowchartToJson();
|
|
72
73
|
if (JSON.stringify(oldNodes.definition.actions) != JSON.stringify(props.Nodes) && oldNodes.definition.actions.length == 0 && props.Nodes.length != 0) {
|
|
@@ -126,8 +127,8 @@ class Designer extends _react.Component {
|
|
|
126
127
|
return null; // Return null if there's an error
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
|
-
if (this.nodes[props.options.updatedNodeId].nodeType
|
|
130
|
-
const newBranches = this.nodes[props.options.updatedNodeId].configuration.properties.
|
|
130
|
+
if (['Branch', 'Switch Branch'].includes(this.nodes[props.options.updatedNodeId].nodeType) && this.nodes[props.options.updatedNodeId].configuration) {
|
|
131
|
+
const newBranches = this.nodes[props.options.updatedNodeId].configuration.properties.branchCase;
|
|
131
132
|
const updatedData = updateBranchesByActionID(props.Nodes, props.options.updatedNodeId, newBranches);
|
|
132
133
|
let data = JSON.parse(JSON.stringify(layout));
|
|
133
134
|
data.definition.actions = updatedData;
|
|
@@ -1085,7 +1086,7 @@ class Designer extends _react.Component {
|
|
|
1085
1086
|
//let item = config.taskType[datatype.parent][datatype.type];
|
|
1086
1087
|
let item = taskConfig[datatype.type];
|
|
1087
1088
|
let branches = copyTask ? copyTask.branches ? copyTask.branches.length : null : item.branch;
|
|
1088
|
-
let nodeType = copyTask
|
|
1089
|
+
let nodeType = copyTask && copyTask.nodeType != null ? copyTask.nodeType : item && item.nodeType != null ? item.nodeType : null;
|
|
1089
1090
|
let connections = this.firstInstance.getConnections({
|
|
1090
1091
|
source: source,
|
|
1091
1092
|
target: target
|
|
@@ -1292,7 +1293,7 @@ class Designer extends _react.Component {
|
|
|
1292
1293
|
let topPos = this.nodes[target].element.offsetTop - _workflow.config.nodeGap;
|
|
1293
1294
|
newTopBranchNode.setAttribute('id', topBranchId);
|
|
1294
1295
|
newBotBranchNode.setAttribute('id', botBranchId);
|
|
1295
|
-
if (
|
|
1296
|
+
if (['Branch', 'Switch Branch'].includes(nodeType)) {
|
|
1296
1297
|
newTopBranchNode.className = "fc-item fc-item-draggable fc-item-end-point initial-branch initial-branch-value".concat(i + 1);
|
|
1297
1298
|
} else if (nodeType == "Condition") {
|
|
1298
1299
|
newTopBranchNode.className = "fc-item fc-item-draggable fc-item-end-point initial-if initial-if-value".concat(i + 1);
|
package/dist/utils/taskConfig.js
CHANGED
|
@@ -273,8 +273,28 @@ const taskConfig = exports.taskConfig = {
|
|
|
273
273
|
"actions": []
|
|
274
274
|
}],
|
|
275
275
|
"title": "Branch",
|
|
276
|
-
"nodeType": "
|
|
277
|
-
"name": "
|
|
276
|
+
"nodeType": "Branch",
|
|
277
|
+
"name": "Branch",
|
|
278
|
+
"description": "IF_ELSE(CMP, branch_if_true, branch_if_false)",
|
|
279
|
+
"type": "logic",
|
|
280
|
+
"icon": "random",
|
|
281
|
+
"enabled": true,
|
|
282
|
+
"input": 1,
|
|
283
|
+
"output": 2,
|
|
284
|
+
"branch": 2,
|
|
285
|
+
"code": ["IF(", " CMP((lambda o, e: o.data[var], val, operator), ", " [branch0], ", " [branch1]", ")"]
|
|
286
|
+
},
|
|
287
|
+
"SWITCH_BRANCH": {
|
|
288
|
+
"branches": [{
|
|
289
|
+
"name": "branch0",
|
|
290
|
+
"actions": []
|
|
291
|
+
}, {
|
|
292
|
+
"name": "branch1",
|
|
293
|
+
"actions": []
|
|
294
|
+
}],
|
|
295
|
+
"title": "Branch",
|
|
296
|
+
"nodeType": "Switch Branch",
|
|
297
|
+
"name": "Branch",
|
|
278
298
|
"description": "IF_ELSE(CMP, branch_if_true, branch_if_false)",
|
|
279
299
|
"type": "logic",
|
|
280
300
|
"icon": "random",
|