gantt-task-react-powern 0.4.28 → 0.4.30

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.
@@ -1877,8 +1877,7 @@ var Project = function Project(_ref) {
1877
1877
  height: task.height,
1878
1878
  rx: task.barCornerRadius,
1879
1879
  ry: task.barCornerRadius,
1880
- className: styles$8.projectBackground,
1881
- stroke: task.styles.criticalPathColor
1880
+ className: styles$8.projectBackground
1882
1881
  }), React.createElement("rect", {
1883
1882
  x: task.progressX,
1884
1883
  width: task.progressWidth,
@@ -1886,8 +1885,7 @@ var Project = function Project(_ref) {
1886
1885
  height: task.height,
1887
1886
  ry: task.barCornerRadius,
1888
1887
  rx: task.barCornerRadius,
1889
- fill: processColor,
1890
- stroke: task.styles.criticalPathColor
1888
+ fill: processColor
1891
1889
  }), React.createElement("rect", {
1892
1890
  fill: barColor,
1893
1891
  x: task.x1,
@@ -1896,18 +1894,15 @@ var Project = function Project(_ref) {
1896
1894
  height: task.height / 2,
1897
1895
  rx: task.barCornerRadius,
1898
1896
  ry: task.barCornerRadius,
1899
- className: styles$8.projectTop,
1900
- stroke: task.styles.criticalPathColor
1897
+ className: styles$8.projectTop
1901
1898
  }), React.createElement("polygon", {
1902
1899
  className: styles$8.projectTop,
1903
1900
  points: projectLeftTriangle,
1904
- fill: barColor,
1905
- stroke: task.styles.criticalPathColor
1901
+ fill: barColor
1906
1902
  }), React.createElement("polygon", {
1907
1903
  className: styles$8.projectTop,
1908
1904
  points: projectRightTriangle,
1909
- fill: barColor,
1910
- stroke: task.styles.criticalPathColor
1905
+ fill: barColor
1911
1906
  }));
1912
1907
  };
1913
1908
 
@@ -2747,11 +2742,7 @@ var Gantt = function Gantt(_ref) {
2747
2742
  };
2748
2743
 
2749
2744
  function topologicalOrderingHelper(taskID, taskMap, sortedTaskList) {
2750
- if (!taskMap[taskID]) {
2751
- console.log("Dependency on nonleaf " + taskID);
2752
- return true;
2753
- }
2754
-
2745
+ if (!taskMap[taskID]) return true;
2755
2746
  if (taskMap[taskID].finished) return true;
2756
2747
 
2757
2748
  if (taskMap[taskID].started) {
@@ -2817,7 +2808,7 @@ var Gantt = function Gantt(_ref) {
2817
2808
 
2818
2809
  var primaryPath = [];
2819
2810
 
2820
- while (primaryLeaf) {
2811
+ while (primaryLeaf !== undefined) {
2821
2812
  taskMap[primaryLeaf].excluded = true;
2822
2813
  primaryPath.push(taskMap[primaryLeaf].task);
2823
2814
  primaryLeaf = taskMap[primaryLeaf].next;
@@ -2839,11 +2830,12 @@ var Gantt = function Gantt(_ref) {
2839
2830
 
2840
2831
  var secondaryPath = [];
2841
2832
 
2842
- while (secondaryLeaf) {
2833
+ while (secondaryLeaf !== undefined) {
2843
2834
  secondaryPath.push(taskMap[secondaryLeaf].task);
2844
2835
  secondaryLeaf = taskMap[secondaryLeaf].next;
2845
2836
  }
2846
2837
 
2838
+ console.log(primaryPath, secondaryPath);
2847
2839
  return [primaryPath, secondaryPath];
2848
2840
  }
2849
2841
 
@@ -2889,8 +2881,6 @@ var Gantt = function Gantt(_ref) {
2889
2881
  if (longestTask) {
2890
2882
  var _longestTask$styles;
2891
2883
 
2892
- console.log("Colored " + longestTask.id + " " + color);
2893
-
2894
2884
  var _styles = (_longestTask$styles = longestTask.styles) != null ? _longestTask$styles : {};
2895
2885
 
2896
2886
  _styles.criticalPathColor = color;
@@ -2899,16 +2889,27 @@ var Gantt = function Gantt(_ref) {
2899
2889
  }
2900
2890
 
2901
2891
  var _loop = function _loop(_i7) {
2902
- var arrows = path[_i7].criticalPathArrows;
2903
- if (!arrows) arrows = [];
2904
- var arrow = arrows.find(function (arrow) {
2905
- return arrow.taskId === path[_i7 + 1].id;
2906
- });
2907
- if (arrow) arrow.arrowColor = color;else arrows.push({
2908
- taskId: path[_i7 + 1].id,
2909
- arrowColor: color
2910
- });
2911
- path[_i7].criticalPathArrows = arrows;
2892
+ var taskFromTasks = void 0;
2893
+
2894
+ for (var _j = 0; _j < tasks.length; _j++) {
2895
+ if (path[_i7].id === tasks[_j].id) {
2896
+ taskFromTasks = tasks[_j];
2897
+ break;
2898
+ }
2899
+ }
2900
+
2901
+ if (taskFromTasks) {
2902
+ var arrows = taskFromTasks.criticalPathArrows;
2903
+ if (!arrows) arrows = [];
2904
+ var arrow = arrows.find(function (arrow) {
2905
+ return arrow.taskId === path[_i7 + 1].id;
2906
+ });
2907
+ if (arrow) arrow.arrowColor = color;else arrows.push({
2908
+ taskId: path[_i7 + 1].id,
2909
+ arrowColor: color
2910
+ });
2911
+ taskFromTasks.criticalPathArrows = arrows;
2912
+ }
2912
2913
  };
2913
2914
 
2914
2915
  for (var _i7 = 0; _i7 + 1 < path.length; _i7++) {