Skip to content

Feat: upgrade dhtmlx-gantt to v10 - #227

Merged
Rom1-B merged 4 commits into
mainfrom
fix_dhtmlx-gantt_v10
Oct 5, 2026
Merged

Rom1-B merged 4 commits into
mainfrom
fix_dhtmlx-gantt_v10

Conversation

@Rom1-B

@Rom1-B Rom1-B commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It replace Bump dhtmlx-gantt from 9.1.4 to 10.0.0 #219
  • Upgrades the bundled dhtmlx-gantt library from v9 to v10.
  • The community edition of v10 drops the marker and undo plugins used by the Gantt view, so the today-column highlight and the rollback of a rejected drag-and-drop are now handled by the plugin itself instead of relying on those plugins.
  • Adds a permanent Playwright e2e suite for the Gantt view to catch regressions on this upgrade going forward, covering rendering, the today-column highlight, and drag and drop reparenting with rollback on a server-rejected change.
  • Adds a dedicated CI workflow to run these tests against a real GLPI instance, since they need a browser and a database the shared plugin CI does not provide.

Screenshots (if appropriate):

@Rom1-B
Rom1-B requested a review from stonebuzz August 7, 2026 14:08
Comment thread public/js/gantt-helper.js
text: __("Today", 'gantt')
});
// highlight the current day column (no marker plugin in dhtmlx-gantt 10 community edition)
gantt.templates.timeline_cell_class = (task, date) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" : "";
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread public/js/gantt-helper.js
} else {
gantt.alert(__('Could not update Task[%s]: ', 'gantt').replace('%s', task.text) + json.error);
gantt.undo();
if (lastDragState && lastDragState.id === task.id) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Rom1-B
Rom1-B requested a review from stonebuzz October 5, 2026 08:22
@Rom1-B
Rom1-B force-pushed the fix_dhtmlx-gantt_v10 branch from 22e10a2 to 06c06cc Compare October 5, 2026 12:14
@Rom1-B
Rom1-B merged commit 36e6a66 into main Oct 5, 2026
7 checks passed
@Rom1-B
Rom1-B deleted the fix_dhtmlx-gantt_v10 branch October 5, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants