0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 11:10:43 +01:00
Commit Graph

15914 Commits

Author SHA1 Message Date
Storm B. Heg
09aee38ca9 Reinstate field_as_li.html
Other packages and projects may still rely on the existence of this
template. We cannot simply remove it without a proper deprecation.

Add a note to remove the template in the next release.
2023-07-18 07:05:34 +10:00
LB Johnston
94ebf435f5 Fix changelog for #10397
- Remove maintenance entry from release notes as already in the callout at the top of the notes
- Add to changelog
2023-07-18 06:41:49 +10:00
LB Johnston
48307ca587 Add changelog for #9961 2023-07-18 06:39:10 +10:00
LB Johnston
4afe01104b Adopt Stimulus SwapController for task-chooser-modal use case
- Builds on #9952
- Create a new method `submit` and `submitLazy` to serialise a form's inputs and submit (GET) async to replace content
- Create a lazy version of `replace` and add unit tests for it
- Partial progress on #9950
2023-07-18 06:24:49 +10:00
Tidiane Dia
a6c9409e03
Avoid N+1 queries in users index view 2023-07-17 17:23:12 +01:00
Matt Westcott
71d19a7827 Release note for snippet inspect view (#10621) 2023-07-17 17:22:15 +01:00
Sage Abdullah
2bfb1043e9 Use field display registry to display field values in generic inspect view 2023-07-17 17:19:11 +01:00
Sage Abdullah
80f9bbf279 Create generic field display registry to render model fields in the admin 2023-07-17 17:19:11 +01:00
Sage Abdullah
0bebe532e8 Add docs and tests for snippets inspect view 2023-07-17 17:19:11 +01:00
Sage Abdullah
4b9f7df4fd Add option to enable inspect view for snippets 2023-07-17 17:19:11 +01:00
Sage Abdullah
46c855fb97 Add generic InspectView
This is mostly based on ModelAdmin's InspectView, but with
modeladmin-specific code removed and a simpler method signature for the
field display methods.
2023-07-17 17:19:11 +01:00
Matt Westcott
16140d7e53 Release notes for #10618 2023-07-17 16:50:54 +01:00
Sage Abdullah
ad4aa33498 Use permission policy to limit the image and document counts on the dashboard
Fixes #7958
2023-07-17 16:45:22 +01:00
Sage Abdullah
8b43b232be Fix 'any' methods on collection permission policies when only 'choose' action is specified
When the 'choose' permission was introduced in
d18ffb0233, all the logic is put in an
`elif` block. It means that this is only ever checked if the
`foo_any_permission_bar` permission policy methods are called without
'change' nor 'delete' in the actions list.

If the user only has a 'choose' permission, and the method is used
with a list of actions that contains both 'change'/'delete' and
'choose', e.g. `instances_user_has_any_permission_for(user, {'change',
'delete', 'choose'}`, it won't return any results.

This is inconsistent with how the logic for these 'any' methods
should work.

Instead of `elif`, the original implementation should add 'choose' to
the list checked in the previous `if`.

This commit does it slightly differently by enforcing for the known
actions in the beginning of the methods, but it still yields the same
results.
2023-07-17 16:45:22 +01:00
Sage Abdullah
1d3569130d Prevent users from being able to move a collection used to assign a single edit permission
We already have the logic in the code to prevent this, but it mistakenly
used the string 'edit' instead of 'change'. The code checks for the
existence of any of "add", "edit", and "delete" permissions.

Unfortunately, the corresponding tests have both the "add" and "change"
permissions configured, so the tests are passing due to the existence of
the "add" permission.

The old test for the GET request was also incorrect: there is no
permission on a different collection for the user, so the form field is
hidden but not because of the existence of the "add" and "change"
permission. This is fixed by granting a permission to the
finance_collection first, similar to how the POST test is configured.

Two new tests have been added that re-runs the tests but with only the
"change" permission for the user, which fail without the "edit" ->
"change" fix.

In addition, a small performance improvement is added by checking the
cached permissions for the user instead of making an exists() query to
the database.
2023-07-17 16:45:22 +01:00
Sage Abdullah
1b5460ff85 Fix typo CollectionMangementPermissionPolicy -> CollectionManagementPermissionPolicy 2023-07-17 16:45:22 +01:00
Matt Westcott
a3e282491e Release notes for Elasticsearch 8 support (#10686) 2023-07-17 16:24:39 +01:00
Matt Westcott
d05c0c1bc1 Update docs to cover Elasticsearch 8 support 2023-07-17 16:18:37 +01:00
Matt Westcott
54f4f510b1 Run year filtering tests on all backends, not just Elasticsearch 2023-07-17 16:18:37 +01:00
Matt Westcott
11ceca305a Handle year comparison filters properly
The existing code identified filters such as `publication_date__year__gt=1950` as ones that can be implemented as a straight comparison on the date. However, it left the right-hand-side expression unchanged, leading to a comparison like `publication_date > 1950`. Apparently this worked up to Elasticsearch 7, but on ES8 it gives spurious results (my best guess is that it's interpreting the integer 1950 as a UNIX timestamp).

Fix this so that it builds the proper comparison expression, based on a datetime.date object of January 1st of the appropriate year.
2023-07-17 16:18:37 +01:00
Matt Westcott
ea5efb79ac Fix deprecation warnings from Elasticsearch 8 2023-07-17 16:18:37 +01:00
Matt Westcott
06df4a66e1 Skip Elasticsearch backend tests unless the appropriate version of elasticsearch-py is available
These tests seem to have been written with the intent of testing query construction independently of actually running the queries; to do this, they mock the relevant bits of elasticsearch-py so that no actual server needs to be running. However, this is a bit of a bodge job - it still instantiates the Elasticsearch object when initialising the backend, so *some* version of elasticsearch-py must be installed to run Wagtail's test suite; and furthermore, that installed version must be able to handle EVERY backend's variant of the `Elasticsearch(...)` constructor, regardless of whether it was written for a completely different version.

This breaks down with Elasticsearch 8, which makes backward-incompatible changes to the constructor. Since the CI suite as a whole will test each backend with its corresponding correct version of elasticsearch-py at some point, it's redundant (and a waste of CPU cycles) to repeat those tests in environments with a different ES version (or none at all).
2023-07-17 16:18:37 +01:00
Matt Westcott
13c35a8780 Override construction of the host config list on Elasticsearch 8
This allows us to omit the verify_certs and http_auth options, which are no longer valid
2023-07-17 16:18:37 +01:00
Matt Westcott
32315aa255 Add a skeleton Elasticsearch8 backend 2023-07-17 16:18:37 +01:00
Matt Westcott
e364747bfa Install elasticsearch-py v8 for testing against Elasticsearch 8 2023-07-17 16:18:37 +01:00
Matt Westcott
9203716bae Address deprecation warnings raised by elasticsearch-py 7
* pass all arguments as keyword args rather than positional
* instead of passing a 'body' argument to search, pass its top-level keys as kwargs
2023-07-17 16:18:37 +01:00
Matt Westcott
5e1b12ce32 Add Elasticsearch 8 to test matrix (but keep using the v7 python library, as a baseline test) 2023-07-17 16:18:37 +01:00
LB Johnston
3d471edbcf Clean whitespace formatting in docs
- Update formatting with prettier in the documentation
2023-07-17 22:24:54 +10:00
LB Johnston
0f97838381 Documentation - revise usage of e.g.
- Replace one usage of 'eg' with more suitable alternatives
- As per guidelines https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#latin-phrases-and-abbreviations
2023-07-17 15:13:30 +10:00
Albina Starykova
457e260622 Update styles for userbar and a11y checker in dark mode 2023-07-16 22:07:24 +10:00
Storm B. Heg
a4d29494ac Refactor all field_as_li.html includes
`field_as_li.html` merely wraps a <li> and includes `field.html`.

Remove `field_as_li.html` template

It is no longer used.

Historical mention in 1.0 release notes [^1] has
been left intact.

[^1]: docs/releases/1.0.rst

Relates to #9031
2023-07-16 21:38:38 +10:00
Albina Starykova
ecb2126cea Update Wagtail logo to the latest version
- Partial progress on #10404
2023-07-16 17:20:26 +10:00
Stefan Hammer
8960e237ea Add upgrade considerations for the changed audit log timestamps
See #9590
2023-07-16 16:44:44 +10:00
Stefan Hammer
73e29e2585 Add error logging to the timestamp migration and improved migration
This also changes the migration of items with 2 timestamps, so it still
migrates the valid one, if the other is invalid.

See #9590
2023-07-16 16:44:44 +10:00
LB Johnston
74af3e3b45 Add changelog & upgrade considerations for Stimulus dialog/teleport usage
- Closes #10174
- See PR #10397
2023-07-15 23:03:57 +10:00
Lovelyfin00
9868be7900 Adopt DialogController & TeleportController in the userbar 2023-07-15 23:03:57 +10:00
Lovelyfin00
62786ebd13 Adopt DialogController & TeleportController in admin 2023-07-15 23:03:57 +10:00
Lovelyfin00
c556acef35 Create DialogController (w-dialog) & TeleportController (w-teleport) 2023-07-15 23:03:57 +10:00
LB Johnston
a15f7d188b Rename includes/dialog to controllers/DialogController 2023-07-15 23:03:57 +10:00
Daniel Kirkham
1873c49d5d Revise release note for model ordering #10469 2023-07-15 10:37:16 +10:00
zerolab
1a4e5dde12 Add release notes for #10657 2023-07-14 16:17:53 +01:00
zerolab
96c3d719c2 Change the default WebP quality to 80
This is the value most used, and is the default in Willow too

Co-Authored-By: Aman Pandey <74553951+salty-ivy@users.noreply.github.com>
2023-07-14 16:17:53 +01:00
zerolab
ce4afcd578 Update documentation for AVIF support
Co-Authored-By: Aman Pandey <74553951+salty-ivy@users.noreply.github.com>
2023-07-14 16:17:53 +01:00
salty-ivy
f840886b5d Add AVIF support
Co-Authored-By: Aman Pandey <74553951+salty-ivy@users.noreply.github.com>
2023-07-14 16:17:53 +01:00
Sage Abdullah
92f37fe377
Release notes for #10596 2023-07-14 15:24:28 +01:00
Sage Abdullah
9d01cc561a
Fix schedule publishing dialog subtitle for snippets 2023-07-14 15:21:58 +01:00
Sage Abdullah
eedf045899
Fix status side panel not showing when creating a snippet with a particular configuration
This was an oversight for a particular case where:
a non-translatable snippet model uses DraftStateMixin and
has PublishingPanel defined in the panels definition.

The `if` check is done so that the status side panel is hidden
if there's no meaningful info to be shown in the panel, which
is the case when you're creating a plain snippet without any
mixin enabled.

Previously, the check only shows the status side panel on create view if
the model is translatable (by checking `view.locale`). When support for
scheduled publishing for snippets was added, the check should also
consider this case, so that the publishing schedule can be set during
creation.
2023-07-14 15:21:58 +01:00
Sage Abdullah
d204acbaaa
Clarify schedule publishing dialog message text
The old text is confusing, as it might be interpreted as
'the publishing schedule only takes effect after the publishing has happened',
which doesn't make sense.
2023-07-14 15:21:58 +01:00
Sage Abdullah
5f85a39642
Improve accessibility of scheduled publishing info boxes in status side panel
- Add transparent border for WHCM
- Improve colour contrast of 'Edit schedule' button
2023-07-14 15:21:58 +01:00
Sage Abdullah
faf9e700d7
Improve visibility of scheduled publishing errors in status side panel
- Add error counter badge to the toggle icon
- Replace draft schedule info message box with an error message box if
  the configured schedule is invalid
- Use the correct color for the "Once published"/"Invalid schedule" text
  according to designs
2023-07-14 15:21:58 +01:00