From 0ee97d45deacae6e210207e3ebdd3b0b94afb4c7 Mon Sep 17 00:00:00 2001 From: LB Johnston Date: Fri, 15 Sep 2023 06:18:27 +1000 Subject: [PATCH] Add upgrade considerations for data-tippy attribute deprecation --- CHANGELOG.txt | 1 + docs/releases/6.0.md | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a31cf71370..08246a8b2f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -100,6 +100,7 @@ Changelog * Maintenance: Upgrade sphinxcontrib-spelling to 7.x for Python 3.12 compatibility (Matt Westcott) * Maintenance: Move logic for django-filters filtering into `BaseListingView` (Matt Westcott) * Maintenance: Refactor listing views to share more queryset ordering logic (Matt Westcott) + * Maintenance: Remove `initTooltips` in favour of Stimulus controller (LB (Ben) Johnston) 5.2.3 (xx.xx.xxxx) - IN DEVELOPMENT diff --git a/docs/releases/6.0.md b/docs/releases/6.0.md index b8badb5109..82caefa549 100644 --- a/docs/releases/6.0.md +++ b/docs/releases/6.0.md @@ -138,6 +138,7 @@ Thank you to Thibaud Colas and Badr Fourane for their work on this feature. * Rewrite styles using legacy `c-`, `o-`, `u-`, `t-`, `is-` prefixes (Thibaud Colas) * Remove invalid CSS styles / Sass selector concatenation (Thibaud Colas) * Refactor listing views to share more queryset ordering logic (Matt Westcott) + * Remove `initTooltips` in favour of Stimulus controller (LB (Ben) Johnston) ## Upgrade considerations - removal of deprecated features from Wagtail 4.2 - 5.1 @@ -239,3 +240,22 @@ class MyPage(Page): ### `filter_queryset` and `get_filtered_queryset` methods no longer return filters The undocumented internal methods `filter_queryset(queryset)` on `wagtail.admin.views.generic.IndexView`, and `get_filtered_queryset()` on `wagtail.admin.views.reports.ReportView`, now return just the filtered queryset; previously they returned a tuple of `(filters, queryset)`. The filterset instance is always available as the cached property `self.filters`. + +### `data-tippy-content` attribute support will be removed + +The implementation of the JS tooltips have been fully migrated to the Stimulus `w-tooltip`/`TooltipController` implementation. + +Dynamic support for any `data-tippy-content="..."` usage will be removed this release, for example, within chooser modals or dynamic html response data. + +Some minimal backwards compatibility support for `data-tippy-content` will work until a future release, but only in the initial HTML response on a page. + +#### Data attributes + +These HTML data attributes were not documented, but if any custom code implemented custom tooltips, these will need to be changed. + +| Old | New | Notes | +| -------------------------------------------- | ------------------------------------------------------ | ------------------------------------ | +| | `data-controller="w-tooltip"` | Required, new addition for any usage | +| `data-tippy-content="{% trans 'History' %}"` | `data-w-tooltip-content-value="{% trans 'History' %}"` | Required | +| `data-tippy-offset="[12, 24]"` | `data-w-tooltip-offset-value="[12, 24]"` | Optional, default is no offset | +| `data-tippy-placement="top"` | `data-w-tooltip-placement-value="top"` | Optional, default is 'bottom' |