Repository navigation
Feat: upgrade dhtmlx-gantt to v10 - #227
Conversation
| text: __("Today", 'gantt') | ||
| }); | ||
| // highlight the current day column (no marker plugin in dhtmlx-gantt 10 community edition) | ||
| gantt.templates.timeline_cell_class = (task, date) => { |
There was a problem hiding this comment.
timeline_cell_class only matches when the cell's start date is today, so at the month/quarter/year zoom levels (cell unit = week or month) the current period is almost never highlighted; the old marker was visible at every zoom. Compare against the cell's range using the active scale unit instead (this also lets today be hoisted out of the per-cell callback).
gantt.templates.timeline_cell_class = (task, date) => {
const now = new Date();
const cell_end = gantt.date.add(date, 1, gantt.getScale().unit);
return date <= now && now < cell_end ? "today" : "";
};| } else { | ||
| gantt.alert(__('Could not update Task[%s]: ', 'gantt').replace('%s', task.text) + json.error); | ||
| gantt.undo(); | ||
| if (lastDragState && lastDragState.id === task.id) { |
There was a problem hiding this comment.
The new snapshot/rollback path (onBeforeTaskDrag + lastDragState restore on { ok: false }) replaces gantt.undo() but the e2e spec only exercises the changeItemParent rollback, which this PR did not change. A test that drags a task bar, fulfils the updateTask=1 request with { ok: false } and asserts the original start_date/end_date would cover the actual replacement code.
22e10a2 to
06c06cc
Compare
Checklist before requesting a review
Please delete options that are not relevant.
Description
Screenshots (if appropriate):