Closed aekong closed 10 months ago
@aekong thank you for this. The change needs to be conditional (ie only use PreviewSidePanel
in 5.2 and leave the rest as-is). I triggered the CI nonetheless to surface any other failures
ah ok, like this?
try:
# for wagtail 5.2
from wagtail.admin.ui.side_panels import PageStatusSidePanel, PreviewSidePanel
except ImportError:
from wagtail.admin.ui.side_panels import PagePreviewSidePanel as PreviewSidePanel, PageSidePanels as PageStatusSidePanel
@aekong that works. The preferred pattern that Wagtail uses is:
from wagtail import VERSION as WAGTAIL_VERSION
if WAGTAIL_VERSION >= (5, 2):
from wagtail.admin.ui.side_panels import PageStatusSidePanel, PreviewSidePanel
else:
from wagtail.admin.ui.side_panels import PagePreviewSidePanel as PreviewSidePanel, PageSidePanels as PageStatusSidePanel
This has the added benefit of being easily searchable when we drop support for Wagtail < 5.2
ah got it, thanks! 1872b2b59ab779ff4646ea700c58c29c2144813d
@aekong thanks for making a start on this. I will take over as there a more fundamental changes we need to account for
sounds good, thank you! if you have time, what are some of those fundamental changes? no worries if you don't have bandwidth to respond to this - just for my own curiosity. i am pretty new to wagtail in general
Superseded by #735. Thank you for starting this @aekong
version 1.7rc1 is now out.
You can use wagtail-localize==1.7rc1
in your requirements file.
awesome, thanks!
The most recent release of wagtail 5.2 replaces PagePreviewSidePanel with PreviewSidePanel.
wagtail_localize/side_panels.py
needs a small update to comply