Skip to content

Release v2.2.0

Choose a tag to compare

@github-actions github-actions released this 07 Oct 17:13
· 99 commits to main since this release

feat: CSP-safe JSON config island for dashboard.js (2.2.0)

Changelog

Added

  • CSP-safe config island: dashboard templates now emit a single <script type="application/json" id="nowo-dashboard-menu-config"> JSON island (from dashboard/base.html.twig, block nowo_dashboard_menu_config_island) instead of inline window.__nowoDashboardMenuConfig = Object.assign(...) scripts. Page templates (index, show, show_items_reorder, item_form) provide their data through the top-level Twig variable nowo_dashboard_menu_page_config, merged with cssFramework into the island. JSON is encoded with JSON_HEX_TAG|AMP|APOS|QUOT.
  • config.ts (readConfigIsland, readDashboardMenuConfig) with Vitest tests (100% coverage) and a PHPUnit guard test (CspSafeConfigIslandTest).

Changed

  • dashboard.js / dashboard.ts read config from #nowo-dashboard-menu-config; island values win over the legacy global.
  • cssFramework is now also emitted when the host sets layout_template to its own layout (it is rendered from base.html.twig, not layout.html.twig).

Deprecated

  • Reading window.__nowoDashboardMenuConfig is kept as a fallback for one minor (removed in 2.3.0). Hosts that rewrote the inline script (e.g. KitInlineConfigScriptSubscriber) can drop that workaround for dashboard-menu.

What's Changed

  • chore(deps): bump nowo-tech/ui-kit-bundle from 1.8.3 to 1.8.4 by @dependabot[bot] in #76
  • chore(deps): bump nowo-tech/phpstan-frankenphp from 1.1.3 to 1.2.0 by @dependabot[bot] in #77
  • chore(deps): bump nowo-tech/form-kit-bundle from 2.5.2 to 2.5.3 by @dependabot[bot] in #78
  • chore(deps): bump phpstan/phpstan-phpunit from 2.0.18 to 2.0.21 in the phpstan group by @dependabot[bot] in #79
  • chore(deps): bump nowo-tech/form-kit-bundle from 2.5.3 to 2.5.4 by @dependabot[bot] in #80
  • chore(deps): bump igor-php/igor-php from 0.9.7 to 0.10.0 by @dependabot[bot] in #81
  • chore(deps): bump nowo-tech/ui-kit-bundle from 1.8.4 to 1.8.5 by @dependabot[bot] in #82
  • chore(deps): bump nowo-tech/phpstan-frankenphp from 1.2.0 to 1.2.1 by @dependabot[bot] in #83

Full Changelog: v2.1.14...v2.2.0