We’ve been working on a poc using the GANTT and want to purchase the license. However we faced a bug and before we continue with it, we want to solve this issue.
We are using GANTT on react and on the task change we send that new data to my api and then reparsing the task list to the gantt, but when we do it if we have a link between two tasks, the child is endlessly triggering taskUpdate on my dataProcessor. I am sending some files with the core gantt implementation.
This is my data processor:
const dataProcessor = useMemo(() => {
return createDataProcessor({
middleware: (type, data) => console.log(type, data),
linkCreate: data => {
const { id, ...dataWithoutId } = data;
handleCreatePlanningLink({ values: { idRefurbish, ...dataWithoutId } }).then(resp =>
ganttInstance.changeLinkId(data.id, resp.id)
);
},
linkUpdate: data => {
handleUpdatePlanningLink({ values: { idRefurbish, ...data } });
},
linkDelete: data => {
handleDeletePlanningLink({ idRefurbish, ...data });
},
taskUpdate: data => {
handleChange({
idRefurbish,
id: data.id,
plStartDate: getBrazilianDate(ganttInstance.date.str_to_date('%d-%m-%Y %H:%i')(data?.start_date)),
plEndDate: getBrazilianDate(ganttInstance.date.str_to_date('%d-%m-%Y %H:%i')(data?.end_date)),
duration: data?.duration === 0 || data?.duration ? data?.duration : undefined
});
},
taskCreate: data => {
const { id, ...dataWithoutId } = data;
handleCreate({
values: {
idRefurbish,
name: data?.text,
plStartDate: ganttInstance.date.str_to_date('%d-%m-%Y %H:%i')(data?.start_date),
plEndDate: ganttInstance.date.str_to_date('%d-%m-%Y %H:%i')(data?.end_date),
idParent: data.parent ? data.parent : null,
...dataWithoutId
}
}).then(resp => ganttInstance.changeTaskId(data.id, resp.id));
},
taskDelete: data => {
handleDelete({ idRefurbish, ...data });
}
});
}, [idRefurbish]);