gantt-task-react-powern 0.6.0 → 0.6.1

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.
@@ -3512,6 +3512,14 @@ function getCriticalPaths(leafTasks) {
3512
3512
  }
3513
3513
  }
3514
3514
 
3515
+ var printedList = taskChainList.map(function (elem) {
3516
+ var newElem = _extends({}, elem);
3517
+
3518
+ newElem.duration = Math.round(elem.duration / 86400000);
3519
+ return newElem;
3520
+ });
3521
+ console.debug(printedList);
3522
+
3515
3523
  if (taskChainList.length > 0) {
3516
3524
  taskChainList.sort(function (a, b) {
3517
3525
  return b.duration - a.duration;
@@ -3623,25 +3631,27 @@ function computeCriticalPath(taskID, taskMap) {
3623
3631
  }
3624
3632
  }
3625
3633
 
3626
- var immediateChildDuration = taskMap[taskID].end - taskMap[taskID].start + depDuration - overlap;
3634
+ if (paths.length === 0) {
3635
+ var immediateChildDuration = taskMap[taskID].end - taskMap[taskID].start + depDuration - overlap;
3627
3636
 
3628
- if (taskMap[taskID].paths.length < 2) {
3629
- taskMap[taskID].paths.push({
3630
- duration: immediateChildDuration,
3631
- task: dependents[j],
3632
- parent: taskID,
3633
- visited: false
3634
- });
3635
- } else if (immediateChildDuration > taskMap[taskID].paths[0].duration) {
3636
- taskMap[taskID].paths[0].duration = immediateChildDuration;
3637
- taskMap[taskID].paths[0].task = dependents[j];
3638
- taskMap[taskID].paths[0].parent = taskID;
3639
- taskMap[taskID].paths[0].visited = false;
3640
- } else if (immediateChildDuration > taskMap[taskID].paths[1].duration) {
3641
- taskMap[taskID].paths[1].duration = immediateChildDuration;
3642
- taskMap[taskID].paths[1].task = dependents[j];
3643
- taskMap[taskID].paths[1].parent = taskID;
3644
- taskMap[taskID].paths[1].visited = false;
3637
+ if (taskMap[taskID].paths.length < 2) {
3638
+ taskMap[taskID].paths.push({
3639
+ duration: immediateChildDuration,
3640
+ task: dependents[j],
3641
+ parent: taskID,
3642
+ visited: false
3643
+ });
3644
+ } else if (immediateChildDuration > taskMap[taskID].paths[0].duration) {
3645
+ taskMap[taskID].paths[0].duration = immediateChildDuration;
3646
+ taskMap[taskID].paths[0].task = dependents[j];
3647
+ taskMap[taskID].paths[0].parent = taskID;
3648
+ taskMap[taskID].paths[0].visited = false;
3649
+ } else if (immediateChildDuration > taskMap[taskID].paths[1].duration) {
3650
+ taskMap[taskID].paths[1].duration = immediateChildDuration;
3651
+ taskMap[taskID].paths[1].task = dependents[j];
3652
+ taskMap[taskID].paths[1].parent = taskID;
3653
+ taskMap[taskID].paths[1].visited = false;
3654
+ }
3645
3655
  }
3646
3656
  }
3647
3657
  }