From 81e2e3f63fd1533be693a2883647d1b97d30c721 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Fri, 25 Aug 2023 08:09:48 +0700 Subject: [PATCH 1/3] Fix show hide column --- edit-mode/function/function.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/edit-mode/function/function.js b/edit-mode/function/function.js index 7aa1542..dde69da 100644 --- a/edit-mode/function/function.js +++ b/edit-mode/function/function.js @@ -539,10 +539,10 @@ function setUpForShowHideColumn(data) { configColumn[val.column_name] = val.show }); if (!isBaselineSet) { - configColumn.planned_start = undefined; - configColumn.planned_end = undefined; - configColumn.planned_duration = undefined; - configColumn.baseline_progress = undefined; + // configColumn.planned_start = undefined; + // configColumn.planned_end = undefined; + // configColumn.planned_duration = undefined; + // configColumn.baseline_progress = undefined; } gantt.config.columns = createColumnsConfig(configColumn); From 511ddcbcefd6bd6c04fc53e632f9e662203c24c7 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Fri, 25 Aug 2023 09:48:09 +0700 Subject: [PATCH 2/3] handle abort error request material --- edit-mode/function/expenseResource.js | 10 +++++++++- edit-mode/function/materialResource.js | 18 ++++++++++++++---- edit-mode/function/reportActivity.js | 10 +++++++++- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/edit-mode/function/expenseResource.js b/edit-mode/function/expenseResource.js index bd7f101..2ab9f3f 100644 --- a/edit-mode/function/expenseResource.js +++ b/edit-mode/function/expenseResource.js @@ -131,7 +131,15 @@ $(document).ready(function () { cache: false } }); - + // $('#required-date-req-expense').datepicker({ + // format: 'dd-mm-yyyy', // Set the desired format + // autoclose: true // Close the datepicker when a date is selected + // }); + // + // $('#required-date-plan-expense').datepicker({ + // format: 'dd-mm-yyyy', // Set the desired format + // autoclose: true // Close the datepicker when a date is selected + // }); $("#form-assign-expense").on('submit', function (e) { e.preventDefault(); diff --git a/edit-mode/function/materialResource.js b/edit-mode/function/materialResource.js index 1a01df7..f540f4d 100644 --- a/edit-mode/function/materialResource.js +++ b/edit-mode/function/materialResource.js @@ -164,13 +164,23 @@ $(document).ready(function () { results: dataIntegrasiMaterial }; }, error: function (jqXHR, textStatus, errorThrown) { - gantt.alert(`Status: ${textStatus}`); - gantt.alert(`Error thrown: ${errorThrown}`); - gantt.alert(`Error accessing URL: ${adwIntegrationUrl}/request-material/get-material-integration`); + if (textStatus != "abort") { + gantt.alert(`Status: ${textStatus}`); + gantt.alert(`Error thrown: ${errorThrown}`); + gantt.alert(`Error accessing URL: ${adwIntegrationUrl}/request-material/get-material-integration`); + } } } }); - + // $('#required-date-req-material').datepicker({ + // format: 'dd-mm-yyyy', // Set the desired format + // autoclose: true // Close the datepicker when a date is selected + // }); + // + // $('#required-date-plan-material').datepicker({ + // format: 'dd-mm-yyyy', // Set the desired format + // autoclose: true // Close the datepicker when a date is selected + // }); $("#form-assign-material").on('submit', function (e) { e.preventDefault(); diff --git a/edit-mode/function/reportActivity.js b/edit-mode/function/reportActivity.js index 0800729..89d9b98 100644 --- a/edit-mode/function/reportActivity.js +++ b/edit-mode/function/reportActivity.js @@ -62,7 +62,15 @@ $(document).ready(function () { $('#ra_date_end_activity').prop('disabled', true); } }); - + // $('#ra_date_start_activity').datepicker({ + // format: 'dd-mm-yyyy', // Set the desired format + // autoclose: true // Close the datepicker when a date is selected + // }); + // + // $('#ra_date_end_activity').datepicker({ + // format: 'dd-mm-yyyy', // Set the desired format + // autoclose: true // Close the datepicker when a date is selected + // }); $("#ra_date_end_activity").on("change", function () { let valEnd = $(this).val() let valStart = $('#ra_date_start_activity').val() From de987474dbb4dcbd6f24ed3e8880f3b08a275647 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Fri, 25 Aug 2023 11:21:36 +0700 Subject: [PATCH 3/3] handle all link type update link --- edit-mode/function/function.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/edit-mode/function/function.js b/edit-mode/function/function.js index dde69da..68cb96d 100644 --- a/edit-mode/function/function.js +++ b/edit-mode/function/function.js @@ -716,8 +716,25 @@ function updateLinksLag(data) { if (link.target == task.id) { let predecessor = data.data.find(item => item.id == link.source); if (predecessor) { - let lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date)); - if (link.type == "0" && isBaselineSet) { + let lag; + if (isBaselineSet) { + switch (link.type) { + case "0": + lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date)); + break; + case "1": + lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.start_date)); + break; + case "2": + lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.end_date)); + break; + case "3": + lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.end_date)); + break; + default: + // Handle an unknown link type if needed + break; + } link.lag = lag; } }