Wykres commitów

17571 Commity (d00df53a62a2061ddd40fdc8956f9b9b4a48067b)

Autor SHA1 Wiadomość Data
Daniel Kirkham d00df53a62 Document the vary_fields property for custom image filters 2024-07-09 06:53:27 +10:00
smark-1 ad884fe8d5 Add better docs for generating URLs on creating admin views
- Fixes #11963
2024-07-09 06:38:51 +10:00
Afonso 76fb103f54
Fix #11716: Failure in Dynamic Image ServeView
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>
2024-07-04 11:10:50 +01:00
Andy Chosak a81cabce05 Expose URL resolver match for RoutablePageMixin (#11953)
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
2024-07-03 14:17:12 +01:00
Matt Westcott 37e367b7ed Add release endpoint 2024-07-03 13:29:48 +01:00
Matt Westcott 387d98d7bb Add cleanup method to EditingSession 2024-07-03 13:29:48 +01:00
Matt Westcott a8e631adb0 Show other sessions in ping response 2024-07-03 13:29:48 +01:00
Matt Westcott 633df98af5 Add permission check to ping endpoint 2024-07-03 13:29:48 +01:00
Matt Westcott 548624121a Add ping endpoint 2024-07-03 13:29:43 +01:00
Matt Westcott 8ae526621a Add EditingSession model 2024-07-03 13:29:09 +01:00
Ben Dickinson 2c6ab32d61 Fix bug with .get_menu_item(order=0) calls (#12082) 2024-07-02 17:34:22 +01:00
Matt Westcott 9ef20ca08d Release note for #12097 2024-07-02 16:48:16 +01:00
Joshua Munn 8ca641d1d2 Remove redundant queryset annotations 2024-07-02 16:46:31 +01:00
Joshua Munn fc281d228b Handle null stream fields in stream field migrations 2024-07-02 16:46:31 +01:00
Romein van Buren 7fca2d74a0 Add label to "user" column in views.generic.HistoryView (#12101)
Fixes #12100
2024-07-02 16:02:56 +01:00
Sage Abdullah 94d92ed822
Release note for #11987 2024-07-02 12:17:21 +01:00
Sage Abdullah ab8d721f92
Add upgrade considerations for migrating non-page reports to universal listings 2024-07-02 11:56:40 +01:00
Sage Abdullah 2e44eb3c8f
Use PermissionCheckedMixin in ReportView
Also fix an issue where the workflow tasks report is accessible despite
the user does not have the necessary page permissions, because the fix
in 13048eab79 is missing the view
dispatch() override for the workflow task report view.

This wasn't a security risk as the queryset is filtered down to the data
where the user has the relevant permissions for.
2024-07-02 10:49:32 +01:00
Sage Abdullah 94baf0645a
Deprecate ReportView.title in favour of page_title
The latter is enforced by WagtailAdminTemplateMixin
2024-07-02 10:49:32 +01:00
Sage Abdullah c18068c079
Add upgrade considerations for migrating report views to universal listings 2024-07-02 10:49:32 +01:00
Sage Abdullah 880958a776
Reuse filters from PageHistoryFilterSet for site history report 2024-07-02 10:49:31 +01:00
Sage Abdullah c490ef2410
Change site history's commenting action filter to be a tri-state filter
This allows users to also show commenting actions *only*. In addition,
this also fixes an issue where the active filter mechanism thinks that
the hide_commenting_action filter is active with the value False when
the filter is left unchecked.

The test for the inactive filter state is already covered by
test_unfiltered.

Similar to 2173a42345
2024-07-02 10:49:31 +01:00
Sage Abdullah 4a7f23a466
Add tests to ensure active filters are not rendered when not explicitly filtering report views 2024-07-02 10:49:31 +01:00
Sage Abdullah ab87dcb089
Add tests for reports' result-only views 2024-07-02 10:49:31 +01:00
Sage Abdullah 429cea7705
Reinstate link to 'by task' and 'by workflow' in workflow/task reports 2024-07-02 10:49:31 +01:00
Sage Abdullah 9e93b66f13
Render active filters and fragment updates in base listing_results.html template
Without adding an {% if breadcrumbs_items %}, this means the active
filter pills will also be shown even if the listing is still using the
old designs. However, at this point there should be no built-in views in
Wagtail that uses the old design _and_ have filters.

The active filter's clear button works pretty well with the old designs
(when _show_breadcrumbs = False). However, the filters (on the right side)
won't be updated because they are not re-rendered when the AJAX response
comes in.

Rather than adding the if check, we let this happen for now, and
hopefully can set _show_breadcrumbs to True by default in all views,
then advise people on how to adjust to the new templates...
2024-07-02 10:49:31 +01:00
Sage Abdullah 7ab8e6932f
Add breadcrumbs and new AJAX-based filtering to built-in report views
The export buttons, while working correctly on initial load, is still
broken upon filtering on the client-side. This is because the base
listing results template has yet to include the re-rendered header
buttons. As a result, the export links won't be updated on filter.

This will be fixed in the next commit.

Also, the "by task" and "by workflow" links in the workflow reports are
gone because the slim header doesn't support passing arbitrary actions
fragment. This will be fixed in another commit using header_buttons.
2024-07-02 10:49:30 +01:00
Sage Abdullah 105df51ae3
Make base_report.html extend generic/listing.html 2024-07-02 10:49:30 +01:00
Sage Abdullah 245baa9065
Consolidate base_page_report.html into base_report.html
The template is no longer used in Wagtail itself, but we
keep it around for now so that custom page reports don't
immediately raise an error.
2024-07-02 10:49:30 +01:00
Sage Abdullah e3dfcc099c
Use separate results template for PageReportView
While in theory it should work, we haven't actually added tests to ensure
the tables framework can be used in ReportView.
2024-07-02 10:49:30 +01:00
Sage Abdullah 6fe7d9e6e5
Remove unnecessary object_list check in report results templates
It's already done in the base listing_results.html template
2024-07-02 10:49:30 +01:00
Sage Abdullah 38dcd6506f
Use a separate results template for non-page reports
This brings us one step closer to the generic BaseListingView and its
template.

Pagination is now rendered via the base listing_results.html template.
Technically we can remove the {% if object_list %} since the check is
already done outside of the results block in that base template.
However, leave it out for now so Git correctly detects that the files
are just renamed for now.

Also, only do this for views that extend the base ReportView and
base_report.html template for now. We'll do the same for PageReportView
and base_page_report.html later, since the template for that one is
a bit different (especially around which blocks are named listing vs
results...)
2024-07-02 10:49:30 +01:00
Sage Abdullah 3a2a362c6d
Simplify page_types_usage.html template
This report doesn't extend PageReportView or base_page_report.html,
there's no reason for it to follow the structure of
base_page_report.html (having no_results block, the extra wrapper div,
etc.). Simplify this template to follow other non-page reports, so we
can unify them to use a separate results template in the next commit.
2024-07-02 10:49:29 +01:00
Sage Abdullah f526702762
Make aging_pages.html extend base_page_report.html
The class extends PageReportView, so this technically should've extended the corresponding template instead of the base one
2024-07-02 10:49:29 +01:00
Sage Abdullah 4060405e69
Remove incorrect and unused no_results block in report templates
- <tbody> only allows <tr> as child elements, so using <p> here is
  incorrect.
- The no_results block in _list_* templates will never be rendered,
  because the outer template that includes these templates already
  do the checking for whether the results are empty or not:
  - See in base_page_report.html, the _list_page_report.html is only
    included `if pages` – else, the base_page_report.html defines a
    no_results block. This block is what actually gets rendered when
    there are no results. In short: the no_results block should be
    defined in templates that extend base_page_report.html, not
    _list_page_report.html (the included template).
  - Similarly for _list_page_types_usage.html, the no_results block
    should be defined in the view template (page_types_usage.html). This
    is already the case, so the block in _list_page_types_usage.html
    really shouldn't exist. (Moreover, it does not even extend
    _list_page_report.html...)
- Note that as of right now, only the base_page_report.html and
  page_types_usage.html templates support the no_results block.
  This means the no_results block in aging_pages.html and
  site_history.html (both of which extend the base_report.html instead
  of base_page_report.html) do not get rendered. This explains why there
  are duplicate markups for the no results message in an "else" tag a few
  lines above.

Also see the documentation for adding reports:
https://docs.wagtail.org/en/stable/extending/adding_reports.html

The no_results block in the template is only shown for the view
template (one that extends base_page_report.html, not the smaller
include one that extends _list_page_report.html).
2024-07-02 10:49:29 +01:00
Sage Abdullah e784636045
Use wagtailadmin/generic/base.html as the base template for wagtailadmin/reports/base_report.html 2024-07-02 10:49:29 +01:00
Sage Abdullah 2fc7b4d5c9
Do not register 'view' permission if inspect view is not enabled 2024-07-02 10:21:03 +01:00
Sage Abdullah b3e87bcee8
Register permissions for models registered with ModelViewSet 2024-07-02 09:30:57 +01:00
Matt Westcott 79a22efff8 Release note for #11985 2024-07-01 23:57:34 +01:00
Jake Howard 4e3c42011c Cache embed finders and finder match
This intentionally doesn't interfere with the existing caching of the embed HTML
2024-07-01 23:56:44 +01:00
Jake Howard 7330df391d Reduce duplication for facebook/instagram embeds
The constructors were mostly duplicated, so reuse the oembed finder, since they're still oembed
2024-07-01 23:56:44 +01:00
Jake Howard 15511411bd Allow manually specifying credentials for CloudFront frontend cache backend (#10565) 2024-07-01 19:02:12 +01:00
Alex Morega d0647f3288
Add a deactivate() method to ProgressController 2024-06-28 11:59:43 +01:00
Matt Westcott 6dbae8ca2c Implement `for_instance` on `PageLogEntryManager` (#12093)
`BaseLogEntryManager` leaves this unimplemented, and `ModelLogEntryManager` implements it but `PageLogEntryManager` doesn't. The `LogActionRegistry.get_logs_for_instance` method calls this, which means it fails on page models.

Currently this is only used on generic views, which aren't used by page models (unless they're also registered as a snippet, which isn't really a supported setup) but LogActionRegistry is supposed to work transparently across log models, so this is clearly a bug.
2024-06-27 17:00:40 +01:00
Albina 03f26187b6
Add alt text validation rule in the accessibility checker (#11986)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-06-27 09:33:46 +01:00
Albina c632832edf
Language label redesign - admin listings (#12010)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-06-26 11:18:59 +01:00
Matt Westcott ecefcb680f Release note for #12075 2024-06-25 18:02:14 +01:00
Sage Abdullah e1b77ccd6f Add docs about not converting relative links when there are multiple sites 2024-06-25 17:59:37 +01:00
Sage Abdullah 5d209edf82 Optimise queries when converting external link with a custom serve path
Before the converter was fixed, the possible_sites list contains tuples
of (site_pk, url_to_match) where the site_pk is unique for the whole
list.

With the initial version of the fix, the pk may appear twice as we have
two url_to_match: with and without the wagtail_serve path. As a result,
we would fetch the Site object twice when matching URLs that include the
serve path.

This commit optimizes the fix by using a dictionary using the key as the
site_pk that maps to a list of urls to match, so we can fetch each site
exactly once, to then be used for matching the urls.
2024-06-25 17:59:37 +01:00
Sage Abdullah 6faae89fdc Add test for number of queries when converting an external link with a custom serve path 2024-06-25 17:59:37 +01:00