0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
Commit Graph

17560 Commits

Author SHA1 Message Date
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
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
Sage Abdullah
939e045d3c Fix external-to-internal link converter detection when using non-root path for wagtail_serve view 2024-06-25 17:59:37 +01:00
Sage Abdullah
43bb39f9ee Add tests for external-to-internal link converter when i18n is enabled and/or the wagtail_serve path is registered at a non-root path 2024-06-25 17:59:37 +01:00
Sage Abdullah
fb3a6b1b31 Add tests for external-to-internal link converter when wagtail_serve URL is not registered 2024-06-25 17:59:37 +01:00
Matt Westcott
a7af760aa7 Add release notes for 5.2.6 2024-06-25 13:10:19 +01:00
Alex Tomkins
5fe8da9921
Fix image preview when Willow optimizers are enabled (#12047)
Avoids https://github.com/wagtail/Willow/issues/147
2024-06-25 10:19:25 +01:00
Jochen Wersdörfer
77791767a2 make sure there are no null bytes in input data from query strings (#12072)
Fixes #12052
2024-06-24 18:53:23 +01:00
ad95e0a991 Add verbose name to locale field of TranslatableMixin (#12071)
fixes #12068
2024-06-24 18:48:45 +01:00
Matt Westcott
ead391ea14 Release note for #12059 2024-06-24 16:52:55 +01:00
Matt Westcott
0594a12630 Use double backticks in StreamField.__init__ docstring
Co-authored-by: sag​e <laymonage@gmail.com>
2024-06-24 16:51:16 +01:00
Matt Westcott
4bf6afd0eb Update docstring on Block.__eq__
The speculation that it might be useful for this feature turned out to be false...
2024-06-24 16:51:16 +01:00
Matt Westcott
935a579426 Use a dict as the in-code representation of the lookup table
This makes it more human-readable.
2024-06-24 16:51:16 +01:00