Wykres commitów

15650 Commity (678b32e4e79df829801447150085ae44b103e37a)

Autor SHA1 Wiadomość Data
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
Sage Abdullah 994698d76c
Do not use FieldRowPanel for scheduled publishing fields
To prevent inconsistent layout if only one of the fields has an error
2023-07-14 15:21:57 +01:00
Sage Abdullah 876b0e0f19
Move comments counter badge markup to base SidePanelToggle component 2023-07-14 15:21:57 +01:00
Sage Abdullah dbcad2b7c6
Refactor side panel toggle into subcomponent of side panels
This allows us to utilise the parent's context when rendering the toggle,
which can be useful to get information e.g. for a counter badge
2023-07-14 15:21:57 +01:00
Albina e5da22586b
Update styles for block picker in dark mode (#10644)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2023-07-14 14:42:12 +01:00
Matt Westcott 9881ec12b8 Update black target version to 3.8 in circleci config 2023-07-14 13:44:02 +01:00
Matt Westcott aca754aa36 Release note for dropping Python 3.7 support (#10676) 2023-07-14 13:09:55 +01:00
Matt Westcott 1e49d2a63b Remove redundant format string in test_move_page.py
Co-authored-by: Jake Howard <RealOrangeOne@users.noreply.github.com>
2023-07-14 13:06:41 +01:00
zerolab 5a6991dd8f Run django-upgrade with a 3.2 target
`git ls-files --others --cached --exclude-standard -- '*.py' | xargs django-upgrade --target 3.2`
2023-07-14 13:06:41 +01:00
zerolab ac10b36c7b Run pyupgrade with `--py38-plus` 2023-07-14 13:06:41 +01:00
zerolab adde8b66f6 Drop support for Python 3.7 2023-07-14 13:06:41 +01:00
Sage Abdullah 3d0282573d
Release notes for #10619 2023-07-14 10:20:45 +01:00
Sage Abdullah 12583d9c48
Allow purging revisions of only page/non-page models 2023-07-14 10:18:33 +01:00
Sage Abdullah 8074ed4bbc
Add not_page_revisions method to RevisionQuerySet and RevisionsManager
Also simplify RevisionsManager definition using Manager.from_queryset()
2023-07-14 10:18:33 +01:00
Sage Abdullah 2a888bcb30
Replace workflow support check with WAGTAIL_WORKFLOW_ENABLED setting check
The workflow models can always be imported via wagtail.models even if workflow is disabled.

Instead of checking the import with try/except, we should check the setting instead.
2023-07-14 10:18:32 +01:00