@syncfusion/ej2-gantt 20.1.58 → 20.2.36
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/CHANGELOG.md +37 -0
- package/dist/ej2-gantt.umd.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +1100 -74
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +1099 -71
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +2 -2
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +18 -18
- package/src/gantt/actions/actions.d.ts +1 -0
- package/src/gantt/actions/actions.js +1 -0
- package/src/gantt/actions/cell-edit.js +5 -3
- package/src/gantt/actions/connector-line-edit.js +20 -6
- package/src/gantt/actions/context-menu.js +3 -4
- package/src/gantt/actions/critical-path.d.ts +26 -0
- package/src/gantt/actions/critical-path.js +735 -0
- package/src/gantt/actions/dependency.js +3 -0
- package/src/gantt/actions/dialog-edit.js +1 -1
- package/src/gantt/actions/edit.js +29 -3
- package/src/gantt/actions/filter.js +1 -1
- package/src/gantt/actions/keyboard.js +2 -2
- package/src/gantt/actions/selection.js +3 -0
- package/src/gantt/actions/taskbar-edit.js +6 -4
- package/src/gantt/actions/toolbar.js +22 -4
- package/src/gantt/base/css-constants.d.ts +12 -0
- package/src/gantt/base/css-constants.js +12 -0
- package/src/gantt/base/date-processor.d.ts +1 -1
- package/src/gantt/base/date-processor.js +8 -2
- package/src/gantt/base/enum.d.ts +3 -1
- package/src/gantt/base/gantt-chart.js +6 -2
- package/src/gantt/base/gantt-model.d.ts +8 -1
- package/src/gantt/base/gantt.d.ts +32 -1
- package/src/gantt/base/gantt.js +133 -5
- package/src/gantt/base/interface.d.ts +16 -0
- package/src/gantt/base/splitter.js +4 -0
- package/src/gantt/base/task-processor.js +19 -6
- package/src/gantt/base/tree-grid.js +1 -1
- package/src/gantt/export/export-helper.js +19 -6
- package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +16 -0
- package/src/gantt/renderer/chart-rows.js +16 -5
- package/src/gantt/renderer/nonworking-day.js +5 -2
- package/src/gantt/renderer/timeline.js +35 -14
- package/src/global.js +1 -1
- package/styles/bootstrap-dark.css +272 -14
- package/styles/bootstrap.css +271 -14
- package/styles/bootstrap4.css +273 -12
- package/styles/bootstrap5-dark.css +272 -15
- package/styles/bootstrap5.css +272 -15
- package/styles/fabric-dark.css +270 -12
- package/styles/fabric.css +276 -18
- package/styles/fluent-dark.css +272 -14
- package/styles/fluent.css +272 -14
- package/styles/gantt/_bootstrap-dark-definition.scss +59 -16
- package/styles/gantt/_bootstrap-definition.scss +57 -14
- package/styles/gantt/_bootstrap4-definition.scss +65 -21
- package/styles/gantt/_bootstrap5-definition.scss +55 -12
- package/styles/gantt/_fabric-dark-definition.scss +58 -15
- package/styles/gantt/_fabric-definition.scss +58 -15
- package/styles/gantt/_fluent-definition.scss +53 -10
- package/styles/gantt/_fusionnew-definition.scss +212 -0
- package/styles/gantt/_highcontrast-definition.scss +57 -14
- package/styles/gantt/_highcontrast-light-definition.scss +55 -12
- package/styles/gantt/_layout.scss +293 -7
- package/styles/gantt/_material-dark-definition.scss +60 -16
- package/styles/gantt/_material-definition.scss +65 -21
- package/styles/gantt/_material3-definition.scss +213 -0
- package/styles/gantt/_tailwind-definition.scss +52 -8
- package/styles/gantt/_theme.scss +56 -1
- package/styles/gantt/bootstrap-dark.css +272 -14
- package/styles/gantt/bootstrap.css +271 -14
- package/styles/gantt/bootstrap4.css +273 -12
- package/styles/gantt/bootstrap5-dark.css +272 -15
- package/styles/gantt/bootstrap5.css +272 -15
- package/styles/gantt/fabric-dark.css +270 -12
- package/styles/gantt/fabric.css +276 -18
- package/styles/gantt/fluent-dark.css +272 -14
- package/styles/gantt/fluent.css +272 -14
- package/styles/gantt/highcontrast-light.css +260 -13
- package/styles/gantt/highcontrast.css +271 -13
- package/styles/gantt/icons/_bootstrap-dark.scss +12 -1
- package/styles/gantt/icons/_bootstrap.scss +12 -1
- package/styles/gantt/icons/_bootstrap4.scss +12 -1
- package/styles/gantt/icons/_bootstrap5.scss +12 -0
- package/styles/gantt/icons/_fabric-dark.scss +12 -0
- package/styles/gantt/icons/_fabric.scss +12 -0
- package/styles/gantt/icons/_fluent.scss +12 -0
- package/styles/gantt/icons/_fusionnew.scss +120 -0
- package/styles/gantt/icons/_highcontrast.scss +12 -0
- package/styles/gantt/icons/_material-dark.scss +12 -0
- package/styles/gantt/icons/_material.scss +12 -0
- package/styles/gantt/icons/_material3.scss +124 -0
- package/styles/gantt/icons/_tailwind-dark.scss +12 -0
- package/styles/gantt/icons/_tailwind.scss +12 -0
- package/styles/gantt/material-dark.css +277 -12
- package/styles/gantt/material.css +279 -14
- package/styles/gantt/tailwind-dark.css +279 -15
- package/styles/gantt/tailwind.css +276 -12
- package/styles/highcontrast-light.css +260 -13
- package/styles/highcontrast.css +271 -13
- package/styles/material-dark.css +277 -12
- package/styles/material.css +279 -14
- package/styles/tailwind-dark.css +279 -15
- package/styles/tailwind.css +276 -12
|
@@ -390,7 +390,7 @@ class DateProcessor {
|
|
|
390
390
|
* @returns {Date} .
|
|
391
391
|
* @private
|
|
392
392
|
*/
|
|
393
|
-
checkBaselineEndDate(date) {
|
|
393
|
+
checkBaselineEndDate(date, ganttProp) {
|
|
394
394
|
if (isNullOrUndefined(date)) {
|
|
395
395
|
return null;
|
|
396
396
|
}
|
|
@@ -400,7 +400,7 @@ class DateProcessor {
|
|
|
400
400
|
if (hour > this.parent.defaultEndTime) {
|
|
401
401
|
this.setTime(this.parent.defaultEndTime, cloneDate);
|
|
402
402
|
}
|
|
403
|
-
else if (hour <= this.parent.defaultStartTime) {
|
|
403
|
+
else if (hour <= this.parent.defaultStartTime && !ganttProp.isMilestone) {
|
|
404
404
|
cloneDate.setDate(cloneDate.getDate() - 1);
|
|
405
405
|
this.setTime(this.parent.defaultEndTime, cloneDate);
|
|
406
406
|
}
|
|
@@ -1383,6 +1383,12 @@ class DateProcessor {
|
|
|
1383
1383
|
* @private
|
|
1384
1384
|
*/
|
|
1385
1385
|
calculateProjectDates(editArgs) {
|
|
1386
|
+
if (this.parent.isLoad && this.parent.enablePersistence &&
|
|
1387
|
+
this.parent.cloneProjectStartDate && this.parent.cloneProjectEndDate) {
|
|
1388
|
+
this.parent.cloneProjectStartDate = this.getDateFromFormat(this.parent.cloneProjectStartDate);
|
|
1389
|
+
this.parent.cloneProjectEndDate = this.getDateFromFormat(this.parent.cloneProjectEndDate);
|
|
1390
|
+
return;
|
|
1391
|
+
}
|
|
1386
1392
|
const sDate = typeof this.parent.projectStartDate === 'string' ?
|
|
1387
1393
|
new Date(this.parent.projectStartDate) : this.parent.projectStartDate;
|
|
1388
1394
|
const eDate = typeof this.parent.projectEndDate === 'string' ?
|
|
@@ -1578,10 +1584,11 @@ class TaskProcessor extends DateProcessor {
|
|
|
1578
1584
|
const mappingData = new DataManager(dataSource).executeLocal(new Query()
|
|
1579
1585
|
.group(this.parent.taskFields.parentID));
|
|
1580
1586
|
const rootData = [];
|
|
1587
|
+
let index;
|
|
1581
1588
|
for (let i = 0; i < mappingData.length; i++) {
|
|
1582
1589
|
const groupData = mappingData[i];
|
|
1583
1590
|
if (!isNullOrUndefined(groupData.key)) {
|
|
1584
|
-
|
|
1591
|
+
index = this.taskIds.indexOf(groupData.key.toString());
|
|
1585
1592
|
if (index > -1) {
|
|
1586
1593
|
if (!isNullOrUndefined(groupData.key)) {
|
|
1587
1594
|
dataSource[index][this.parent.taskFields.child] = groupData.items;
|
|
@@ -1589,7 +1596,9 @@ class TaskProcessor extends DateProcessor {
|
|
|
1589
1596
|
}
|
|
1590
1597
|
}
|
|
1591
1598
|
}
|
|
1592
|
-
|
|
1599
|
+
if (index !== -1) {
|
|
1600
|
+
rootData.push.apply(rootData, groupData.items); // eslint-disable-line
|
|
1601
|
+
}
|
|
1593
1602
|
}
|
|
1594
1603
|
this.hierarchyData = this.dataReorder(dataSource, rootData);
|
|
1595
1604
|
}
|
|
@@ -1803,7 +1812,7 @@ class TaskProcessor extends DateProcessor {
|
|
|
1803
1812
|
progress = progress ? parseFloat(progress.toString()) ? parseFloat(progress.toString()) : 0 : 0;
|
|
1804
1813
|
const predecessors = data[taskSettings.dependency];
|
|
1805
1814
|
const baselineStartDate = this.getDateFromFormat(data[taskSettings.baselineStartDate], true);
|
|
1806
|
-
|
|
1815
|
+
let baselineEndDate = this.getDateFromFormat(data[taskSettings.baselineEndDate], true);
|
|
1807
1816
|
const ganttData = {};
|
|
1808
1817
|
const ganttProperties = {};
|
|
1809
1818
|
const autoSchedule = (this.parent.taskMode === 'Auto') ? true :
|
|
@@ -1837,7 +1846,11 @@ class TaskProcessor extends DateProcessor {
|
|
|
1837
1846
|
if (baselineEndDate && baselineEndDate.getHours() === 0 && this.parent.defaultEndTime !== 86400) {
|
|
1838
1847
|
this.setTime(this.parent.defaultEndTime, baselineEndDate);
|
|
1839
1848
|
}
|
|
1840
|
-
|
|
1849
|
+
if ((ganttProperties.baselineStartDate && baselineEndDate &&
|
|
1850
|
+
(ganttProperties.baselineStartDate.getTime() > baselineEndDate.getTime())) || ganttProperties.isMilestone) {
|
|
1851
|
+
baselineEndDate = ganttProperties.baselineStartDate;
|
|
1852
|
+
}
|
|
1853
|
+
this.parent.setRecordValue('baselineEndDate', this.checkBaselineEndDate(baselineEndDate, ganttProperties), ganttProperties, true);
|
|
1841
1854
|
this.parent.setRecordValue('progress', progress, ganttProperties, true);
|
|
1842
1855
|
this.parent.setRecordValue('totalProgress', progress, ganttProperties, true);
|
|
1843
1856
|
this.parent.setRecordValue('predecessorsName', predecessors, ganttProperties, true);
|
|
@@ -1858,7 +1871,6 @@ class TaskProcessor extends DateProcessor {
|
|
|
1858
1871
|
!isNullOrUndefined(taskSettings.child)) {
|
|
1859
1872
|
this.parent.setRecordValue(taskSettings.child, [], ganttData);
|
|
1860
1873
|
}
|
|
1861
|
-
this.parent.setRecordValue('baselineEndDate', this.checkBaselineEndDate(baselineEndDate), ganttProperties, true);
|
|
1862
1874
|
if (!isNullOrUndefined(data[taskSettings.child]) && data[taskSettings.child].length > 0) {
|
|
1863
1875
|
this.parent.setRecordValue('hasChildRecords', true, ganttData);
|
|
1864
1876
|
this.parent.setRecordValue('isMilestone', false, ganttProperties, true);
|
|
@@ -2070,6 +2082,13 @@ class TaskProcessor extends DateProcessor {
|
|
|
2070
2082
|
work = parseFloat(work.toFixed(2));
|
|
2071
2083
|
}
|
|
2072
2084
|
}
|
|
2085
|
+
if (ganttData.childRecords.length > 0 && this.parent.isOnEdit) {
|
|
2086
|
+
let childCompletedWorks = 0;
|
|
2087
|
+
for (let i = 0; i < ganttData.childRecords.length; i++) {
|
|
2088
|
+
childCompletedWorks += ganttData.childRecords[i].ganttProperties.work;
|
|
2089
|
+
}
|
|
2090
|
+
work += childCompletedWorks;
|
|
2091
|
+
}
|
|
2073
2092
|
this.parent.setRecordValue('work', work, ganttData.ganttProperties, true);
|
|
2074
2093
|
if (!isNullOrUndefined(this.parent.taskFields.work)) {
|
|
2075
2094
|
this.parent.dataOperation.updateMappingData(ganttData, 'work');
|
|
@@ -2565,7 +2584,7 @@ class TaskProcessor extends DateProcessor {
|
|
|
2565
2584
|
calculateBaselineWidth(ganttProperties) {
|
|
2566
2585
|
const baselineStartDate = this.getDateFromFormat(ganttProperties.baselineStartDate);
|
|
2567
2586
|
const baselineEndDate = this.getDateFromFormat(ganttProperties.baselineEndDate);
|
|
2568
|
-
if (baselineStartDate && baselineEndDate) {
|
|
2587
|
+
if (baselineStartDate && baselineEndDate && (baselineStartDate.getTime() !== baselineEndDate.getTime())) {
|
|
2569
2588
|
return (this.getTaskWidth(baselineStartDate, baselineEndDate));
|
|
2570
2589
|
}
|
|
2571
2590
|
else {
|
|
@@ -3687,7 +3706,7 @@ class TaskProcessor extends DateProcessor {
|
|
|
3687
3706
|
}
|
|
3688
3707
|
this.updateWorkWithDuration(parentData);
|
|
3689
3708
|
let parentWork = parentProp.work;
|
|
3690
|
-
parentWork
|
|
3709
|
+
parentWork = this.parent.isOnEdit ? parentWork : (parentWork + childCompletedWorks);
|
|
3691
3710
|
this.parent.setRecordValue('work', parentWork, parentProp, true);
|
|
3692
3711
|
this.parent.setRecordValue('taskType', 'FixedDuration', parentProp, true);
|
|
3693
3712
|
if (!isNullOrUndefined(this.parent.taskFields.type)) {
|
|
@@ -3758,8 +3777,12 @@ const parentProgressBarInnerDiv = 'e-gantt-parent-progressbar-inner-div';
|
|
|
3758
3777
|
const taskLabel = 'e-task-label';
|
|
3759
3778
|
const childTaskBarInnerDiv = 'e-gantt-child-taskbar-inner-div';
|
|
3760
3779
|
const childProgressBarInnerDiv = 'e-gantt-child-progressbar-inner-div';
|
|
3780
|
+
const criticalChildTaskBarInnerDiv = 'e-gantt-child-critical-taskbar-inner-div';
|
|
3781
|
+
const criticalChildProgressBarInnerDiv = 'e-gantt-child-critical-progressbar-inner-div';
|
|
3761
3782
|
const milestoneTop = 'e-milestone-top';
|
|
3762
3783
|
const milestoneBottom = 'e-milestone-bottom';
|
|
3784
|
+
const criticalMilestoneTop = 'e-critical-milestone-top';
|
|
3785
|
+
const criticalMilestoneBottom = 'e-critical-milestone-bottom';
|
|
3763
3786
|
const baselineBar = 'e-baseline-bar';
|
|
3764
3787
|
const baselineMilestoneContainer = 'e-baseline-gantt-milestone-container';
|
|
3765
3788
|
const baselineMilestoneDiv = 'e-baseline-gantt-milestone';
|
|
@@ -3795,6 +3818,7 @@ const traceManualUnscheduledTask = 'e-gantt-unscheduled-manualtask';
|
|
|
3795
3818
|
const traceParentTaskBar = 'e-gantt-parent-taskbar';
|
|
3796
3819
|
const traceParentProgressBar = 'e-gantt-parent-progressbar';
|
|
3797
3820
|
const traceUnscheduledTask = 'e-gantt-unscheduled-task';
|
|
3821
|
+
const criticalUnscheduledTask = 'e-gantt-critical-unscheduled-taskbar';
|
|
3798
3822
|
const taskIndicatorDiv = 'e-indicator-span';
|
|
3799
3823
|
const leftResizeGripper = 'e-left-resize-gripper';
|
|
3800
3824
|
const rightResizeGripper = 'e-right-resize-gripper';
|
|
@@ -3822,13 +3846,19 @@ const unscheduledMilestoneBottom = 'e-unscheduled-milestone-bottom';
|
|
|
3822
3846
|
const dependencyViewContainer = 'e-gantt-dependency-view-container';
|
|
3823
3847
|
const connectorLineContainer = 'e-connector-line-container';
|
|
3824
3848
|
const connectorLine = 'e-line';
|
|
3849
|
+
const criticalConnectorLine = 'e-criticalconnector-line';
|
|
3850
|
+
const criticalConnectorLineRightArrow = 'e-criticalconnector-line-right-arrow';
|
|
3851
|
+
const criticalConnectorLineLeftArrow = 'e-criticalconnector-line-left-arrow';
|
|
3825
3852
|
const connectorLineRightArrow = 'e-connector-line-right-arrow';
|
|
3826
3853
|
const connectorLineLeftArrow = 'e-connector-line-left-arrow';
|
|
3827
3854
|
const connectorLineZIndex = 'e-connector-line-z-index';
|
|
3828
3855
|
const connectorLineHover = 'e-connector-line-hover';
|
|
3856
|
+
const criticalConnectorLineHover = 'e-critical-connector-line-hover';
|
|
3829
3857
|
const connectorLineHoverZIndex = 'e-connector-line-hover-z-index';
|
|
3830
3858
|
const connectorLineRightArrowHover = 'e-connector-line-right-arrow-hover';
|
|
3831
3859
|
const connectorLineLeftArrowHover = 'e-connector-line-left-arrow-hover';
|
|
3860
|
+
const criticalConnectorLineRightArrowHover = 'e-critical-connector-line-right-arrow-hover';
|
|
3861
|
+
const criticalConnectorLineLeftArrowHover = 'e-critical-connector-line-left-arrow-hover';
|
|
3832
3862
|
|
|
3833
3863
|
const connectorPointLeft = 'e-connectorpoint-left';
|
|
3834
3864
|
const connectorPointRight = 'e-connectorpoint-right';
|
|
@@ -3855,6 +3885,7 @@ const editIcon = 'e-edit';
|
|
|
3855
3885
|
const indentIcon = 'e-indent';
|
|
3856
3886
|
const outdentIcon = 'e-outdent';
|
|
3857
3887
|
const addIcon = 'e-add';
|
|
3888
|
+
|
|
3858
3889
|
const addAboveIcon = 'e-add-above';
|
|
3859
3890
|
const addBelowIcon = 'e-add-below';
|
|
3860
3891
|
//Predecessor touch mode
|
|
@@ -4158,6 +4189,10 @@ class GanttChart {
|
|
|
4158
4189
|
this.parent.predecessorModule.createConnectorLinesCollection();
|
|
4159
4190
|
}
|
|
4160
4191
|
this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);
|
|
4192
|
+
if (this.parent.enableCriticalPath) {
|
|
4193
|
+
let crtiticalModule = this.parent.criticalPathModule;
|
|
4194
|
+
this.parent.criticalPathModule.criticalConnectorLine(crtiticalModule.criticalPathCollection, crtiticalModule.detailPredecessorCollection, this.parent.enableCriticalPath, crtiticalModule.predecessorCollectionTaskIds);
|
|
4195
|
+
}
|
|
4161
4196
|
if (this.parent.viewType === 'ResourceView' && this.parent.showOverAllocation) {
|
|
4162
4197
|
this.renderOverAllocationContainer();
|
|
4163
4198
|
}
|
|
@@ -5035,7 +5070,7 @@ class GanttChart {
|
|
|
5035
5070
|
this.parent.treeGrid.grid.notify('key-pressed', e);
|
|
5036
5071
|
}
|
|
5037
5072
|
}
|
|
5038
|
-
if (!isInEditedState) {
|
|
5073
|
+
if (!isNullOrUndefined(isInEditedState) && !this.parent.editModule.cellEditModule.isCellEdit) {
|
|
5039
5074
|
if (nextElement) {
|
|
5040
5075
|
if ($target.classList.contains('e-rowcell')) {
|
|
5041
5076
|
this.manageFocus($target, 'remove', false);
|
|
@@ -5043,7 +5078,7 @@ class GanttChart {
|
|
|
5043
5078
|
else {
|
|
5044
5079
|
this.manageFocus($target, 'remove', true);
|
|
5045
5080
|
}
|
|
5046
|
-
if (nextElement.classList.contains('e-rowcell') && $target.nextElementSibling) {
|
|
5081
|
+
if ((nextElement.classList.contains('e-rowcell') && $target.nextElementSibling) || $target.classList.contains('e-right-label-container')) {
|
|
5047
5082
|
if (!$target.classList.contains('e-rowcell')) {
|
|
5048
5083
|
this.parent.treeGrid.grid.notify('key-pressed', e);
|
|
5049
5084
|
const fmodule = getValue('focusModule', this.parent.treeGrid.grid);
|
|
@@ -5324,6 +5359,9 @@ class Timeline {
|
|
|
5324
5359
|
this.totalTimelineWidth = 0;
|
|
5325
5360
|
this.customTimelineSettings = null;
|
|
5326
5361
|
this.parent.isTimelineRoundOff = this.isZoomToFit ? false : isNullOrUndefined(this.parent.projectStartDate) ? true : false;
|
|
5362
|
+
if (this.parent.enablePersistence) {
|
|
5363
|
+
this.parent.timelineSettings = this.parent.currentZoomingLevel;
|
|
5364
|
+
}
|
|
5327
5365
|
}
|
|
5328
5366
|
/**
|
|
5329
5367
|
* To render timeline header series.
|
|
@@ -5450,6 +5488,10 @@ class Timeline {
|
|
|
5450
5488
|
this.parent.isTimelineRoundOff = this.isZoomToFit ? false : isNullOrUndefined(this.parent.projectStartDate) ? true : false;
|
|
5451
5489
|
this.processTimelineUnit();
|
|
5452
5490
|
this.parent.updateProjectDates(this.parent.cloneProjectStartDate, this.parent.cloneProjectEndDate, this.parent.isTimelineRoundOff);
|
|
5491
|
+
const criticalModule = this.parent.criticalPathModule;
|
|
5492
|
+
if (this.parent.enableCriticalPath && criticalModule) {
|
|
5493
|
+
criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
5494
|
+
}
|
|
5453
5495
|
if (this.isZooming || this.isZoomToFit) {
|
|
5454
5496
|
const args = {
|
|
5455
5497
|
requestType: this.isZoomIn ? 'AfterZoomIn' : this.isZoomToFit ? 'AfterZoomToProject' : 'AfterZoomOut',
|
|
@@ -5472,6 +5514,9 @@ class Timeline {
|
|
|
5472
5514
|
this.parent.zoomingProjectEndDate = this.parent.cloneProjectEndDate;
|
|
5473
5515
|
}
|
|
5474
5516
|
this.parent.dataOperation.calculateProjectDates();
|
|
5517
|
+
if (this.parent.zoomingProjectStartDate > this.parent.cloneProjectStartDate) {
|
|
5518
|
+
this.parent.cloneProjectStartDate = new Date(this.parent.allowUnscheduledTasks ? this.parent.zoomingProjectStartDate : this.parent.cloneProjectStartDate);
|
|
5519
|
+
}
|
|
5475
5520
|
const timeDifference = (this.parent.cloneProjectEndDate.getTime() - this.parent.cloneProjectStartDate.getTime());
|
|
5476
5521
|
const totalDays = (timeDifference / (1000 * 3600 * 24));
|
|
5477
5522
|
const chartWidth = this.parent.ganttChartModule.chartElement.offsetWidth;
|
|
@@ -6103,7 +6148,7 @@ class Timeline {
|
|
|
6103
6148
|
parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell, isFirstCell);
|
|
6104
6149
|
scheduleDateCollection.push(new Date(startDate.toString()));
|
|
6105
6150
|
if (isFirstCell) {
|
|
6106
|
-
newTime = this.calculateQuarterEndDate(startDate).getTime();
|
|
6151
|
+
newTime = this.calculateQuarterEndDate(startDate, count).getTime();
|
|
6107
6152
|
}
|
|
6108
6153
|
else {
|
|
6109
6154
|
increment = this.getIncrement(startDate, count, mode);
|
|
@@ -6259,19 +6304,29 @@ class Timeline {
|
|
|
6259
6304
|
mode === 'Hour' || mode === 'Minutes') &&
|
|
6260
6305
|
this.parent.nonWorkingDayIndex.indexOf(day.getDay()) !== -1;
|
|
6261
6306
|
}
|
|
6262
|
-
calculateQuarterEndDate(date) {
|
|
6307
|
+
calculateQuarterEndDate(date, count) {
|
|
6263
6308
|
const month = date.getMonth();
|
|
6264
|
-
if (
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6309
|
+
if (count === 3) {
|
|
6310
|
+
if (month >= 0 && month <= 2) {
|
|
6311
|
+
return new Date(date.getFullYear(), 3, 1);
|
|
6312
|
+
}
|
|
6313
|
+
else if (month >= 3 && month <= 5) {
|
|
6314
|
+
return new Date(date.getFullYear(), 6, 1);
|
|
6315
|
+
}
|
|
6316
|
+
else if (month >= 6 && month <= 8) {
|
|
6317
|
+
return new Date(date.getFullYear(), 9, 1);
|
|
6318
|
+
}
|
|
6319
|
+
else {
|
|
6320
|
+
return new Date(date.getFullYear() + 1, 0, 1);
|
|
6321
|
+
}
|
|
6272
6322
|
}
|
|
6273
6323
|
else {
|
|
6274
|
-
|
|
6324
|
+
if (month >= 0 && month <= 5) {
|
|
6325
|
+
return new Date(date.getFullYear(), 6, 1);
|
|
6326
|
+
}
|
|
6327
|
+
else {
|
|
6328
|
+
return new Date(date.getFullYear() + 1, 0, 1);
|
|
6329
|
+
}
|
|
6275
6330
|
}
|
|
6276
6331
|
}
|
|
6277
6332
|
/**
|
|
@@ -6302,7 +6357,7 @@ class Timeline {
|
|
|
6302
6357
|
this.customFormat(scheduleWeeks, format, tier, mode, formatter);
|
|
6303
6358
|
thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
|
|
6304
6359
|
const cellWidth = thWidth;
|
|
6305
|
-
thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks))
|
|
6360
|
+
thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks, count))
|
|
6306
6361
|
: thWidth;
|
|
6307
6362
|
const isWeekendCell = this.isWeekendHeaderCell(mode, tier, scheduleWeeks);
|
|
6308
6363
|
const textClassName = tier === 'topTier' ? ' e-gantt-top-cell-text' : '';
|
|
@@ -6652,8 +6707,9 @@ class Timeline {
|
|
|
6652
6707
|
if (type === 'prevTimeSpan' && isFrom === 'publicMethod') {
|
|
6653
6708
|
this.parent.ganttChartModule.updateScrollLeft(0);
|
|
6654
6709
|
}
|
|
6655
|
-
else if (type === 'nextTimeSpan' && isFrom === 'publicMethod') {
|
|
6656
|
-
|
|
6710
|
+
else if ((type === 'nextTimeSpan' && isFrom === 'publicMethod') || (type === 'nextTimeSpan' && isFrom === 'TaskbarEditing')) {
|
|
6711
|
+
let currentScrollLeft = document.getElementsByClassName('e-chart-scroll-container e-content')[0].scrollLeft;
|
|
6712
|
+
this.parent.element.querySelector('.e-timeline-header-container').scrollLeft = currentScrollLeft;
|
|
6657
6713
|
}
|
|
6658
6714
|
this.parent.timelineModule.timeSpanActionEvent('actionComplete', type, isFrom);
|
|
6659
6715
|
}
|
|
@@ -6889,7 +6945,7 @@ class GanttTreeGrid {
|
|
|
6889
6945
|
const scrollWidth = this.getScrollbarWidth();
|
|
6890
6946
|
const isMobile = /Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
6891
6947
|
if (scrollWidth !== 0) {
|
|
6892
|
-
content.style.cssText += 'width: calc(100% + ' + (scrollWidth + 1) + 'px);';
|
|
6948
|
+
content.style.cssText += 'width: calc(100% + ' + (scrollWidth + 1) + 'px);'; //actual scrollbar width 17 px but here scrollbar width set to 16px hence adding increment of 1
|
|
6893
6949
|
}
|
|
6894
6950
|
else {
|
|
6895
6951
|
content.classList.add('e-gantt-scroll-padding');
|
|
@@ -8048,7 +8104,7 @@ class ChartRows extends DateProcessor {
|
|
|
8048
8104
|
'border-bottom-right-radius:' + this.getBorderRadius(data.ganttProperties) + 'px;">' +
|
|
8049
8105
|
'</div>');
|
|
8050
8106
|
}
|
|
8051
|
-
|
|
8107
|
+
const tempDiv = createElement('div');
|
|
8052
8108
|
if (this.taskLabelTemplateFunction && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
|
|
8053
8109
|
const taskLabelTemplateNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressDiv[0]);
|
|
8054
8110
|
if (taskLabelTemplateNode && taskLabelTemplateNode.length > 0) {
|
|
@@ -8061,7 +8117,8 @@ class ChartRows extends DateProcessor {
|
|
|
8061
8117
|
labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
|
|
8062
8118
|
}
|
|
8063
8119
|
if (labelString.indexOf('null') === -1) {
|
|
8064
|
-
if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
|
|
8120
|
+
if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
|
|
8121
|
+
!this.isTemplate(this.parent.labelSettings.taskLabel)) {
|
|
8065
8122
|
labelString = '';
|
|
8066
8123
|
}
|
|
8067
8124
|
if (isNaN(parseInt(labelString))) {
|
|
@@ -8111,7 +8168,7 @@ class ChartRows extends DateProcessor {
|
|
|
8111
8168
|
progressDiv[0].querySelectorAll('.e-task-label')[0].children[0])
|
|
8112
8169
|
progressDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
|
|
8113
8170
|
if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
|
|
8114
|
-
childLabel && !childLabel['elementRef'] && tempDiv.innerHTML
|
|
8171
|
+
childLabel && !childLabel['elementRef'] && tempDiv.innerHTML !== '')
|
|
8115
8172
|
progressDiv[0].querySelectorAll('.e-task-label')[0].textContent = childLabel;
|
|
8116
8173
|
}
|
|
8117
8174
|
if (!isNullOrUndefined(taskbarInnerDiv) && taskbarInnerDiv.length > 0) {
|
|
@@ -8129,6 +8186,13 @@ class ChartRows extends DateProcessor {
|
|
|
8129
8186
|
let splitTasks = '';
|
|
8130
8187
|
for (let i = 0; i < data.ganttProperties.segments.length; i++) {
|
|
8131
8188
|
const segment = data.ganttProperties.segments[i];
|
|
8189
|
+
let progressBarVisible;
|
|
8190
|
+
if (!segment.showProgress) {
|
|
8191
|
+
progressBarVisible = 'hidden';
|
|
8192
|
+
}
|
|
8193
|
+
else {
|
|
8194
|
+
progressBarVisible = 'initial';
|
|
8195
|
+
}
|
|
8132
8196
|
const segmentPosition = (i === 0) ? 'e-segment-first' : (i === data.ganttProperties.segments.length - 1)
|
|
8133
8197
|
? 'e-segment-last' : 'e-segment-inprogress';
|
|
8134
8198
|
splitTasks += (
|
|
@@ -8136,7 +8200,7 @@ class ChartRows extends DateProcessor {
|
|
|
8136
8200
|
'<div class="' + childTaskBarInnerDiv + ' ' + segmentPosition + ' ' + traceChildTaskBar + ' ' +
|
|
8137
8201
|
' e-segmented-taskbar' +
|
|
8138
8202
|
'"style="width:' + segment.width + 'px;position: absolute; left:' + segment.left + 'px;height:' +
|
|
8139
|
-
(this.taskBarHeight) + 'px; overflow:
|
|
8203
|
+
(this.taskBarHeight) + 'px; overflow:' + progressBarVisible + ';" data-segment-index = "' + i + '" aria-label = "' +
|
|
8140
8204
|
this.generateSpiltTaskAriaLabel(segment, data.ganttProperties) + '"> ' +
|
|
8141
8205
|
this.getSplitTaskbarLeftResizerNode() +
|
|
8142
8206
|
//split progress bar
|
|
@@ -8258,6 +8322,7 @@ class ChartRows extends DateProcessor {
|
|
|
8258
8322
|
this.parent.dataOperation.updateMappingData(mergeData, 'segments');
|
|
8259
8323
|
if (segments.length === 1) {
|
|
8260
8324
|
this.parent.setRecordValue('endDate', endDate, mergeData.ganttProperties, true);
|
|
8325
|
+
this.parent.setRecordValue('EndDate', endDate, mergeData, true);
|
|
8261
8326
|
this.parent.setRecordValue('segments', null, mergeData.ganttProperties, true);
|
|
8262
8327
|
this.parent.dataOperation.updateMappingData(mergeData, 'segments');
|
|
8263
8328
|
}
|
|
@@ -8426,6 +8491,7 @@ class ChartRows extends DateProcessor {
|
|
|
8426
8491
|
else {
|
|
8427
8492
|
startDate = new Date(splitDate.getTime());
|
|
8428
8493
|
startDate.setDate(startDate.getDate() + 1 + increment);
|
|
8494
|
+
this.setTime(this.parent.defaultStartTime, startDate);
|
|
8429
8495
|
startDate = this.parent.dataOperation.checkStartDate(startDate, ganttProp, false);
|
|
8430
8496
|
segmentEndDate = new Date(endDate.getTime());
|
|
8431
8497
|
segmentEndDate.setDate(segmentEndDate.getDate() + 1);
|
|
@@ -8686,7 +8752,7 @@ class ChartRows extends DateProcessor {
|
|
|
8686
8752
|
'width:' + data.ganttProperties.progressWidth + 'px;' +
|
|
8687
8753
|
'border-top-right-radius:' + this.getBorderRadius(data) + 'px;' +
|
|
8688
8754
|
'border-bottom-right-radius:' + this.getBorderRadius(data) + 'px;height:100%;"></div>');
|
|
8689
|
-
|
|
8755
|
+
const div = createElement('div');
|
|
8690
8756
|
if (this.taskLabelTemplateFunction) {
|
|
8691
8757
|
const parentTaskLabelNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressBarInnerDiv[0]);
|
|
8692
8758
|
if (parentTaskLabelNode && parentTaskLabelNode.length > 0) {
|
|
@@ -8699,7 +8765,8 @@ class ChartRows extends DateProcessor {
|
|
|
8699
8765
|
labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
|
|
8700
8766
|
}
|
|
8701
8767
|
if (labelString.indexOf('null') === -1) {
|
|
8702
|
-
if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
|
|
8768
|
+
if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
|
|
8769
|
+
!this.isTemplate(this.parent.labelSettings.taskLabel)) {
|
|
8703
8770
|
labelString = '';
|
|
8704
8771
|
}
|
|
8705
8772
|
if (isNaN(parseInt(labelString))) {
|
|
@@ -8728,7 +8795,7 @@ class ChartRows extends DateProcessor {
|
|
|
8728
8795
|
progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0])
|
|
8729
8796
|
progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
|
|
8730
8797
|
if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
|
|
8731
|
-
parentLabel && !parentLabel['elementRef'] && div.innerHTML
|
|
8798
|
+
parentLabel && !parentLabel['elementRef'] && div.innerHTML !== '')
|
|
8732
8799
|
progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent = parentLabel;
|
|
8733
8800
|
}
|
|
8734
8801
|
const milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
|
|
@@ -10280,6 +10347,9 @@ class Dependency {
|
|
|
10280
10347
|
updateConnectorLineObject(parentGanttRecord, childGanttRecord, predecessor) {
|
|
10281
10348
|
const connectorObj = this.parent.connectorLineModule.createConnectorLineObject(parentGanttRecord, childGanttRecord, predecessor);
|
|
10282
10349
|
if (connectorObj) {
|
|
10350
|
+
if (childGanttRecord.isCritical && parentGanttRecord.isCritical) {
|
|
10351
|
+
connectorObj.isCritical = true;
|
|
10352
|
+
}
|
|
10283
10353
|
if ((this.parent.connectorLineIds.length > 0 && this.parent.connectorLineIds.indexOf(connectorObj.connectorLineId) === -1) ||
|
|
10284
10354
|
this.parent.connectorLineIds.length === 0) {
|
|
10285
10355
|
this.parent.updatedConnectorLineCollection.push(connectorObj);
|
|
@@ -11350,6 +11420,7 @@ class Splitter$1 {
|
|
|
11350
11420
|
this.splitterObject = new Splitter({
|
|
11351
11421
|
height: null,
|
|
11352
11422
|
width: this.parent.ganttWidth.toString(),
|
|
11423
|
+
enablePersistence: this.parent.enablePersistence,
|
|
11353
11424
|
separatorSize: this.parent.splitterSettings.separatorSize,
|
|
11354
11425
|
paneSettings: [
|
|
11355
11426
|
{
|
|
@@ -11401,6 +11472,9 @@ class Splitter$1 {
|
|
|
11401
11472
|
* @private
|
|
11402
11473
|
*/
|
|
11403
11474
|
calculateSplitterPosition(splitter$$1, isDynamic) {
|
|
11475
|
+
if (!isNullOrUndefined(this.splitterObject) && this.parent.enablePersistence) {
|
|
11476
|
+
return this.splitterObject.paneSettings[0].size;
|
|
11477
|
+
}
|
|
11404
11478
|
if (splitter$$1.view === 'Grid') {
|
|
11405
11479
|
return '100%';
|
|
11406
11480
|
}
|
|
@@ -12097,8 +12171,8 @@ class FocusModule {
|
|
|
12097
12171
|
break;
|
|
12098
12172
|
}
|
|
12099
12173
|
case 'delete':
|
|
12100
|
-
if (ganttObj.selectionModule && ganttObj.editModule &&
|
|
12101
|
-
(ganttObj.editModule.dialogModule.dialogObj &&
|
|
12174
|
+
if (ganttObj.selectionModule && ganttObj.editModule && ganttObj.editModule.dialogModule &&
|
|
12175
|
+
(!ganttObj.editModule.dialogModule.dialogObj || (ganttObj.editModule.dialogModule.dialogObj &&
|
|
12102
12176
|
!ganttObj.editModule.dialogModule.dialogObj.visible)) && (!ganttObj.editSettings.allowTaskbarEditing
|
|
12103
12177
|
|| (ganttObj.editSettings.allowTaskbarEditing && !ganttObj.editModule.taskbarEditModule.touchEdit))) {
|
|
12104
12178
|
if ((ganttObj.selectionSettings.mode !== 'Cell' && ganttObj.selectionModule.selectedRowIndexes.length)
|
|
@@ -12285,6 +12359,7 @@ let Gantt = class Gantt extends Component {
|
|
|
12285
12359
|
* @private
|
|
12286
12360
|
*/
|
|
12287
12361
|
this.isEdit = false;
|
|
12362
|
+
setValue('mergePersistData', this.mergePersistGanttData, this);
|
|
12288
12363
|
}
|
|
12289
12364
|
/**
|
|
12290
12365
|
* To get the module name
|
|
@@ -12354,8 +12429,10 @@ let Gantt = class Gantt extends Component {
|
|
|
12354
12429
|
this.dataOperation.getNonWorkingDayIndex();
|
|
12355
12430
|
this.columnMapping = {};
|
|
12356
12431
|
this.controlId = this.element.id;
|
|
12357
|
-
this.cloneProjectStartDate =
|
|
12358
|
-
|
|
12432
|
+
this.cloneProjectStartDate = this.enablePersistence && this.cloneProjectStartDate ?
|
|
12433
|
+
this.cloneProjectStartDate : null;
|
|
12434
|
+
this.cloneProjectEndDate = this.enablePersistence && this.cloneProjectEndDate ?
|
|
12435
|
+
this.cloneProjectEndDate : null;
|
|
12359
12436
|
this.totalHolidayDates = this.dataOperation.getHolidayDates();
|
|
12360
12437
|
this.ganttChartModule = new GanttChart(this);
|
|
12361
12438
|
this.timelineModule = new Timeline(this);
|
|
@@ -12622,6 +12699,10 @@ let Gantt = class Gantt extends Component {
|
|
|
12622
12699
|
this.updateRowHeightInConnectorLine(this.updatedConnectorLineCollection);
|
|
12623
12700
|
this.connectorLineModule.renderConnectorLines(this.updatedConnectorLineCollection);
|
|
12624
12701
|
}
|
|
12702
|
+
if (this.enableCriticalPath) {
|
|
12703
|
+
let criticalModule = this.criticalPathModule;
|
|
12704
|
+
this.criticalPathModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
12705
|
+
}
|
|
12625
12706
|
}
|
|
12626
12707
|
}
|
|
12627
12708
|
keyActionHandler(e) {
|
|
@@ -12952,6 +13033,38 @@ let Gantt = class Gantt extends Component {
|
|
|
12952
13033
|
const value = this.dateValidationModule.getWorkString(work, workUnit);
|
|
12953
13034
|
return value;
|
|
12954
13035
|
}
|
|
13036
|
+
updateTreeColumns() {
|
|
13037
|
+
let temp;
|
|
13038
|
+
var field;
|
|
13039
|
+
let gridColumns = this.treeGrid.grid.getColumns();
|
|
13040
|
+
if (this.treeColumnIndex !== -1 && this.columns[this.treeColumnIndex] &&
|
|
13041
|
+
!isNullOrUndefined(this.columns[this.treeColumnIndex]['template'])) {
|
|
13042
|
+
temp = this.columns[this.treeColumnIndex]['template'];
|
|
13043
|
+
field = this.columns[this.treeColumnIndex]['field'];
|
|
13044
|
+
}
|
|
13045
|
+
let gridColumn;
|
|
13046
|
+
for (let i = 0; i < gridColumns.length; i++) {
|
|
13047
|
+
gridColumn = {};
|
|
13048
|
+
for (let j = 0; j < this.columns.length; j++) {
|
|
13049
|
+
if (this.columns[j]['field'] == gridColumns[i].field) {
|
|
13050
|
+
for (const prop of Object.keys(this.columns[j])) {
|
|
13051
|
+
if (!isUndefined(this.columns[j][prop])) {
|
|
13052
|
+
gridColumn[prop] = gridColumns[i][prop];
|
|
13053
|
+
}
|
|
13054
|
+
gridColumn.visible = gridColumns[i].visible;
|
|
13055
|
+
gridColumn.width = gridColumns[i].width;
|
|
13056
|
+
}
|
|
13057
|
+
this.columns[j] = (gridColumn);
|
|
13058
|
+
if (this.columns[j]['type'] !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
13059
|
+
this.columns[j]['template'] = temp;
|
|
13060
|
+
}
|
|
13061
|
+
}
|
|
13062
|
+
}
|
|
13063
|
+
}
|
|
13064
|
+
if (this.columns.length > 0) {
|
|
13065
|
+
this.treeGrid.setProperties({ columns: this.columns }, true);
|
|
13066
|
+
}
|
|
13067
|
+
}
|
|
12955
13068
|
/**
|
|
12956
13069
|
*
|
|
12957
13070
|
* @param {object} args .
|
|
@@ -12972,6 +13085,9 @@ let Gantt = class Gantt extends Component {
|
|
|
12972
13085
|
this.splitterElement.style.height = '100%';
|
|
12973
13086
|
}
|
|
12974
13087
|
if (this.isLoad) {
|
|
13088
|
+
if (this.enablePersistence) {
|
|
13089
|
+
this.updateTreeColumns();
|
|
13090
|
+
}
|
|
12975
13091
|
this.updateCurrentViewData();
|
|
12976
13092
|
if (!this.enableVirtualization) {
|
|
12977
13093
|
this.updateContentHeight();
|
|
@@ -13001,7 +13117,14 @@ let Gantt = class Gantt extends Component {
|
|
|
13001
13117
|
else {
|
|
13002
13118
|
this.getCurrentRecords(args);
|
|
13003
13119
|
}
|
|
13120
|
+
if (this.enableCriticalPath && this.criticalPathModule) {
|
|
13121
|
+
this.criticalPathModule.showCriticalPath(this.enableCriticalPath);
|
|
13122
|
+
}
|
|
13004
13123
|
this.notify('recordsUpdated', {});
|
|
13124
|
+
if (this.enableCriticalPath && this.criticalPathModule) {
|
|
13125
|
+
let criticalModule = this.criticalPathModule;
|
|
13126
|
+
this.criticalPathModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
13127
|
+
}
|
|
13005
13128
|
this.initialChartRowElements = this.ganttChartModule.getChartRows();
|
|
13006
13129
|
this.isLoad = false;
|
|
13007
13130
|
this.trigger('dataBound', args);
|
|
@@ -13089,6 +13212,7 @@ let Gantt = class Gantt extends Component {
|
|
|
13089
13212
|
}
|
|
13090
13213
|
break;
|
|
13091
13214
|
case 'timezone':
|
|
13215
|
+
case 'enableCriticalPath':
|
|
13092
13216
|
this.dataOperation.checkDataBinding(true);
|
|
13093
13217
|
break;
|
|
13094
13218
|
case 'filterSettings':
|
|
@@ -13256,15 +13380,42 @@ let Gantt = class Gantt extends Component {
|
|
|
13256
13380
|
}
|
|
13257
13381
|
}
|
|
13258
13382
|
/**
|
|
13259
|
-
*
|
|
13383
|
+
* Returns the properties to be maintained in persisted state.
|
|
13260
13384
|
*
|
|
13261
13385
|
* @returns {string} .
|
|
13262
13386
|
* @private
|
|
13263
13387
|
*/
|
|
13264
13388
|
getPersistData() {
|
|
13265
|
-
const keyEntity = ['
|
|
13389
|
+
const keyEntity = ['sortSettings',
|
|
13390
|
+
'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex', 'treeColumnIndex', 'currentZoomingLevel', 'cloneProjectStartDate', 'cloneProjectEndDate'];
|
|
13391
|
+
const ignoreOnPersist = {
|
|
13392
|
+
filterSettings: ['type', 'mode', 'showFilterBarStatus', 'immediateModeDelay', 'ignoreAccent', 'hierarchyMode'],
|
|
13393
|
+
searchSettings: ['fields', 'operator', 'ignoreCase'],
|
|
13394
|
+
sortSettings: [], columns: [], selectedRowIndex: []
|
|
13395
|
+
};
|
|
13396
|
+
const ignoreOnColumn = ['filter', 'edit', 'filterBarTemplate', 'headerTemplate', 'template',
|
|
13397
|
+
'commandTemplate', 'commands', 'dataSource'];
|
|
13398
|
+
for (let i = 0; i < keyEntity.length; i++) {
|
|
13399
|
+
const currentObject = this[keyEntity[i]];
|
|
13400
|
+
for (let k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
|
|
13401
|
+
const objVal = val[k];
|
|
13402
|
+
delete currentObject[objVal];
|
|
13403
|
+
}
|
|
13404
|
+
}
|
|
13405
|
+
this.ignoreInArrays(ignoreOnColumn, this.columns);
|
|
13266
13406
|
return this.addOnPersist(keyEntity);
|
|
13267
13407
|
}
|
|
13408
|
+
ignoreInArrays(ignoreOnColumn, columns) {
|
|
13409
|
+
for (let i = 0; i < columns.length; i++) {
|
|
13410
|
+
this.ignoreInColumn(ignoreOnColumn, columns[i]);
|
|
13411
|
+
}
|
|
13412
|
+
}
|
|
13413
|
+
ignoreInColumn(ignoreOnColumn, column) {
|
|
13414
|
+
for (let i = 0; i < ignoreOnColumn.length; i++) {
|
|
13415
|
+
delete column[ignoreOnColumn[i]];
|
|
13416
|
+
column.filter = {};
|
|
13417
|
+
}
|
|
13418
|
+
}
|
|
13268
13419
|
/**
|
|
13269
13420
|
* @returns {void} .
|
|
13270
13421
|
* @private
|
|
@@ -13347,6 +13498,12 @@ let Gantt = class Gantt extends Component {
|
|
|
13347
13498
|
args: [this]
|
|
13348
13499
|
});
|
|
13349
13500
|
}
|
|
13501
|
+
if (this.enableCriticalPath) {
|
|
13502
|
+
modules.push({
|
|
13503
|
+
member: 'criticalPath',
|
|
13504
|
+
args: [this]
|
|
13505
|
+
});
|
|
13506
|
+
}
|
|
13350
13507
|
if (this.allowResizing) {
|
|
13351
13508
|
modules.push({
|
|
13352
13509
|
member: 'resize',
|
|
@@ -13424,6 +13581,17 @@ let Gantt = class Gantt extends Component {
|
|
|
13424
13581
|
this.sortModule.sortColumn(columnName, direction, isMultiSort);
|
|
13425
13582
|
}
|
|
13426
13583
|
}
|
|
13584
|
+
mergePersistGanttData() {
|
|
13585
|
+
if (!this.treeGrid) {
|
|
13586
|
+
this.treeGrid = new TreeGrid();
|
|
13587
|
+
}
|
|
13588
|
+
const persist1 = 'mergePersistGridData';
|
|
13589
|
+
this.treeGrid.grid[persist1].apply(this);
|
|
13590
|
+
}
|
|
13591
|
+
mergeColumns(storedColumn, columns) {
|
|
13592
|
+
const persist2 = 'mergeColumns';
|
|
13593
|
+
this.treeGrid.grid[persist2].apply(this, [storedColumn, columns]);
|
|
13594
|
+
}
|
|
13427
13595
|
/**
|
|
13428
13596
|
* Clears all the sorted columns of the Gantt.
|
|
13429
13597
|
*
|
|
@@ -13501,7 +13669,7 @@ let Gantt = class Gantt extends Component {
|
|
|
13501
13669
|
*/
|
|
13502
13670
|
updateGridLineContainerHeight() {
|
|
13503
13671
|
if (this.chartVerticalLineContainer) {
|
|
13504
|
-
this.chartVerticalLineContainer.style.height = formatUnit(this.
|
|
13672
|
+
this.chartVerticalLineContainer.style.height = formatUnit(this.getContentHeight());
|
|
13505
13673
|
}
|
|
13506
13674
|
}
|
|
13507
13675
|
/**
|
|
@@ -13605,6 +13773,7 @@ let Gantt = class Gantt extends Component {
|
|
|
13605
13773
|
progress: 'Progress',
|
|
13606
13774
|
dependency: 'Dependency',
|
|
13607
13775
|
notes: 'Notes',
|
|
13776
|
+
criticalPath: 'Critical Path',
|
|
13608
13777
|
baselineStartDate: 'Baseline Start Date',
|
|
13609
13778
|
baselineEndDate: 'Baseline End Date',
|
|
13610
13779
|
taskMode: 'Task Mode',
|
|
@@ -14302,6 +14471,34 @@ let Gantt = class Gantt extends Component {
|
|
|
14302
14471
|
this.editModule.outdent();
|
|
14303
14472
|
}
|
|
14304
14473
|
}
|
|
14474
|
+
/**
|
|
14475
|
+
* To render the critical path tasks in Gantt.
|
|
14476
|
+
*
|
|
14477
|
+
* @returns {void} .
|
|
14478
|
+
* @param {boolean} isCritical- whether to render critical path or not .
|
|
14479
|
+
* @public
|
|
14480
|
+
*/
|
|
14481
|
+
showCriticalPath(isCritical) {
|
|
14482
|
+
if (this.criticalPathModule) {
|
|
14483
|
+
this.criticalPathModule.showCriticalPath(isCritical);
|
|
14484
|
+
let criticalModule = this.criticalPathModule;
|
|
14485
|
+
this.criticalPathModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
14486
|
+
}
|
|
14487
|
+
}
|
|
14488
|
+
/**
|
|
14489
|
+
* To get all the critical tasks in Gantt.
|
|
14490
|
+
*
|
|
14491
|
+
* @returns {IGanttData[]} .
|
|
14492
|
+
* @public
|
|
14493
|
+
*/
|
|
14494
|
+
getCriticalTasks() {
|
|
14495
|
+
if (!isNullOrUndefined(this.criticalPathModule) && this.enableCriticalPath) {
|
|
14496
|
+
return this.criticalPathModule.getCriticalTasks();
|
|
14497
|
+
}
|
|
14498
|
+
else {
|
|
14499
|
+
return null;
|
|
14500
|
+
}
|
|
14501
|
+
}
|
|
14305
14502
|
/**
|
|
14306
14503
|
* To perform Zoom in action on Gantt timeline.
|
|
14307
14504
|
*
|
|
@@ -15113,6 +15310,9 @@ __decorate([
|
|
|
15113
15310
|
__decorate([
|
|
15114
15311
|
Property(false)
|
|
15115
15312
|
], Gantt.prototype, "enableContextMenu", void 0);
|
|
15313
|
+
__decorate([
|
|
15314
|
+
Property(false)
|
|
15315
|
+
], Gantt.prototype, "enableCriticalPath", void 0);
|
|
15116
15316
|
__decorate([
|
|
15117
15317
|
Property()
|
|
15118
15318
|
], Gantt.prototype, "contextMenuItems", void 0);
|
|
@@ -15410,7 +15610,7 @@ class CellEdit {
|
|
|
15410
15610
|
return;
|
|
15411
15611
|
}
|
|
15412
15612
|
if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
|
|
15413
|
-
data['isManual']
|
|
15613
|
+
data['isManual'] === false) || this.parent.taskMode === 'Auto')) || field === taskSettings.duration
|
|
15414
15614
|
|| field === taskSettings.dependency || field === taskSettings.progress
|
|
15415
15615
|
|| field === taskSettings.work || field === 'taskType')) {
|
|
15416
15616
|
args.cancel = true;
|
|
@@ -15599,7 +15799,7 @@ class CellEdit {
|
|
|
15599
15799
|
const ganttProb = args.data.ganttProperties;
|
|
15600
15800
|
let currentValue = args.data[this.parent.taskFields.startDate];
|
|
15601
15801
|
currentValue = currentValue ? new Date(currentValue.getTime()) : null;
|
|
15602
|
-
currentValue = this.parent.dateValidationModule.checkStartDate(currentValue);
|
|
15802
|
+
currentValue = this.parent.dateValidationModule.checkStartDate(currentValue, ganttData.ganttProperties, ganttData.ganttProperties.isMilestone);
|
|
15603
15803
|
if (isNullOrUndefined(currentValue)) {
|
|
15604
15804
|
if (!ganttData.hasChildRecords) {
|
|
15605
15805
|
this.parent.setRecordValue('startDate', null, ganttProb, true);
|
|
@@ -15724,7 +15924,9 @@ class CellEdit {
|
|
|
15724
15924
|
const currentDuration = ganttProb.duration;
|
|
15725
15925
|
if (isNullOrUndefined(currentDuration)) {
|
|
15726
15926
|
this.parent.setRecordValue('isMilestone', false, ganttProb, true);
|
|
15727
|
-
this.parent.
|
|
15927
|
+
if (args.data[this.parent.taskFields.duration] != null) {
|
|
15928
|
+
this.parent.setRecordValue('endDate', null, ganttProb, true);
|
|
15929
|
+
}
|
|
15728
15930
|
}
|
|
15729
15931
|
else {
|
|
15730
15932
|
if (isNullOrUndefined(startDate) && !isNullOrUndefined(endDate)) {
|
|
@@ -16445,9 +16647,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
16445
16647
|
addClass([element], [activeParentTask]);
|
|
16446
16648
|
}
|
|
16447
16649
|
}
|
|
16448
|
-
|
|
16449
|
-
addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll('.' + connectorLineContainer), [connectorLineZIndex]);
|
|
16450
|
-
}
|
|
16650
|
+
addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll('.' + connectorLineContainer), [connectorLineZIndex]);
|
|
16451
16651
|
if (!isNullOrUndefined(this.parent.taskFields.dependency)
|
|
16452
16652
|
&& (element.querySelector('.' + connectorPointLeft)
|
|
16453
16653
|
|| element.parentElement.querySelector('.' + connectorPointLeft))
|
|
@@ -16709,7 +16909,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
16709
16909
|
this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.left;
|
|
16710
16910
|
this.startScrollTimer('left');
|
|
16711
16911
|
}
|
|
16712
|
-
else if (isConnectorLineEdit && ((mouseY +
|
|
16912
|
+
else if (isConnectorLineEdit && ((mouseY + 80) >
|
|
16713
16913
|
containerPosition.top + this.parent.ganttChartModule.chartBodyContainer.offsetHeight)) {
|
|
16714
16914
|
this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.top;
|
|
16715
16915
|
this.startScrollTimer('bottom');
|
|
@@ -17586,6 +17786,10 @@ class TaskbarEdit extends DateProcessor {
|
|
|
17586
17786
|
else {
|
|
17587
17787
|
this.parent.isOnEdit = false;
|
|
17588
17788
|
this.cancelTaskbarEditActionInMouseLeave();
|
|
17789
|
+
if (this.parent.enableCriticalPath && this.parent.criticalPathModule) {
|
|
17790
|
+
let criticalModule = this.parent.criticalPathModule;
|
|
17791
|
+
criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
17792
|
+
}
|
|
17589
17793
|
}
|
|
17590
17794
|
}
|
|
17591
17795
|
if (this.parent.viewType === 'ResourceView' && this.parent.enableMultiTaskbar && !isNullOrUndefined(this.taskBarEditElement)) {
|
|
@@ -18894,7 +19098,7 @@ class DialogEdit {
|
|
|
18894
19098
|
}
|
|
18895
19099
|
else if (isScheduledTask(ganttProp) || !isNullOrUndefined(ganttProp.startDate)) {
|
|
18896
19100
|
if (ganttData.ganttProperties.isMilestone && ganttData.ganttProperties.duration !== 0) {
|
|
18897
|
-
this.parent.dateValidationModule.
|
|
19101
|
+
this.parent.dateValidationModule.checkStartDate(ganttProp.startDate);
|
|
18898
19102
|
}
|
|
18899
19103
|
this.parent.dateValidationModule.calculateEndDate(ganttData);
|
|
18900
19104
|
}
|
|
@@ -20242,9 +20446,16 @@ class ConnectorLineEdit {
|
|
|
20242
20446
|
addHighlight(element) {
|
|
20243
20447
|
this.connectorLineElement = element;
|
|
20244
20448
|
addClass([element], [connectorLineHoverZIndex]);
|
|
20245
|
-
|
|
20246
|
-
|
|
20247
|
-
|
|
20449
|
+
if (element.querySelectorAll('.' + connectorLine)[0].classList.contains('e-criticalconnector-line')) {
|
|
20450
|
+
addClass(element.querySelectorAll('.' + connectorLine), [criticalConnectorLineHover]);
|
|
20451
|
+
addClass(element.querySelectorAll('.' + connectorLineRightArrow), [criticalConnectorLineRightArrowHover]);
|
|
20452
|
+
addClass(element.querySelectorAll('.' + connectorLineLeftArrow), [criticalConnectorLineLeftArrowHover]);
|
|
20453
|
+
}
|
|
20454
|
+
else {
|
|
20455
|
+
addClass(element.querySelectorAll('.' + connectorLine), [connectorLineHover]);
|
|
20456
|
+
addClass(element.querySelectorAll('.' + connectorLineRightArrow), [connectorLineRightArrowHover]);
|
|
20457
|
+
addClass(element.querySelectorAll('.' + connectorLineLeftArrow), [connectorLineLeftArrowHover]);
|
|
20458
|
+
}
|
|
20248
20459
|
}
|
|
20249
20460
|
/**
|
|
20250
20461
|
* To remove connector line highlight class.
|
|
@@ -20255,9 +20466,16 @@ class ConnectorLineEdit {
|
|
|
20255
20466
|
removeHighlight() {
|
|
20256
20467
|
if (!isNullOrUndefined(this.connectorLineElement)) {
|
|
20257
20468
|
removeClass([this.connectorLineElement], [connectorLineHoverZIndex]);
|
|
20258
|
-
|
|
20259
|
-
|
|
20260
|
-
|
|
20469
|
+
if (this.connectorLineElement.querySelectorAll('.' + connectorLine)[0].classList.contains(criticalConnectorLineHover)) {
|
|
20470
|
+
removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLine), [criticalConnectorLineHover]);
|
|
20471
|
+
removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineRightArrow), [criticalConnectorLineRightArrowHover]);
|
|
20472
|
+
removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineLeftArrow), [criticalConnectorLineLeftArrowHover]);
|
|
20473
|
+
}
|
|
20474
|
+
else {
|
|
20475
|
+
removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLine), [connectorLineHover]);
|
|
20476
|
+
removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineRightArrow), [connectorLineRightArrowHover]);
|
|
20477
|
+
removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineLeftArrow), [connectorLineLeftArrowHover]);
|
|
20478
|
+
}
|
|
20261
20479
|
this.connectorLineElement = null;
|
|
20262
20480
|
}
|
|
20263
20481
|
}
|
|
@@ -21436,6 +21654,9 @@ class Edit$2 {
|
|
|
21436
21654
|
}
|
|
21437
21655
|
if ((key === tasks.baselineStartDate || key === tasks.baselineEndDate) &&
|
|
21438
21656
|
(ganttData.ganttProperties.baselineStartDate && ganttData.ganttProperties.baselineEndDate)) {
|
|
21657
|
+
ganttObj.setRecordValue('baselineStartDate', ganttObj.dataOperation.checkBaselineStartDate(ganttData.ganttProperties.baselineStartDate), ganttData.ganttProperties, true);
|
|
21658
|
+
ganttObj.dataOperation.setTime(this.parent.defaultEndTime, ganttData.ganttProperties.baselineEndDate);
|
|
21659
|
+
ganttObj.setRecordValue('baselineEndDate', ganttObj.dataOperation.checkBaselineEndDate(ganttData.ganttProperties.baselineEndDate), ganttData.ganttProperties, true);
|
|
21439
21660
|
ganttObj.setRecordValue('baselineLeft', ganttObj.dataOperation.calculateBaselineLeft(ganttData.ganttProperties), ganttData.ganttProperties, true);
|
|
21440
21661
|
ganttObj.setRecordValue('baselineWidth', ganttObj.dataOperation.calculateBaselineWidth(ganttData.ganttProperties), ganttData.ganttProperties, true);
|
|
21441
21662
|
}
|
|
@@ -22197,6 +22418,11 @@ class Edit$2 {
|
|
|
22197
22418
|
eventArgs.taskBarEditAction = args.taskBarEditAction;
|
|
22198
22419
|
}
|
|
22199
22420
|
this.endEditAction(args);
|
|
22421
|
+
if (this.parent.enableCriticalPath) {
|
|
22422
|
+
let criticalModule = this.parent.criticalPathModule;
|
|
22423
|
+
criticalModule.showCriticalPath(true);
|
|
22424
|
+
criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
22425
|
+
}
|
|
22200
22426
|
this.parent.trigger('actionComplete', eventArgs);
|
|
22201
22427
|
}
|
|
22202
22428
|
else {
|
|
@@ -22531,6 +22757,8 @@ class Edit$2 {
|
|
|
22531
22757
|
}
|
|
22532
22758
|
else {
|
|
22533
22759
|
this.deleteSelectedItems();
|
|
22760
|
+
const focusingElement = this.parent.element.querySelector('.e-treegrid');
|
|
22761
|
+
focusingElement.focus();
|
|
22534
22762
|
}
|
|
22535
22763
|
}
|
|
22536
22764
|
}
|
|
@@ -23400,7 +23628,17 @@ class Edit$2 {
|
|
|
23400
23628
|
this.refreshRecordInImmutableMode();
|
|
23401
23629
|
}
|
|
23402
23630
|
}
|
|
23403
|
-
refreshRecordInImmutableMode() {
|
|
23631
|
+
refreshRecordInImmutableMode(data, dragged) {
|
|
23632
|
+
if (!dragged && !isNullOrUndefined(data)) {
|
|
23633
|
+
for (let i = data[0].index + 1; i < this.parent.currentViewData.length; i++) {
|
|
23634
|
+
if (data[0].level < this.parent.currentViewData[i].level) {
|
|
23635
|
+
this.parent.modifiedRecords.push(this.parent.currentViewData[i]);
|
|
23636
|
+
}
|
|
23637
|
+
else {
|
|
23638
|
+
break;
|
|
23639
|
+
}
|
|
23640
|
+
}
|
|
23641
|
+
}
|
|
23404
23642
|
for (let i = 0; i < this.parent.modifiedRecords.length; i++) {
|
|
23405
23643
|
const originalData = this.parent.modifiedRecords[i];
|
|
23406
23644
|
let treeIndex = this.parent.allowRowDragAndDrop ? 1 : 0;
|
|
@@ -23562,7 +23800,13 @@ class Edit$2 {
|
|
|
23562
23800
|
const insertCrud = data.insert(updatedData[addedRecords], null, query);
|
|
23563
23801
|
insertCrud.then((e) => {
|
|
23564
23802
|
const changedRecords = 'changedRecords';
|
|
23565
|
-
|
|
23803
|
+
let addedRecords;
|
|
23804
|
+
if (!isNullOrUndefined(e[0])) {
|
|
23805
|
+
addedRecords = e[0];
|
|
23806
|
+
}
|
|
23807
|
+
else {
|
|
23808
|
+
addedRecords = updatedData['addedRecords'][0];
|
|
23809
|
+
}
|
|
23566
23810
|
/* tslint:disable-next-line */
|
|
23567
23811
|
const updateCrud = data.update(this.parent.taskFields.id, updatedData[changedRecords], null, query);
|
|
23568
23812
|
updateCrud.then(() => {
|
|
@@ -24107,7 +24351,7 @@ class Edit$2 {
|
|
|
24107
24351
|
this.parent.treeGrid.parentData = [];
|
|
24108
24352
|
this.parent.treeGrid.refresh();
|
|
24109
24353
|
if (this.parent.enableImmutableMode) {
|
|
24110
|
-
this.refreshRecordInImmutableMode();
|
|
24354
|
+
this.refreshRecordInImmutableMode(args.data, isDrag);
|
|
24111
24355
|
}
|
|
24112
24356
|
if (isDrag) {
|
|
24113
24357
|
args.requestType = 'rowDropped';
|
|
@@ -24719,7 +24963,7 @@ class Filter$1 {
|
|
|
24719
24963
|
const ganttElement = closest(element, '#' + this.parent.element.id)
|
|
24720
24964
|
|| element.querySelector('#' + this.parent.element.id);
|
|
24721
24965
|
if ((!(this.filterMenuElement.contains(element)) && !isNullOrUndefined(ganttElement)) || (!(this.filterMenuElement.contains(element)) && (isNullOrUndefined(datePickerElement))
|
|
24722
|
-
&& (isNullOrUndefined(dateTimePickerElement)) && ((element.nodeName === 'DIV') || (element.nodeName === 'HTML')))) {
|
|
24966
|
+
&& (isNullOrUndefined(dateTimePickerElement)) && ((element.nodeName === 'DIV') || (element.nodeName === 'HTML') || (element.nodeName === 'SPAN') || (element.nodeName === 'BUTTON')))) {
|
|
24723
24967
|
remove(this.filterMenuElement);
|
|
24724
24968
|
this.parent.treeGrid.grid.notify('filter-menu-close', { isOpen: false });
|
|
24725
24969
|
this.filterMenuElement = null;
|
|
@@ -25365,6 +25609,9 @@ class Selection$1 {
|
|
|
25365
25609
|
this.popUpClickHandler(e);
|
|
25366
25610
|
if (this.parent.selectionSettings.mode !== 'Cell' && isSelected) {
|
|
25367
25611
|
if (closest(e.target, 'tr.e-chart-row')) {
|
|
25612
|
+
if (this.parent.enableVirtualization) {
|
|
25613
|
+
this.parent.treeGrid.grid.selectionModule.isInteracted = true;
|
|
25614
|
+
}
|
|
25368
25615
|
this.highlightSelectedRows(e, true);
|
|
25369
25616
|
}
|
|
25370
25617
|
else {
|
|
@@ -25423,7 +25670,7 @@ class Toolbar$3 {
|
|
|
25423
25670
|
this.predefinedItems = {};
|
|
25424
25671
|
this.items = ['Add', 'Edit', 'Update', 'Delete', 'Cancel', 'ExpandAll', 'CollapseAll', 'Search',
|
|
25425
25672
|
'PrevTimeSpan', 'NextTimeSpan', 'ZoomIn', 'ZoomOut', 'ZoomToFit', 'ExcelExport',
|
|
25426
|
-
'CsvExport', 'PdfExport', 'Indent', 'Outdent'];
|
|
25673
|
+
'CsvExport', 'PdfExport', 'Indent', 'Outdent', 'CriticalPath'];
|
|
25427
25674
|
this.parent = parent;
|
|
25428
25675
|
this.id = this.parent.element.id;
|
|
25429
25676
|
this.parent.on('ui-toolbarupdate', this.propertyChanged, this);
|
|
@@ -25447,10 +25694,18 @@ class Toolbar$3 {
|
|
|
25447
25694
|
}
|
|
25448
25695
|
const preItems = ['Add', 'Edit', 'Update', 'Delete', 'Cancel', 'ExpandAll', 'CollapseAll',
|
|
25449
25696
|
'PrevTimeSpan', 'NextTimeSpan', 'ZoomIn', 'ZoomOut', 'ZoomToFit', 'ExcelExport', 'CsvExport',
|
|
25450
|
-
'PdfExport', 'Indent', 'Outdent'];
|
|
25697
|
+
'PdfExport', 'Indent', 'Outdent', 'CriticalPath'];
|
|
25451
25698
|
for (const item of preItems) {
|
|
25452
|
-
|
|
25453
|
-
|
|
25699
|
+
let itemStr;
|
|
25700
|
+
let localeName;
|
|
25701
|
+
if (item === 'CriticalPath') {
|
|
25702
|
+
itemStr = "critical-path";
|
|
25703
|
+
localeName = "criticalPath";
|
|
25704
|
+
}
|
|
25705
|
+
else {
|
|
25706
|
+
itemStr = item.toLowerCase();
|
|
25707
|
+
localeName = item[0].toLowerCase() + item.slice(1);
|
|
25708
|
+
}
|
|
25454
25709
|
this.predefinedItems[item] = {
|
|
25455
25710
|
id: this.parent.element.id + '_' + itemStr, prefixIcon: 'e-' + itemStr,
|
|
25456
25711
|
text: this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant(localeName),
|
|
@@ -25651,6 +25906,14 @@ class Toolbar$3 {
|
|
|
25651
25906
|
gObj.indent();
|
|
25652
25907
|
}
|
|
25653
25908
|
break;
|
|
25909
|
+
case gID + '_critical-path':
|
|
25910
|
+
if (gObj.enableCriticalPath) {
|
|
25911
|
+
gObj.enableCriticalPath = false;
|
|
25912
|
+
}
|
|
25913
|
+
else {
|
|
25914
|
+
gObj.enableCriticalPath = true;
|
|
25915
|
+
}
|
|
25916
|
+
break;
|
|
25654
25917
|
case gID + '_outdent':
|
|
25655
25918
|
if (gObj.editModule && gObj.selectionModule.getSelectedRecords().length) {
|
|
25656
25919
|
gObj.outdent();
|
|
@@ -25830,6 +26093,8 @@ class Toolbar$3 {
|
|
|
25830
26093
|
disableItems.push(gID + '_edit');
|
|
25831
26094
|
disableItems.push(gID + '_update');
|
|
25832
26095
|
disableItems.push(gID + '_cancel');
|
|
26096
|
+
disableItems.push(gID + '_indent');
|
|
26097
|
+
disableItems.push(gID + '_outdent');
|
|
25833
26098
|
}
|
|
25834
26099
|
for (let e = 0; e < enableItems.length; e++) {
|
|
25835
26100
|
let index;
|
|
@@ -25947,8 +26212,9 @@ class NonWorkingDay {
|
|
|
25947
26212
|
let toDate;
|
|
25948
26213
|
const container = createElement('div');
|
|
25949
26214
|
const height = this.parent.contentHeight;
|
|
26215
|
+
// eslint-disable-next-line
|
|
25950
26216
|
let toolbarHeight = 0;
|
|
25951
|
-
if (!isNullOrUndefined(this.parent.toolbarModule)) {
|
|
26217
|
+
if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
|
|
25952
26218
|
toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
|
|
25953
26219
|
}
|
|
25954
26220
|
const viewportHeight = this.parent.ganttHeight - toolbarHeight - this.parent.ganttChartModule.chartTimelineContainer.offsetHeight;
|
|
@@ -26053,6 +26319,7 @@ class NonWorkingDay {
|
|
|
26053
26319
|
}
|
|
26054
26320
|
updateHolidayLabelHeight() {
|
|
26055
26321
|
const height = this.parent.getContentHeight();
|
|
26322
|
+
// eslint-disable-next-line
|
|
26056
26323
|
let toolbarHeight = 0;
|
|
26057
26324
|
if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
|
|
26058
26325
|
toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
|
|
@@ -26254,6 +26521,737 @@ class DayMarkers {
|
|
|
26254
26521
|
}
|
|
26255
26522
|
}
|
|
26256
26523
|
|
|
26524
|
+
class CriticalPath {
|
|
26525
|
+
constructor(parent) {
|
|
26526
|
+
this.resourceCollectionIds = [];
|
|
26527
|
+
this.criticalTasks = [];
|
|
26528
|
+
this.parent = parent;
|
|
26529
|
+
}
|
|
26530
|
+
getCriticalTasks() {
|
|
26531
|
+
return this.criticalTasks;
|
|
26532
|
+
}
|
|
26533
|
+
showCriticalPath(isCritical) {
|
|
26534
|
+
const modelIds = this.parent.ids;
|
|
26535
|
+
const totalRecords = this.parent.flatData;
|
|
26536
|
+
if (isCritical && this.parent.flatData.length > 0 && !this.parent.enableMultiTaskbar) {
|
|
26537
|
+
this.parent.enableCriticalPath = true;
|
|
26538
|
+
const parentRecords = this.parent.treeGrid.parentData;
|
|
26539
|
+
let checkEndDateTaskid;
|
|
26540
|
+
let checkEndDate = parentRecords[0].ganttProperties.endDate;
|
|
26541
|
+
let dateDifference = 0;
|
|
26542
|
+
const checkBeyondEnddate = [];
|
|
26543
|
+
const totalPredecessorsCollection = [];
|
|
26544
|
+
const totalPredecessorsCollectionId = [];
|
|
26545
|
+
let predecessorIndex = 0;
|
|
26546
|
+
const taskBeyondEnddate = [];
|
|
26547
|
+
const predecessorTaskBeyondEnddate = [];
|
|
26548
|
+
const collection = [];
|
|
26549
|
+
const collectionTaskId = [];
|
|
26550
|
+
const fromDataObject = [];
|
|
26551
|
+
let criticalPathIds = [];
|
|
26552
|
+
/* eslint-disable-next-line */
|
|
26553
|
+
if (parentRecords[0].ganttProperties.autoEndDate > parentRecords[0].ganttProperties.endDate && !parentRecords[0].ganttProperties.isAutoSchedule) {
|
|
26554
|
+
checkEndDate = parentRecords[0].ganttProperties.autoEndDate;
|
|
26555
|
+
}
|
|
26556
|
+
checkEndDateTaskid = parentRecords[0].ganttProperties.taskId;
|
|
26557
|
+
// Find the total project endDate
|
|
26558
|
+
for (let i = 1; i < parentRecords.length; i++) {
|
|
26559
|
+
if (parentRecords[i].ganttProperties.endDate >= checkEndDate) {
|
|
26560
|
+
checkEndDate = parentRecords[i].ganttProperties.endDate;
|
|
26561
|
+
checkEndDateTaskid = parentRecords[i].ganttProperties.taskId;
|
|
26562
|
+
}
|
|
26563
|
+
if (!parentRecords[i].ganttProperties.isAutoSchedule) {
|
|
26564
|
+
if (parentRecords[i].ganttProperties.autoEndDate >= checkEndDate) {
|
|
26565
|
+
checkEndDate = parentRecords[i].ganttProperties.autoEndDate;
|
|
26566
|
+
checkEndDateTaskid = parentRecords[i].ganttProperties.taskId;
|
|
26567
|
+
}
|
|
26568
|
+
}
|
|
26569
|
+
}
|
|
26570
|
+
this.maxEndDate = checkEndDate;
|
|
26571
|
+
// find the tasks that ends on total project end date that stored in checkBeyondEnddate
|
|
26572
|
+
// find the tasks with predecessor that stored in totalPredecessorsCollectionId.
|
|
26573
|
+
for (let j = 0; j < totalRecords.length; j++) {
|
|
26574
|
+
totalRecords[j].isCritical = false;
|
|
26575
|
+
totalRecords[j].ganttProperties.isCritical = false;
|
|
26576
|
+
/* eslint-disable-next-line */
|
|
26577
|
+
dateDifference = this.parent.dataOperation.getDuration(totalRecords[j].ganttProperties.endDate, checkEndDate, totalRecords[j].ganttProperties.durationUnit, totalRecords[j].ganttProperties.isAutoSchedule, totalRecords[j].ganttProperties.isMilestone);
|
|
26578
|
+
totalRecords[j].slack = dateDifference + ' ' + totalRecords[j].ganttProperties.durationUnit;
|
|
26579
|
+
totalRecords[j].ganttProperties.slack = dateDifference + ' ' + totalRecords[j].ganttProperties.durationUnit;
|
|
26580
|
+
if (totalRecords[j].ganttProperties.endDate >= checkEndDate) {
|
|
26581
|
+
checkBeyondEnddate.push(parseInt(totalRecords[j].ganttProperties.taskId, 10));
|
|
26582
|
+
}
|
|
26583
|
+
if (totalRecords[j].ganttProperties.predecessor) {
|
|
26584
|
+
if (totalRecords[j].ganttProperties.predecessor.length !== 0) {
|
|
26585
|
+
totalPredecessorsCollection.push(totalRecords[j]);
|
|
26586
|
+
totalPredecessorsCollectionId.push(parseInt(totalRecords[j].ganttProperties.taskId, 10));
|
|
26587
|
+
}
|
|
26588
|
+
}
|
|
26589
|
+
}
|
|
26590
|
+
if (this.parent.viewType === 'ResourceView') {
|
|
26591
|
+
for (let i = 0; i < this.parent.taskIds.length; i++) {
|
|
26592
|
+
this.resourceCollectionIds[i] = this.parent.taskIds[i].slice(1);
|
|
26593
|
+
}
|
|
26594
|
+
}
|
|
26595
|
+
// seperate the predecessor connected taskes from the individual taskes that ends on total project end date
|
|
26596
|
+
for (let k = 0; k < checkBeyondEnddate.length; k++) {
|
|
26597
|
+
if (totalPredecessorsCollectionId.indexOf(checkBeyondEnddate[k]) === -1) {
|
|
26598
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
26599
|
+
predecessorIndex = modelIds.indexOf(checkBeyondEnddate[k].toString());
|
|
26600
|
+
}
|
|
26601
|
+
else {
|
|
26602
|
+
predecessorIndex = this.resourceCollectionIds.indexOf(checkBeyondEnddate[k].toString());
|
|
26603
|
+
}
|
|
26604
|
+
if (totalRecords[predecessorIndex].ganttProperties.progress < 100) {
|
|
26605
|
+
totalRecords[predecessorIndex].isCritical = true;
|
|
26606
|
+
totalRecords[predecessorIndex].ganttProperties.isCritical = true;
|
|
26607
|
+
}
|
|
26608
|
+
totalRecords[predecessorIndex]['slack'] = 0 + ' ' + totalRecords[predecessorIndex].ganttProperties.durationUnit;
|
|
26609
|
+
taskBeyondEnddate.push(checkBeyondEnddate[k]);
|
|
26610
|
+
}
|
|
26611
|
+
else {
|
|
26612
|
+
predecessorTaskBeyondEnddate.push(checkBeyondEnddate[k]);
|
|
26613
|
+
}
|
|
26614
|
+
}
|
|
26615
|
+
const predecessorLength = totalPredecessorsCollection.length;
|
|
26616
|
+
const endTask = [];
|
|
26617
|
+
// find the detail collection of predecessor for each taskes that stored in collection.
|
|
26618
|
+
for (let x = 0; x < predecessorLength; x++) {
|
|
26619
|
+
let to = -1;
|
|
26620
|
+
let from = -1;
|
|
26621
|
+
let toPredecessor = -1;
|
|
26622
|
+
let fromPredecessor = -1;
|
|
26623
|
+
const currentIndex = x;
|
|
26624
|
+
const predecessor = totalPredecessorsCollection[x].ganttProperties.predecessor;
|
|
26625
|
+
const individualPredecessorLength = totalPredecessorsCollection[x].ganttProperties.predecessor.length;
|
|
26626
|
+
const taskid = (parseInt(totalPredecessorsCollection[x].ganttProperties.taskId, 10));
|
|
26627
|
+
for (let y = 0; y < individualPredecessorLength; y++) {
|
|
26628
|
+
if (parseInt(predecessor[y].from, 10) === taskid) {
|
|
26629
|
+
if (to === -1) {
|
|
26630
|
+
if (!predecessor[y].offset) {
|
|
26631
|
+
to = predecessor[y].to;
|
|
26632
|
+
toPredecessor = predecessor[y].type;
|
|
26633
|
+
}
|
|
26634
|
+
else {
|
|
26635
|
+
to = predecessor[y].to + ':' + predecessor[y].offset + predecessor[y].offsetUnit;
|
|
26636
|
+
toPredecessor = predecessor[y].type;
|
|
26637
|
+
}
|
|
26638
|
+
}
|
|
26639
|
+
else {
|
|
26640
|
+
if (!predecessor[y].offset) {
|
|
26641
|
+
to = to + ',' + predecessor[y].to;
|
|
26642
|
+
toPredecessor = toPredecessor + ',' + predecessor[y].type;
|
|
26643
|
+
}
|
|
26644
|
+
else {
|
|
26645
|
+
to = to + ',' + predecessor[y].to + ':' + predecessor[y].offset + predecessor[y].offsetUnit;
|
|
26646
|
+
toPredecessor = toPredecessor + ',' + predecessor[y].type;
|
|
26647
|
+
}
|
|
26648
|
+
}
|
|
26649
|
+
}
|
|
26650
|
+
if (parseInt(predecessor[y].to, 10) === taskid) {
|
|
26651
|
+
if (from === -1) {
|
|
26652
|
+
if (!predecessor[y].offset) {
|
|
26653
|
+
from = predecessor[y].from;
|
|
26654
|
+
fromPredecessor = predecessor[y].type;
|
|
26655
|
+
}
|
|
26656
|
+
else {
|
|
26657
|
+
from = predecessor[y].from + ':' + predecessor[y].offset + predecessor[y].offsetUnit;
|
|
26658
|
+
fromPredecessor = predecessor[y].type;
|
|
26659
|
+
}
|
|
26660
|
+
}
|
|
26661
|
+
else {
|
|
26662
|
+
if (!predecessor[y].offset) {
|
|
26663
|
+
from = from + ',' + predecessor[y].from;
|
|
26664
|
+
fromPredecessor = fromPredecessor + ',' + predecessor[y].type;
|
|
26665
|
+
}
|
|
26666
|
+
else {
|
|
26667
|
+
from = from + ',' + predecessor[y].from + ':' + predecessor[y].offset + predecessor[y].offsetUnit;
|
|
26668
|
+
fromPredecessor = fromPredecessor + ',' + predecessor[y].type;
|
|
26669
|
+
}
|
|
26670
|
+
}
|
|
26671
|
+
}
|
|
26672
|
+
}
|
|
26673
|
+
if (from === -1) {
|
|
26674
|
+
from = null;
|
|
26675
|
+
fromPredecessor = null;
|
|
26676
|
+
}
|
|
26677
|
+
if (to === -1) {
|
|
26678
|
+
to = null;
|
|
26679
|
+
toPredecessor = null;
|
|
26680
|
+
}
|
|
26681
|
+
/* eslint-disable-next-line */
|
|
26682
|
+
collection.push({ from: from, fromPredecessor: fromPredecessor, taskid: taskid, to: to, toPredecessor: toPredecessor, currentIndex: currentIndex, slack: null, enddate: null });
|
|
26683
|
+
collectionTaskId.push(taskid);
|
|
26684
|
+
}
|
|
26685
|
+
const collectionLength = collection.length;
|
|
26686
|
+
let indexEnddate = 0;
|
|
26687
|
+
let num;
|
|
26688
|
+
// find the predecessors connected taskes that does not contains any successor.
|
|
26689
|
+
for (let z = 0; z < collectionLength; z++) {
|
|
26690
|
+
if (!collection[z]['to']) {
|
|
26691
|
+
num = collection[z]['taskid'];
|
|
26692
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
26693
|
+
indexEnddate = modelIds.indexOf(num.toString());
|
|
26694
|
+
}
|
|
26695
|
+
else {
|
|
26696
|
+
indexEnddate = this.resourceCollectionIds.indexOf(num.toString());
|
|
26697
|
+
}
|
|
26698
|
+
const flatData = totalRecords[indexEnddate].ganttProperties;
|
|
26699
|
+
/* eslint-disable-next-line */
|
|
26700
|
+
dateDifference = this.parent.dataOperation.getDuration(flatData.endDate, checkEndDate, 'minute', flatData.isAutoSchedule, flatData.isMilestone);
|
|
26701
|
+
collection[z]['slack'] = dateDifference;
|
|
26702
|
+
collection[z]['fs'] = -1;
|
|
26703
|
+
collection[z]['enddate'] = flatData.endDate;
|
|
26704
|
+
endTask.push({
|
|
26705
|
+
fromdata: collection[z]['from'], todateID: collection[z]['taskid'],
|
|
26706
|
+
fromDataPredecessor: collection[z]['fromPredecessor']
|
|
26707
|
+
});
|
|
26708
|
+
}
|
|
26709
|
+
}
|
|
26710
|
+
for (let k = 0; k < endTask.length; k++) {
|
|
26711
|
+
fromDataObject.push(endTask[k]);
|
|
26712
|
+
this.slackCalculation(fromDataObject, collection, collectionTaskId, checkEndDate, totalRecords, modelIds);
|
|
26713
|
+
}
|
|
26714
|
+
criticalPathIds = this.finalCriticalPath(collection, taskBeyondEnddate, totalRecords, modelIds, checkEndDate);
|
|
26715
|
+
this.criticalPathCollection = criticalPathIds;
|
|
26716
|
+
this.detailPredecessorCollection = collection;
|
|
26717
|
+
this.predecessorCollectionTaskIds = collectionTaskId;
|
|
26718
|
+
}
|
|
26719
|
+
if (isCritical === false && this.parent.flatData.length > 0 && !this.parent.enableMultiTaskbar) {
|
|
26720
|
+
let pathIndex;
|
|
26721
|
+
this.parent.enableCriticalPath = false;
|
|
26722
|
+
for (let z = 0; z < this.criticalPathCollection.length; z++) {
|
|
26723
|
+
pathIndex = modelIds.indexOf(this.criticalPathCollection[z].toString());
|
|
26724
|
+
totalRecords[pathIndex].isCritical = false;
|
|
26725
|
+
}
|
|
26726
|
+
this.criticalPathCollection = [];
|
|
26727
|
+
this.detailPredecessorCollection = [];
|
|
26728
|
+
this.predecessorCollectionTaskIds = [];
|
|
26729
|
+
}
|
|
26730
|
+
}
|
|
26731
|
+
/* eslint-disable-next-line */
|
|
26732
|
+
slackCalculation(fromDataObject, collection, collectionTaskId, checkEndDate, flatRecords, modelRecordIds) {
|
|
26733
|
+
const fromDateArray = fromDataObject[0]['fromdata'].split(',');
|
|
26734
|
+
const fromDataPredecessor = fromDataObject[0]['fromDataPredecessor'].split(',');
|
|
26735
|
+
let fromDateArray1 = [];
|
|
26736
|
+
let fromTaskIdIndex;
|
|
26737
|
+
let indexFromTaskId;
|
|
26738
|
+
let indexToTaskId;
|
|
26739
|
+
let totaskId;
|
|
26740
|
+
let dateDifference;
|
|
26741
|
+
let prevTaskEnddate;
|
|
26742
|
+
let offsetInMillSec;
|
|
26743
|
+
let ffslack;
|
|
26744
|
+
for (let i = 0; i < fromDateArray.length; i++) {
|
|
26745
|
+
fromDateArray1 = fromDateArray[i].split(':');
|
|
26746
|
+
fromTaskIdIndex = collectionTaskId.indexOf(parseInt(fromDateArray1[0], 10));
|
|
26747
|
+
totaskId = collectionTaskId.indexOf(parseInt(fromDataObject[0]['todateID'], 10));
|
|
26748
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
26749
|
+
indexFromTaskId = modelRecordIds.indexOf(fromDateArray1[0].toString());
|
|
26750
|
+
indexToTaskId = modelRecordIds.indexOf(fromDataObject[0]['todateID'].toString());
|
|
26751
|
+
}
|
|
26752
|
+
else {
|
|
26753
|
+
indexFromTaskId = this.resourceCollectionIds.indexOf(fromDateArray1[0].toString());
|
|
26754
|
+
indexToTaskId = this.resourceCollectionIds.indexOf(fromDataObject[0]['todateID'].toString());
|
|
26755
|
+
}
|
|
26756
|
+
const fromIdFlatData = flatRecords[indexFromTaskId].ganttProperties;
|
|
26757
|
+
const toIdFlatData = flatRecords[indexToTaskId].ganttProperties;
|
|
26758
|
+
if (fromDateArray1.length > 1) {
|
|
26759
|
+
if (fromDateArray1[1].indexOf('hour') !== -1) {
|
|
26760
|
+
offsetInMillSec = parseFloat(fromDateArray1[1]) * 60;
|
|
26761
|
+
}
|
|
26762
|
+
else if (fromDateArray1[1].indexOf('day') !== -1) {
|
|
26763
|
+
offsetInMillSec = parseFloat(fromDateArray1[1]) * (this.parent.secondsPerDay / 3600) * 60;
|
|
26764
|
+
}
|
|
26765
|
+
else {
|
|
26766
|
+
offsetInMillSec = parseFloat(fromDateArray1[1]);
|
|
26767
|
+
}
|
|
26768
|
+
}
|
|
26769
|
+
// calculate slack value for the task contains predecessor connection in "finish to start".
|
|
26770
|
+
if (fromDataPredecessor[i] === 'FS') {
|
|
26771
|
+
if (fromIdFlatData.endDate > toIdFlatData.startDate) {
|
|
26772
|
+
/* eslint-disable-next-line */
|
|
26773
|
+
dateDifference = -(this.parent.dataOperation.getDuration(toIdFlatData.startDate, fromIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone));
|
|
26774
|
+
}
|
|
26775
|
+
else {
|
|
26776
|
+
/* eslint-disable-next-line */
|
|
26777
|
+
dateDifference = this.parent.dataOperation.getDuration(fromIdFlatData.endDate, toIdFlatData.startDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone);
|
|
26778
|
+
}
|
|
26779
|
+
// execute if the slack value is not set initially.
|
|
26780
|
+
if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
|
|
26781
|
+
// execute if the offset value is not given.
|
|
26782
|
+
if (fromDateArray1.length <= 1) {
|
|
26783
|
+
if (collection[totaskId]['slack'] + dateDifference < 0) {
|
|
26784
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26785
|
+
}
|
|
26786
|
+
else {
|
|
26787
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
26788
|
+
}
|
|
26789
|
+
}
|
|
26790
|
+
}
|
|
26791
|
+
// execute if the current calculated slack value is less than the previous slack value.
|
|
26792
|
+
else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
|
|
26793
|
+
// execute if the offset value is not given.
|
|
26794
|
+
if (fromDateArray1.length <= 1) {
|
|
26795
|
+
if (collection[totaskId]['slack'] + dateDifference < 0) {
|
|
26796
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26797
|
+
}
|
|
26798
|
+
else {
|
|
26799
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
26800
|
+
}
|
|
26801
|
+
}
|
|
26802
|
+
}
|
|
26803
|
+
// execute if the offset value is given.
|
|
26804
|
+
if (fromDateArray1.length > 1) {
|
|
26805
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
26806
|
+
collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
|
|
26807
|
+
if (collection[fromTaskIdIndex]['slack'] < 0) {
|
|
26808
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26809
|
+
}
|
|
26810
|
+
}
|
|
26811
|
+
collection[fromTaskIdIndex]['fs'] = 1;
|
|
26812
|
+
collection[fromTaskIdIndex]['fsslack'] = collection[fromTaskIdIndex]['slack'];
|
|
26813
|
+
collection[fromTaskIdIndex]['enddate'] = fromIdFlatData.startDate;
|
|
26814
|
+
if (fromIdFlatData.endDate >= checkEndDate && fromIdFlatData.endDate <= checkEndDate) {
|
|
26815
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26816
|
+
}
|
|
26817
|
+
}
|
|
26818
|
+
// calculate slack value for the task contains predecessor connection in "start to start".
|
|
26819
|
+
if (fromDataPredecessor[i] === 'SS') {
|
|
26820
|
+
// It execute if the task is in auto mode.
|
|
26821
|
+
if (fromIdFlatData.isAutoSchedule) {
|
|
26822
|
+
if (fromIdFlatData.startDate > toIdFlatData.startDate) {
|
|
26823
|
+
/* eslint-disable-next-line */
|
|
26824
|
+
dateDifference = -(this.parent.dataOperation.getDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone));
|
|
26825
|
+
}
|
|
26826
|
+
else {
|
|
26827
|
+
/* eslint-disable-next-line */
|
|
26828
|
+
dateDifference = this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.startDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone);
|
|
26829
|
+
}
|
|
26830
|
+
// It execute while the slack value is not set to the corresponding task.
|
|
26831
|
+
if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
|
|
26832
|
+
if (fromDateArray1.length <= 1) {
|
|
26833
|
+
if (collection[totaskId]['slack'] + dateDifference < 0) {
|
|
26834
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26835
|
+
}
|
|
26836
|
+
else {
|
|
26837
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
26838
|
+
}
|
|
26839
|
+
}
|
|
26840
|
+
}
|
|
26841
|
+
//It execute while already the slack value is set and it is higher than the datedifference.
|
|
26842
|
+
else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
|
|
26843
|
+
if (fromDateArray1.length <= 1) {
|
|
26844
|
+
if (collection[totaskId]['slack'] + dateDifference < 0) {
|
|
26845
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26846
|
+
}
|
|
26847
|
+
else {
|
|
26848
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
26849
|
+
}
|
|
26850
|
+
}
|
|
26851
|
+
}
|
|
26852
|
+
// execute if the offset value is given.
|
|
26853
|
+
if (fromDateArray1.length > 1) {
|
|
26854
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
26855
|
+
collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
|
|
26856
|
+
if (collection[fromTaskIdIndex]['slack'] < 0) {
|
|
26857
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26858
|
+
}
|
|
26859
|
+
}
|
|
26860
|
+
collection[fromTaskIdIndex]['fs'] = 1;
|
|
26861
|
+
collection[fromTaskIdIndex]['fsslack'] = collection[fromTaskIdIndex]['slack'];
|
|
26862
|
+
collection[fromTaskIdIndex]['enddate'] = fromIdFlatData.startDate;
|
|
26863
|
+
}
|
|
26864
|
+
// It execute if the task is in not an auto mode task.
|
|
26865
|
+
else if (!fromIdFlatData.isAutoSchedule) {
|
|
26866
|
+
dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
|
|
26867
|
+
if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
|
|
26868
|
+
collection[fromTaskIdIndex]['slack'] = dateDifference;
|
|
26869
|
+
}
|
|
26870
|
+
else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
|
|
26871
|
+
collection[fromTaskIdIndex]['slack'] = dateDifference;
|
|
26872
|
+
}
|
|
26873
|
+
}
|
|
26874
|
+
if (fromIdFlatData.endDate >= checkEndDate && fromIdFlatData.endDate <= checkEndDate) {
|
|
26875
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26876
|
+
}
|
|
26877
|
+
}
|
|
26878
|
+
// calculate slack value for the task contains predecessor connection in "finish to finish".
|
|
26879
|
+
if (fromDataPredecessor[i] === 'FF') {
|
|
26880
|
+
// execute if the previous task is from finish to start or finish to finish state.
|
|
26881
|
+
if (collection[totaskId]['fs'] === 1 || collection[totaskId]['ff'] === 1 || collection[totaskId]['fs'] === -1) {
|
|
26882
|
+
if (collection[totaskId]['fs'] === 1 || collection[totaskId]['ff'] === 1) {
|
|
26883
|
+
prevTaskEnddate = toIdFlatData.endDate;
|
|
26884
|
+
ffslack = collection[totaskId]['slack'];
|
|
26885
|
+
}
|
|
26886
|
+
if (collection[totaskId]['fs'] === -1) {
|
|
26887
|
+
prevTaskEnddate = collection[totaskId]['enddate'];
|
|
26888
|
+
ffslack = collection[totaskId]['slack'];
|
|
26889
|
+
}
|
|
26890
|
+
if (prevTaskEnddate > fromIdFlatData.endDate) {
|
|
26891
|
+
dateDifference = -(this.getSlackDuration(fromIdFlatData.endDate, prevTaskEnddate, 'minute', flatRecords[indexFromTaskId]));
|
|
26892
|
+
}
|
|
26893
|
+
else {
|
|
26894
|
+
dateDifference = this.getSlackDuration(prevTaskEnddate, fromIdFlatData.endDate, 'minute', flatRecords[indexFromTaskId]);
|
|
26895
|
+
}
|
|
26896
|
+
// set the slack value if the slack value is not set initially.
|
|
26897
|
+
if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
|
|
26898
|
+
// execute if the offset value is not given.
|
|
26899
|
+
if (fromDateArray1.length <= 1) {
|
|
26900
|
+
if (ffslack - dateDifference < 0) {
|
|
26901
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26902
|
+
}
|
|
26903
|
+
else {
|
|
26904
|
+
collection[fromTaskIdIndex]['slack'] = ffslack - dateDifference;
|
|
26905
|
+
}
|
|
26906
|
+
}
|
|
26907
|
+
}
|
|
26908
|
+
// overright the slack value if the current calculated slack value is less than the previous slack value.
|
|
26909
|
+
else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
|
|
26910
|
+
// execute if the offset value is not given.
|
|
26911
|
+
if (fromDateArray1.length <= 1) {
|
|
26912
|
+
if (ffslack - dateDifference < 0) {
|
|
26913
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26914
|
+
}
|
|
26915
|
+
else {
|
|
26916
|
+
collection[fromTaskIdIndex]['slack'] = ffslack - dateDifference;
|
|
26917
|
+
}
|
|
26918
|
+
}
|
|
26919
|
+
}
|
|
26920
|
+
// execute if the offset value is given.
|
|
26921
|
+
if (fromDateArray1.length > 1) {
|
|
26922
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] - dateDifference;
|
|
26923
|
+
collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
|
|
26924
|
+
if (collection[fromTaskIdIndex]['slack'] < 0) {
|
|
26925
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26926
|
+
}
|
|
26927
|
+
}
|
|
26928
|
+
collection[fromTaskIdIndex]['ff'] = 1;
|
|
26929
|
+
collection[fromTaskIdIndex]['enddate'] = prevTaskEnddate;
|
|
26930
|
+
collection[fromTaskIdIndex]['fsslack'] = ffslack;
|
|
26931
|
+
}
|
|
26932
|
+
if (fromIdFlatData.endDate >= checkEndDate && fromIdFlatData.endDate <= checkEndDate) {
|
|
26933
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26934
|
+
}
|
|
26935
|
+
}
|
|
26936
|
+
// calculate slack value for the task contains predecessor connection in "start to finish".
|
|
26937
|
+
if (fromDataPredecessor[i] === 'SF') {
|
|
26938
|
+
//It execute if the task is an auto mode task.
|
|
26939
|
+
if (fromIdFlatData.isAutoSchedule) {
|
|
26940
|
+
//execute if the slack value is not set initially.
|
|
26941
|
+
if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
|
|
26942
|
+
// execute if the offset value is not given.
|
|
26943
|
+
if (fromDateArray1.length <= 1) {
|
|
26944
|
+
// execute if the previous task does no has sucessor.
|
|
26945
|
+
if (isNullOrUndefined(collection[totaskId]['to'])) {
|
|
26946
|
+
dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
|
|
26947
|
+
collection[fromTaskIdIndex]['slack'] = dateDifference;
|
|
26948
|
+
}
|
|
26949
|
+
// execute if the previous task has sucessor.
|
|
26950
|
+
else if (!isNullOrUndefined(collection[totaskId]['to'])) {
|
|
26951
|
+
if (toIdFlatData.endDate > fromIdFlatData.startDate) {
|
|
26952
|
+
/* eslint-disable-next-line */
|
|
26953
|
+
dateDifference = -(this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone));
|
|
26954
|
+
}
|
|
26955
|
+
else {
|
|
26956
|
+
dateDifference = this.getSlackDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', flatRecords[indexFromTaskId]);
|
|
26957
|
+
}
|
|
26958
|
+
if (collection[totaskId]['slack'] + dateDifference < 0) {
|
|
26959
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26960
|
+
}
|
|
26961
|
+
else {
|
|
26962
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
26963
|
+
}
|
|
26964
|
+
}
|
|
26965
|
+
}
|
|
26966
|
+
// execute if the offset value is given.
|
|
26967
|
+
else if (fromDateArray1.length > 1) {
|
|
26968
|
+
if (toIdFlatData.endDate >= fromIdFlatData.endDate) {
|
|
26969
|
+
if (fromIdFlatData.startDate > toIdFlatData.endDate) {
|
|
26970
|
+
/* eslint-disable-next-line */
|
|
26971
|
+
dateDifference = -(this.getSlackDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', flatRecords[indexFromTaskId]));
|
|
26972
|
+
}
|
|
26973
|
+
else {
|
|
26974
|
+
/* eslint-disable-next-line */
|
|
26975
|
+
dateDifference = this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone);
|
|
26976
|
+
}
|
|
26977
|
+
}
|
|
26978
|
+
else {
|
|
26979
|
+
dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
|
|
26980
|
+
}
|
|
26981
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
26982
|
+
collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
|
|
26983
|
+
if (collection[fromTaskIdIndex]['slack'] < 0) {
|
|
26984
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
26985
|
+
}
|
|
26986
|
+
}
|
|
26987
|
+
collection[fromTaskIdIndex]['fs'] = 1;
|
|
26988
|
+
collection[fromTaskIdIndex]['fsslack'] = collection[fromTaskIdIndex]['slack'];
|
|
26989
|
+
collection[fromTaskIdIndex]['enddate'] = fromIdFlatData.startDate;
|
|
26990
|
+
}
|
|
26991
|
+
else {
|
|
26992
|
+
if (fromDateArray1.length <= 1) {
|
|
26993
|
+
if (isNullOrUndefined(collection[totaskId]['to'])) {
|
|
26994
|
+
/* eslint-disable-next-line */
|
|
26995
|
+
dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
|
|
26996
|
+
}
|
|
26997
|
+
else if (!isNullOrUndefined(collection[totaskId]['to'])) {
|
|
26998
|
+
if (toIdFlatData.endDate > fromIdFlatData.startDate) {
|
|
26999
|
+
// eslint-disable-next-line
|
|
27000
|
+
dateDifference = -(this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone));
|
|
27001
|
+
}
|
|
27002
|
+
else {
|
|
27003
|
+
dateDifference = this.getSlackDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', flatRecords[indexFromTaskId]);
|
|
27004
|
+
}
|
|
27005
|
+
}
|
|
27006
|
+
// execute if the current calculated slack value is less than the previous slack value.
|
|
27007
|
+
if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
|
|
27008
|
+
if (isNullOrUndefined(collection[totaskId]['to'])) {
|
|
27009
|
+
collection[fromTaskIdIndex]['slack'] = dateDifference;
|
|
27010
|
+
}
|
|
27011
|
+
else if (!isNullOrUndefined(collection[totaskId]['to'])) {
|
|
27012
|
+
if (collection[totaskId]['slack'] + dateDifference < 0) {
|
|
27013
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
27014
|
+
}
|
|
27015
|
+
else {
|
|
27016
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
27017
|
+
}
|
|
27018
|
+
}
|
|
27019
|
+
}
|
|
27020
|
+
}
|
|
27021
|
+
else if (fromDateArray1.length > 1) {
|
|
27022
|
+
if (toIdFlatData.endDate > fromIdFlatData.endDate) {
|
|
27023
|
+
if (fromIdFlatData.startDate > toIdFlatData.endDate) {
|
|
27024
|
+
/* eslint-disable-next-line */
|
|
27025
|
+
dateDifference = -(this.getSlackDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', flatRecords[indexFromTaskId]));
|
|
27026
|
+
}
|
|
27027
|
+
else {
|
|
27028
|
+
// eslint-disable-next-line
|
|
27029
|
+
dateDifference = this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone);
|
|
27030
|
+
}
|
|
27031
|
+
}
|
|
27032
|
+
else {
|
|
27033
|
+
/* eslint-disable-next-line */
|
|
27034
|
+
dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
|
|
27035
|
+
}
|
|
27036
|
+
// execute if the current calculated slack value is less than the previous slack value.
|
|
27037
|
+
if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
|
|
27038
|
+
collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
|
|
27039
|
+
collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
|
|
27040
|
+
if (collection[fromTaskIdIndex]['slack'] < 0) {
|
|
27041
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
27042
|
+
}
|
|
27043
|
+
}
|
|
27044
|
+
}
|
|
27045
|
+
collection[fromTaskIdIndex]['fs'] = 1;
|
|
27046
|
+
collection[fromTaskIdIndex]['fsslack'] = collection[fromTaskIdIndex]['slack'];
|
|
27047
|
+
collection[fromTaskIdIndex]['enddate'] = fromIdFlatData.startDate;
|
|
27048
|
+
}
|
|
27049
|
+
}
|
|
27050
|
+
//It execute if the task is an auto mode task.
|
|
27051
|
+
else if (!fromIdFlatData.isAutoSchedule) {
|
|
27052
|
+
dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
|
|
27053
|
+
if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
|
|
27054
|
+
collection[fromTaskIdIndex]['slack'] = dateDifference;
|
|
27055
|
+
}
|
|
27056
|
+
else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
|
|
27057
|
+
collection[fromTaskIdIndex]['slack'] = dateDifference;
|
|
27058
|
+
}
|
|
27059
|
+
}
|
|
27060
|
+
if (fromIdFlatData.endDate >= checkEndDate && fromIdFlatData.endDate <= checkEndDate) {
|
|
27061
|
+
collection[fromTaskIdIndex]['slack'] = 0;
|
|
27062
|
+
}
|
|
27063
|
+
}
|
|
27064
|
+
if (collection[fromTaskIdIndex]['from']) {
|
|
27065
|
+
fromDataObject.push({
|
|
27066
|
+
fromdata: collection[fromTaskIdIndex]['from'], todateID: collection[fromTaskIdIndex]['taskid'],
|
|
27067
|
+
fromDataPredecessor: collection[fromTaskIdIndex]['fromPredecessor']
|
|
27068
|
+
});
|
|
27069
|
+
}
|
|
27070
|
+
}
|
|
27071
|
+
if (fromDataObject) {
|
|
27072
|
+
fromDataObject.splice(0, 1);
|
|
27073
|
+
if (fromDataObject.length > 0) {
|
|
27074
|
+
this.slackCalculation(fromDataObject, collection, collectionTaskId, checkEndDate, flatRecords, modelRecordIds);
|
|
27075
|
+
}
|
|
27076
|
+
}
|
|
27077
|
+
}
|
|
27078
|
+
getSlackDuration(sDate, eDate, durationUnit, record) {
|
|
27079
|
+
const startDate = this.parent.dateValidationModule.checkStartDate(new Date(sDate));
|
|
27080
|
+
const endDate = this.parent.dateValidationModule.checkEndDate(new Date(eDate));
|
|
27081
|
+
if (this.parent.dataOperation['getTimeDifference'](startDate, endDate, true) <= 0) {
|
|
27082
|
+
return 0;
|
|
27083
|
+
}
|
|
27084
|
+
else {
|
|
27085
|
+
return this.parent.dataOperation.getDuration(startDate, endDate, durationUnit, record.ganttProperties.isAutoSchedule, true);
|
|
27086
|
+
}
|
|
27087
|
+
}
|
|
27088
|
+
/* eslint-disable-next-line */
|
|
27089
|
+
finalCriticalPath(collection, taskBeyondEnddate, flatRecords, modelRecordIds, checkEndDate) {
|
|
27090
|
+
let criticalPathIds = [];
|
|
27091
|
+
let index;
|
|
27092
|
+
for (let x = collection.length - 1; x >= 0; x--) {
|
|
27093
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
27094
|
+
index = modelRecordIds.indexOf(collection[x]['taskid'].toString());
|
|
27095
|
+
}
|
|
27096
|
+
else {
|
|
27097
|
+
index = this.resourceCollectionIds.indexOf(collection[x]['taskid'].toString());
|
|
27098
|
+
}
|
|
27099
|
+
const predecessorLength = flatRecords[index].ganttProperties.predecessor;
|
|
27100
|
+
const noSlackValue = 0 + ' ' + flatRecords[index].ganttProperties.durationUnit;
|
|
27101
|
+
for (let i = 0; i < predecessorLength.length; i++) {
|
|
27102
|
+
let toID;
|
|
27103
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
27104
|
+
toID = this.parent.ids.indexOf(predecessorLength[i].to);
|
|
27105
|
+
}
|
|
27106
|
+
else {
|
|
27107
|
+
toID = this.resourceCollectionIds.indexOf(predecessorLength[i].to);
|
|
27108
|
+
}
|
|
27109
|
+
let dateDifference;
|
|
27110
|
+
const currentData = flatRecords[index].ganttProperties;
|
|
27111
|
+
if (predecessorLength[i].type === 'FS') {
|
|
27112
|
+
/* eslint-disable-next-line */
|
|
27113
|
+
dateDifference = this.parent.dataOperation.getDuration(currentData.endDate, flatRecords[toID].ganttProperties.startDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
|
|
27114
|
+
if (dateDifference === 0 && index !== toID && flatRecords[index].slack !== noSlackValue) {
|
|
27115
|
+
flatRecords[index].slack = flatRecords[toID].slack;
|
|
27116
|
+
flatRecords[index].ganttProperties.slack = flatRecords[toID].slack;
|
|
27117
|
+
}
|
|
27118
|
+
else if (dateDifference !== 0 && index !== toID && flatRecords[toID].isCritical) {
|
|
27119
|
+
flatRecords[index].slack = dateDifference + ' ' + flatRecords[index].ganttProperties.durationUnit;
|
|
27120
|
+
flatRecords[index].ganttProperties.slack = dateDifference + ' ' + flatRecords[index].ganttProperties.durationUnit;
|
|
27121
|
+
}
|
|
27122
|
+
}
|
|
27123
|
+
else if (predecessorLength[i].type === 'SF') {
|
|
27124
|
+
/* eslint-disable-next-line */
|
|
27125
|
+
dateDifference = this.parent.dataOperation.getDuration(currentData.startDate, flatRecords[toID].ganttProperties.endDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
|
|
27126
|
+
}
|
|
27127
|
+
else if (predecessorLength[i].type === 'SS') {
|
|
27128
|
+
/* eslint-disable-next-line */
|
|
27129
|
+
dateDifference = this.parent.dataOperation.getDuration(currentData.startDate, flatRecords[toID].ganttProperties.startDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
|
|
27130
|
+
}
|
|
27131
|
+
else {
|
|
27132
|
+
/* eslint-disable-next-line */
|
|
27133
|
+
dateDifference = this.parent.dataOperation.getDuration(currentData.endDate, flatRecords[toID].ganttProperties.endDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
|
|
27134
|
+
}
|
|
27135
|
+
if (parseInt(predecessorLength[i].from, 10) === flatRecords[index][this.parent.taskFields.id] &&
|
|
27136
|
+
flatRecords[toID].slack === noSlackValue && dateDifference <= 0) {
|
|
27137
|
+
flatRecords[index].slack = noSlackValue;
|
|
27138
|
+
flatRecords[index].ganttProperties.slack = noSlackValue;
|
|
27139
|
+
}
|
|
27140
|
+
}
|
|
27141
|
+
if (flatRecords[index].slack === noSlackValue) {
|
|
27142
|
+
if (flatRecords[index].ganttProperties.progress < 100) {
|
|
27143
|
+
flatRecords[index].isCritical = true;
|
|
27144
|
+
flatRecords[index].ganttProperties.isCritical = true;
|
|
27145
|
+
this.criticalTasks.push(flatRecords[index]);
|
|
27146
|
+
criticalPathIds.push(collection[x]['taskid']);
|
|
27147
|
+
}
|
|
27148
|
+
}
|
|
27149
|
+
}
|
|
27150
|
+
if (taskBeyondEnddate.length > 0) {
|
|
27151
|
+
for (let i = 0; i < taskBeyondEnddate.length; i++) {
|
|
27152
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
27153
|
+
index = modelRecordIds.indexOf(taskBeyondEnddate[i].toString());
|
|
27154
|
+
}
|
|
27155
|
+
else {
|
|
27156
|
+
index = this.resourceCollectionIds.indexOf(taskBeyondEnddate[i].toString());
|
|
27157
|
+
}
|
|
27158
|
+
if (index !== -1 && flatRecords[index].ganttProperties.progress < 100) {
|
|
27159
|
+
this.criticalTasks.push(flatRecords[index]);
|
|
27160
|
+
criticalPathIds = criticalPathIds.concat(taskBeyondEnddate[i]);
|
|
27161
|
+
}
|
|
27162
|
+
}
|
|
27163
|
+
}
|
|
27164
|
+
return criticalPathIds;
|
|
27165
|
+
}
|
|
27166
|
+
/* eslint-disable-next-line */
|
|
27167
|
+
criticalConnectorLine(criticalPathIds, collection, condition, collectionTaskId) {
|
|
27168
|
+
const ganttChartElement = this.parent.ganttChartModule.chartElement;
|
|
27169
|
+
removeClass(ganttChartElement.querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
|
|
27170
|
+
removeClass(ganttChartElement.querySelectorAll('.e-gantt-child-progressbar-inner-div'), criticalChildProgressBarInnerDiv);
|
|
27171
|
+
removeClass(ganttChartElement.querySelectorAll('.e-milestone-top'), criticalMilestoneTop);
|
|
27172
|
+
removeClass(ganttChartElement.querySelectorAll('.e-milestone-bottom'), criticalMilestoneBottom);
|
|
27173
|
+
for (let i = 0; i < criticalPathIds.length; i++) {
|
|
27174
|
+
let criticalData;
|
|
27175
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
27176
|
+
criticalData = this.parent.flatData[this.parent.ids.indexOf(criticalPathIds[i].toString())];
|
|
27177
|
+
}
|
|
27178
|
+
else {
|
|
27179
|
+
criticalData = this.parent.flatData[this.resourceCollectionIds.indexOf(criticalPathIds[i].toString())];
|
|
27180
|
+
}
|
|
27181
|
+
const index = this.parent.currentViewData.indexOf(criticalData);
|
|
27182
|
+
const element = this.parent.getRowByIndex(index);
|
|
27183
|
+
let taskClass;
|
|
27184
|
+
const columnFields = this.parent.taskFields;
|
|
27185
|
+
/* eslint-disable-next-line */
|
|
27186
|
+
if (this.parent.allowUnscheduledTasks && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
|
|
27187
|
+
taskClass = criticalUnscheduledTask;
|
|
27188
|
+
}
|
|
27189
|
+
else {
|
|
27190
|
+
taskClass = criticalChildProgressBarInnerDiv;
|
|
27191
|
+
}
|
|
27192
|
+
if (element) {
|
|
27193
|
+
if (element.getElementsByClassName('e-milestone-top')[0]) {
|
|
27194
|
+
addClass(element.querySelectorAll('.e-milestone-top'), criticalMilestoneTop);
|
|
27195
|
+
}
|
|
27196
|
+
if (element.getElementsByClassName('e-milestone-bottom')[0]) {
|
|
27197
|
+
addClass(element.querySelectorAll('.e-milestone-bottom'), criticalMilestoneBottom);
|
|
27198
|
+
}
|
|
27199
|
+
if (element.getElementsByClassName('e-gantt-child-taskbar-inner-div').length > 0) {
|
|
27200
|
+
addClass(element.querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
|
|
27201
|
+
}
|
|
27202
|
+
if (element.getElementsByClassName('e-gantt-child-progressbar-inner-div').length > 0) {
|
|
27203
|
+
addClass(element.querySelectorAll('.e-gantt-child-progressbar-inner-div'), taskClass);
|
|
27204
|
+
}
|
|
27205
|
+
}
|
|
27206
|
+
}
|
|
27207
|
+
removeClass(this.parent.element.querySelectorAll('.e-line'), criticalConnectorLine);
|
|
27208
|
+
removeClass(this.parent.element.querySelectorAll('.e-connector-line-right-arrow'), criticalConnectorLineRightArrow);
|
|
27209
|
+
removeClass(this.parent.element.querySelectorAll('.e-connector-line-left-arrow'), criticalConnectorLineLeftArrow);
|
|
27210
|
+
if (collection.length !== 0) {
|
|
27211
|
+
let index = 0;
|
|
27212
|
+
let currentdata;
|
|
27213
|
+
let checking = [];
|
|
27214
|
+
let checkint;
|
|
27215
|
+
for (let i = 0; i < this.criticalPathCollection.length; i++) {
|
|
27216
|
+
index = collectionTaskId.indexOf(this.criticalPathCollection[i]);
|
|
27217
|
+
currentdata = collection[index];
|
|
27218
|
+
if (index !== -1 && currentdata['to']) {
|
|
27219
|
+
checking = currentdata['to'].split(',');
|
|
27220
|
+
for (let j = 0; j < checking.length; j++) {
|
|
27221
|
+
checkint = parseInt(checking[j], 10);
|
|
27222
|
+
if (criticalPathIds.indexOf(checkint) !== -1) {
|
|
27223
|
+
const lineElement = this.parent.element.querySelectorAll('#ConnectorLineparent' +
|
|
27224
|
+
currentdata['taskid'] + 'child' + checkint);
|
|
27225
|
+
if (lineElement.length > 0) {
|
|
27226
|
+
addClass(this.parent.element.querySelectorAll('#ConnectorLineparent' + currentdata['taskid'] + 'child' +
|
|
27227
|
+
checkint)[0].querySelectorAll('.e-line'), criticalConnectorLine);
|
|
27228
|
+
addClass(this.parent.element.querySelectorAll('#ConnectorLineparent' + currentdata['taskid'] + 'child' +
|
|
27229
|
+
checkint)[0].querySelectorAll('.e-connector-line-right-arrow'), criticalConnectorLineRightArrow);
|
|
27230
|
+
addClass(this.parent.element.querySelectorAll('#ConnectorLineparent' + currentdata['taskid'] + 'child' +
|
|
27231
|
+
checkint)[0].querySelectorAll('.e-connector-line-left-arrow'), criticalConnectorLineLeftArrow);
|
|
27232
|
+
}
|
|
27233
|
+
}
|
|
27234
|
+
}
|
|
27235
|
+
}
|
|
27236
|
+
}
|
|
27237
|
+
}
|
|
27238
|
+
}
|
|
27239
|
+
getModuleName() {
|
|
27240
|
+
return 'criticalPath';
|
|
27241
|
+
}
|
|
27242
|
+
/**
|
|
27243
|
+
* Destroys the Critical Path of Gantt.
|
|
27244
|
+
*
|
|
27245
|
+
* @returns {void} .
|
|
27246
|
+
* @private
|
|
27247
|
+
*/
|
|
27248
|
+
destroy() {
|
|
27249
|
+
if (!this.parent.enableCriticalPath && this.parent.criticalPathModule) {
|
|
27250
|
+
this.parent.criticalPathModule = undefined;
|
|
27251
|
+
}
|
|
27252
|
+
}
|
|
27253
|
+
}
|
|
27254
|
+
|
|
26257
27255
|
// eslint-disable-next-line
|
|
26258
27256
|
/**
|
|
26259
27257
|
* The ContextMenu module is used to handle the context menu items & sub-menu items.
|
|
@@ -26482,9 +27480,8 @@ class ContextMenu$2 {
|
|
|
26482
27480
|
getClickedDate(element) {
|
|
26483
27481
|
// context menu click position
|
|
26484
27482
|
const ganttElementPosition = this.parent.getOffsetRect(this.parent.element);
|
|
26485
|
-
const ganttLeft = ganttElementPosition.left - this.parent.element.offsetLeft;
|
|
26486
27483
|
// task left position
|
|
26487
|
-
const pageLeft =
|
|
27484
|
+
const pageLeft = ganttElementPosition.left + this.parent.ganttChartModule.chartElement.offsetLeft +
|
|
26488
27485
|
this.rowData.ganttProperties.left - this.parent.ganttChartModule.scrollElement.scrollLeft;
|
|
26489
27486
|
// difference from task start date to current click position.
|
|
26490
27487
|
const currentTaskDifference = this.clickedPosition - pageLeft;
|
|
@@ -26670,7 +27667,7 @@ class ContextMenu$2 {
|
|
|
26670
27667
|
break;
|
|
26671
27668
|
case 'Indent':
|
|
26672
27669
|
{
|
|
26673
|
-
if (!this.parent.allowSelection) {
|
|
27670
|
+
if (!this.parent.allowSelection || !this.parent.editModule || !this.parent.editSettings) {
|
|
26674
27671
|
this.hideItems.push(item.text);
|
|
26675
27672
|
}
|
|
26676
27673
|
else {
|
|
@@ -26687,7 +27684,7 @@ class ContextMenu$2 {
|
|
|
26687
27684
|
}
|
|
26688
27685
|
case 'Outdent':
|
|
26689
27686
|
{
|
|
26690
|
-
if (!this.parent.allowSelection) {
|
|
27687
|
+
if (!this.parent.allowSelection || !this.parent.editModule || !this.parent.editSettings) {
|
|
26691
27688
|
this.hideItems.push(item.text);
|
|
26692
27689
|
}
|
|
26693
27690
|
else {
|
|
@@ -27921,6 +28918,10 @@ class PdfGanttTheme {
|
|
|
27921
28918
|
//chart side theme
|
|
27922
28919
|
ganttStyle.taskbar.taskColor = new PdfColor(49, 122, 185);
|
|
27923
28920
|
ganttStyle.taskbar.progressColor = new PdfColor(33, 82, 125);
|
|
28921
|
+
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
28922
|
+
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
28923
|
+
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
28924
|
+
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
27924
28925
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(119, 119, 119);
|
|
27925
28926
|
ganttStyle.taskbar.parentProgressColor = new PdfColor(85, 85, 85);
|
|
27926
28927
|
ganttStyle.taskbar.taskBorderColor = new PdfColor(33, 82, 125);
|
|
@@ -27937,6 +28938,10 @@ class PdfGanttTheme {
|
|
|
27937
28938
|
//chart side theme
|
|
27938
28939
|
ganttStyle.taskbar.taskColor = new PdfColor(0, 123, 255);
|
|
27939
28940
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 86, 179);
|
|
28941
|
+
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
28942
|
+
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
28943
|
+
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
28944
|
+
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
27940
28945
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(108, 117, 125);
|
|
27941
28946
|
ganttStyle.taskbar.parentProgressColor = new PdfColor(73, 80, 87);
|
|
27942
28947
|
ganttStyle.taskbar.taskBorderColor = new PdfColor(0, 86, 179);
|
|
@@ -27955,6 +28960,10 @@ class PdfGanttTheme {
|
|
|
27955
28960
|
//chart side theme
|
|
27956
28961
|
ganttStyle.taskbar.taskColor = new PdfColor(0, 120, 214);
|
|
27957
28962
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 91, 163);
|
|
28963
|
+
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
28964
|
+
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
28965
|
+
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
28966
|
+
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
27958
28967
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(118, 118, 118);
|
|
27959
28968
|
ganttStyle.taskbar.parentProgressColor = new PdfColor(80, 80, 80);
|
|
27960
28969
|
ganttStyle.taskbar.taskBorderColor = new PdfColor(0, 91, 163);
|
|
@@ -27971,6 +28980,10 @@ class PdfGanttTheme {
|
|
|
27971
28980
|
//chart side theme
|
|
27972
28981
|
ganttStyle.taskbar.taskColor = new PdfColor(88, 105, 197);
|
|
27973
28982
|
ganttStyle.taskbar.progressColor = new PdfColor(63, 81, 181);
|
|
28983
|
+
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
28984
|
+
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
28985
|
+
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
28986
|
+
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
27974
28987
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(132, 132, 132);
|
|
27975
28988
|
ganttStyle.taskbar.parentProgressColor = new PdfColor(97, 97, 97);
|
|
27976
28989
|
ganttStyle.taskbar.taskBorderColor = new PdfColor(63, 81, 181);
|
|
@@ -30081,6 +31094,12 @@ class ExportHelper {
|
|
|
30081
31094
|
predecessor.milestoneParent = data.milestoneParent;
|
|
30082
31095
|
predecessor.milestoneChild = data.milestoneChild;
|
|
30083
31096
|
predecessor.lineWidth = this.parent.connectorLineWidth > 5 ? pixelToPoint(5) : pixelToPoint(this.parent.connectorLineWidth);
|
|
31097
|
+
if (data.isCritical) {
|
|
31098
|
+
predecessor.connectorLineColor = this.ganttStyle.criticalConnectorLineColor;
|
|
31099
|
+
}
|
|
31100
|
+
else {
|
|
31101
|
+
predecessor.connectorLineColor = this.ganttStyle.connectorLineColor;
|
|
31102
|
+
}
|
|
30084
31103
|
predecessor.connectorLineColor = this.ganttStyle.connectorLineColor;
|
|
30085
31104
|
this.gantt.predecessorCollection.push(predecessor);
|
|
30086
31105
|
});
|
|
@@ -30202,9 +31221,16 @@ class ExportHelper {
|
|
|
30202
31221
|
taskbar.progressColor = new PdfColor(this.ganttStyle.taskbar.parentProgressColor);
|
|
30203
31222
|
}
|
|
30204
31223
|
else {
|
|
30205
|
-
|
|
30206
|
-
|
|
30207
|
-
|
|
31224
|
+
if (data.isCritical) {
|
|
31225
|
+
taskbar.taskColor = new PdfColor(this.ganttStyle.taskbar.criticalTaskColor);
|
|
31226
|
+
taskbar.progressColor = new PdfColor(this.ganttStyle.taskbar.criticalProgressColor);
|
|
31227
|
+
taskbar.taskBorderColor = new PdfColor(this.ganttStyle.taskbar.criticalTaskBorderColor);
|
|
31228
|
+
}
|
|
31229
|
+
else {
|
|
31230
|
+
taskbar.taskColor = new PdfColor(this.ganttStyle.taskbar.taskColor);
|
|
31231
|
+
taskbar.progressColor = new PdfColor(this.ganttStyle.taskbar.progressColor);
|
|
31232
|
+
taskbar.taskBorderColor = new PdfColor(this.ganttStyle.taskbar.taskBorderColor);
|
|
31233
|
+
}
|
|
30208
31234
|
}
|
|
30209
31235
|
taskbar.gridLineColor = new PdfColor(this.ganttStyle.chartGridLineColor);
|
|
30210
31236
|
this.gantt.taskbarCollection.push(taskbar);
|
|
@@ -30430,13 +31456,13 @@ class ExportValueFormatter {
|
|
|
30430
31456
|
if (typeof args.column.format === 'string') {
|
|
30431
31457
|
let format;
|
|
30432
31458
|
if (args.column.type === 'date') {
|
|
30433
|
-
format = { type: 'date',
|
|
31459
|
+
format = { type: 'date', format: args.column.format };
|
|
30434
31460
|
}
|
|
30435
31461
|
else if (args.column.type === 'time') {
|
|
30436
|
-
format = { type: 'time',
|
|
31462
|
+
format = { type: 'time', format: args.column.format };
|
|
30437
31463
|
}
|
|
30438
31464
|
else {
|
|
30439
|
-
format = { type: 'dateTime',
|
|
31465
|
+
format = { type: 'dateTime', format: args.column.format };
|
|
30440
31466
|
}
|
|
30441
31467
|
return this.returnFormattedValue(args, format);
|
|
30442
31468
|
}
|
|
@@ -31951,5 +32977,5 @@ class VirtualScroll$1 {
|
|
|
31951
32977
|
* Gantt index file
|
|
31952
32978
|
*/
|
|
31953
32979
|
|
|
31954
|
-
export { Gantt, PdfHorizontalOverflowType, parentsUntil$1 as parentsUntil, isScheduledTask, isCountRequired, getSwapKey, isRemoteData, getTaskData, updateDates, formatString, getIndex, pixelToPoint, pointToPixel, getUid$1 as getUid, load, rowDataBound, queryCellInfo, toolbarClick, keyPressed, Edit$2 as Edit, Reorder$1 as Reorder, Resize$1 as Resize, Filter$1 as Filter, Sort$1 as Sort, Dependency, Selection$1 as Selection, Toolbar$3 as Toolbar, DayMarkers, ContextMenu$2 as ContextMenu, ExcelExport$1 as ExcelExport, ColumnMenu$1 as ColumnMenu, RowDD$1 as RowDD, PdfExport, VirtualScroll$1 as VirtualScroll, Column, DayWorkingTime, AddDialogFieldSettings, EditDialogFieldSettings, EditSettings, EventMarker, FilterSettings, SearchSettings, Holiday, LabelSettings, SelectionSettings, SplitterSettings, TaskFields, TimelineTierSettings, TimelineSettings, TooltipSettings, SortDescriptor, SortSettings, ResourceFields };
|
|
32980
|
+
export { Gantt, PdfHorizontalOverflowType, parentsUntil$1 as parentsUntil, isScheduledTask, isCountRequired, getSwapKey, isRemoteData, getTaskData, updateDates, formatString, getIndex, pixelToPoint, pointToPixel, getUid$1 as getUid, load, rowDataBound, queryCellInfo, toolbarClick, keyPressed, Edit$2 as Edit, Reorder$1 as Reorder, Resize$1 as Resize, Filter$1 as Filter, Sort$1 as Sort, Dependency, Selection$1 as Selection, Toolbar$3 as Toolbar, DayMarkers, CriticalPath, ContextMenu$2 as ContextMenu, ExcelExport$1 as ExcelExport, ColumnMenu$1 as ColumnMenu, RowDD$1 as RowDD, PdfExport, VirtualScroll$1 as VirtualScroll, Column, DayWorkingTime, AddDialogFieldSettings, EditDialogFieldSettings, EditSettings, EventMarker, FilterSettings, SearchSettings, Holiday, LabelSettings, SelectionSettings, SplitterSettings, TaskFields, TimelineTierSettings, TimelineSettings, TooltipSettings, SortDescriptor, SortSettings, ResourceFields };
|
|
31955
32981
|
//# sourceMappingURL=ej2-gantt.es2015.js.map
|