Also deprecate the `window.ActivateWorkflowActionsForDashboard` and
`window.ActivateWorkflowActionsForEditView` functions as they no longer
need to be globally-accessible
This reverts commit b3846a63fc.
It's a partial revert as the changes to DropdownController itself is
still useful, since it allows us to target the 'shown' event on the more
specific element instead of the document.
This allows us to more easily hook up any event listeners for elements in the dropdown on init. Without keeping it mounted, Tippy will immediately unmount the content, making it impossible for attaching event listeners without listening for the dropdown's show event
We want to make sure the feature works (without the new version
detection) when using a snippet model that does not use RevisionMixin.
We don't have any tests that ensures the new version detection works
with a RevisionMixin-enabled snippet. We can add those later, but the
code itself doesn't make a special-case between snippet vs pages, so
it's probably okay to skip them.
This will simplify the logic when we come to incorporate revision data, since A) we have a lookup by user ID to work with, and B) if a user has multiple sessions AND a revision, we'd have to arbitrarily choose one session to attach the revision data to.
Requiring a word boundary before the start of a filter prevents backtracking, as substrings of the filter name are no longer valid filter names.
This also makes matching around an order of magnitude faster.
The default implementation makes use of the permission policy, and since we supply the model via get_user_model(), it should automatically pick up the correct codenames
This speeds up application startup. The hash is now a query param, injected in the template. As this param is only needed for cache invalidation, it's optional. A helper method is provided to generate the URL, along with a template tag.
This also migrates to an `lru_cache` over a global variable for simplicity.
Fixes#11680
Added back a line that was removed in a previous commit,"rendition.file.open("rb")" in serve.py.
Also, created a test in admin/tests/viewsets , test_image_presence.py that confirms that
the issue has been resolved. The test looks for a status error code 500 in the display of an image,
something that happenned when the dynamic serve view failed. If it finds it, the test fails.
The test also passes when we dont't use a dynamic serve view.
Co-authored-by: SebCorbin <sebastien@rgoods.com>
Django provides an `HttpRequest.resolver_match` attribute [0] that
allows downstream code to inspect a request object to see how its URL
was resolved to a view.
Wagtail's RoutablePageMixin does its own sub-URL routing to call
different view functions on a page object, but the resolver result isn't
similarly made available.
This commit sets a new `routable_resolver_match` attribute on the
request object, akin to Django's `resolver_match`, that stores this
sub-URL routing information for downstream use.
Documentation has been updated appropriately (along with a couple of
other minor broken things in the RoutablePageMixin docs).
[0] https://docs.djangoproject.com/en/5.0/ref/request-response/#django.http.HttpRequest.resolver_match