beta-glozic-workflow 1.28.0 → 1.34.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 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 == "BRANCH" && this.nodes[props.options.updatedNodeId].configuration) {
130
- const newBranches = this.nodes[props.options.updatedNodeId].configuration.properties.branches;
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 ? copyTask !== null && copyTask !== void 0 && copyTask.nodeType ? copyTask.nodeType : null : item === null || item === void 0 ? void 0 : item.nodeType;
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 (nodeType == "BRANCH") {
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);
@@ -1990,7 +1991,8 @@ class Designer extends _react.Component {
1990
1991
  let endBranchId = "node-botbranch_".concat(i, "-").concat(self.nodes[node].count);
1991
1992
  newData[i] = [];
1992
1993
  let curBranch = Object.assign({}, this.nodes[node].branches[i], {
1993
- actions: []
1994
+ actions: [],
1995
+ name: "branch".concat(i)
1994
1996
  });
1995
1997
  while (cNode !== endBranchId) {
1996
1998
  //console.log('ele in branch ', cNode, this.nodes[cNode])
@@ -273,8 +273,28 @@ const taskConfig = exports.taskConfig = {
273
273
  "actions": []
274
274
  }],
275
275
  "title": "Branch",
276
- "nodeType": "BRANCH",
277
- "name": "BRANCH",
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",
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "components",
8
8
  "ui"
9
9
  ],
10
- "version": "1.28.0",
10
+ "version": "1.34.0",
11
11
  "private": false,
12
12
  "main": "dist/index.js",
13
13
  "module": "dist/index.js",