Closed gasman closed 3 years ago
Just to add - wagtail-instance-selector's modal embeds are affected by https://github.com/wagtail/wagtail/pull/7169, so if you test against the current 2.13 release candidates you may encounter JS errors on opening them... this will be fixed for 2.13 final.
@markfinger Wagtail 2.13 is now out - https://github.com/wagtail/wagtail/releases/tag/v2.13 - would be great to have this reviewed and released out in the wild, if you have time.
This looks amazing! Thanks @gasman!
Thanks for all the work, @gasman. Sorry for the delay in response, I've been on leave.
I've run a quick test against one of our wagtail 2.11 systems, and everything looks alright.
Thanks again to everyone for the reports and the fixes. 2.1.0
been published with @gasman's fixes.
Fixes #11. The new telepath StreamField implementation in 2.13 requires some fairly heavy refactoring to the InstanceSelector widget, since InstanceSelector was quite heavily reliant on rendering a template for each instance, while StreamField needs to be able to construct them client-side from serialised data. I got it working by extracting an 'state' dict consisting of the pk, display_markup and edit_url, which can be used by both the server-side and client-side rendering logic.
(For reference, I submitted a fairly similar patch to wagtailmodelchooser that might help in following the changes: https://github.com/neon-jungle/wagtailmodelchooser/pull/27)