Browse Source

Merge pull request 'Fix show hide column' (#30) from dev-wahyu into staging

Reviewed-on: ordo/adw-gantt#30
pull/1/head
ibnu 1 year ago
parent
commit
985f0438f5
  1. 10
      edit-mode/function/expenseResource.js
  2. 29
      edit-mode/function/function.js
  3. 18
      edit-mode/function/materialResource.js
  4. 10
      edit-mode/function/reportActivity.js

10
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();

29
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);
@ -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;
}
}

18
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();

10
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()

Loading…
Cancel
Save