beta-glozic-workflow 1.0.0 → 1.2.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.
Files changed (2) hide show
  1. package/dist/index.js +27 -16
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -67,11 +67,15 @@ class Designer extends _react.Component {
67
67
  _defineProperty(this, "componentWillReceiveProps", props => {
68
68
  this.onUpdateNodes(props);
69
69
  });
70
+
70
71
  _defineProperty(this, "onUpdateNodes", props => {
71
72
  if (props.Nodes && props.Nodes.length != 0) {
72
- let data = JSON.parse(JSON.stringify(layout));
73
- data.definition.actions = props.Nodes;
74
- this.importedJsonFile(data);
73
+ const oldNodes = this.flowchartToJson()
74
+ if (JSON.stringify(oldNodes.definition.actions) != JSON.stringify(props.Nodes) && (oldNodes.definition.actions.length == 0 && props.Nodes.length != 0)) {
75
+ let data = JSON.parse(JSON.stringify(layout));
76
+ data.definition.actions = props.Nodes;
77
+ this.importedJsonFile(data);
78
+ }
75
79
  }
76
80
  });
77
81
  _defineProperty(this, "onload", async () => {
@@ -144,8 +148,9 @@ class Designer extends _react.Component {
144
148
  self.draged = null;
145
149
  }
146
150
  window.setTimeout(() => {
151
+ console.log("====================151=======================");
147
152
  self.props.onChange(self.flowchartToJson());
148
- }, 300);
153
+ }, 400);
149
154
  }, false);
150
155
  document.addEventListener('click', e => {
151
156
  //console.log(e.target, document.getElementById('designer-form-container'))
@@ -180,7 +185,6 @@ class Designer extends _react.Component {
180
185
  let targetId = target.getAttribute('id');
181
186
  // focus on NODE_END or NODE_START
182
187
  if (targetId === NODE_START || targetId === NODE_END) {
183
- this.props.onChange(this.flowchartToJson());
184
188
  return self.setState({
185
189
  currentNodeFocused: null
186
190
  });
@@ -206,10 +210,8 @@ class Designer extends _react.Component {
206
210
  // })
207
211
  // }
208
212
  //comment by anup Stop
209
- this.props.onNodeClick(actionObj, this.flowchartToJson());
210
- self.setState({
211
- currentNodeFocused: actionObj
212
- });
213
+ this.props.onNodeClick(actionObj);
214
+ self.setState({ currentNodeFocused: actionObj });
213
215
  return;
214
216
  }
215
217
  // not focusing on Node
@@ -378,10 +380,12 @@ class Designer extends _react.Component {
378
380
  y: e.pageY
379
381
  }
380
382
  }).then(ele => {
383
+ console.log("====================385=======================");
381
384
  this.props.onChange(this.flowchartToJson());
382
385
  });
383
386
  } else {
384
387
  window.setTimeout(() => {
388
+ console.log("====================390=======================");
385
389
  this.props.onChange(this.flowchartToJson());
386
390
  }, 300);
387
391
  }
@@ -540,6 +544,7 @@ class Designer extends _react.Component {
540
544
  this.removeAllEndpointOfNode = this.removeAllEndpointOfNode.bind(this);
541
545
  this.handleSubmitTaskForm = this.handleSubmitTaskForm.bind(this);
542
546
  }
547
+ //Componet By anup
543
548
  // componentWillReceiveProps(newProps) {
544
549
  // console.log(newProps.workflowobj)
545
550
  // console.log(newProps.is_import)
@@ -722,8 +727,9 @@ class Designer extends _react.Component {
722
727
  this.setState({
723
728
  popupRenameFormDisplay: false
724
729
  });
725
- this.props.onChange(this.flowchartToJson());
730
+ // this.props.onChange(this.flowchartToJson());
726
731
  }
732
+
727
733
  getOverlayBySourceTarget(source, target) {
728
734
  let o = document.querySelector('.jtk-overlay .workflow--node-dropable-zone[data-source="' + source + '"][data-target="' + target + '"]');
729
735
  //console.log('getOverlayBySourceTarget ', source, target, o)
@@ -953,7 +959,7 @@ class Designer extends _react.Component {
953
959
  })
954
960
  })
955
961
  })).then(() => {
956
- this.props.onChange(this.flowchartToJson());
962
+ // this.props.onChange(this.flowchartToJson());
957
963
  });
958
964
  }
959
965
  }
@@ -966,7 +972,7 @@ class Designer extends _react.Component {
966
972
  display: !this.state.taskPalette.display
967
973
  })
968
974
  }).then(() => {
969
- this.props.onChange(this.flowchartToJson());
975
+ // this.props.onChange(this.flowchartToJson());
970
976
  });
971
977
  }
972
978
  addEndPointToNode(node, position, uuid) {
@@ -1389,21 +1395,26 @@ class Designer extends _react.Component {
1389
1395
  propertiesClone = item.defaultFormData;
1390
1396
  }
1391
1397
  }
1398
+
1399
+ console.log("==================item====================");
1400
+ console.log(item);
1401
+ console.log(copyTask);
1402
+ console.log("==================item====================");
1392
1403
  this.nodes["node-".concat(_count)] = {
1393
1404
  number: _count,
1394
1405
  next: '',
1395
1406
  previous: source,
1396
1407
  next: '',
1397
- actionConfig: copyTask ? copyTask.actionConfig : {},
1398
1408
  configuration: {
1399
1409
  actionID: "node-".concat(_count),
1400
1410
  actionTitle: item.title,
1401
- actionName: copyTask ? copyTask.configuration.actionName : item.name,
1402
1411
  actionImage: item.actionImage,
1403
- properties: propertiesClone,
1412
+ isHidden: false,
1404
1413
  nodeType: item.nodeType,
1414
+ properties: propertiesClone,
1415
+ actionName: copyTask ? copyTask.configuration.actionName : item.name,
1405
1416
  isDisabled: copyTask ? copyTask.configuration.isDisabled : false,
1406
- isHidden: false
1417
+ actionConfig: copyTask ? copyTask.configuration.actionConfig : {}
1407
1418
  },
1408
1419
  branches: null,
1409
1420
  wrapper: item.wrapper,
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "components",
8
8
  "ui"
9
9
  ],
10
- "version": "1.0.0",
10
+ "version": "1.2.0",
11
11
  "private": false,
12
12
  "main": "dist/index.js",
13
13
  "module": "dist/index.js",