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

15740 Commits

Author SHA1 Message Date
LB Johnston
412b71ac1c Update Sphinx Wagtail Theme to v6.1.1 2023-07-20 07:50:33 +10:00
Dan Hayden
2ed1b33bb8 fix code block typo in streamfield_migrations.md 2023-07-20 07:48:09 +10:00
LB Johnston
b94f16e67c Fix a few minor typos in the 5.1 release notes / changelog 2023-07-19 11:34:17 +01:00
Matt Westcott
112fa6b72d
Set an AutocompleteField on FullFeaturedSnippet so TestFilterSetClassSearch works correctly 2023-07-19 11:05:34 +01:00
dependabot[bot]
f66cb7cbb5 Bump word-wrap from 1.2.3 to 1.2.4 in /client/tests/integration
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 18:07:56 +10:00
dependabot[bot]
b57b90fa43 Bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 17:54:10 +10:00
Sage Abdullah
a71232df7b Set up release notes for 5.2 2023-07-19 17:53:26 +10:00
Sage Abdullah
5ee1c413ce Version bump to start work on 5.2 2023-07-19 17:53:26 +10:00
Sage Abdullah
64f496a2e1 Remove old versionadded / versionchanged notes 2023-07-19 17:53:26 +10:00
Sage Abdullah
9f48a8af94 Fix incorrect versionchanged number for user_page_permissions deprecation 2023-07-19 17:53:26 +10:00
zerolab
eb0fbdbb9e Bump target python version to 3.8 in Makefile 2023-07-19 17:52:17 +10:00
Sage Abdullah
4abfcd6830
Generate new strings for translation 2023-07-18 15:26:48 +01:00
Sage Abdullah
e39623ff24
Fetch new translations from Transifex 2023-07-18 15:24:24 +01:00
sgfost
61594a2616
Add docs for managing stored queries in searchpromotions
and update docs about the search -> searchpromotions migration.
2023-07-18 15:00:56 +01:00
LB Johnston
f3c3d31e23
Ensure userbar dialog can sit above other website content
- Fixes #10471
2023-07-18 13:53:06 +01:00
LB Johnston
ad6fd746b9 Documentation - Add recent third party tutorials 2023-07-18 21:48:59 +10:00
LB Johnston
aa3863f17c DropdownController - fix test & refine events & methods
- Test that uses setTimeout never ran as Tippy relies on `transitionend` events, which JSDom will not dispatch. Rework tests to correctly test this custom event gets dispatched
- Use Stimulus dispatch method for custom event dispatching as the controller name (e.g. 'w-dropdown') will automatically be added, work around TypeScript bug in Stimulus which should be fixed in a future release https://github.com/hotwired/stimulus/issues/642
- Add show/hide methods, pull out options to own get method
- Add unit tests for show/hide, content being in dropdown
- Relates to #10557
2023-07-18 21:46:07 +10:00
Storm B. Heg
fef8c4ac3c Ensure StreamField panels validation errors are visible (#10673)
...by rendering panels as expanded, regardless of the collapse
setting specified by the Wagtail implementor.

Fixes #8990 partially.
2023-07-18 12:43:17 +01:00
LB Johnston
bebbcfb48d Fix a few grammar / spelling typos in the 5.1 release notes 2023-07-18 21:38:52 +10:00
Sage Abdullah
191ddf8a55
Deprecate wagtail.contrib.modeladmin 2023-07-18 12:33:42 +01:00
Sage Abdullah
f8da5f1be1
Release notes for #10689 2023-07-18 10:42:14 +01:00
Thibaud Colas
be2eb7fafc
Use inactive field border styles for read-only FieldPanel 2023-07-18 10:42:05 +01:00
Thibaud Colas
3ae40d87f0
Use a theme-agnostic color token for read-only panels support in dark mode 2023-07-18 10:40:07 +01:00
Matt Westcott
5fcb58f929 Deprecate Elasticsearch 5 and 6 search backends 2023-07-18 09:32:37 +01:00
LB Johnston
995809a318 Adopt data attribute usage of SwapController (w-swap) for all header searches
- Removes six inline scripts completely, no longer relying on window.headerSearch
- Update the fallback Stimulus Swap controller afterLoad to be a deprecated method
- Add upgrade considerations
- Fix regression from d554cbe310 where manually submitting page search results would load the partial, not full page response
- Closes #9950
2023-07-18 07:09:28 +10:00
LB Johnston
b0dc6c1ea5 Revise the default SwapController target to the more common '#listing-results' 2023-07-18 07:09:28 +10:00
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