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