support
support copied to clipboard
Unplanned tasks resets duration on revertChanges
Hi,
We have a use case for unplanned work/ unplanned tasks to revert the changes when the backend returns an error on the save event. This all works fine, except the scheduler does not reset the duration field -> with as result the task is back in the unplanned grid, but the duration field is not set anymore.
It is reproducible on the public demo of unplanned work (https://bryntum.com/products/schedulerpro/examples/drag-unplanned-tasks/). Replace the onSave method with the following:
onSave() {
Toast.show('TODO: Save data (see onSave() event for SchedulerPro)');
// console.log('Changes:', this.project.changes);
this.project.commitAsync().then(() => {
this.project.revertChanges();
return this.project.commitAsync()
}).then(() => {
this.project.acceptChanges();
});
},
https://drive.google.com/file/d/1-9C4OUWLCAxXk-caWiK_3_1QTW0X5joi/view?usp=sharing
Looks engine related @canonic-epicure, after event is "descheduled", start+end are reset to null which triggers duration to be lost too.