0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00
wagtail/docs/releases/5.1.md

149 lines
8.8 KiB
Markdown
Raw Normal View History

2023-04-21 13:28:31 +02:00
# Wagtail 5.1 release notes - IN DEVELOPMENT
_Unreleased_
```{contents}
---
local:
depth: 1
---
```
## What's new
### Read-only panels
FieldPanels can now be marked as read-only with the `read_only=True` keyword argument, so that they are displayed in the admin but cannot be edited. This feature was developed by Andy Babic.
2023-04-21 13:28:31 +02:00
### Wagtail tutorial improvements
As part of Google Season of Docs 2023, we worked with technical writer Damilola Oladele to make improvements to Wagtails "Getting started" tutorial. Here are the specific changes made as part of this project:
* Revamp the start of the getting started section, with separate quick install page
* Move the tutorials snippets section to come before tags
Thank you to Damilola for his work, and to Google for sponsoring this project.
2023-04-21 13:28:31 +02:00
### Other features
* Mark calls to `md5` as not being used for secure purposes, to avoid flagging on FIPS-mode systems (Sean Kelly)
* Return filters from `parse_query_string` as a `QueryDict` to support multiple values (Aman Pandey)
* Explicitly specify `MenuItem.name` for all admin menu and submenu items (Justin Koestinger)
* Add oEmbed provider patterns for YouTube Shorts (e.g. [https://www.youtube.com/shorts/nX84KctJtG0](https://www.youtube.com/shorts/nX84KctJtG0)) and YouTube Live URLs (valnuro, Fabien Le Frapper)
2023-06-16 12:44:44 +02:00
* Add initial implementation of `PagePermissionPolicy` (Sage Abdullah)
2023-06-19 16:29:30 +02:00
* Refactor `UserPagePermissionsProxy` and `PagePermissionTester` to use `PagePermissionPolicy` (Sage Abdullah)
* Add a predictable default ordering of the "Object/Other permissions" in the Group Editing view, allow this [ordering to be customised](customising_group_views_permissions_order) (Daniel Kirkham)
2023-06-26 15:03:08 +02:00
* Implement a new design for chooser buttons with better accessibility (Thibaud Colas)
2023-04-21 13:28:31 +02:00
### Bug fixes
* Prevent choosers from failing when initial value is an unrecognised ID, e.g. when moving a page from a location where `parent_page_types` would disallow it (Dan Braghis)
2023-05-22 12:00:21 +02:00
* Move comment notifications toggle to the comments side panel (Sage Abdullah)
2023-05-23 09:22:21 +02:00
* Remove comment button on InlinePanel fields (Sage Abdullah)
* Fix missing link to `UsageView` from `EditView` for snippets (Christer Jensen)
* Prevent lowercase conversions of IndexView column headers (Virag Jain)
* Ensure that `RichText` objects with the same values compare as equal (NikilTn)
* Use `gettext_lazy` on generic model views so that language settings are correctly used (Matt Westcott)
2023-06-13 14:05:51 +02:00
* Prevent JS error when reverting the spinner on a submit button after a validation error (LB (Ben) Johnston)
* Prevent crash when comparing page revisions that include `MultipleChooserPanel` (Matt Westcott)
2023-06-14 19:51:08 +02:00
* Ensure that title and slug continue syncing after entering non-URL-safe characters (LB (Ben) Johnston)
2023-06-15 13:15:18 +02:00
* Ensure that title and slug are synced on keypress, not just on blur (LB (Ben) Johnston)
* Add a more visible active state for side panel toggle buttons (Thibaud Colas)
2023-06-21 23:59:20 +02:00
* Debounce and optimise live preview panel to prevent excessive requests (Sage Abdullah)
2023-06-26 15:03:08 +02:00
* Page listings actions under the "More" dropdown are now accessible for screen reader and keyboard users (Thibaud Colas)
* Bulk actions under the "More" dropdown are now accessible for screen reader and keyboard users (Thibaud Colas)
* Navigation to translations via the locale dropdown is now accessible for screen reader and keyboard users (Thibaud Colas)
* Make it possible for speech recognition users to reveal chooser buttons (Thibaud Colas)
2023-04-21 13:28:31 +02:00
### Documentation
* Document how to add non-ModelAdmin views to a `ModelAdminGroup` (Onno Timmerman)
* Document how to add StructBlock data to a StreamField (Ramon Wenger)
2023-05-08 23:30:08 +02:00
* Update ReadTheDocs settings to v2 to resolve urllib3 issue in linkcheck extension (Thibaud Colas)
* Update documentation for `log_action` parameter on `RevisionMixin.save_revision` (Christer Jensen)
2023-05-24 12:07:50 +02:00
* Reorganise snippets documentation to cover customisations and optional features (Sage Abdullah)
2023-06-12 11:54:51 +02:00
* Update color customisations guidance to include theme-agnostic options (Thibaud Colas)
* Mark LTS releases in release note page titles (Thiago C. S. Tioma)
* Revise main Getting started tutorial for clarity (Kevin Chung (kev-odin))
2023-04-21 13:28:31 +02:00
### Maintenance
* Switch to ruff for flake8 / isort code checking (Oliver Parker)
* Deprecate `insert_editor_css` in favour of `insert_global_admin_css` (Ester Beltrami)
2023-06-07 16:51:24 +02:00
* Optimise use of `specific` on Task and TaskState (Matt Westcott)
* Use table UI component for workflow task index view (Matt Westcott)
2023-06-09 15:18:10 +02:00
* Make header search available on generic index view (Matt Westcott)
2023-06-10 14:09:33 +02:00
* Update pagination behaviour to reject out-of-range / invalid page numbers (Matt Westcott)
2023-06-12 11:54:51 +02:00
* Remove color tokens which are duplicates / unused (Thibaud Colas)
* Add tests to help with maintenance of theme color tokens (Thibaud Colas)
2023-06-13 11:58:50 +02:00
* Split out a base listing view from generic index view (Matt Westcott)
* Update type hints in admin/ui/components.py so that `parent_context` is mutable (Andreas Nüßlein)
2023-06-19 16:29:30 +02:00
* Deprecate `UserPagePermissionsProxy` (Sage Abdullah)
* Optimise the Settings context processor to avoid redundantly finding a Site to improve cache ratios (Jake Howard)
2023-06-26 12:15:40 +02:00
* Convert page listing to a class-based view (Matt Westcott)
* Clean up page reports and type usage views to be independent of page listing views (Matt Westcott)
2023-06-26 15:03:08 +02:00
* Refactor "More" dropdowns, locale selector, "Switch locales", page actions, to use the same dropdown component (Thibaud Colas)
2023-04-21 13:28:31 +02:00
## Upgrade considerations
### `insert_editor_css` hook is deprecated
The `insert_editor_css` hook has been deprecated. The `insert_global_admin_css` hook has the same functionality, and all uses of `insert_editor_css` should be changed to `insert_global_admin_css`.
2023-06-14 13:18:56 +02:00
### `UserPagePermissionsProxy` is deprecated
The undocumented `wagtail.models.UserPagePermissionsProxy` class is deprecated.
If you use the `.for_page(page)` method of the class to get a `PagePermissionTester` instance, you can replace it with `page.permissions_for_user(user)`.
If you use the other methods, they can be replaced via the `wagtail.permission_policies.pages.PagePermissionPolicy` class. The following is a list of the `PagePermissionPolicy` equivalent of each method:
```python
from wagtail.models import UserPagePermissionsProxy
from wagtail.permission_policies.pages import PagePermissionPolicy
# proxy = UserPagePermissionsProxy(user)
permission_policy = PagePermissionPolicy()
# proxy.revisions_for_moderation()
permission_policy.revisions_for_moderation(user)
# proxy.explorable_pages()
permission_policy.explorable_instances(user)
# proxy.editable_pages()
permission_policy.instances_user_has_permission_for(user, "edit")
# proxy.can_edit_pages()
permission_policy.instances_user_has_permission_for(user, "edit").exists()
# proxy.publishable_pages()
permission_policy.instances_user_has_permission_for(user, "publish")
# proxy.can_publish_pages()
permission_policy.instances_user_has_permission_for(user, "publish").exists()
# proxy.can_remove_locks()
permission_policy.user_has_permission(user, "unlock")
2023-06-14 13:18:56 +02:00
```
The `UserPagePermissionsProxy` object that is available in page's `ActionMenuItem` context as `user_page_permissions` (which might be used as part of a `register_page_action_menu_item` hook) has been deprecated. In cases where the page object is available (e.g. the page edit view), the `PagePermissionTester` object stored as the `user_page_permissions_tester` context variable can still be used.
2023-06-14 13:18:56 +02:00
The `UserPagePermissionsProxy` object that is available in the template context as `user_page_permissions` as a side-effect of the `page_permissions` template tag has also been deprecated.
If you use the `user_page_permissions` context variable or use the `UserPagePermissionsProxy` class directly, make sure to replace it either with the `PagePermissionTester` or the `PagePermissionPolicy` equivalent.
### `get_pages_with_direct_explore_permission`, `get_explorable_root_page`, and `users_with_page_permission` are deprecated
The undocumented `get_pages_with_direct_explore_permission` and `get_explorable_root_page` functions in `wagtail.admin.navigation` are deprecated. They can be replaced with `PagePermissionPolicy().instances_with_direct_explore_permission(user)` and `PagePermissionPolicy().explorable_root_instance(user)`, respectively.
The undocumented `users_with_page_permission` function in `wagtail.admin.auth` is also deprecated. It can be replaced with `PagePermissionPolicy().users_with_permission_for_instance(action, page, include_superusers)`.
### The default ordering of Group Editing Permissions models has changed
The ordering for "Object permissions" and "Other permissions" now follows a predictable order equivalent do Django's default `Model` ordering.
This will be different to the previous ordering which never intentionally implemented.
This default ordering is now `["content_type__app_label", "content_type__model", "codename"]`, which can now be customised [](customising_group_views_permissions_order).