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

14795 Commits

Author SHA1 Message Date
AceHunterr
ff7494bf79 Replace ButtonSelect widgets with radio buttons
- Instead of a complex and non-accessible JS solution for filter selects, replace with simple radio select fields
- Fixes #9838
2023-03-11 17:21:00 +10:00
George Sakkis
38e39271ee ChooserWidget: Trigger manually change event when input.value is set
- Ensure that the change events bubble as this is the default browser behaviour
- By default, changes to hidden values will not fire a `change` event, nor those that are a result of programatic changes to `value, so instead this needs to be added manually so that other code can listen to changes to chosen fields with DOM event listeners.
- https://stackoverflow.com/questions/6533087/jquery-detect-value-change-on-hidden-input-field/8965804#8965804
- Closes #10187
2023-03-11 15:57:33 +10:00
Daniel Kirkham
23552f0e70 Fix two spacing typos 2023-03-11 11:03:54 +10:00
Andy Chosak
7f79b4de73 Implement ConvertedValueField.get_prep_value
Fixes issue 10200.

Per the Django docs [0], "if you override from_db_value() you also have
to override get_prep_value() to convert Python objects back to query
values."

The ConvertedValueField inherits from IntegerField, which means that it
stores its data as an integer. But its Python value is of type
ConvertedValue, which is actually a string. The representation of that
string is (potentially) a shifted version of the actual field value.

For example, given a ConvertedValue of 320333593, its string
representation is actually "92467817240" due to the logic here [1]
(which, to be honest, I am not sure I understand the rationale behind).

Because ConvertedValueField wasn't implementing get_prep_value, the
parent IntegerField get_prep_value logic was being called, which
tried to cast int() on the field's value, which is actually the string
representation. So instead of the actual integer value being stored in
the database, it's this shifted value that gets stored.

But, with the recent commit to Django [2], that value could potentially
overflow the supported integer field range in the database -- whereas
the actual integer ConvertedValue value should always be okay.

So, this commit implements ConvertedValueField.get_prep_value to ensure
that the real integer value gets stored, not the shifted string value.

[0] https://docs.djangoproject.com/en/dev/howto/custom-model-fields/#converting-python-objects-to-query-values
[1] d5e4ac5590/wagtail/test/customuser/fields.py (L11-L22)
[2] dde2537fbb
2023-03-10 23:11:41 +00:00
Thibaud Colas
d5e4ac5590
Update Algolia DocSearch integration with new application and correct versioning setup 2023-03-10 15:57:17 +00:00
Albina
5e23eedcd8
Axe accessibility checker: sorting violations based on their place in DOM (#10013)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2023-03-10 12:05:12 +00:00
Matt Westcott
b7f81bc720 Release note for #10215 2023-03-10 12:03:14 +00:00
Matt Westcott
1472db03f0 Enable partial matching on documents index view where available 2023-03-10 12:01:14 +00:00
Mng
a51f9250b3 Enable partial matching on images index view where available (#10215)
Fixes #10213
2023-03-10 12:00:47 +00:00
Thibaud Colas
fff70ad2f9 Add missing CHANGELOG entry for v4.2.1 2023-03-10 09:55:48 +00:00
Deepam Priyadarshi
de3a0b3495
Fixing duplicate addition of StreamField blocks with the new block picker. Fix #10057 (#10149)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2023-03-10 09:52:17 +00:00
LB Johnston
90585c9bba Messages Controller - ensure we add a unit test for XSS checks
- Relates to #9493 & #10182
2023-03-10 08:28:39 +10:00
Sage Abdullah
dc48dcce8a Add add_facets to ModelAdmin's IndexView to fix crash against Django 5.0 2023-03-09 12:54:42 +00:00
Matt Westcott
ab05be3bb2
Prevent matches from unrelated models from leaking into SQLite FTS searches
Fixes #10188
2023-03-09 10:13:54 +00:00
Thibaud Colas
c01303927a Release notes for #10171 2023-03-08 15:21:38 +00:00
Sage Abdullah
81a5bdeb94 Use warning and info level for lock messages 2023-03-08 15:21:38 +00:00
Sage Abdullah
322d305457 Add missing background color for info messages 2023-03-08 15:21:38 +00:00
Sage Abdullah
c8eb100bcf Use action switch component for lock/unlock action in the status side panel 2023-03-08 15:21:38 +00:00
Sage Abdullah
c6974198dd Create action switch component 2023-03-08 15:21:38 +00:00
Sage Abdullah
b0896ef53b Use focus-visible for switch component
Prevent unnecessary outline when clicking on the component
2023-03-08 15:21:38 +00:00
LB Johnston
6ec6895f4f Docs - 5.0 release notes - clean up formatting 2023-03-08 21:35:34 +10:00
4the4ryushin
eb5bb5a9c8 Migrate window.addMessage to a Stimulus Controller w-message
- Introduce a new controller `MessagesController` to contain the dynamic updating of messages
- Ensure the document updated label does not repeat every time a document is updated
- Using the Stimulus controller with templates approach, icons can easily be pre-loaded for each message type
- Ensure that messages are consistently cleared when new ones are added (this was done ad-hoc across some usage and not others)
- Fixes #9493
2023-03-08 21:35:34 +10:00
Lovelyfin00
2519dc84e8 adding the introduction to stimulus webinar video link to docs 2023-03-08 06:35:59 +10:00
Sage Abdullah
24ba0b7fc1
Release notes for #9628 in 4.1.3 and 4.2.1 2023-03-07 19:01:40 +00:00
Sam
a393ea8091
Fix dialog component's message to have rounded corners at the top side
Fixes #10177
2023-03-07 18:36:02 +00:00
Suyash Srivastava
382b7fbbee
Keep applied filters when downloading form submissions
Made use of the xlsx_export_url and the csv_export_url properties instead of hardcoding the urls in the template
2023-03-07 18:21:00 +00:00
sheepman4267
04cca97f09
Fix typo in "Extending Draftail" docs (#10185)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2023-03-07 10:11:45 +00:00
Thibaud Colas
468e8d8581 Docs - Prepare short section on Stimulus usage in UI guidelines
- Aimed at contributors, based on initial implementation learnings and original RFC content
- See https://github.com/wagtail/rfcs/blob/main/text/078-adopt-stimulus-js.md#c-documentation-for-contributors
- Closes #10093
2023-03-07 18:11:39 +10:00
Sage Abdullah
b3b53c8b70
Release notes for #9628 2023-03-01 12:00:43 +00:00
Stefan Hammer
ec6397af01
Fix time zone activation leaking into subsequent requests in require_admin_access()
The timezone of an admin user was only activated, but never deactivated,
so it leaks into following requests of the current thread.

For example, this affected tests executed AFTER
wagtail.admin.tests.test_account_management (see #9628).

This commit changes the timezone activation to use the override()
context manager from django.utils.timezone, which calls deactivate()
when the context manager is closed.

This is similar to how we use the override() from
django.utils.translation for locale activation in the same decorator.
2023-03-01 11:58:49 +00:00
Stefan Hammer
b7c7f689e6
Add missing log information for wagtail.schedule.cancel
Fixes #9595
2023-03-01 11:49:56 +00:00
Matt Westcott
114e25e7db Release note for custom StreamField validation support (#7250) 2023-03-01 12:24:05 +01:00
Matt Westcott
a07fe20ceb Add documentation for customising StreamField validation 2023-03-01 12:07:13 +01:00
Matt Westcott
eadfe419fe Make StructBlockValidationError importable from wagtail.blocks 2023-03-01 11:53:50 +01:00
Matt Westcott
a98779e734 Make TypedTableBlockValidationError constructor more permissive
Either of cell_errors or non_block_errors can now be omitted, and non_block_errors accepts a plain list of ValidationErrors as well as an ErrorList.
2023-03-01 11:48:29 +01:00
Matt Westcott
e9e401b891 Make StreamBlockValidationError constructor more permissive
Either of block_errors or non_block_errors can be omitted; non_block_errors can be passed as a plain list rather than an ErrorList; and the values in block_errors can be ValidationError instances or singleton lists, not just singleton ErrorLists.
2023-03-01 11:48:29 +01:00
Matt Westcott
d262291b6e Make StructBlockValidationError constructor more permissive
Refactor it to allow either of block_errors or non_block_errors to be omitted; allow non_block_errors to be passed as a plain list rather than an ErrorList; and allow the items of block_errors to be ValidationError instances or singleton lists rather than just singleton ErrorLists.
2023-03-01 11:48:29 +01:00
Matt Westcott
486a49797b Refactor ListBlockValidationError to use a dict for block_errors 2023-03-01 11:47:18 +01:00
Sage Abdullah
4956e9554c
Release notes for #9946 2023-03-01 09:23:40 +00:00
Sage Abdullah
fb6d3262ad
Allow manual lock even if WorkflowLock is currently applied 2023-03-01 09:20:40 +00:00
Sage Abdullah
9ea12d42b4
Rework how lock information is displayed in status side panel 2023-03-01 09:16:08 +00:00
Sage Abdullah
2b0bdd66ff
Extract get_user_display_name() from template tag
This allows us to use the function in modules that are imported by wagtailadmin_tags (either directly or indirectly) without triggering a circular import.
2023-03-01 09:11:37 +00:00
Sage Abdullah
d8d7710d39
Remove page-specific strings in lock objects and status template 2023-03-01 09:11:37 +00:00
Sage Abdullah
f3f45a9860
Fix page/snippet cannot proceed a GroupApprovalTask if it's locked by someone outside of the group
Regression in d85db866cc
2023-02-28 13:22:06 +00:00
4the4ryushin
9537547b46 Migrate initErrorDetection to a Stimulus Controller w-count
- Used for tabs error counts
- Fixes #10090
2023-02-27 23:11:19 +10:00
LB Johnston
845b731d13 Add release notes & upgrade considerations for #7277
- Relates to #8012
2023-02-26 12:59:18 +10:00
Karl Hobley
6ee7746b43 Add management command for copying old Query/QueryDailyHits records 2023-02-26 12:59:18 +10:00
Karl Hobley
16da7828af Add deprecation warning for wagtailsearch.Query.add_hit 2023-02-26 12:59:18 +10:00
Karl Hobley
2817fec9fc Move QueryForm into searchpromotions 2023-02-26 12:59:18 +10:00
Karl Hobley
751032a16d Switch to new Query model 2023-02-26 12:59:18 +10:00