You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f31c46e
Browse filesBrowse the repository at this point in the historyBrowse files
Forward-port of #255 to `main`.
## Description
The plugin now declares `csp_compliant` and no longer relies on inline
event handlers, so it keeps working when GLPI sends its Content Security
Policy.
Converted patterns:
- `templates/view.html.twig`: fullscreen button
`onclick="gantt.ext.fullscreen.toggle();"` replaced by the
`data-gantt-fullscreen` attribute (category a).
- `templates/view.html.twig`: search field
`oninput="gantt.$doFilter(this.value);"` replaced by the
`data-gantt-filter` attribute (category a).
- `public/js/gantt-helper.js`: two delegated listeners bound once at
file load, calling the same functions with the same arguments.
- `setup.php`: `'csp_compliant' => true` added to
`plugin_version_gantt()`.
No `<script>` tag was printed from PHP or created from JavaScript: the
only inline script is literal Twig text and receives the nonce
automatically.
No behaviour change.
## Blocked by
- glpi-project/glpi#26020 (CSP) and its 11.0 / 12.0 backports: the
minimum GLPI version (`PLUGIN_GANTT_MIN_GLPI_VERSION`, currently 11.0.0)
must be bumped to the first CSP-enabled release before merging.
## Manual test checklist
Open a project with the Gantt tab (Project item, Gantt tab) and keep the
browser console open. CSP violations are reported there as `Refused to
execute inline event handler` or `Refused to execute inline script`.
- Click the fullscreen button (icon at the top right of the Gantt
controls): the Gantt enters and leaves fullscreen mode.
- Type in the "by name" search field with the Find option selected:
matching tasks are highlighted and the view refreshes about 500 ms after
typing stops.
- Type in the same field with the Filter option selected: only matching
tasks are displayed.
- No CSP error appears in the console.
Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
0 commit comments