Porównaj commity

...

654 Commity
v6.3.3 ... main

Autor SHA1 Wiadomość Data
Matt Westcott 917e74661b Release note for Django 5.2 support in 6.3.4 2025-04-11 21:08:21 +01:00
Sage Abdullah 714e5c0f62 Change 'Publish' button label to 'Schedule to publish' if go-live schedule is set (#12424) 2025-04-11 18:41:30 +01:00
Stefan Hammer d18ea820bf Don't select the root page as the default destination for MoveBulkAction (#10600)
The test covers a crash (#10473), which has also been fixed by #10362.
2025-04-10 20:25:04 +01:00
Chiemezuo e28cb2930e refactor move_choose_destination to CBV (#12748) 2025-04-10 17:48:50 +01:00
Sage Abdullah 32e1366534 Use Task.get_template_for_action() in workflow modal views (#12926) 2025-04-10 17:39:02 +01:00
Sage Abdullah e86fdb1899 Add UserApprovalTask from docs to testapp models 2025-04-10 16:55:17 +01:00
Matt Westcott 01a47c3e37 Move release process docs to releases section 2025-04-10 12:56:11 +01:00
Matt Westcott 24179dc418 Mark 7.0 as a LTS release
The schedule is being moved so that LTS releases now happen in May, to align with Django.
2025-04-10 12:56:11 +01:00
Matt Westcott 5e0b0b56b6 customisations -> customizations 2025-04-10 12:56:11 +01:00
Matt Westcott 0b683aa320 Fix URL for groups integration test 2025-04-10 12:56:11 +01:00
Matt Westcott 26e65b5c01 Change references to version 6.5 to 7.0 2025-04-10 12:56:11 +01:00
Matt Westcott 1dc0fd0441 Rotate deprecation warnings 2025-04-10 12:56:11 +01:00
Matt Westcott 7a68f466f3 Remove features deprecated in 7.0 2025-04-10 12:56:11 +01:00
Matt Westcott b87372a5ba Bump deprecations happening within 6.4 to be removed in 8.0 2025-04-10 12:56:11 +01:00
Matt Westcott 49dafb1e76 Bump deprecations happening within 6.5 to be removed in 8.0 2025-04-10 12:56:11 +01:00
Matt Westcott 2d4c2b0ed5 Refactor custom user viewset tests to use post-6.2 mechanism
Rather than just patching WAGTAIL_USER_EDIT_FORM / WAGTAIL_USER_CREATION_FORM (which are imminently to be removed) when we come to test custom forms, we set up the viewset for CustomUser as per https://docs.wagtail.org/en/stable/releases/6.2.html#deprecation-of-wagtail-user-edit-form-wagtail-user-creation-form-and-wagtail-user-custom-fields-settings so that the custom forms are active whenever CustomUser is (i.e. we're not running the tests with the --emailuser switch). This means we have to adjust the regular create/edit view tests to pass the additional fields `country` and `attachment` when using CustomUser.

We also remove the tests for the get_user_creation_form / get_user_edit_form helpers, as the only purpose of these is to accommodate the deprecated WAGTAIL_USER_EDIT_FORM / WAGTAIL_USER_CREATION_FORM settings.
2025-04-10 12:56:11 +01:00
Matt Westcott 2a0a864eb9 Remove subclassing from TestGroupViewSet / TestUserViewSet
We need to move to CustomUserCreationForm / CustomUserEditForm being globally defined in the customuser app as part of the migration to the post-Wagtail-6.2 mechanism (https://docs.wagtail.org/en/stable/releases/6.2.html#deprecation-of-wagtail-user-edit-form-wagtail-user-creation-form-and-wagtail-user-custom-fields-settings), which means the patching isn't going to work in the same way as GroupViewSet.
2025-04-10 12:56:11 +01:00
Sage Abdullah b94683d5b1
Use super().run() in customised sdist command
More idiomatic for Python 3
2025-04-10 11:05:27 +07:00
Sage Abdullah 1bc88e77a2
Release note for #12993 2025-04-10 10:46:19 +07:00
Sage Abdullah d555bd6186
Update manage.py from Django's project template 2025-04-10 10:33:31 +07:00
Sage Abdullah 51291a77de
Rename manage.py to manage.py-tpl in the project_template
This ensures the executable flag is retained when building the package
2025-04-10 10:33:31 +07:00
Matt Westcott faca901a89
Add license-files to pyproject.toml 2025-04-10 10:33:29 +07:00
Sage Abdullah 28be91e258
Update instructions to install from fork 2025-04-10 10:30:33 +07:00
Sage Abdullah 3b1bed811f
Update CircleCI config to use pyproject.toml 2025-04-10 10:30:33 +07:00
Sage Abdullah ca7e9bd65a
Update editable installation instruction to use editable_mode=strict
Avoid "module not found" errors on VSCode
https://microsoft.github.io/pyright/#/import-resolution?id=editable-installs
2025-04-10 10:30:33 +07:00
Sage Abdullah 136e0a8461
Add funding link in project.urls in pyproject.toml 2025-04-10 10:30:32 +07:00
Sage Abdullah b27deeaaa9
Update doc8 to latest
Support for loading config from pyproject.toml was added in 0.9.0

https://github.com/PyCQA/doc8/releases/tag/0.9.0
2025-04-10 10:30:32 +07:00
Sage Abdullah d9a09a7442
Migrate setup.py and setup.cfg to pyproject.toml
Move the custom sdist command from wagtail/utils/setup.py directly to
setup.py, because we cannot import the wagtail package itself during
the build process without installing it in the build environment.
2025-04-10 10:30:32 +07:00
Sage Abdullah 4b990df86a
Remove unused setuptools cmdclass customisations
We no longer publish any NPM package from this repository. There is no
package.json in the "client" directory, and we do not include anything
in the "client" directory in the final package either.

The bdist_egg command is deprecated in favour of wheels. We don't
distribute eggs, so the custom version with the static assets check is
not relevant.
2025-04-10 01:41:15 +07:00
Sylvain Boissel cfda3a6ad2 Add missing apps.py file (#13001) 2025-04-09 19:19:15 +01:00
Sage Abdullah f3e2084b3a Document snippets requirement for features provided by model mixins (#12999) 2025-04-09 15:50:49 +01:00
Sage Abdullah a3352a8676 Ensure reference index uses pk instead of id for references in inline objects (#12983)
Fixes #12426

Fixes an issue with models that use a custom primary key with a different name than 'id'
2025-04-09 12:48:40 +01:00
Sage Abdullah 32f4a78c96 Use tuple to define UniqueConstraint fields in CustomRendition test model
Avoid spurious migrations when the set order is different on evaluation
2025-04-09 12:40:35 +01:00
LB 5b429e24d6 Ensure `insert_editor_js` documentation reflects common usage (#13022)
Fixes #13021
Relates to #2936
2025-04-09 12:14:10 +01:00
dependabot[bot] 8a9d05eef5 Bump tar-fs from 3.0.6 to 3.0.8 in /client/tests/integration
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 3.0.6 to 3.0.8.
- [Commits](https://github.com/mafintosh/tar-fs/compare/v3.0.6...v3.0.8)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 3.0.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-06 17:03:22 +10:00
Baptiste Mispelon c6c996b54c Make all formbuilder field types accept a custom widget + add docs
Prior to this change, it was inconsistent whether passing
a `widget` argument as an option to a create_<field>_field()
method would work or not (it might work, or might result in a
TypeError caused by the duplicate argument).
2025-04-06 17:03:14 +10:00
smark-1 c4922ccd39 Fix privacy collection status label for children of private collections
Fixes #12972
2025-04-06 15:46:45 +10:00
LB 273d231992 Add changelog & contributors entry #12968 2025-04-06 15:39:13 +10:00
Dhruvi Patel 32ec338538 Add comments keyboard shortcuts to the shortcut dialog 2025-04-06 15:39:13 +10:00
Dhruvi Patel 9fe5987549 Refactor `keyboard_shortcuts_dialog` template tag to be easier to maintain
- Split out core shortcut modifiers to a `get_keyboard_key_labels_from_request` util + add tests
- Added key label mapping in admin/utils, refactored code for keyboard shortcut dialog and updated tests
- Updated key label mapping for MOD in admin/utils, updated code for keyboard shortcut dialog and updated tests
2025-04-06 15:39:13 +10:00
SebCorbin 5c30b4211a Support documented ability to override/extend icons in the userbar
Allow to override icons in userbar
2025-04-06 14:57:11 +10:00
LB c663911b9c Minor cleanup to documentation whitespace formatting 2025-04-06 14:32:00 +10:00
dependabot[bot] 730ce4c092 Bump tar-fs from 2.1.1 to 2.1.2
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 2.1.1 to 2.1.2.
- [Commits](https://github.com/mafintosh/tar-fs/compare/v2.1.1...v2.1.2)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 2.1.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-06 12:32:00 +10:00
Matt Westcott 8054801f3e Release notes for #13015 2025-04-04 15:35:02 +01:00
Matt Westcott 934aa79789 Remove upper bound of Django dependency
As per #12574 - fixes #13012
2025-04-03 20:34:11 +01:00
Matt Westcott 014f6b2b35 Formalize support for Django 5.2 2025-04-03 20:33:55 +01:00
LB 46c7c60b49 Add changelog & release considerations #12882 2025-04-03 12:19:54 +10:00
the-r3aper7 9f04de83d5 Remove shared admin imports from `_editor_js.html` & remove unnecessary usage
- Fixes #2936
- Deprecate the usage of _editor_js.html
2025-04-03 12:19:54 +10:00
Srishti-j18 97975b5293 Increase the gap of columns within row fields for comment button #12806 2025-04-02 08:35:40 +10:00
Srishti-j18 cc345cff54 Fix comment button positioning next to fields #12807
- Fixes #12687
- Fields fixed; radio checkbox, radio, multi checkbox, select
2025-04-02 06:36:22 +10:00
Matt Westcott edf7c66fac Mention third-party StreamField form builder packages in form builder docs
As per https://github.com/wagtail/wagtail/pull/12287#issuecomment-2769692508
2025-04-02 06:17:47 +10:00
Matt Westcott db3a695695
Ensure ImproperlyConfigured is thrown from db_field on unbound FieldPanels as intended
Since the refactor of the base panel class in b599fce714, self.model is always defined (initially as None) so the ImproperlyConfigured exception would never be thrown.
2025-03-27 13:57:02 +07:00
Matt Westcott 125a749a9a Defer validation of min_num constraints on InlinePanel when saving drafts 2025-03-25 09:17:37 +00:00
Matt Westcott d0f28a1a69 Defer validation of required fields in InlinePanel when saving drafts 2025-03-25 09:17:37 +00:00
Matt Westcott 39e4db4e39 Release note for #12976 2025-03-24 20:25:44 +00:00
Sage Abdullah 5c97298e15 Use underscore-separated keys in setup.cfg for setuptools >= v78 2025-03-24 20:08:30 +00:00
Sage Abdullah 45f89a335d Use WagtailAdminModelForm as the base for RedirectForm and SearchPromotionForm 2025-03-24 20:08:30 +00:00
Sage Abdullah 2fbf6b5f06 Remove FORMS_URLFIELD_ASSUME_HTTPS stop-gap in CI tests 2025-03-24 20:08:30 +00:00
Sage Abdullah 7b5d772b21 Avoid deprecation warnings about URLField assume_scheme on Django 5.x 2025-03-24 20:08:30 +00:00
Sébastien Corbin 6a7917697c
Fix typo in preview blocks documentation 2025-03-24 10:01:52 +01:00
Sage Abdullah d3341e8fa7 Make title and slug optional in page previews 2025-03-21 17:47:27 +00:00
Sage Abdullah 9eac93a565 Defer validation of required text fields in previews 2025-03-21 17:47:27 +00:00
Sage Abdullah 6b40a38346 Ignore AVIF deprecation in pillow-heif
A stop-gap until https://github.com/wagtail/Willow/issues/166 is resolved
2025-03-21 16:47:17 +00:00
Jake Howard 8faa15175c
Make GitHub highlight html files as Django templates
Shamelessly stolen from https://github.com/django/django/pull/19279
2025-03-21 23:20:06 +07:00
Matt Westcott 103ea61702
Document that request_or_site is optional on BaseGenericSetting.load 2025-03-20 19:11:19 +07:00
Matt Westcott 68a3bd4725 Ignore minimum block_counts constraints when deferring validation 2025-03-19 18:27:09 +00:00
Matt Westcott 6938786444 Ignore min_num constraints when deferring validation 2025-03-19 18:27:09 +00:00
Matt Westcott 6d01356ec6 Rework deferring validation on StreamField
Overwriting a block's `required` option is not safe, as a block object is part of a class-level definition and is thus shared by all block instances, not just the one currently being validated. Instead, introduce a flag to Block.clean to skip 'required' validation.
2025-03-19 18:27:09 +00:00
Matt Westcott c38db51559 Add versionchanged note for new Page.save validation 2025-03-19 14:22:45 +00:00
Matt Westcott 04a174f0f2 Make get_latest_str fallback translatable 2025-03-19 14:22:45 +00:00
Matt Westcott 6a0bd93e5b Add an empty_value_display property on Column for use when value is blank
This surfaces an issue with SearchPromotion having a broken string representation when the query string is None, so fix that too
2025-03-19 14:22:45 +00:00
Matt Westcott 397edf2ec5 Support deferring validation on StreamField 2025-03-19 14:22:45 +00:00
Matt Westcott 5015eddef3 Preserve required asterisks on validation-deferred fields when re-showing form after an error 2025-03-19 14:22:45 +00:00
Matt Westcott 2ab55ac3c8 Use fallback for blank string representations on model index and edit views 2025-03-19 14:22:45 +00:00
Matt Westcott 3f70a0a52f Add fallback for blank string representations in audit log, and add tests for creating/editing invalid draft snippets 2025-03-19 14:22:45 +00:00
Matt Westcott f649856cf4 Defer validation when saving snippets as draft 2025-03-19 14:22:45 +00:00
Matt Westcott 0745ae53da Test that validation is still enforced on save_revision when saving or scheduling
As per https://github.com/wagtail/rfcs/pull/104#issuecomment-2691145020 - unless clean=False is explicitly passed, validation should be applied, including on fields that would accept nulls at the database level.
2025-03-19 14:22:45 +00:00
Matt Westcott 2b882743ec Enforce validation on save for FieldPanels corresponding to non-null, non-text-type model fields 2025-03-19 14:22:45 +00:00
Matt Westcott 96f9ebe3f6 Recognise required_on_save flag being set on model fields
It is clear from the test models and bakerydemo that title is frequently declared with a plain FieldPanel rather than TitleFieldPanel, so we should not rely on the presence of TitleFieldPanel or an explicit required_on_save flag on the FieldPanel to enforce form-level validation on the title.
2025-03-19 14:22:45 +00:00
Matt Westcott abb7a687e4 Add tests for creating / publishing EventPage with a blank (required) from_date field
The fix to EventPageForm.clean addresses a logic bug that existed before the change to validation - if `date_from` was left blank, it would be omitted from `cleaned_data` and so retrieving it would raise an uncaught KeyError.
2025-03-19 14:22:45 +00:00
Matt Westcott a20c55a9bc Add tests for validate-on-publish when editing 2025-03-19 14:22:45 +00:00
Matt Westcott 51629e8488 Add tests for validate-on-publish when creating pages 2025-03-19 14:22:45 +00:00
Matt Westcott a56888a7ab Defer validation on FieldPanel unless required_on_save passed 2025-03-19 14:22:45 +00:00
Matt Westcott d0e106b403 Fix test models to use TitleFieldPanel for the title field 2025-03-19 14:22:45 +00:00
Matt Westcott 1f210831dd Relax model validation when saving pages as draft 2025-03-19 14:22:45 +00:00
Matt Westcott 13dbf61323 Set default slug / draft_title / locale independently of full_clean method 2025-03-19 14:22:45 +00:00
Matt Westcott a80f40999e Refactor page create/edit views to decouple identifying the action from performing it 2025-03-19 14:22:45 +00:00
Matt Westcott 8cdbbcfe29 Add mechanism for deferring required field validation on WagtailAdminModelForm 2025-03-19 14:22:45 +00:00
LB 8f640a8cdb Add changelog for #12448 2025-03-15 15:51:57 +10:00
Andy Babic a983dc220b
Frontend cache: Fix n+1 query issues when batch purging page urls (#12448)
* Update tests to highlight the current issues
* Optimise PurgeBatch and util methods, and add docstrings
* Use page objects as the site_cache_target in tests
* Use 'cache_object' instead of 'site_cache_target' to better match terminology in Page methods
* Ensure self.captureOnCommitCallback() is applied when performing purges in tests
* Ensure tests check PURGED_URLS outside of captureOnCommitCallback()
2025-03-15 15:48:58 +10:00
LB de99b8b90f Docs - Minor whitespace cleanup 2025-03-15 15:25:30 +10:00
LB 57fcb353d8 Add changelog for #12278 2025-03-15 15:23:54 +10:00
smark-1 322d7e1620 Add documentation for setting the default privacy option on pages 2025-03-15 15:23:54 +10:00
smark-1 6bbd109072 Support showing the default (or parent) privacy setting on page edit/create
Fixes #3708
2025-03-15 15:23:54 +10:00
smark-1 8654aadb63 Add method to set a default privacy option on Page models
Fixes #3708
2025-03-15 15:23:54 +10:00
LB f0c7e88d0e Add changelog for CI test fixes #12960 & #12961 2025-03-15 11:20:41 +10:00
Sage Abdullah 8e4a721525 Fix nondeterministic page order in test_ordering_by_content_type 2025-03-15 11:18:04 +10:00
Sage Abdullah 8e8770d334
Release note for #12958 2025-03-13 21:29:42 +07:00
ashish-nagmoti 52ac35acea
Add color-scheme meta tag to Wagtail admin 2025-03-13 21:29:42 +07:00
Sage Abdullah ee83938fa5
Release note for #12555 2025-03-13 20:03:15 +07:00
LB 3c628b8ad2 Add Python unit tests to ensure the skip link element is present 2025-03-13 21:27:23 +10:00
LB 1772909551 Add FocusController story 2025-03-13 21:27:23 +10:00
LB 3c09da2fb8 Enhance & rework FocusController
- Update the Controller import & identifier to be `w-focus` not `w-skip-link`
- Rework methods to be easier to maintain, pull out the focus event attachment handler to a function
- Add JSDoc examples & refine description
- Only add then remove the tabindex attribute if needed
- Rework unit tests to be the emerging common structure, add unit test coverage & test for the preservation of existing tabindex attributes
2025-03-13 21:27:23 +10:00
LB 472c1e95c2 Create a force focus util for common forced focus usage 2025-03-13 21:27:23 +10:00
LB 5ccea76e3d Rename SkipLinkController to FocusController 2025-03-13 21:27:23 +10:00
Sage Abdullah 9edb8be32d
Release note for #12952 2025-03-13 17:53:52 +07:00
LB 7b7dd98c19 Stimulus controllers - Move repeated no-param-reassign declarations to top of file 2025-03-13 05:51:08 +10:00
LB 85665af504 Update Stimulus controller `@example` JSDoc items
- Use consistent ```html markdown blocks
- Use consistent two space indentation
- Move the description to the example row, not on the new line where applicable
- Add missing examples were practical
2025-03-13 05:51:08 +10:00
LB 83ec67d6c1 Update Stimulus JSDoc to use US English spelling 2025-03-13 05:50:41 +10:00
LB c793d302b4 Fix alpha sorting of Stimulus controller imports 2025-03-13 05:50:41 +10:00
LB bfcd0c7496
Clean up stubs & adapter
- Ensure Jest only adapter items are in adapter.js
- Ensure Jest AND Storybook items are in stubs.js
- Add mock for someElement.scrollIntoView in the adapter
2025-03-12 21:06:08 +07:00
Sage Abdullah 3d9a868a97
Fix LocaleController tests 2025-03-12 15:39:23 +07:00
LB cbfaecdfae Add changelog for #12805 2025-03-10 09:30:59 +10:00
joelwilliam2005 b82f0fb150 Add unit tests for InlinePanel initial min_num fix #12805 2025-03-10 09:30:59 +10:00
elhussein almasri 9dcdaeecfc Fix the initial order of InlinePanel with min_num set #11889
Fixes #9391
2025-03-10 09:30:59 +10:00
Baptiste Mispelon dbf920e00c Fix incorrect column label in promoted search tables (#12941)
The promoted search tables are not filtered by date.
2025-03-05 17:19:37 +00:00
Matt Westcott d9de2d781f Release note for #12886 2025-03-05 16:20:04 +00:00
Sage Abdullah a81b119821 Bump ruff to 0.9.6 2025-03-05 16:15:13 +00:00
Mohammad Fathi Rahman 8998549807 Update third_party_tutorials.md 2025-03-05 14:21:42 +00:00
Sage Abdullah 871f12934f
Release note for #12895 2025-02-24 15:16:50 +00:00
Thibaud Colas da57f04b80
Use identical button styles for comment and comment replies 2025-02-24 11:46:31 +00:00
Thibaud Colas aae7d85153
Refactor comment styles to use new Sass module system and avoid duplication 2025-02-24 11:46:31 +00:00
Thibaud Colas 21b5e3114f
Add focus-outline mixin to global set 2025-02-24 11:46:30 +00:00
Thibaud Colas 2d2953a28a
Stop using box mixin for a11y result row 2025-02-24 11:46:30 +00:00
Thibaud Colas e8a3d753e3
Refactor minimap styles 2025-02-24 11:46:30 +00:00
Thibaud Colas e67836da34
Remove unused Draftail ImageBlock styles 2025-02-24 11:46:30 +00:00
Thibaud Colas b59539c7d6
Update Draftail stylesheets to resolve all Sass warnings 2025-02-24 11:46:29 +00:00
Sage Abdullah df6a3d8256
Release note for #12894 2025-02-24 11:38:32 +00:00
Sage Abdullah 4016cbeafb
Reinstate WorkflowManager availability in wagtail.models 2025-02-24 11:36:31 +00:00
Matt Westcott a6f2a68aae Set module path for Page to appease Sphinx autodoc 2025-02-22 01:16:02 +00:00
Matt Westcott 8559ae9d68 Move remaining models to pages submodule 2025-02-22 01:15:50 +00:00
Matt Westcott 1f1956246e Move WorkflowMixin to workflows submodule 2025-02-22 01:14:05 +00:00
Matt Westcott 6505a02d61 Move TaskState model to workflows submodule 2025-02-22 01:14:05 +00:00
Matt Westcott 855dcd4bb6 Move GroupApprovalTask to workflows submodule 2025-02-22 01:14:05 +00:00
Matt Westcott eb36ff3570 Move Task model to workflows submodule 2025-02-22 01:14:05 +00:00
Matt Westcott 41a36333ff Move WorkflowTask model to workflows submodule 2025-02-22 01:14:05 +00:00
Matt Westcott de30668dad Move Orderable to orderable submodule 2025-02-22 01:14:05 +00:00
Matt Westcott 4a1497437c Move WorkflowState model to workflows submodule 2025-02-22 01:14:05 +00:00
Matt Westcott 399df657a9 Move WorkflowContentType to workflows submodule 2025-02-22 01:14:05 +00:00
Matt Westcott 35b71a0b7b Move Workflow model to workflows submodule 2025-02-22 01:14:04 +00:00
Matt Westcott 0c168e302a Move LockableMixin to locking submodule 2025-02-22 01:14:04 +00:00
Matt Westcott f2ebae3343 Move PreviewMixin to preview submodule 2025-02-22 01:14:04 +00:00
Matt Westcott 204df71f40 Move DraftStateMixin to draft_state submodule 2025-02-22 01:14:04 +00:00
Matt Westcott b3202ebf20 Move RevisionMixin to revisions submodule 2025-02-22 01:14:04 +00:00
Matt Westcott 33ef3d5317 Move revision model/manager to its own submodule 2025-02-22 01:14:04 +00:00
Sage Abdullah 732ac35b3f fixup! fixup! Validate against invalid characters in Lexeme values 2025-02-21 21:07:45 +00:00
Sage Abdullah fcbd114936 Do not run MySQL tests in parallel 2025-02-21 21:07:45 +00:00
Sage Abdullah add5b57b18
fixup! Validate against invalid characters in Lexeme values 2025-02-21 18:41:40 +00:00
Matt Westcott 6a22961ff2
Validate against invalid characters in Lexeme values 2025-02-21 17:59:33 +00:00
Sage Abdullah 7e299fb267
Recompile German translation to allow test_context_i18n to pass 2025-02-21 17:49:28 +00:00
Sage Abdullah 43220b9dde
Update latest.txt for 6.3.1 2025-02-21 16:47:21 +00:00
Sage Abdullah 78a239175d
Fill in release date for 6.4.1 2025-02-21 16:15:34 +00:00
Sage Abdullah dad755eee8
Fetch new translations from Transifex 2025-02-21 16:15:34 +00:00
Thibaud Colas 3a2792ea88 Release notes for #12845 2025-02-21 13:50:21 +00:00
Bernhard Bliem 5b2791f18e Make 'Actions' string in Draftail widget translatable 2025-02-21 13:50:21 +00:00
Bernhard Bliem c09bd91db9 Generate translations for rich text headings 2025-02-21 13:50:21 +00:00
Bernhard Bliem 3f381892cd Use gettext_lazy instead of gettext in rich-text editor 2025-02-21 13:50:21 +00:00
Thibaud Colas 7c284d9e31 Release notes for #12782 2025-02-21 11:24:10 +00:00
Sage Abdullah cbbc571867 Fix white text on white background in previews for sites that use color-scheme without a background-color 2025-02-21 11:24:10 +00:00
Thibaud Colas 311d49b04a Add release notes for #12903 2025-02-21 10:38:00 +00:00
Sage Abdullah e8b3cd885d Add missing aria-label to upgrade banner dismiss button 2025-02-21 10:38:00 +00:00
Sage Abdullah a668dea376
Release note for #12905 in 6.4.1 2025-02-20 20:46:59 +00:00
Baptiste Mispelon b1fad0cb61
Fix typo in docstring 2025-02-20 20:41:29 +00:00
Sage Abdullah 411088da71
Release note for #12907 in 6.4.1 2025-02-20 20:37:58 +00:00
Sage Abdullah 5ee7e62074
Bump sphinx-wagtail-theme to 6.5.0 2025-02-20 17:33:45 +00:00
Sage Abdullah f714f8d219
Fix console errors in Draftail tests 2025-02-20 13:53:35 +00:00
Sage Abdullah 2fb27ed018
Release note for #12869 2025-02-20 13:51:59 +00:00
Sage Abdullah fd7ec28e3d
Force preview panel scroll behavior to instant to avoid flickering 2025-02-20 13:34:12 +00:00
Sage Abdullah 786d9eb854
Release note for #12901 in 6.4.1 2025-02-20 11:32:12 +00:00
Matt Westcott 8393c5ad2a Relax upper bounds of django-taggit (<7) and beautifulsoup (<5)
Fixes #12884
2025-02-19 17:20:05 +00:00
Matt Westcott 0bcdc4359f Release note for #12880 in 6.5 2025-02-19 16:09:26 +00:00
Matt Westcott c986bacd77 Release note for SubqueryConstraint fix from #12880 in 6.4.1 2025-02-19 16:08:16 +00:00
Sage Abdullah 1c973a7605 Fix 'in' lookup with an explicit subquery on Elasticsearch 2025-02-19 16:03:47 +00:00
Sage Abdullah 297a810d10 Fix 'exact' lookup with an explicit subquery on Elasticsearch 2025-02-19 16:03:47 +00:00
Sage Abdullah bcf9f55b96 Fix 'exact' lookup with an implicit subquery on Elasticsearch 2025-02-19 16:03:47 +00:00
Sage Abdullah aa7b1d58ef Remove obsolete SubqueryConstraint check in search backends 2025-02-19 16:03:47 +00:00
Matt Westcott 6847656406 Ensure that bugfixes in 6.4.1 are mentioned in the release notes there and not in 6.5 2025-02-19 14:16:31 +00:00
Matt Westcott f7695bc4e7 remove spurious period from 6.4.1 release note 2025-02-19 14:10:19 +00:00
Matt Westcott d1b7c38fa8 remove spurious period from 6.3.4 release note 2025-02-19 14:08:51 +00:00
Thibaud Colas 451195a3de Add v6.3.4 release notes to release index 2025-02-19 14:08:47 +00:00
Thibaud Colas 952ee04f08 Use the correct event listener to adjust minimap positioning (#12896) 2025-02-19 13:43:44 +00:00
Sage Abdullah 3e24fee094 Fix invisible nested menu items #12847 2025-02-19 13:25:42 +00:00
zerolab 81171b1eae
fixup! Unpin django-filter's top boundary (#12885) 2025-02-17 14:53:25 +00:00
zerolab 8dd59b149a
Unpin django-filter's top boundary (#12885) 2025-02-17 14:33:31 +00:00
Matt Westcott cbca63c1a3 Release note for #12874 2025-02-13 15:43:57 +00:00
Matt Westcott 995203f42e Pass image PK to set_image_focal_point_task as a string
Using a non-integer primary key on an image model is not formally supported or tested, but it's possible someone might try it, and there's no harm in getting into the habit of stringifying PKs that we pass to tasks.
2025-02-13 14:21:53 +00:00
Matt Westcott c865c8a1f3 Fix handling of models with UUID primary keys in search indexing 2025-02-13 14:18:06 +00:00
Matt Westcott fcf3e257ec Fix handling of models with UUID primary keys in reference index 2025-02-13 13:49:46 +00:00
Matt Westcott 88abe5872c Support searching `none()` querysets (#12873) 2025-02-13 12:52:04 +00:00
Matt Westcott e01aaed00c Add release notes for 6.4.1 including #12862 2025-02-13 01:12:13 +00:00
Sage Abdullah 3c81589250 Prevent error when filtering by locale and searching with Elasticsearch (#12862) 2025-02-13 01:09:18 +00:00
LB (Ben Johnston) 33d30d8105
NPM package updates; `downshift`, `focus-trap-react`, `immer`, `redux`, `uuid` (#12540)
* Update NPM packages (focus-trap-react, downshift, uuid, immer, redux)

## Relevant upgrade release notes

- `focus-trap-react` - v8 to v10
  - https://github.com/focus-trap/focus-trap-react/releases/tag/v9.0.0
  - https://github.com/focus-trap/focus-trap-react/releases/tag/v10.0.0
- `downshift` - v7 to v9
  - https://github.com/downshift-js/downshift/releases/tag/v9.0.0
  - https://github.com/downshift-js/downshift/releases/tag/v8.0.0
  - https://github.com/downshift-js/downshift/blob/master/src/hooks/MIGRATION_V8.md
- `uuid` - v9 to v11
  - https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md#1100-2024-10-26
  - https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md#1000-2024-06-07
- `immer` v9 to v10
  - https://github.com/immerjs/immer/releases/tag/v10.0.0
- Update Redux ecosystem
  - https://github.com/reduxjs/redux-thunk/releases/tag/v3.1.0
  - https://github.com/reduxjs/redux/releases/tag/v5.0.0
  - https://github.com/reduxjs/reselect/releases/tag/v5.0.1
  - https://github.com/reduxjs/react-redux/releases/tag/v8.0.0 (note: react-redux cannot be updated further due to React dependency, which is blocked by Draftail)

* Add release notes

---------

Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-02-12 03:51:27 +00:00
naina35 182ae8488c
Apply Sass mixed declarations migration in preparation for CSS nesting. Fix #12720 (#12733)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-02-12 03:15:56 +00:00
Srishti Jaiswal e23096f354
Migrate away from deprecated Sass import rules to module system (#12734) 2025-02-11 14:58:31 +00:00
mahmoud 8f6b72b19a Docs - Fix word order in Headless GraphQL section
Fixes #12852
2025-02-11 06:00:29 +10:00
Sage Abdullah 31f547e103 Include Python version in CircleCI cache key
Ref: https://discuss.circleci.com/t/how-to-use-python-version-or-image-name-in-cache-key/41108/2
2025-02-10 16:30:51 +00:00
Srishti-j18 6c7e45b894
Do not show the content type column as sortable when searching pages 2025-02-10 15:05:13 +00:00
Matt Westcott 225d3f384c Use standard tokenizer for Elasticsearch to preserve numeric tokens (#12851)
Since its inception the Elasticsearch backend has defaulted to the `lowercase` tokenizer (https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-tokenizers.html#_word_oriented_tokenizers), which treats non-letter characters as separators. This means that numbers within text (surrounded by whitespace) are skipped when indexing and cannot be searched.

Change to the `standard` tokenizer, but apply the `lowercase` filter to keep searches case-insensitive.
2025-02-10 12:55:38 +00:00
Thibaud Colas 801b1bb067
Add more details of legacy rich text behavior
This is to hopefully make it easier to look up with search.
2025-02-06 16:34:49 +00:00
Sage Abdullah a812b61f60
Release note for #8716 2025-02-06 11:54:51 +00:00
Sage Abdullah ad70e5fdb6
Simplify UniqueConstraint check for custom rendition models 2025-02-06 11:46:26 +00:00
Cynthia Kiser 530cc5c355
Added tests for AbstractRendition's unique constraint check
Co-authored-by: Sage Abdullah <sage.abdullah@torchbox.com>
2025-02-06 11:40:15 +00:00
Sage Abdullah 1aecddf34a
Improve unique constraint check error message for custom rendition models
Co-authored-by: Cynthia Kiser <cnk@caltech.edu>
2025-02-06 11:40:15 +00:00
Oliver Parker ea30d636d4
Adds support for constraints on AbstractRendition, as an alternative to unique_together 2025-02-06 11:38:52 +00:00
Sage Abdullah 9294907f31
Release note for #12849 2025-02-06 10:47:18 +00:00
Matt Westcott 2acd50c2db Simplify example of appending a rich text block to a streamfield 2025-02-05 20:38:19 +00:00
Matt Westcott a61cfa678d Apply normalization when modifying a StreamBlock
Fixes #12827
2025-02-05 20:37:00 +00:00
Matt Westcott 09c7f66e03 Add release note for #12639 to 6.5 release page 2025-02-05 18:39:10 +00:00
Sage Abdullah 794fe25e97 Add normalize() implementation to TypedTableBlock (#12808) 2025-02-05 18:38:16 +00:00
Matt Westcott 58584896df Add Seb Corbin to core team 2025-02-05 09:35:43 +00:00
Matt Westcott 78ba5f3625 Update latest.txt for 6.4 and 6.3.3 2025-02-05 09:34:32 +00:00
Sage Abdullah 9de2f4ddd6
Add Bernhard Bliem to contributors 2025-02-04 13:47:41 +00:00
Bernhard Bliem 9c4136635b
Activate user's preferred language in JavaScriptCatalog view 2025-02-04 13:36:12 +00:00
Aayushman Singh 4f37b011f5
Add WAGTAIL_ prefix to non-taggit settings 2025-02-04 10:34:25 +00:00
Sage Abdullah 251d1d188c Expand docs for StreamField block previews 2025-02-03 16:43:29 +00:00
Sage Abdullah f309a44075 Add reference docs for Block.get_template and Block.get_context 2025-02-03 16:43:29 +00:00
Sage Abdullah 88bb61d32e Minor tweaks to StreamField block previews documentation 2025-02-03 16:43:29 +00:00
Matt Westcott f04af6cc16 Fill in release date for 6.3.3 2025-02-03 15:11:44 +00:00
Matt Westcott c6923f43c4 Fill in release date for 5.2.8 2025-02-03 15:11:28 +00:00
Matt Westcott af7254a808 Fill in release date for 6.4 final 2025-02-03 15:11:18 +00:00
Matt Westcott cb0a358022 Fetch new translations from Transifex 2025-02-03 15:10:49 +00:00
Sage Abdullah c70719bfa6
Ensure block preview is hidden when the user clears out the search input 2025-02-03 14:45:37 +00:00
Matt Westcott 14d3341ffd Release note for #12829 in 6.4 2025-01-31 18:09:49 +00:00
Matt Westcott 58ff3e1067 Release note for #12829 in 6.3.3 2025-01-31 18:09:49 +00:00
Matt Westcott 2970a1531e Release note for #12829 in 5.2.8 2025-01-31 18:09:49 +00:00
Matt Westcott 7722ffed1e Prevent syntax error on MySQL search when query includes symbols
Fixes #8614 and #12811

We match MySQL's behaviour of treating non-alphanumeric characters as token separators, equivalent to spaces. This way, the Lexeme instances consist of alphanumerics only, avoiding escaping issues that lead to these syntax errors.

(note: the \w class in regexp also counts underscores as "alphanumeric", but this is also consistent with the MySQL behaviour and presents no issues with escaping.)
2025-01-31 17:49:28 +00:00
Matt Westcott 88cbfb2875 Don't break on blank search queries 2025-01-31 17:49:28 +00:00
Sage Abdullah e4748e45de Fix Block.is_previewable detection on blocks with non-None unset default values 2025-01-31 15:37:44 +00:00
Thibaud Colas b365206d05
Switch block previews from hover + toggle to toggle only 2025-01-31 15:34:17 +00:00
Thibaud Colas 0193cad5ea
Adjust block chooser styles to match latest designs 2025-01-31 14:48:40 +00:00
Matt Westcott 6cad9c4397 More descriptive release note for #12322 in 6.4 2025-01-31 13:05:37 +00:00
Matt Westcott 6a8298879d Release note for #12322 in 5.2.8 2025-01-31 13:05:37 +00:00
Matt Westcott d9e2714c56 Release note for #12322 in 6.3.3 2025-01-31 13:05:37 +00:00
Matt Westcott bdde31c9ed Release note for #12837 2025-01-31 11:09:33 +00:00
Mohamed-Rabiaa f2f94c4d12 docs: Add django.contrib.admin to INSTALLED_APPS in add_to_django_project guide 2025-01-31 11:02:30 +00:00
Sage Abdullah db87deb0c8 Improve block preview layout for responsiveness and reduced shifting 2025-01-30 15:40:49 +00:00
Sage Abdullah f71be48bb3 Add block- CSS class in block preview template
This matches the behaviour of {% include_block %} inside a StreamBlock
2025-01-30 15:40:49 +00:00
Matt Westcott 259770f56d Release note for #12831 in 6.4 2025-01-29 20:53:52 +00:00
Matt Westcott a7f00156ad Release note for #12831 in 6.3.3 2025-01-29 20:53:52 +00:00
Matt Westcott 335817e289 Revert "Simplify example of appending a rich text block to a streamfield" (#12831)
See #12827 - `normalize` is not applied on append, so the value type must match.

This reverts commit b0cda80626.
2025-01-29 20:53:51 +00:00
Thibaud Colas eb4b240791
Add unit tests for rich text block chooser initialisation based on capabilities 2025-01-28 11:11:56 +00:00
Thibaud Colas 4d6c8b87a1
Configure block previews and descriptions in block chooser within rich text 2025-01-28 11:11:56 +00:00
Matt Westcott 2a42ae4edd Add release note stubs for 6.5 2025-01-27 18:54:25 +00:00
Matt Westcott b66a9bfb64 Version bump to 6.5a0 2025-01-27 18:54:25 +00:00
Matt Westcott a2eb6ea8ca Drop support for Django 5.0
This will end security support on 30 Apr 2025, immediately before the release of Wagtail 6.5.
2025-01-27 18:54:25 +00:00
Matt Westcott 695ff86c87 Remove versionchanged note for ImageChooserBlock to ImageBlock migration
Leave other versionadded/versionchanged notes intact, as they relate to deprecated features that are not yet removed and should thus be left in place until 7.0.
2025-01-27 18:54:25 +00:00
Matt Westcott cf19e6ea8e Release notes for #12097 and #12394 in 5.2.8 2025-01-27 17:03:49 +00:00
Matt Westcott 4301d4ded2 Release note for #12812 in 6.4 2025-01-27 16:49:58 +00:00
Matt Westcott 11f7997227 Release note for #12812 in 6.3.3 2025-01-27 16:49:58 +00:00
Matt Westcott 30deac59d0 Release note for #12812 in 5.2.8 2025-01-27 16:49:58 +00:00
Matt Westcott 6489eae6cf Prevent database error when calling permission_order.register on app ready
Fixes #12742

Previously, `permission_order.register` performed a database lookup for the content type. This is invalid if called from an app `ready` method as the documentation suggests, because this may run before the database has been initialised. Instead, `register` now queues up the arguments it receives, and the content type lookup is constructed lazily on first call to `get_content_type_order_lookup` (which happens when the group edit view is requested).
2025-01-27 16:14:51 +00:00
dependabot[bot] 77a55e3f60 Bump store2 from 2.14.2 to 2.14.4
Bumps [store2](https://github.com/nbubna/store) from 2.14.2 to 2.14.4.
- [Commits](https://github.com/nbubna/store/compare/2.14.2...2.14.4)

---
updated-dependencies:
- dependency-name: store2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-25 11:43:42 +00:00
Thibaud Colas 9d496be14c Fix incorrect documentation reference 2025-01-23 17:07:48 +00:00
Thibaud Colas 29e41ea6fc Add separate release notes for performance optimizations 2025-01-23 16:54:05 +00:00
Thibaud Colas 484c71c539 Add separate release notes for search terms report 2025-01-23 16:40:57 +00:00
Matt Westcott 4b99a17554 Extend LTS period to 18 months 2025-01-23 13:15:33 +00:00
LB 2ce58fed95 Refine 6.4 release notes
- Fix a few small typos & formatting issues
- Ensure the form builder changes are better documented
- Add links to other docs pages where possible
- Improve consistency with usage of `code` backticks on modules
- Add docs reference for StreamField `get_template` docs
2025-01-22 10:31:35 +00:00
LB 1dd3dbea87 Fix spelling of `CloudFront` in docs & release notes 2025-01-22 10:31:35 +00:00
LB 0bf909414a Fix minor whitespace formatting issues in docs 2025-01-22 10:31:35 +00:00
LB 1422a9d6c4 Add third party tutorials from late 2024 2025-01-22 10:21:02 +00:00
Matt Westcott 22061091cf Add correct indent for 6.3.3 release notes 2025-01-21 21:24:46 +00:00
Matt Westcott 80c2f928fd Release note for #12394 in 6.4 2025-01-21 21:24:14 +00:00
Matt Westcott 834afaea54 Release note for #12394 in 6.3.3 2025-01-21 21:23:11 +00:00
Joshua Munn 8fbd74a2f0 Rename operations_and_block_path identifiers for consistency 2025-01-21 21:23:05 +00:00
Joshua Munn 3949026270 Fix StreamChildrenToListBlockOperation sharing model instance state 2025-01-21 21:23:05 +00:00
Mohamed-Rabiaa f25a95deee Fix typo: Replace 'another field' with 'an author field' in writing_templates documentation (#12799) 2025-01-21 20:35:26 +00:00
Matt Westcott 01d7858ba4 Fix typo 2025-01-21 11:10:02 +00:00
Matt Westcott 7f39750de9 Clarify lack of support for filtering across relations in RelatedFields docs
Fixes #11757
2025-01-21 11:07:12 +00:00
Matt Westcott 4244943300 Fix typo in block preview example 2025-01-20 18:19:32 +00:00
Matt Westcott 9a024bcb42 Generate new translation strings 2025-01-20 18:00:22 +00:00
Matt Westcott c17c1c859b Fetch new translations from Transifex 2025-01-20 17:59:24 +00:00
Matt Westcott 1309f5e7cc Remove unused heading 2025-01-20 17:48:47 +00:00
Sage Abdullah ac4bd79e40
Add initial docs for StreamField block previews 2025-01-20 17:35:06 +00:00
Sage Abdullah 476e7aa35c
Ensure block label and description are scrollable in previews 2025-01-20 17:30:27 +00:00
Sage Abdullah 00fd54acda
Add body block in block_preview.html to ease customisations 2025-01-20 17:30:27 +00:00
Sage Abdullah 63d5ce9d11
Remove color-scheme from default block_preview.html template 2025-01-20 17:30:27 +00:00
Sage Abdullah 28d8ba6af7
Improve responsiveness of block preview layout 2025-01-20 17:30:26 +00:00
Sage Abdullah 77bcbf702d
Add preview button with eye icon in block chooser 2025-01-20 17:30:25 +00:00
Sage Abdullah d25a67a4b8
Implement block previews in StreamField block chooser 2025-01-20 17:29:53 +00:00
Thibaud Colas efc73a649d Release notes for #12790 2025-01-20 17:05:08 +00:00
Thibaud Colas e236919a79 Implement dragndrop safeguard for rich text fields 2025-01-20 17:05:08 +00:00
Thibaud Colas 3cbca376a9 Implement dragndrop for StreamField with sortable.js 2025-01-20 17:05:08 +00:00
Thibaud Colas 1636059bef Fix Tippy destroy preventing further instantiations 2025-01-20 17:05:08 +00:00
Thibaud Colas fe9409f99c Add drag and drop support to InlinePanel 2025-01-20 17:05:08 +00:00
Thibaud Colas 1c3f84f9c2 Clean up inline panel tests, using correct markup 2025-01-20 17:05:08 +00:00
Matt Westcott 03f5352fe0 Full release note for FieldPanel / InlinePanel shorthand 2025-01-20 16:16:42 +00:00
Matt Westcott ab7547c6cb
Add upgrade note about fixing tests for background tasks (#12794)
* Add upgrade note about fixing tests for background tasks

Addition to the upgrade note added in https://github.com/wagtail/wagtail/pull/12787 to cover how to update tests that make database changes and expect to see the results reflected immediately in search queries and other processes that now only happen at the end of a transaction.

* Update docs/releases/6.4.md

Co-authored-by: sag​e <laymonage@gmail.com>

---------

Co-authored-by: sag​e <laymonage@gmail.com>
2025-01-20 16:08:47 +00:00
Sage Abdullah 6a7792e910 Use unreleased django-modelcluster main branch to test against Django's main 2025-01-20 15:18:10 +00:00
Sage Abdullah 5cfc4aac6e Test against Django stable/5.2.x branch 2025-01-20 15:18:10 +00:00
Jatin Bhardwaj b4781e2a90
Added scroll offset to ensure visibility of fields when typing. Fix #7777 (#12759)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-01-20 13:24:33 +00:00
Thibaud Colas a2038727a7 Add more release notes sections 2025-01-20 12:06:44 +00:00
Thibaud Colas 72808487cd Add missing release notes for #12766 2025-01-20 11:51:50 +00:00
Thibaud Colas 1e0b0f3508
Enable alt text quality check by default. Fix #12636 (#12793) 2025-01-20 11:49:58 +00:00
Thibaud Colas ca66dcc6af Release notes for #12766 2025-01-20 11:46:54 +00:00
Cynthia Kiser e6f27c95e8 Update accessibility concerns docs in light of GSOC contextual alt text project
This also documents default_alt_text, providing a stricter example that does not fall back to image title
2025-01-20 11:46:54 +00:00
Cynthia Kiser 3f551f212c Insert default_alt_text when auto-converting from ImageChooserBlock to ImageBlock 2025-01-20 11:46:54 +00:00
Sage Abdullah fc4a892aad
Do not check for is_previewable in block preview template
We'll allow the view to render it anyway, but the block chooser won't show the preview
2025-01-20 10:03:59 +00:00
Sage Abdullah 4c8ea0e54c
Move default block preview template definition to Block.DEFAULT_PREVIEW_TEMPLATE 2025-01-20 10:03:59 +00:00
Sage Abdullah 3b8e15561d
Require block previews to override the global template if only preview value is provided 2025-01-20 10:03:59 +00:00
Sage Abdullah 7055155183
Move block preview template to wagtailcore
This allows us to use it in wagtail.blocks without depending on wagtail.admin
2025-01-20 10:03:59 +00:00
Sage Abdullah 839f95f50b
Add template_is_overridden utility function 2025-01-20 10:03:59 +00:00
Sage Abdullah c13caa952f
Add Block.is_previewable to avoid showing previews without proper configuration 2025-01-20 10:03:59 +00:00
Sage Abdullah adf52d85c7
Add Block.get_description() to be used in block preview 2025-01-20 10:03:58 +00:00
Sage Abdullah 3bad585b74
Add mechanism for previewing StreamField blocks 2025-01-20 10:03:58 +00:00
Sage Abdullah 7c0712cc38
Include Block.definition_prefix as blockDefId in blocks' Telepath metadata 2025-01-20 10:03:58 +00:00
Sage Abdullah 3ea241370d
Store block definitions in Block.definition_registry 2025-01-20 10:03:58 +00:00
sag​e 841b36ed18
Prevent main menu from re-rendering when clicking outside while the menu is closed (#12755)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-01-20 07:33:36 +00:00
Thibaud Colas 06ce7d2868 Release notes for #12723 2025-01-20 07:20:49 +00:00
Matt Westcott 0ccd99c867 Only replace alt text field if it hasn't been edited from the previous default 2025-01-20 07:20:49 +00:00
Matt Westcott 26f4d07ee1 Populate ImageBlock alt text from default_alt_text when an image is chosen
Fixes #12660
2025-01-20 07:20:49 +00:00
Matt Westcott 1db66a7ded Add default_alt_text to the state dictionary returned by ImageChooser view and used by AdminImageChooser widget 2025-01-20 07:20:49 +00:00
Matt Westcott a6b64dc42e Release notes for #12040 / #12787 2025-01-17 20:37:09 +00:00
Jake Howard bc9d5da38f Move deleting old image / document files to task 2025-01-17 19:01:22 +00:00
Jake Howard 0da3c731a5 Move updating search index to task 2025-01-17 19:01:17 +00:00
Jake Howard 5a0ecb9b30 Move setting image focal point to task 2025-01-17 18:08:50 +00:00
Jake Howard 78cd283b9e Move updating reference index to task 2025-01-17 18:08:39 +00:00
Jake Howard 79d129f8c2 Move frontend cache purging to task 2025-01-17 16:34:41 +00:00
Jake Howard 65d3b34698 Install `django-tasks`
The default configuration is to run tasks in-band, resulting in no change in functionality when simply adding tasks.
2025-01-17 15:48:56 +00:00
Thibaud Colas 7af2ca013e Release notes for #11257 2025-01-17 13:50:12 +00:00
Thibaud Colas 3e09c75814 Update documented Safari support version numbers 2025-01-17 13:50:12 +00:00
Thibaud Colas dcf523416c Switch TypeScript target to ES2023 2025-01-17 13:50:12 +00:00
Thibaud Colas 14d16ae823 Remove now-unneeded focus-visible backwards compat 2025-01-17 13:50:12 +00:00
Thibaud Colas be9b462947 Update Storybook Babel browser support configuration 2025-01-17 13:50:12 +00:00
Thibaud Colas 8d5fc606a8 Remove unneeded IE11 reference from browserslist 2025-01-17 13:50:12 +00:00
Thibaud Colas fc6aee2318 Update browserslist definition to remove Safari 15 2025-01-17 13:50:12 +00:00
Thibaud Colas 7ec01f813e Update caniuse-lite DB 2025-01-17 13:50:12 +00:00
Stéphane Blondon 3329e6dadf fix: add missing space between two words (#12781)
Otherwise, logs show such lines:
HINT: Ensure that MainMenu uses `panels` instead of `content_panels`or set up an `edit_handler` ...
2025-01-16 17:35:14 +00:00
Mike Gifford 4298665bfd Update guideline links in sustainability_considerations.md (#12762)
One of your links was busted, so I figured I'd suggest some updates.
2025-01-16 17:31:41 +00:00
Matt Westcott 7e1832a4eb Prevent error when searching and filtering by locale (#12772)
Ref: https://github.com/wagtail/wagtail/issues/6616#issuecomment-2590737050

The current locale filter logic performs a related field filter on `locale__language_code` which isn't supported when searching, as per #6616. Change this to look up the locale object in a separate query.
2025-01-16 16:38:25 +00:00
Matt Westcott b2958e2b4c Work around Sphinx failing to resolve HttpRequest in type annotations
Fixes #12777
2025-01-16 16:00:14 +00:00
Matt Westcott c561977e8d Move 6.3.3 changelog entry to the right place 2025-01-16 14:57:44 +00:00
Matt Westcott 9511d7f3ac Release note for #12778 2025-01-16 14:54:29 +00:00
Matt Westcott 581bb5ccd7 Use double quotes in code snippet
Co-authored-by: sag​e <laymonage@gmail.com>
2025-01-16 14:53:16 +00:00
Matt Westcott 54797e3826 Document Block.get_template in StreamField usage guide 2025-01-16 14:53:16 +00:00
Cynthia Kiser f3d1765353
Update example for customizing "p-as-heading" check (#12763)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-01-15 16:34:13 +00:00
Matt Westcott 8b3eb44340 Fix TestFormPageWithCustomFormBuilder assertion against Django 5.1.5 and other security releases
Django 5.1.5 (and other security releases released today) has added a `max_length` attribute to GenericIPAddressField, which breaks an assertion in the form builder tests that compares HTML directly. Change this to a BeautifulSoup-based test so that it works on older and newer releases.
2025-01-15 10:58:27 +00:00
Andy Babic 88a3a397ca Prevent redundant calls to Site.find_for_request() from Page.get_url_parts() (#12454) 2025-01-15 00:41:57 +00:00
Rishabh Sharma 782aa0e16b
Reduce confusing spacing below StreamField blocks help text. Fix #11888 (#11934)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-01-14 10:00:09 +00:00
Ayaan cb11ec3e01
Upgraded sass-loader to remove Sass warnings (#12728)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-01-14 08:44:47 +00:00
Tom Usher 75e07498f4 Add support for specifying an operator on Fuzzy queries (#12714) 2025-01-13 17:04:35 +00:00
Thibaud Colas d20c1b66bf release notes for #12751 2025-01-13 13:05:53 +00:00
Sage Abdullah da12f4a284 Use explicit label for defaulting to server language in account settings 2025-01-13 13:05:53 +00:00
Sage Abdullah 944fd02dc3 Replace l18n library with Intl-based LocaleController 2025-01-13 13:05:53 +00:00
Sage Abdullah 983a86b0b8 Fix missing heading and breadcrumbs in Account view 2025-01-13 13:05:53 +00:00
Thibaud Colas f0b04200a4 Add v6.3.3 release notes 2025-01-13 12:14:56 +00:00
Srishti-j18 c63ac0af4a
Add FilterField('created_at') to fix sorting by created_at when searching in documents index view 2025-01-13 12:12:09 +00:00
Srishti Jaiswal 0bba5da337
Correct positioning of comment buttons with DateField, TimeField and DateTimeField. Fix #12214 (#12685)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-01-13 12:08:56 +00:00
sag​e 99a9317eea
Avoid loading icons sprite and JS files in 404 page (#12745)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2025-01-13 11:29:17 +00:00
Joren Hammudoglu 4fc2c2abac
Improve deprecation warning for `WidgetWithScript` by raising it with `stacklevel=3` 2025-01-07 16:27:26 +00:00
Sage Abdullah 7a59c9cc20
Release note for #12735 2025-01-07 13:34:37 +00:00
Sage Abdullah 9b3acffaac
Fix crash when loading the dashboard with only the "bulk_delete" page permission 2025-01-07 12:23:26 +00:00
Unyime Emmanuel Udoh d8d75bddf0
Fix crash when loading the dashboard with only the "unlock" page permission 2025-01-07 12:03:11 +00:00
Matt Westcott 216b80111b
Upgrade consideration note for change of Page panel definitions 2025-01-07 11:05:11 +00:00
Matt Westcott 3f91fcb3a3
Define base Page panels as placeholders within wagtail.models
This ensures that code such as `content_panels = Page.content_panels + [...]` works as expected even if wagtail.admin has not been loaded.

Fixes #12747
2025-01-07 11:01:08 +00:00
Matt Westcott 09e26c3c2b
Add failing test for page model defined before wagtail.admin is loaded 2025-01-07 10:22:12 +00:00
Matt Westcott a2407c0027 Release note for #12697 2025-01-06 23:44:28 +00:00
Matt Westcott f9debd9084 Continuity fixes for tutorial 2025-01-06 23:11:53 +00:00
Matt Westcott 82c42d1ecc Nest code snippets for string panel definitions inside the note 2025-01-06 19:29:44 +00:00
USER 961aa07547 Addressed feedback: Updated FieldPanel documentation 2025-01-06 19:26:26 +00:00
USER da818b562f “Update-FieldPanel-documentation-to-encourage-use-of-strings-in-panel-definitions” 2025-01-06 19:26:26 +00:00
Matt Westcott 7cfae8c3b5 Update latest.txt for 6.3.2 2025-01-02 12:18:57 +00:00
Matt Westcott b97ac14cba Fill in release date for 6.3.2 2025-01-02 11:09:43 +00:00
Matt Westcott 50fb7b21bb Fetch new translations from Transifex 2025-01-02 11:09:17 +00:00
Daniel Kirkham 996484099b Insert missing space into 6.3 release notes 2025-01-02 09:16:49 +00:00
Artem Kamyshansky f90fae1aee typo fix 2025-01-02 09:16:07 +00:00
Matt Westcott 784f4bbbb9 Don't set aria-expanded=false on clear(), because clearing in itself doesn't close the menu 2024-12-19 14:10:30 +00:00
Ayaan 1cbb1e8fb2 Remove - extra addClass & aria-label in appendColumnButton and restore aria-expanded="false" in clear method 2024-12-19 13:23:24 +00:00
Ayaan df8a6f219c Added aria-expanded attribute to add new column button (#12680) 2024-12-18 18:03:24 +00:00
Matt Westcott 2e08d84332 Release note for #12702 in 6.4 2024-12-18 16:07:58 +00:00
Matt Westcott 5a17312e42 Release note for #12702 in 6.3.2 2024-12-18 16:07:25 +00:00
Matt Westcott 3cfbd028e9 Implement get_block_by_content_path on ImageBlock (#12702)
Fixes #12688. Without this, commenting on a field of an ImageBlock will cause subsequent loads of the edit view to fail at the point that the comments validate that they are attached to a valid block path.
2024-12-18 16:07:25 +00:00
Matt Westcott ac08838115 Update James Harrington's name in credits 2024-12-18 16:01:06 +00:00
ankit02327 7745aa628d Separate creation and activation steps in tutorial document (#12695) 2024-12-18 15:30:53 +00:00
Sage Abdullah 23b9f4aca9 Move images and documents get_usage().count() call to view code (#12691)
The get_usage() method returns a ReferenceGroups instance that defines a
__getitem__ method. Accessing get_usage().count() from the template
means that Django tries to access the count via ["count"], which fails,
then continues by using getattr(reference_groups, "count") before
finally calling the count method.

We have seen reports where the blocktranslate tag fails because the
usage_count_val is not a number. We haven't got a reproducible example,
but this would help surface any errors, as the exception would be raised
from the Python code rather than the template.
2024-12-18 14:58:28 +00:00
Jake Howard 57d141c701 Don't persist credentials in CI
There's no vulnerability here, especially since the token explicitly only has read access anyway, but it's worth improving regardless.
2024-12-18 14:37:54 +00:00
Sage Abdullah 6b33690cd3 Refactor pages revisions_revert view to be a subclass of EditView (#12690)
Currently, the code that handles the POST request for reverting a
revision lives in the EditView class, while the revisions_revert view is
a smaller view that tries to "mimic" the EditView for rendering the view
as part of a GET request. The view injects the revision ID into the
form, which has the action URL hardcoded to the EditView. Including the
revision ID in the form allows the EditView to tell whether it's in a
"reverting" mode or not, and adjust the POST logic accordingly.

However, this results in possible inconsistencies in both views.
Whenever we want to change EditView code or template, we need to make
sure to also update the revisions_revert view. The fact that the
revisions_revert view is a function-based view doesn't help.

Instead of copying the view code and reusing the template with the
addition of injecting the revision ID in the form, turn it into a proper
subclass of the EditView, and make use of Django's URL patterns to
retrieve the revision ID in the EditView.

This approach is similar to how reverting revisions is handled for
snippets.

Ideally, all the code for handling revisions revert should live in the
RevisionsRevertView, and the EditView shouldn't know about it at all.
This is how it's done for snippets: all the revisions revert-related
code is put in RevisionsRevertMixin.

However, this is currently not possible for pages without more
significant refactoring, so this commit does the minimal change needed
to achieve the goal of keeping the revisions_revert view in sync with
the EditView.
2024-12-18 14:36:39 +00:00
Matt Westcott 8bb2a18cd7 Release note for #12676 2024-12-18 12:55:43 +00:00
Sage Abdullah 130a9ebd93 Enable breadcrumbs by default 2024-12-18 12:52:31 +00:00
Sage Abdullah 58d9f9bc72 Make generic/confirm_unschedule.html template extend generic/base.html template 2024-12-18 12:52:31 +00:00
Sage Abdullah faa37c0068 Make generic/confirm_unpublish.html template extend generic/base.html template 2024-12-18 12:52:31 +00:00
Sage Abdullah e63b42b547
Add explicit path to Sphinx configuration in .readthedocs.yml 2024-12-18 11:34:31 +00:00
Sage Abdullah 286d7cbd6b Enable breadcrumbs in revisions compare view (#12675) 2024-12-18 00:45:43 +00:00
Matt Westcott 01e7291486 Handle old construct_wagtail_userbar signature in ChecksSidePanel 2024-12-18 00:41:31 +00:00
Claude Meyer 268174b781 Release notes for #12678 2024-12-17 22:10:23 +00:00
Claude Meyer aa08e86cba Fixes #3847 by adding page as a third argument to construct_wagtail_userbar hooks along with a deprecation warning. 2024-12-17 22:10:09 +00:00
Jake Howard 076af8bec8 Automatically set CSP when serving images and documents (#12672)
Addresses #12617
2024-12-17 21:06:39 +00:00
jhrr 5402010d16 Allow hook override of user profile avatar url in admin tags (#12689)
Fixes #12661
2024-12-17 20:42:36 +00:00
Matt Westcott 9889bddcb8 Release notes for #11633 2024-12-10 01:54:54 +00:00
LB Johnston ae89829661 Deprecate & rework imports for `window.buildExpandingFormset`
- window.buildExpandingFormset and using the base class `ExpandingFormset` can now be deprecated.
- Move the window global setting to core.js which avoids the need to add the import in editor_js, to align with other future deprecations in core.js
- Add upgrade considerations in release notes
- `ExpandingFormset` is still needed for other existing usage (InlinePanel/MultipleChooserPanel)
- Add additional JSDoc and updates to Eslint to advise developers that this feature is not to be used for new code
2024-12-10 01:42:32 +00:00
LB Johnston 6bc9b0ea40 Adopt Stimulus `w-formset` attributes in Group edit/create view
- Use the Wagtail admin formset mixin to adopt new data attributes on core form parts
- Update the edit/create templates to put the attributes on the remaining elements
- Add basic unit tests for smoke testing data attributes
- Remove CSP incompatible inline scripts approach
- Remove the now unused standalone static build/imports for the group edit view as this will not be needed
- Update Eslint accordingly
2024-12-10 01:42:32 +00:00
LB Johnston 585d3e3385 Adopt Stimulus `w-formset` attributes in Workflow pages basic formset
- Use the Wagtail admin formset mixin to adopt new data attributes on core form parts
- Update the edit/create templates to put the attributes on the remaining elements
- Add basic unit tests for smoke testing data attributes
- Remove CSP incompatible inline scripts approach
- Remove the now unused standalone static build/imports for the group edit view as this will not be needed
- Ensure that the edit workflow form does not render any JS or attributes when the pages are not actually editable (workflow disabled)
2024-12-10 01:42:32 +00:00
LB Johnston 3d6f1c366f Prepare Wagtail admin formset mixin
- Leverage the new Django 4.0 feature `deletion_widget` for formsets to attach data attributes and make the input a HiddenInput for existing and 'blank' forms.
- Add support for data attributes used by the new Stimulus FormsetController
2024-12-10 01:42:32 +00:00
LB Johnston 8d35cc57e6 Add initial Stimulus FormsetController `w-formset`
Replaces the core functionality in `client/src/components/ExpandingFormset/index.js` and the Delete callbacks in other usage of the `window.buildExpandingFormset` function.

Provides limitations on add/delete once the min/max have been reached but does not set up any disabling of these buttons as this is currently in the remit of `InlinePanel`.

Includes a full test suite for error handling, updating inputs and nested usage which leverages Stimulus' scope management.

Does not rely on any id attribute structure or wrangling.

Relates to #7915
2024-12-10 01:42:32 +00:00
LB 4020efc4d0 Add JSDoc to exported function in runInlineScripts 2024-12-10 01:42:32 +00:00
LB d42af56220 Create `transition` util to resolve a promise when an animation ends 2024-12-10 01:42:32 +00:00
Sage Abdullah 4760509d65
Release note for #12681 2024-12-09 11:06:26 +00:00
Sage Abdullah c7700feae2
Use built-in venv instead of pipenv in CircleCI 2024-12-09 10:38:44 +00:00
Ayaan 3e75c018be Add support for query string params in WAGTAIL_GRAVATAR_PROVIDER_URL
- Enhance capabilities for WAGTAIL_GRAVATAR_PROVIDER_URL URL to support merging of URL params.
- Fixes #12659
- Rework of original PR #11077
2024-12-07 21:23:13 +10:00
Krystian Magdziarz 32417f9adc Fix Missing Cache-Control Headers for Password-Protected Pages (#12465)
Fixes #12455
2024-12-07 02:49:16 +00:00
Matt Westcott 94d3557cea Release note for #12614 2024-12-06 19:58:16 +00:00
Sage Abdullah 5f3235fa4f Add permission tests for search promotions views
This ensures we don't miss adding permission_policy to the views
2024-12-06 19:56:10 +00:00
Sage Abdullah 4bbd26d5a4 Refactor search_promotions delete view to extend generic DeleteView 2024-12-06 19:56:10 +00:00
Sage Abdullah 0d7ea86b2d Unify more code into SearchPromotionCreateEditMixin 2024-12-06 19:56:10 +00:00
Sage Abdullah 5e88817d2e Extract more common code into SearchPromotionCreateEditMixin 2024-12-06 19:56:10 +00:00
Sage Abdullah d811066a5b Refactor save_searchpicks into a view mixin method 2024-12-06 19:56:10 +00:00
Sage Abdullah 4e60e0a82b Make search promotions index view page_title consistent with the breadcrumbs item 2024-12-06 19:56:10 +00:00
Sage Abdullah 0c23ebed87 Refactor search_promotions edit view to extend generic EditView 2024-12-06 19:56:10 +00:00
Sage Abdullah 6db13fb704 Use breadcrumbs and simplify template overrides in search promotions CreateView 2024-12-06 19:56:10 +00:00
Sage Abdullah c498be3234 Reuse get_page_subtitle() for breadcrumbs label in CreateView 2024-12-06 19:56:10 +00:00
Sage Abdullah e9ffe38943 Ensure search promotions formset does not get reset if the query form is invalid 2024-12-06 19:56:10 +00:00
Sage Abdullah 93382d3f21 Ensure log entries are only created once for each search pick 2024-12-06 19:56:10 +00:00
Sage Abdullah 4ad08ddf6a Refactor search_promotions create view to extend generic CreateView 2024-12-06 19:56:10 +00:00
Sage Abdullah a506b7f0e2 Change QueryForm into a ModelForm subclass 2024-12-06 19:56:10 +00:00
Sage Abdullah e547f5e040 Add commented-out test to ensure search promotions formset does not get reset if the query form is invalid 2024-12-06 19:56:10 +00:00
Sage Abdullah 3d915733e6 Add test for creating multiple search picks at once
Also add commented-out assertions that log entries are only created
once for each search pick, which currently would fail due to a bug in
the implementation.
2024-12-06 19:56:10 +00:00
Sage Abdullah e79aed3616 Add test for adding promoted search results with an existing query_string 2024-12-06 19:56:10 +00:00
Sage Abdullah 63da8b2733 Improve form validation in search promotions form
Move the individual form validation to the SearchPromotionForm class
instead of the formset.

Do not assume external_link_url and the other fields are available in
cleaned_data, which can cause a crash if the input is invalid.

Attach validation errors to the most relevant section instead of bunging
everything as a non-field error.
2024-12-06 19:56:10 +00:00
Mauro Soche f177c02da8 Ensure the copy page form only allows choosing valid parents for the copy
Ensure the Page chooser disables the types of pages that do not follow the content hierarchy when trying to copy a page.

Fixes #11593
2024-12-06 15:07:32 +10:00
hsd2514 547e4d3731 Changing default value for Gravatar URL from ( mm -> mp )
- See https://docs.gravatar.com/api/avatars/images/#default-image
- Fixes #12658
2024-12-06 13:46:12 +10:00
Sage Abdullah 23275a4cef
Release note for #12643 2024-12-04 10:56:03 +00:00
Matt Westcott 8cdeb23a43
Preserve URL parameters on parent link in page chooser search results
Fixes #11955
2024-12-04 10:48:46 +00:00
Matt Westcott 28cde800d9
Correctly initialize page chooser search results for multiple selection 2024-12-04 10:48:46 +00:00
Matt Westcott 8da1796d53
Pass all URL parameters to page chooser search action, including multiple and user_perms 2024-12-04 10:48:45 +00:00
Srishti-j18 c2676af857 Ensure new ListBlock instances get created with unique IDs
Fixes #10074
2024-12-04 19:10:04 +10:00
elhussein almasri cd7977ada8 Fix image/document chooser using `MultipleChooserPanel` within `InlinePanel`
Ensure `MultipleChooserPanel` using images or documents work when nested within an `InlinePanel` when no other choosers are in use within the model.

Fixes #11233
2024-12-04 18:35:32 +10:00
Ayaan 5837d346d9 Fix initial mode value logic in modeValueChanged
Fix from #12641
2024-12-04 17:35:01 +10:00
Jaivignesh-afk 13951cf7a5 Fix empty `th` elements in admin (accessibility)
- Headings cannot be empty (https://dequeuniversity.com/rules/axe/4.9/empty-table-header)
- Added aria-hidden=true or a suitable label to empty <th> across admin
- Fixes #11596
- Additional related fixes provided in #12203 & #11465
2024-12-04 12:50:13 +10:00
SebCorbin fceda14872 Use openpyxl at runtime
- See discussion 'import openpyxl' #12125
- Projects that don't use ReportView (or SpreadsheetExportMixin) and wagtail.contrib.redirects should see a memory use decrease
2024-12-04 08:49:13 +10:00
LB bc34020e0d Docs - Ensure documents overview section renders Django template syntax 2024-12-04 08:48:45 +10:00
LB d48cf61701 Docs - Use consistent indents for CSS snippets 2024-12-04 08:48:45 +10:00
LB eac7dd92b6 Docs - fix up whitespace issues 2024-12-04 08:48:45 +10:00
LB 047ecff2bb Release notes - use consistent whitespace above headings 2024-12-04 08:48:45 +10:00
LB 233ff2b419 Add docs contributor Alex Fulcher for #12039 2024-12-04 08:13:01 +10:00
Sævar Öfjörð Magnússon 8ec4ed0127 Incorporate 'are we headless' content into documentation
- API chapters from https://areweheadlessyet.wagtail.org/
2024-12-04 08:10:15 +10:00
Matt Westcott 6047a66663 Allow using plain strings in panel definitions in place of FieldPanel / InlinePanel (#12557) 2024-12-03 19:50:07 +00:00
Srishti-j18 6054245548 Remove unused `is_active` & `active_menu_items` from `wagtail.admin.menu.MenuItem`
These methods are no longer utilized in the codebase and have been superseded by JavaScript-based handling of active menu items. Specifically, the sidebar-menu-item--active class, responsible for theming active menu items via CSS, is now exclusively managed by JavaScript.

Cleaned up the related test from wgatail.admin.tests.tests.py : wagtail.admin.tests.tests.TestMenuItem.test_menuitem_reverse_lazy_url_pass

Fixes #11433
2024-12-03 08:26:38 +10:00
LB 585b9b4b04 Add changelog for #12641 2024-12-03 07:53:40 +10:00
ayaan-qadri acdeb4f8d9 Update privacy-switch class toggle targets to use ZoneController
- Refactor styles for status tag to be more easily used across multiple elements
- Fixes #12611 (accessibility issue with the live link not reflecting update title/tooltips)
2024-12-03 07:53:40 +10:00
ayaan-qadri 4ea2c661c8 Update privacy-switch to avoid toggling classes & instead dispatch an event 2024-12-03 07:53:40 +10:00
ayaan-qadri 3a50b2467a Added switch method & inactive class support to ZoneController
- fixes #12611
2024-12-03 07:53:40 +10:00
LB 3a19f450f6 Fixup changelog typo 2024-12-03 07:53:40 +10:00
LB 26442631c7 Add changelog for #11202 2024-12-03 07:15:09 +10:00
LB Johnston 97d2332ba4 Migrate image-url-generator conditional fields to w-rules/RulesController
See #11045
2024-12-03 07:15:09 +10:00
LB Johnston 4438f13d5c Add initial implementation of w-rules/RulesController
- Allows a controlled form to have targets that are conditionally enabled based on a rule to match against the form data
- Partial progress for #11045
2024-12-03 07:15:09 +10:00
LB Johnston 918ceebc17 Create a JavaScript util `castArray`
- Allows easy conversion of any value/s supplied into an array or keep as an array if it's already one
2024-12-03 07:15:09 +10:00
Sage Abdullah f8f99833f2 Refactor settings EditView to make better use of generic EditView (#12635) 2024-12-02 15:18:09 +00:00
Matt Westcott b81b899c0c credit Sage on search term report 2024-12-02 15:02:39 +00:00
Sage Abdullah 217751e747 Remove unnecessary search_terms_report_results.html template 2024-12-02 15:01:53 +00:00
Sage Abdullah 76925488ad Allow sorting by each column in search terms report 2024-12-02 15:01:53 +00:00
Sage Abdullah 789a0c2572 Change created_at filter param to hit_date in search terms report view 2024-12-02 15:01:53 +00:00
Sage Abdullah 9a1c7126e2 Change query_string filter on search term reports into a search field
Also fix and add the tests. The previous test for search was wrong:
the assertion passed because the search query is found in the form input
(and URLs), and does not actually assert the results. The query_string
is always normalized to lowercase, so the expected result would be
'found' and not 'Found'. Change this to use a more descriptive string
and ensure that the search works by using an icontains lookup.
2024-12-02 15:01:53 +00:00
Sage Abdullah bda83b061c Use gettext_lazy for search terms report views strings
And do not capitalize 'Term'
2024-12-02 15:01:53 +00:00
Clifford Gama a142363a80 Add missing backticks on image tag 2024-12-02 12:10:10 +00:00
Clifford Gama a1de5bdbd7 Introduce tags and filters as they are in user-guide docs (#12647) 2024-12-02 12:07:48 +00:00
Sage Abdullah 839193ff3c Remove unused LinkController
See #11736
2024-11-29 18:17:00 +10:00
Sage Abdullah b7a4271930
Move release note for #12570 to 6.3.2 2024-11-28 10:06:16 +00:00
Sage Abdullah e74703d9ab
Remove duplicate entry in CONTRIBUTORS
We already credited Bartosz under the name "Bart Cieliński" as per the
GitHub profile.
2024-11-28 09:56:59 +00:00
Bartosz Cieliński 5815a7e1ef Ensure Draftail features wrap in case there is a lot of added features 2024-11-28 08:11:12 +10:00
Strapchay b3ba89b2ec Fix commenting not working on pages with read_only FieldPanels
Fixes #11838
2024-11-28 07:12:54 +10:00
ankit02327 79c9ce266c Update community guidelines link in first contribution guide 2024-11-28 06:55:39 +10:00
LB c416cfb7d6 Fix minor typos
Update to US spelling
2024-11-27 15:33:59 +00:00
LB f5a08646c9 Add changelog for #12579 2024-11-27 20:34:42 +10:00
Sage Abdullah 94de52e912 Avoid loading icons sprite in preview error page 2024-11-27 20:34:42 +10:00
Sage Abdullah 6ec4dafc6a Avoid loading default radio input icon for preview size buttons 2024-11-27 20:34:42 +10:00
Matt Westcott 836b8138d3 Prevent generic model edit view from unquoting non-integer primary keys multiple times
Fixes #12599
2024-11-27 20:11:52 +10:00
Srishti-j18 ffe294bc7b Added unit tests, storybook & JSDoc items for DrilldownController
Fixes #12511
2024-11-27 19:29:10 +10:00
Matt Westcott 8026108fa4 Update Noah van der Meer's name in contributors 2024-11-26 15:39:26 +00:00
LB dddac974d2 Add changelog #12535 2024-11-26 08:23:33 +10:00
Aayushman Singh 712374072d Update AdminTagWidget to use delay for debouncing autocomplete
- Fixes #12415
- See also #12564
2024-11-26 08:23:33 +10:00
Aayushman Singh 62109ba75e Update TagController to support debounced tag async autocomplete 2024-11-26 08:23:33 +10:00
joelwilliam2005 dd4b40d467 Show the correct privacy status in the sidebar when creating a new page
Fixes #12277
2024-11-26 07:47:21 +10:00
Clifford Gama 7566fb84e0 Docs: Use sentence case for titles in pages/theory.md 2024-11-26 06:46:21 +10:00
Clifford Gama 8df6cae90c Docs: Break Scheduled Publishing into multiple subheadings 2024-11-26 06:38:26 +10:00
Sage Abdullah 6b84e93259 Link to HTTPMethod in Page.handle_options_request() docs 2024-11-26 06:32:45 +10:00
LB cc335cad5f
Reinstate modal-workflow self.ajaxifyForm & add unit tests
- Fixes #12618
- Regression from #12380
2024-11-22 16:14:32 +00:00
Matt Westcott 9cacfe0dc2 Release note for #12612 2024-11-22 16:13:35 +00:00
Sage Abdullah ba54c5cce6 Refactor Redirects delete view to use generic DeleteView and template 2024-11-22 16:12:29 +00:00
Sage Abdullah 975e07bbdd Create separate blocks in generic confirm_delete.html template to ease overrides 2024-11-22 16:12:29 +00:00
Sage Abdullah 6be7ed2e49 Replace <input type="button"> with <button> in generic confirm_delete.html template 2024-11-22 16:12:29 +00:00
Sage Abdullah 3f6b919c7b Refactor redirects create view to use generic CreateView and template 2024-11-22 16:12:29 +00:00
Matt Westcott f9e4e10fce Release note for #12608 in 6.4 2024-11-22 12:30:03 +00:00
Matt Westcott 98f0cd5d79 Release note for #12608 in 6.3.2 2024-11-22 12:29:38 +00:00
Jake Howard 62d2d78f17 Ensure cloudfront purges are called with lists 2024-11-22 12:19:07 +00:00
Jake Howard 6b44838841 Use correct connection when searching (#12508)
- Use the indexes preferred DB, not the indexing model
- Use write connections for writes, and reads for reads
2024-11-22 10:23:26 +00:00
Matt Westcott 2b05b6a295 Release note for #12589 in 6.3.2 2024-11-22 09:56:28 +00:00
LB 4bd95942e7 Docs: Fix up formatting on tutorial 'create' pages 2024-11-22 17:16:03 +10:00
Clifford Gama 7aeadde451 Update tutorial instructions to use icon for adding children pages
- Reflects changes added in #11012
2024-11-22 17:16:03 +10:00
Matt Westcott 09a9261f7d Add release note for #12341 2024-11-21 18:37:24 +00:00
Matt Westcott 5b57bd3d85 Move report view into a submodule of wagtail.contrib.search_promotions.views 2024-11-21 18:33:44 +00:00
n_w_vd_meer@proton.me 94bdc200f2 Implementation of search term based reports 2024-11-21 18:27:58 +00:00
Matt Westcott 252ca973d3 Release note for #12566 2024-11-21 18:00:54 +00:00
Sage Abdullah 87dcaf6338 Silence wagtailadmin.W001 in project template test
We don't need to compile the CSS for this
2024-11-21 17:50:02 +00:00
Sage Abdullah f65282f482 Handle deprecated CheckConstraint.check in 0087 migration 2024-11-21 17:50:02 +00:00
Sage Abdullah 9b8015bb5f Suppress locale.getdefaultlocale warning in project template test
It comes from l18n
2024-11-21 17:50:02 +00:00
Sage Abdullah 9e843af55a Test project template against Django's branches 2024-11-21 17:50:02 +00:00
LB 57f7abda43 Add a changelog entry for #12569
Fixes #12563
2024-11-20 16:31:49 +10:00
ayaan-qadri 87f22bebf0 Remove unused jQuery add-multiple / core.js
- Class changes & event handling is now located within the HTML / ZoneController Stimulus usage
2024-11-20 16:31:49 +10:00
ayaan-qadri cc342bbd1c Adopt ZoneController (w-zone) in images/documents add views 2024-11-20 16:31:49 +10:00
ayaan-qadri 31ccda4501 Create new Stimulus ZoneController (w-zone) 2024-11-20 16:31:49 +10:00
LB Johnston b9575f3498 ModalWorkflow - Add JSDoc description & adopt linting recommendations 2024-11-20 12:46:40 +10:00
Andy Babic 66f1e817eb
Allow page types to easily restrict what type of requests they respond to (#12473)
* Allow page types to specify the request methods they support and block unsupported requests in serve()
* Use 'before_serve_page' hook to serve OPTIONS responses
* Add checks to RoutablePageMixin.serve() where the parent implementation is bypassed
* Rename check_http_method to check_request_method and actually use the return value
* Support Python 3.9 through to current approaches for `http` method strings
* Include documentation, docstrings & changelog entry
2024-11-20 10:15:36 +10:00
LB 3697ee1f2a Eslint - fix location of storybook folder & remove eslint ignore 2024-11-20 07:52:43 +10:00
LB acd2c535f6 Remove canvas-to-blob polyfill
Historic recommendation for jQuery image upload before all browsers supported `canvas.toBlob`.

All modern browsers supported by Wagtail have had support for this for many years now.

- See https://caniuse.com/?search=toblob
- See https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
2024-11-20 07:46:40 +10:00
Matt Westcott 5be9bd12d3 Update latest.txt for 6.3.1 2024-11-19 17:00:25 +00:00
Matt Westcott 3697501426 Fill in release date for 6.3.1 2024-11-19 15:56:45 +00:00
Matt Westcott 73445ef175 Fetch new translations from Transifex 2024-11-19 15:56:20 +00:00
Matt Westcott 2d2fb11bf8 Fetch translations from Transifex 2024-11-19 15:56:11 +00:00
Sage Abdullah ae1dab03ab Lower docs search ranking for release notes (#12586)
Except for the 'upgrading' section, as it's still generally useful
2024-11-19 15:24:22 +00:00
Matt Westcott f833a2f520 Remove forced capitalization of site name on admin dashboard (#12601)
Fixes #12592
2024-11-19 15:14:04 +00:00
helloshiv f0d3edfad6
Fix wagtailcache and wagtailpagecache examples to not use quotes for the fragment_name 2024-11-19 14:18:17 +00:00
Sage Abdullah f741f9f333
Release note for #12576 in 6.3.1 2024-11-19 14:16:50 +00:00
Sage Abdullah b1251d8279
Release note for #12573, #12587, #12590, #12591 in 6.3.1 2024-11-19 14:13:29 +00:00
Sage Abdullah a5761bc2a9 Improve spacing of page permissions table in Group settings (#12585) 2024-11-18 16:45:54 +00:00
Matt Westcott d2b9bd224d Release note for #12571 in 6.3.1 2024-11-18 15:51:08 +00:00
Matt Westcott 58f849a294 Handle None in ImageBlock.to_python 2024-11-18 15:47:09 +00:00
Matt Westcott 0dd9b7dcb1 Switch cases in `ImageBlock.bulk_to_python` so that the ImageChooserBlock logic is the special case rather than the default 2024-11-18 15:47:09 +00:00
Storm B. Heg 17378e06c8 Refactor ImageBlock.bulk_to_python to handle more cases of bad data
Specifically, cases where an ImageChooserBlock to ImageBlock migration
results in `[None]` as a value.

ref: https://github.com/wagtail/wagtail/issues/12514
2024-11-18 15:47:09 +00:00
Clifford Gama f4d3c80e2f Fix typo: remove reference to PublishingPanel as a method 2024-11-18 12:49:15 +00:00
Clifford Gama ed084ae3bd Fix misleading wording - clarify that get_site_root is created, not used 2024-11-18 12:48:39 +00:00
Clifford Gama 791f031e16 Fix minor typo - capitalize Page model 2024-11-18 12:40:12 +00:00
Thibaud Colas cd8c19d762 Rename tutorial blog index page to reduce the likelihood of slug issues (#12576) 2024-11-15 16:24:52 +00:00
Matt Westcott 1af469cbd6 Update Emily's name in contributors list 2024-11-15 16:22:39 +00:00
Clifford Gama 9509d6409f Clarify get_context() usage in BlogTagIndexPage example (#12573) 2024-11-15 16:21:10 +00:00
Matt Westcott e7dd00e427 Ensure that creation of image/document choose permissions happens after access_admin permission exists
As per https://github.com/wagtail/wagtail/issues/12581#issuecomment-2478983521.
Fixes #12581
2024-11-15 16:18:20 +00:00
Steve Stein 220a621a88 Add Steve to CONTRIBUTORS.md
docs(contributors): Add Steven to contributors list
2024-11-15 09:51:58 +00:00
Sage Abdullah 5eca192bd2
Release note for #12564 2024-11-13 16:30:50 +00:00
Sage Abdullah d36cb87299
Use values_list() to optimise tag autocomplete view 2024-11-13 16:30:50 +00:00
Aayushman Singh ce0601b77c
Limit autocomplete results view to 10
Prevent performance issues when there are many tags available.
2024-11-13 16:12:57 +00:00
Matt Westcott 5212061485
Normalize StreamField.get_default to prevent creation forms from breaking
Fixes #12561

When a ModelForm is constructed without passing an `initial` instance, the result of `StreamField.get_default()` will become the default value of the form field without the intermediate step of being set on a model instance and read back (which would have the side effect of calling `normalize()`). Form rendering only works with normalized values (e.g. StreamValue rather than list-of-tuples for a StreamBlock), so the return value from `get_default()` needs to be normalized.
2024-11-13 15:46:07 +00:00
Sage Abdullah 210f35f7ec
Release note for #12556 2024-11-13 14:20:10 +00:00
Matt Westcott 7a923de427
Set sensible defaults for InlinePanel heading and label 2024-11-13 14:18:49 +00:00
Matt Westcott 253c401ae2
Pass InlinePanel heading rather than label to use as the label for comparisons
Conventionally `label` is singular (used on individual forms as "Speaker 1", "Speaker 2" etc as well as the "Add speaker" button), while `heading` is plural ("Speakers" or "Speaker lineup", used as the main heading for the list). The plural is most appropriate for the comparison view.

Also fix the test for MultipleChooserPanel, which was copied across from the InlinePanel test without actually setting a label/heading on the panel.
2024-11-13 14:18:49 +00:00
Matt Westcott aa31d329ab
Stop invalid Site hostname records from breaking preview
As made famous by https://youtu.be/v3KEaMTfKg0?t=319 :-)

By design, Wagtail tolerates the default Site record being left at its default value of 'localhost' up to a certain point. Ideally, that point should be when it becomes strictly necessary for Wagtail to care about hostnames (such as when setting up the second site of a multi-site installation) and it should be clear to the developer what has happened and how to fix it.

In practice, that point often comes when the developer deploys their site to production, sets `DEBUG=False`, and is then required by Django to set `ALLOWED_HOSTS` to their real domain name. At this point, front-end page requests work (because the initial site record is default=True, matching any domain including the live one) but previews are broken (because the dummy request object is still formed using localhost as per the site's hostname field, which is disallowed by ALLOWED_HOSTS).

This is unnecessary, and can be avoided by validating the hostname against ALLOWED_HOSTS and substituting one that _is_ allowed if necessary, as we already do for pages that don't have an associated site record.
2024-11-13 13:57:14 +00:00
Sage Abdullah 6315d3c1cc
Release note for #12551 2024-11-12 10:59:57 +00:00
Sage Abdullah 92714d87e7
Minor tweaks per code review 2024-11-12 10:58:04 +00:00
Sage Abdullah 533481b0f4
Add note about extending section not subject to deprecation policy 2024-11-08 20:09:39 +00:00
Sage Abdullah 991d9bcab5
Update release process documentation 2024-11-08 20:09:39 +00:00
Sage Abdullah f43cf941d5
Improve upgrade guide to reflect current versioning scheme and highlight important steps 2024-11-08 20:09:39 +00:00
Sage Abdullah 246f3c7eb5 Fix profile picture upload not working in account settings (#12548)
Fixes #12547
2024-11-07 13:03:20 +00:00
Matt Westcott 122b9683fa Add 6.3.1 release notes 2024-11-07 13:03:13 +00:00
Matt Westcott e7e57cd29e Release note for #12488 2024-11-05 22:36:43 +00:00
Jake Howard 98a141cbc3 Assert query counts for page publishing 2024-11-05 22:35:35 +00:00
Jake Howard f68dd505d0 Don't fetch all related instances when creating revision object 2024-11-05 22:35:35 +00:00
Jake Howard aa1a848bf2 Don't fetch entire live revision 2024-11-05 22:35:35 +00:00
Jake Howard 9efdadb68a Only update changed field 2024-11-05 22:35:35 +00:00
Jake Howard 24726b3797 Optimise resetting comment position from revision 2024-11-05 22:35:35 +00:00
Jake Howard 59ac877063 Don't evaluate expired objects 2024-11-05 22:35:35 +00:00
Jake Howard 37567dfe18 Check workflow cancel before getting workflow 2024-11-05 22:35:35 +00:00
ayaan-qadri b0c90d4be2 Removed preventDefault from openPreviewInNewTab in PreviewController
Relates to #10356
2024-11-06 07:47:10 +10:00
LB 825a77d6c2 Remove all eslint-disable no-undef & use global comments (#12527)
Recommendation is to either declare globals in config or in a `/* global ` comment
See https://eslint.org/docs/latest/rules/no-undef#rule-details
2024-11-05 20:11:09 +00:00
LB cae3229716 Remove unnecessary DOM Range polyfill (#12496)
- Remove DOM Range polyfill provided by https://developer.mozilla.org/en-US/docs/Web/API/Range
- All Wagtail supported browsers, as of a few years ago, have built in support for `document.createRange`, see https://developer.mozilla.org/en-US/docs/Web/API/Range
2024-11-05 20:01:31 +00:00
Matt Westcott 3013673c55 Release notes for #12480 2024-11-05 19:48:24 +00:00
LB 281efdbc88 Fix - Ensure `WagtailAdminFormPageForm.clean` works for any related name
Dynamically detect the `related_name` of any form fields attached to the page so that validation is actually run for custom related_names.

This also will apply validation even if there are multiple `AbstractFormField` subclasses related to the page.

Add unit test to ensure that duplicate clean name validation correctly runs on FormPage models with a custom related name.

Originally from #10375
2024-11-05 19:22:33 +00:00
John-Scott Atlakson 9d31fd3fa5 Fix - Ensure `WagtailAdminFormPageForm.clean` returns `cleaned_data`
Return `cleaned_data` for more consistent subclassing.

Updated documentation with an example of adding custom page validation for form fields.

Add unit test to ensure that the documented usage of extending `WagtailAdminFormPageForm` works as expected.

Originally from #10375
2024-11-05 19:22:33 +00:00
minusf f600a356e6
Add missing apostrophe in settings documentation (#12542) 2024-11-05 16:09:55 +00:00
Sage Abdullah f21f6dd884
Release note for #12525 2024-11-05 12:56:59 +00:00
Sage Abdullah 794fa3bcaf
Improve documentation guidelines on writing docstrings and API reference 2024-11-05 12:52:57 +00:00
Sage Abdullah a81cc7345d
Remove e.g. in documentation guidelines 2024-11-05 12:45:26 +00:00
Sage Abdullah 17ce66ad45
Update outdated Pillow links 2024-11-05 10:44:41 +00:00
Sage Abdullah f54b03d595
Use intersphinx to link to treebeard docs 2024-11-05 10:44:41 +00:00
Sage Abdullah da3e0ade37
Use intersphinx to link to MyST-Parser docs 2024-11-05 10:44:41 +00:00
Sage Abdullah ddf8423f3c
Use stable link to Wand docs
There's only one link to Wand's docs, not worth adding an
intersphinx_mapping entry.
2024-11-05 10:44:40 +00:00
Sage Abdullah b7cf847d69
Replace outdated Wagtail editor manual link with link to the editor guide 2024-11-05 10:44:40 +00:00
Sage Abdullah 503d1a743a
Replace hardcoded Python docs links with intersphinx 2024-11-05 10:44:40 +00:00
Sage Abdullah 5615deb5b1
Add Django's custom Sphinx roles and use them to link to settings
This is necessary for rST docs, i.e. in docstrings and in eval-rst
blocks. Without this, Sphinx cannot seem to understand the role. See:
https://stackoverflow.com/questions/13387125

MyST-Parser seems to be smarter, it can figure out these custom
roles without having to register the types ourselves. This is evident in
the previous commits where I already use the :setting: role in markdown
docs.
2024-11-05 10:44:40 +00:00
Sage Abdullah 9a5be8f180
Replace more hardcoded Django links with intersphinx in rST docs
Some link labels are changed to just the code part, because using Sphinx
roles for code objects (e.g. methods, attributes) would always format the
text as inline code.

It's currently impossible to customize the formatting of a link's text in
rST. See https://stackoverflow.com/questions/4743845
2024-11-05 10:44:39 +00:00
Sage Abdullah 857b26e5a0
Replace hardcoded Django docs links to intersphinx links 2024-11-05 10:44:39 +00:00
Sage Abdullah 9d69863f3c
Use intersphinx to link to Sphinx docs 2024-11-05 10:44:39 +00:00
Sage Abdullah 795ca50dc8
Improve clarity between Markdown/MyST, rST, and Sphinx in docs guidelines
Add more emphasis on the divide between when to use Markdown and when to
use rST.

Also improve examples for versionadded and versionchanged directives.
2024-11-05 10:44:39 +00:00
Sage Abdullah 0dc1698857
Do not index autodoc examples 2024-11-05 10:44:39 +00:00
Sage Abdullah 443ccb23a8
Update docs for writing admonitions
It's MyST syntax, not rST, so it's OK to use it (sparingly).

Custom admonitions are possible with the `admonition` directive.
2024-11-05 10:44:38 +00:00
Sage Abdullah 81e6d79c5e
Improve guidelines for writing links in docs 2024-11-05 10:44:38 +00:00
Sage Abdullah dddf9bfd81
Highlight Markdown vs reStructuredText differences for inline styles 2024-11-05 10:24:51 +00:00
Sage Abdullah 121624d5b1
Add syntax highlighting to code block examples 2024-11-05 10:24:51 +00:00
Jake Howard 71c93cb39c Remove non-unsert support for Postgres indexing (#12509)
PostgreSQL 9.4 support was dropped with the release of Django 3.0.
2024-11-04 18:19:29 +00:00
rahulsamant37 5e4c3f12c3 Remove defunct oEmbed providers (#12537)
Fixes #12054
2024-11-04 18:04:33 +00:00
Matt Westcott 0cab6641cc Release note for #12539 2024-11-04 15:40:44 +00:00
LB f1597b61ed NPM package updates - minor updates & security fixes 2024-11-04 15:40:27 +00:00
LB 2e87f4ddec Update to Node 22 (active LTS)
- See https://nodejs.org/en/blog/release/v22.11.0
- Fixes #12531
2024-11-04 15:40:27 +00:00
LB 21206dc3e7 Clean up JS comments to be aligned to JSDoc where suitable 2024-11-04 21:14:04 +10:00
LB 6f34d3c299 Add changelog for #12503
Fixes #12498
2024-11-02 10:29:19 +10:00
Aayushman Singh 71a735476c Docs - images/documents title generation - update for CSP compliant examples
- Add helpful intro content, insure formatting of Python/JS is consistent
- Avoid inline scripts, instead ensure the example shows external script usage
2024-11-02 10:29:19 +10:00
Aayushman Singh 7f6e7d4062 Docs - Improve hooks & extending pages with CSP compliant examples
- Avoid `mark_safe` and use `format_html` where possible
- Avoid inline scripts, instead ensure the example shows external script usage
2024-11-02 10:29:19 +10:00
Aayushman Singh b0479592ff Docs - Update extending/admin_views to have CSP compliant examples
- Changed style tag, to an external style file
- Also fixed minor spelling mistake "calender" -> "calendar" in line 190
- Avoid inline styles, instead ensure the example shows external style usage
2024-11-02 10:29:19 +10:00
Aayushman Singh e28beb5b45 Docs - Writing guidelines - Add code example considerations
Start a small section to offer some guidance to ensure that code examples are secure, accessible and easier to use.
2024-11-02 10:29:19 +10:00
manu b2cd95bf3b Fix sidebar page explorer transitions - avoid overflow 2024-11-02 09:59:21 +10:00
LB 114998fa21 Fix changelog for #12495 add changelog for #12510 2024-11-02 09:04:55 +10:00
LB 940ac10a9c Remove unused uuid module 2024-11-02 09:02:09 +10:00
Matt Westcott 54e1dc875a Update latest.txt for v6.3 2024-11-01 14:13:23 +00:00
Matt Westcott 793539d208 Fill in release date for 6.3 final 2024-11-01 13:21:07 +00:00
Matt Westcott f110ddd934 Fill in release date for 6.2.3 2024-11-01 13:20:09 +00:00
Matt Westcott e8ca33b023 Fill in release date for 5.2.7 2024-11-01 13:20:08 +00:00
Matt Westcott a8e243d36b Release note for #12521 in 6.2.3 2024-11-01 13:14:05 +00:00
Matt Westcott e931a40451 Release note for #12427 in 6.2.3 2024-11-01 12:50:09 +00:00
Matt Westcott 9ef8c834d2 Release note for #12367 in 6.2.3 2024-11-01 12:33:45 +00:00
Matt Westcott 0313522d38 Release note for #12367 in 5.2.7 2024-11-01 12:33:35 +00:00
Bojan Mihelac cc1805dc86
Fix sub-menus within the main menu cannot be closed on mobile (#10747) 2024-11-01 12:10:53 +00:00
Ayaan 0913118da4
Replaced Twitter references in the docs with more appropriate alternatives (#12516). Fix #12483
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-11-01 11:03:54 +00:00
Thibaud Colas bfd7e46496 Add release notes for #12521 2024-11-01 10:01:34 +00:00
Thibaud Colas b1fc61a5a2 Add release notes for ##12521 2024-11-01 10:01:01 +00:00
Matt Westcott 593b95cad9
Document the ability to migrate from ImageChooserBlock to ImageBlock (#12518) 2024-11-01 09:58:42 +00:00
Matt Westcott cda72797c5
Correctly handle None values in ImageBlock.bulk_to_python (#12517) 2024-11-01 09:56:54 +00:00
Thibaud Colas d7ccda33f6
Update sphinx-wagtail-theme and search implementation (#12521) 2024-11-01 09:35:43 +00:00
LB 93384a062e Update CloneController - added/cleared events should not be cancelable
- While no code uses the event.preventDefault on these it's good practice to advise when cancelling will do nothing
2024-10-31 22:10:00 +10:00
LB b903b572d9 Update changelog for 6.3 cherry-pick #12490 #12506 #12507
Offline formats cherry-picked to 6.3 release
2024-10-31 08:12:48 +10:00
LB 9b4999ed9d Add changelog for #12507
Fixes #12484
2024-10-31 07:52:49 +10:00
Sage Abdullah 49a1e56d10 Replace Torchbox with 'Wagtail core team and contributors' in docs config 2024-10-31 07:52:49 +10:00
Sage Abdullah b6abec16d0 Add minimal epub metadata
Ref: 97a6a678c4/docs/conf.py (L380-L386)
2024-10-31 07:52:49 +10:00
Sage Abdullah 3802f8bf46 Fix remaining XHTML errors in docs to remove ePub build errors
Had to remove the <details> element for the section linking example in
the "Reference links" section.

This is because Sphinx/MyST renders a <section> element for each heading
and closes it when the next heading starts. If we create a heading
inside a <details> element, the <section> element will not be closed
until the next heading starts, which generates invalid HTML.
2024-10-31 07:52:49 +10:00
Sage Abdullah 78120671da Ensure docs template layout override is XHTML-compatible for ePub 2024-10-31 07:52:49 +10:00
Sage Abdullah 7955b815ce Fix HTML errors in wagtail_icons_table.txt 2024-10-31 07:52:49 +10:00
Sage Abdullah a2c8e2b26f Suppress unknown files warning when building the ePub docs 2024-10-30 14:29:22 +00:00
Joel William 7b2b44b541 Documentation - Configure RTD to build all offline formats
- https://docs.readthedocs.io/en/stable/config-file/v2.html#formats

Fixes #12484
2024-10-30 18:26:31 +10:00
Jake Howard f08a947f8e Bypass ALLOWED_HOSTS checks when resolving Site for request (#12129) 2024-10-29 19:41:23 +00:00
LB 3a5ae9c695 Docs - Ensure core models module level docstring does not appear in docs
Avoid the docstring being shared in the model reference documentation, this content is for core development only.
Update name of core modules.
2024-10-29 15:47:39 +00:00
LB b6b9c003ff Doc - Fix minor spelling inconsistency 2024-10-29 15:47:39 +00:00
Srishti-j18 fd9b1ca22b Docs - Update spelling to US customize variants
Fixes #12476
2024-10-29 18:47:43 +10:00
Storm B. Heg d404d37ba5 Extend Pillow version range to allow v11 (#12475) 2024-10-28 18:23:31 +00:00
LB a562d4db6a Docs - Align spelling of 'subpages' to be consistent with rest of docs 2024-10-28 08:34:59 +10:00
Srishti-j18 652de3fcb3 Documentation - Improve code highlighting & formatting for Python docstrings in core models 2024-10-28 08:34:38 +10:00
Matt Westcott 37d9d7eb06 Increase DATA_UPLOAD_MAX_NUMBER_FIELDS in project template & docs
Also recommend increasing this in the "Integrating into Django" docs.

Fixes #12452

- Don't use commas for thousand separator
- Co-authored-by: Jake Howard <RealOrangeOne@users.noreply.github.com>
2024-10-28 08:27:29 +10:00
Andy Babic e451bbd96a Support application of select_related and prefetch_related lookups to subqueries made by SpecificIterable
- Add queryset methods to reference docs, and provide performance considerations for prefetch_related()
2024-10-28 08:06:03 +10:00
fazledyn fde2e6f26a Close open files when reading within utils/setup.py 2024-10-28 08:04:52 +10:00
Stefan Hammer e7b4daaf32 Fix StreamValue._prefetch_blocks() to skip manually inserted items
Fixes #12320
2024-10-28 07:31:25 +10:00
LB 5477a872c7 Changelog for #11122 & #12418 2024-10-27 20:20:02 +10:00
Joel William 4a933df9fb Rich Text (Draftail) - Ensure SVG paths are correctly handled for custom features #12418
Ensure the documented support for providing an array of SVG paths to the 'icon' attribute when using `register_rich_text_features` is correctly supported.

Fixes #11777
Fixes #11051
Fixes #10319

See https://docs.wagtail.org/en/stable/extending/extending_draftail.html#creating-new-blocks
> It can also be an array of strings, to use SVG paths, or SVG symbol references for example 'icon': ['M100 100 H 900 V 900 H 100 Z'],. The paths need to be set for a 1024x1024 viewbox.
2024-10-27 20:20:02 +10:00
Temidayo32 c611dd4056 Ensure the Icon react component can support custom icon paths #11122
- When provided with children (e.g. custom paths), render these instead of the `use` symbol reference
- Allow any valid SVG attribute to be passed to the component to render on the `svg` element
- Clean up rendering of className to avoid extra whitespace
- Clean up ordering of the props to be alphabetically sorted
- Update unit tests to be focused more on testing and less on snapshots
2024-10-27 20:20:02 +10:00
Srishti-j18 d2f476c050 Documentation - Update page titles to align with Style Guide
- Use sentence case for headings and titles. (as per the Google Developer Documentation Style Guide)
- Fixes #12466
2024-10-27 15:27:03 +10:00
Thibaud Colas b970f635e3 Update developer documentation screenshots for Wagtail 6.3 2024-10-26 01:50:46 +01:00
Thibaud Colas 987bd2a054 Update documentation colors based on latest color theming for more-contrast 2024-10-25 17:11:38 +01:00
LB (Ben Johnston) 61fe21af16
Documentation - Add recent third party tutorials (#12442)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-10-25 13:50:50 +01:00
activus-d 97a1f5aabd Documentation - Improve project template (wagtail start) & add to management commands reference
Fixes #11938

* Add `wagtail start` to the management commands reference
* Add detail on how to creating templates with the need to escape template syntax by using the verbatim tag
2024-10-25 21:15:30 +10:00
LB fa81e2dbbe Docs - update spelling to US 'customizations' 2024-10-25 21:14:52 +10:00
LB bd2a035439 Remove duplicate contributor name 2024-10-25 21:14:52 +10:00
Alessandro Chitarrini b9e13077bb Documentation - Refine the adding reports page
- Move all generic (page/non-page) class references to the top of the documentation
- Use better heading level nesting cleanly isolate the full page report example
- Relates to #12428
2024-10-25 20:40:02 +10:00
LB d5b56e00f6 Add changelog entry for docs changes #12437
Fixes #12435
2024-10-25 20:30:12 +10:00
Srishti-j18 2d644dd8e2 Documentation - Move tags out from pages model recipes to a standalone advanced topic 2024-10-25 20:30:12 +10:00
Srishti-j18 f588fcf249 Documentation - Reposition model & panel references
- Move model reference to directly under the references section, not the reference/pages section
- Move panel reference to directly under the references section, not the reference/pages section
- Merge panel API with panels reference pages
- Fix confusing heading levels in the page model recipes page
- Fix title in model reference to align with docs style guide
- Adopt US spelling for customize (panels) reference key
2024-10-25 20:30:12 +10:00
Thibaud Colas 25de8011d5 Release notes for #12460 2024-10-24 12:14:09 +01:00
Alex Morega e4e94a5640
Replace X links with Mastodon (#12460)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2024-10-24 12:09:59 +01:00
LB c0b2977647 Add links to 6.3 release notes documentation items 2024-10-24 11:51:15 +01:00
LB d459bdb5dc Clean up whitespace items in documentation markdown 2024-10-24 11:51:15 +01:00
Thibaud Colas 46d2e44cd1 Release notes for #12393 2024-10-24 10:18:19 +01:00
Thibaud Colas b680536286 Add release note template for 5.2.7 2024-10-24 09:57:11 +01:00
Thibaud Colas 3895136fd0 Add release note template for 6.2.3 2024-10-24 09:53:53 +01:00
sag​e 3f6cd8c18f
Fix font size for custom listing button styles (#12456) 2024-10-24 09:33:28 +01:00
Matt Westcott e9af16b48d Improve i18n of success message for bulk page actions (#12453)
Previously, translations for messages such as "1 page and 3 child pages have been published" were handled with separate branches for the "one parent page" vs "multiple parent pages" cases, to work around ngettext only being able to handle pluralisation for one item in the string. This fails for languages such as Polish where the pluralisation does not follow the straightforward one/many distinction.

Instead, we can translate "N pages" and "N child pages" separately before forming the final message. We generally avoid translating sentence fragments in isolation as this can make things difficult for translators if the sentence structure does not match the English version - but this is hopefully an improvement over the current situation, as well as simplifying the code and reducing repetition.
2024-10-23 15:54:11 +01:00
Matt Westcott 34cbec36b2 Start new release notes sections for 6.4 2024-10-23 16:45:46 +10:00
Matt Westcott bff75a2d08 Version bump to start work on 6.4 2024-10-23 16:45:46 +10:00
Matt Westcott bbb50459c9 Remove versionadded / versionchanged notes for 6.2
However, leave behind notes that mark settings/features that are deprecated but not yet removed, as this would be removing information that isn't in the main body of the text (and moving it out of a versionchanged note would make it harder to find when we come to remove it properly in 7.0).
2024-10-23 16:45:46 +10:00
Matt Westcott 4d31bd0a29 Add clarification on using versionadded / versionchanged directives 2024-10-22 22:13:36 +01:00
Matt Westcott c1ce58fb42 Add Uyghur language support to release notes 2024-10-22 17:13:26 +01:00
sumana sree d35eb68b78 Fix: Update `can_handle` method to check for AbstractGroupApprovalTask instances
- Fixes #12328
- Regression from #11653
2024-10-22 08:19:38 +10:00
Matt Westcott f265896267 Only add Uyghur to supported languages under Django 5.x 2024-10-21 18:35:17 +01:00
2344 zmienionych plików z 37942 dodań i 31649 usunięć

Wyświetl plik

@ -1,16 +1,7 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100,
"safari": 15,
"firefox": 91
}
}
],
"@babel/preset-env",
"@babel/preset-typescript",
"@babel/preset-react"
],

Wyświetl plik

@ -4,36 +4,38 @@ jobs:
backend:
docker:
- image: cimg/python:3.12
environment:
PIPENV_VENV_IN_PROJECT: true
steps:
- checkout
- run: python --version > .python_version
- restore_cache:
key: pipenv-v3-{{ checksum "setup.py" }}
key: &venv-cache venv-v1-{{ checksum "pyproject.toml" }}-{{ checksum ".python_version" }}
# Only install if .venv wasnt cached.
- run: |
if [[ ! -e ".venv" ]]; then
pipenv install -e .[testing,docs]
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .[testing,docs]
fi
echo "source $(pwd)/.venv/bin/activate" >> $BASH_ENV
- save_cache:
key: pipenv-v3-{{ checksum "setup.py" }}
key: *venv-cache
paths:
- .venv
- run: pipenv run ruff check .
- run: pipenv run ruff format --check .
- run: pipenv run semgrep --config .semgrep.yml --error .
- run: git ls-files '*.html' | xargs pipenv run djhtml --check
- run: pipenv run curlylint --parse-only wagtail
- run: pipenv run doc8 docs
- run: ruff check .
- run: ruff format --check .
- run: semgrep --config .semgrep.yml --error .
- run: git ls-files '*.html' | xargs djhtml --check
- run: curlylint --parse-only wagtail
- run: doc8 docs
- run:
name: Run tests
command: |
export PYTHONUNBUFFERED=1
WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT=1 pipenv run python -u runtests.py --parallel=2
WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT=1 python -u runtests.py --parallel=2
frontend:
docker:
- image: cimg/node:20.9
- image: cimg/node:22.11
steps:
- checkout
- restore_cache:
@ -64,45 +66,48 @@ jobs:
docker:
- image: cimg/python:3.12-browsers
environment:
PIPENV_VENV_IN_PROJECT: true
DJANGO_SETTINGS_MODULE: wagtail.test.settings_ui
DJANGO_DEBUG: true
DJANGO_DEBUG: 'true'
steps:
- checkout
- attach_workspace:
at: ~/project
- run: python --version > .python_version
- restore_cache:
key: ui_tests-pipenv-v3-{{ checksum "setup.py" }}
key: &ui_tests-venv-cache ui_tests-venv-v1-{{ checksum "pyproject.toml" }}-{{ checksum ".python_version" }}
# Only install if .venv wasnt cached.
- run: |
if [[ ! -e ".venv" ]]; then
pipenv install -e .[testing]
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .[testing]
fi
echo "source $(pwd)/.venv/bin/activate" >> $BASH_ENV
- save_cache:
key: ui_tests-pipenv-v3-{{ checksum "setup.py" }}
key: *ui_tests-venv-cache
paths:
- .venv
- restore_cache:
key: ui_tests-npm_integration-v3-{{ checksum "client/tests/integration/package-lock.json" }}
key: &ui_tests-npm-cache ui_tests-npm_integration-v3-{{ checksum "client/tests/integration/package-lock.json" }}
# Only install if node_modules wasnt cached.
- run: |
if [[ ! -e "client/tests/integration/node_modules" ]]; then
npm --prefix ./client/tests/integration ci
fi
- save_cache:
key: ui_tests-npm_integration-v3-{{ checksum "client/tests/integration/package-lock.json" }}
key: *ui_tests-npm-cache
paths:
- client/tests/integration/node_modules
# Also cache the global location where Puppeteer stores browsers.
# https://pptr.dev/guides/configuration/#changing-the-default-cache-directory
- ~/.cache/puppeteer
- run: pipenv run ./wagtail/test/manage.py migrate
- run: ./wagtail/test/manage.py migrate
- run:
command: pipenv run ./wagtail/test/manage.py runserver 0:8000
command: ./wagtail/test/manage.py runserver 0:8000
background: true
- run: pipenv run ./wagtail/test/manage.py createcachetable
- run: ./wagtail/test/manage.py createcachetable
- run:
command: pipenv run ./wagtail/test/manage.py createsuperuser --noinput
command: ./wagtail/test/manage.py createsuperuser --noinput
environment:
DJANGO_SUPERUSER_EMAIL: admin@example.com
DJANGO_SUPERUSER_USERNAME: admin
@ -112,9 +117,9 @@ jobs:
environment:
JEST_JUNIT_OUTPUT_DIR: reports/jest
- run:
command: pipenv run ./wagtail/test/manage.py collectstatic --noinput
command: ./wagtail/test/manage.py collectstatic --noinput
environment:
DJANGO_DEBUG: false
DJANGO_DEBUG: 'false'
STATICFILES_STORAGE: manifest
- store_test_results:
path: ./reports/jest
@ -124,12 +129,11 @@ jobs:
- image: cimg/python:3.12-node
steps:
- checkout
- run: pip install --user wheel boto3
- run: pip install --user build boto3
- run: npm install
- run: npm run build
- run: PYTHONPATH=. python scripts/nightly/get_version.py > __init__.py
- run: mv __init__.py wagtail/__init__.py
- run: python setup.py bdist_wheel
- run: python -m build
- run: python scripts/nightly/upload.py
workflows:

Wyświetl plik

@ -11,7 +11,6 @@ wagtail/images/static
wagtail/embeds/static
wagtail/search/static
wagtail/snippets/static
wagtail/users/static
wagtail/contrib/*/static
.mypy_cache
/storybook-static

Wyświetl plik

@ -132,14 +132,14 @@ module.exports = {
files: [
'client/extract-translatable-strings.js',
'client/tests/**',
'webpack.config.js',
'tailwind.config.js',
'storybook/**/*',
'*.test.ts',
'*.test.tsx',
'*.test.js',
'webpack.config.js',
'*.stories.js',
'*.stories.tsx',
'*.test.js',
'*.test.ts',
'*.test.tsx',
'**/storybook/**',
],
rules: {
'@typescript-eslint/no-empty-function': 'off',
@ -167,7 +167,6 @@ module.exports = {
'wagtail/images/static_src/wagtailimages/js/add-multiple.js',
'wagtail/images/static_src/wagtailimages/js/focal-point-chooser.js',
'wagtail/images/static_src/wagtailimages/js/image-url-generator.js',
'wagtail/users/static_src/wagtailusers/js/group-form.js',
],
globals: { $: 'readonly', jQuery: 'readonly' },
},
@ -175,7 +174,6 @@ module.exports = {
{
files: ['wagtail/**/**'],
globals: {
buildExpandingFormset: 'readonly',
escapeHtml: 'readonly',
ModalWorkflow: 'readonly',
DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS: 'writable',

2
.gitattributes vendored 100644
Wyświetl plik

@ -0,0 +1,2 @@
# Make GitHub highlight html files as Django templates
*.html linguist-language=django

Wyświetl plik

@ -24,7 +24,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v1

Wyświetl plik

@ -23,15 +23,14 @@ concurrency:
# - django 4.2, python 3.9, postgres:12, psycopg 2, parallel
# - django 4.2, python 3.10, mysql:8.0
# - django 4.2, python 3.11, mariadb:10.5
# - django 5.0, python 3.11, sqlite, WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT=1
# - django 5.1, python 3.12, mysql:8.4, parallel, USE_EMAIL_USER_MODEL=yes
# - django 5.1, python 3.12, mysql:8.4, USE_EMAIL_USER_MODEL=yes
# - django 5.1, python 3.12, mariadb:11.4, USE_EMAIL_USER_MODEL=yes
# - django 5.1, python 3.13, sqlite, parallel, USE_EMAIL_USER_MODEL=yes
# - django 5.1, python 3.13, postgres:15, psycopg 3, parallel, DISABLE_TIMEZONE=yes
# - django stable/5.1.x, python 3.11, postgres:15, psycopg 3 (allow failures)
# - django 5.2, python 3.13, sqlite, parallel, WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT=1
# - django 5.2, python 3.13, postgres:15, psycopg 3, parallel, DISABLE_TIMEZONE=yes
# - django stable/5.2.x, python 3.12, postgres:15, psycopg 3 (allow failures)
# - django main, python 3.13, postgres:latest, psycopg 3, parallel (allow failures)
# - elasticsearch 7, django 4.2, python 3.9, postgres:latest, psycopg 2
# - opensearch 2, django 5.0, python 3.10, sqlite
# - opensearch 2, django 5.2, python 3.10, sqlite
# - elasticsearch 8, django 5.1, python 3.13, sqlite, USE_EMAIL_USER_MODEL=yes
# Some tests are run in parallel by passing --parallel to runtests.py.
@ -49,16 +48,15 @@ jobs:
strategy:
matrix:
include:
- python: '3.11'
django: 'Django>=5.0,<5.1'
check_template_number_format: '1'
- python: '3.13'
django: 'Django>=5.1,<5.2'
emailuser: emailuser
django: 'Django>=5.2,<5.3'
check_template_number_format: '1'
parallel: '--parallel'
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
@ -96,14 +94,14 @@ jobs:
experimental: false
parallel: '--parallel'
- python: '3.13'
django: 'Django>=5.0,<5.1'
django: 'Django>=5.2,<5.3'
psycopg: 'psycopg>=3.1.8'
postgres: 'postgres:15'
notz: notz
experimental: false
parallel: '--parallel'
- python: '3.11'
django: 'git+https://github.com/django/django.git@stable/5.1.x#egg=Django'
- python: '3.12'
django: 'git+https://github.com/django/django.git@stable/5.2.x#egg=Django'
psycopg: 'psycopg>=3.1.8'
postgres: 'postgres:15'
experimental: true
@ -113,6 +111,9 @@ jobs:
experimental: true
postgres: 'postgres:latest'
parallel: '--parallel'
install_extras: |
pip uninstall -y django-modelcluster
pip install "git+https://github.com/wagtail/django-modelcluster.git@main#egg=django-modelcluster"
services:
postgres:
image: ${{ matrix.postgres || 'postgres:12' }}
@ -124,6 +125,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
@ -153,6 +156,24 @@ jobs:
name: coverage-data-${{ github.job }}-${{ strategy.job-index }}
path: .coverage.*
include-hidden-files: true
- name: Test project template
if: ${{ matrix.experimental }}
env:
PYTHONWARNINGS: error
run: |
wagtail start testproject
cd testproject
tee -a testproject/settings/local.py << EOF
from warnings import filterwarnings
SILENCED_SYSTEM_CHECKS = ["wagtailadmin.W001"]
# Remove when https://github.com/wagtail/Willow/issues/166 is resolved
filterwarnings(
"ignore", "The AVIF support in this library is marked as deprecated"
)
EOF
python manage.py makemigrations --check --dry-run
python manage.py migrate
python manage.py check --fail-level WARNING
test-mysql:
runs-on: ubuntu-latest
@ -175,7 +196,6 @@ jobs:
- python: '3.12'
django: 'Django>=5.1,<5.2'
experimental: false
parallel: '--parallel'
mysql: 'mysql:8.4'
emailuser: emailuser
services:
@ -193,6 +213,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
@ -228,7 +250,7 @@ jobs:
matrix:
include:
- python: '3.13'
django: 'Django>=5.1,<5.2'
django: 'Django>=5.2,<5.3'
emailuser: emailuser
steps:
- name: Configure sysctl limits
@ -246,6 +268,8 @@ jobs:
node port: 9300
discovery type: 'single-node'
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
@ -301,6 +325,9 @@ jobs:
with:
stack-version: 7.6.1
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
@ -337,7 +364,7 @@ jobs:
matrix:
include:
- python: '3.10'
django: 'Django>=5.0,<5.1'
django: 'Django>=5.1,<5.2'
experimental: false
steps:
@ -351,6 +378,8 @@ jobs:
with:
opensearch-version: 2
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
@ -388,6 +417,8 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5

2
.nvmrc
Wyświetl plik

@ -1 +1 @@
20
22

Wyświetl plik

@ -3,7 +3,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.5'
rev: 'v0.9.6'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

Wyświetl plik

@ -9,5 +9,11 @@ python:
path: .
extra_requirements:
- docs
formats: all
sphinx:
configuration: docs/conf.py
fail_on_warning: True
search:
ranking:
releases/*: -1
releases/upgrading.html: 0

Wyświetl plik

@ -3,7 +3,7 @@ deployments:
dockerimage: python:3.11.4-slim-bullseye
build_steps:
- apt-get update && apt-get install -y libssl-dev libpq-dev git build-essential libfontconfig1 libfontconfig1-dev curl
- RUN bash -c "curl -sL https://deb.nodesource.com/setup_20.x | bash -"
- RUN bash -c "curl -sL https://deb.nodesource.com/setup_22.x | bash -"
- apt install -y nodejs
- pip install setuptools pip --upgrade --force-reinstall
- cd /code

Wyświetl plik

@ -23,12 +23,7 @@ module.exports = {
// Would be valuable for strict BEM components but is too hard to enforce with legacy code.
'no-descending-specificity': null,
// Refined ordering to align with media mixin usage - see https://github.com/wagtail/stylelint-config-wagtail/issues/37
'order/order': [
'dollar-variables',
'custom-properties',
{ type: 'at-rule', hasBlock: false }, // @-rules that have no nesting.
'declarations',
],
'order/order': ['dollar-variables', 'custom-properties', 'declarations'],
// Some parts of declaration-strict-value commented out until we are in a position to enforce them.
'scale-unlimited/declaration-strict-value': [
[
@ -56,6 +51,7 @@ module.exports = {
'none',
'unset',
'transparent',
'normal',
// System colors for forced-colors styling.
// See https://drafts.csswg.org/css-color-4/#css-system-colors.
'Canvas',

Wyświetl plik

@ -1,7 +1,266 @@
Changelog
=========
6.3 LTS (xx.xx.xxxx) - IN DEVELOPMENT
7.0 LTS (xx.xx.xxxx) - IN DEVELOPMENT
~~~~~~~~~~~~~~~~~~~~
* Add formal support for Django 5.2 (Matt Westcott)
* Add `WAGTAIL_` prefix to Wagtail-specific tag settings (Aayushman Singh)
* Implement `normalize` on `TypedTableBlock` to assist with setting `default` and `preview_value` (Sage Abdullah)
* Apply normalization when modifying a `StreamBlock`'s value to assist with programmatic changes to `StreamField` (Matt Westcott)
* Allow a custom image rendition model to define its unique constraint with `models.UniqueConstraint` instead of `unique_together` (Oliver Parker, Cynthia Kiser, Sage Abdullah)
* Default to the `standard` tokenizer on Elasticsearch, to correctly handle numbers as tokens (Matt Westcott)
* Add color-scheme meta tag to Wagtail admin (Ashish Nagmoti)
* Add the ability to set the default privacy restriction for new pages using `get_default_privacy_setting` (Shlomo Markowitz)
* Improve performance of batch purging page urls in the frontend cache, avoiding n+1 query issues (Andy Babic)
* Add better support and documentation for overriding or extending icons used in the in the userbar (Sébastien Corbin)
* List the comments action, if comments are enabled, within the admin keyboard shortcuts dialog (Dhruvi Patel)
* Add better support and documentation for overriding the default field widgets used within form pages (Baptiste Mispelon)
* Allow workflow tasks to specify a template for the action modal via `get_template_for_action` (Sage Abdullah)
* Change 'Publish' button label to 'Schedule to publish' if go-live schedule is set (Sage Abdullah)
* Fix: Take preferred language into account for translatable strings in client-side code (Bernhard Bliem, Sage Abdullah)
* Fix: Do not show the content type column as sortable when searching pages (Srishti Jaiswal, Sage Abdullah)
* Fix: Support simple subqueries for `in` and `exact` lookup on Elasticsearch (Sage Abdullah)
* Fix: Force preview panel scroll behavior to instant to avoid flickering (Sage Abdullah)
* Fix: Support translating with the preferred language for rich text formatting labels (Bernhard Bliem, Sage Abdullah)
* Fix: Make "Actions" label translatable within the rich text toolbar (Bernhard Bliem, Sage Abdullah)
* Fix: Fix incorrect "Views (past week)" heading on promoted search results listing (Baptiste Mispelon)
* Fix: Ensure `InlinePanel` will be correctly ordered after the first save when `min_num` is used (Elhussein Almasri, Joel William)
* Fix: Avoid deprecation warnings about URLField `assume_scheme` on Django 5.x (Sage Abdullah)
* Fix: Fix setup.cfg syntax for setuptools v78 (Sage Abdullah)
* Fix: Ensure `ImproperlyConfigured` is thrown from `db_field` on unbound `FieldPanel`s as intended (Matt Westcott)
* Fix: Refine the positioning of the add comment button next to select, radio, checkbox fields and between field row columns (Srishti Jaiswal)
* Fix: Show the correct privacy status for child collections of private collections (Shlomo Markowitz)
* Fix: Ensure reference index correctly handles models with primary keys not named `id` (Sage Abdullah)
* Fix: On "move page" bulk action, do not prefill the destination with the root page (Stefan Hammer)
* Docs: Add missing `django.contrib.admin` to list of apps in "add to Django project" guide (Mohamed Rabiaa)
* Docs: Add tutorial on deploying on Ubuntu to third-party tutorials (Mohammad Fathi Rahman)
* Docs: Document that request_or_site is optional on BaseGenericSetting.load (Matt Westcott)
* Docs: Mention third-party StreamField based form builder packages in the form builder documentation (Matt Westcott)
* Docs: Clarify that `insert_editor_js` hook applies to all core editing/creation views (LB (Ben) Johnston)
* Docs: Clarify requirement for non-page models using model mixins to be registered as snippets (Sage Abdullah)
* Maintenance: Migrate away from deprecated Sass import rules to module system (Srishti Jaiswal)
* Maintenance: Apply Sass mixed declarations migration in preparation for CSS nesting (Prabhpreet Kaur)
* Maintenance: Refactor styles for Draftail, minimap, and comments to fix remaining Sass migration warnings (Thibaud Colas)
* Maintenance: npm package updates; `downshift`, `focus-trap-react`, `immer`, `redux`, `uuid` (LB (Ben) Johnston)
* Maintenance: Validate against invalid characters in Lexeme values (Matt Westcott)
* Maintenance: Split up `wagtail.models` module into submodules (Matt Westcott)
* Maintenance: Update `ruff` to 0.9.6 (Sage Abdullah)
* Maintenance: Fix up `stubs` & `adapter` contents to better support Jest testing (LB (Ben) Johnston)
* Maintenance: Cleanup Stimulus controller imports, JSDoc & linting (LB (Ben) Johnston)
* Maintenance: Rename `SkipLinkController` to `FocusController` with improved reusability, updated unit tests, and added story (LB (Ben) Johnston)
* Maintenance: Fix CI testing issues with the Stimulus `LocaleController` time zones & non-deterministic page ordering tests (Sage Abdullah)
* Maintenance: Make GitHub highlight `.html` files as Django templates (Jake Howard)
* Maintenance: Remove admin JavaScript imports from shared template includes, moving the imports to the appropriate core admin inclusion locations (Sai Srikar Dumpeti)
* Maintenance: Remove non-editing view inclusions of the `insert_editor_js` hook output, deprecate the wrapper template tag `_editor_js.html` (Sai Srikar Dumpeti, LB (Ben) Johnston)
* Maintenance: Remove upper bound on Django dependency (Matt Westcott)
* Maintenance: Add `default_auto_field` setting to home app in project template (Sylvain Boissel)
* Maintenance: Migrate setuptools configuration from `setup.py` and `setup.cfg` to `pyproject.toml` (Sage Abdullah)
* Maintenance: Refactor `move_choose_destination` to a class-based view (Chiemezuo Akujobi)
6.4.1 (21.02.2025)
~~~~~~~~~~~~~~~~~~
* Fix: Prevent error when filtering by locale and searching with Elasticsearch (Sage Abdullah)
* Fix: Support searching `none()` querysets (Matt Westcott)
* Fix: Correctly handle UUID primary keys when invoking background tasks (Matt Westcott)
* Fix: Fix regression where nested sub-menu items would not be visible (Sage Abdullah)
* Fix: Ensure the top of the minimap correctly adjusts when resizing the browser viewport (Thibaud Colas)
* Fix: Remove obsolete SubqueryConstraint check in search backends, for provisional Django 5.2 compatibility (Sage Abdullah)
* Fix: Add missing “Close” label to the upgrade notification dismiss button (Sage Abdullah)
* Fix: Fix white text on white background in previews for sites that use color-scheme without a background-color (Sage Abdullah)
* Docs: Fix typo in the headless documentation page (Mahmoud Nasser)
* Docs: Fix typo in `Page.get_route_paths` docstring (Baptiste Mispelon)
* Docs: Upgrade sphinx-wagtail-theme to v6.5.0 (Sage Abdullah)
* Maintenance: Remove upper version boundary for django-filter (Dan Braghis)
* Maintenance: Relax upper version boundaries for django-taggit and beautifulsoup4 (Matt Westcott)
6.4 (03.02.2025)
~~~~~~~~~~~~~~~~
* Support for background tasks using `django-tasks` (Jake Howard)
* Add search terms report (Noah van der Meer, Sage Abdullah)
* Add the ability to apply basic Page QuerySet optimizations to `specific()` sub-queries using `select_related` & `prefetch_related` (Andy Babic)
* Increase `DATA_UPLOAD_MAX_NUMBER_FIELDS` in project template (Matt Westcott)
* Stop invalid Site hostname records from breaking preview (Matt Westcott)
* Set sensible defaults for InlinePanel heading and label (Matt Westcott)
* Limit tags autocompletion to 10 items and add delay to avoid performance issues with large number of matching tags (Aayushman Singh)
* Add the ability to restrict what types of requests a Pages supports via `allowed_http_methods` (Andy Babic)
* Allow plain strings in panel definitions as shorthand for `FieldPanel` / `InlinePanel` (Matt Westcott)
* Only allow selection of valid new parents within the copy Page view (Mauro Soche)
* Add `on_serve_page` hook to modify the serving chain of pages (Krystian Magdziarz, Dawid Bugajewski)
* Add support for `WAGTAIL_GRAVATAR_PROVIDER_URL` URLs with query string parameters (Ayaan Qadri, Guilhem Saurel)
* Add `get_avatar_url` hook to customise user avatars (James Harrington)
* Set content security policy (CSP) headers to block embedded content when serving images and documents (Jake Howard, with thanks to Ali İltizar for the initial report)
* Add `page` as a third parameter to the `construct_wagtail_userbar` hook (claudobahn)
* Enable breadcrumbs in revisions compare view (Sage Abdullah)
* Skip loading of unused JavaScript to speed up 404 page rendering (Sage Abdullah)
* Replace l18n library with JavaScript Intl API for time zone options in Account view (Sage Abdullah)
* Use explicit label for defaulting to server language in account settings (Sage Abdullah)
* Add support for specifying an operator on `Fuzzy` queries (Tom Usher)
* Remove support for Safari 15 (Thibaud Colas)
* Populate the ImageBlock alt text from the images default alt text when selecting a new image (Matt Westcott)
* Prevent main menu from re-rendering when clicking outside while the menu is closed (Sage Abdullah)
* Fill in the ImageBlock alt text from the images default alt text when converting from ImageChooserBlock (Cynthia Kiser)
* Make sure typing text at the bottom of the page editor always scrolls enough to keep the text into view (Jatin Bhardwaj)
* Add StreamField and InlinePanel interfaces support for drag-and-drop reordering of items (Thibaud Colas, Sage Abdullah)
* Add previews support for StreamField blocks inside the block picker (Sage Abdullah, Thibaud Colas)
* Fix: Improve handling of translations for bulk page action confirmation messages (Matt Westcott)
* Fix: Ensure custom rich text feature icons are correctly handled when provided as a list of SVG paths (Temidayo Azeez, Joel William, LB (Ben) Johnston)
* Fix: Prevent error on lazily loading StreamField blocks after the stream has been modified (Stefan Hammer)
* Fix: Fix sub-menus within the main menu cannot be closed on mobile (Bojan Mihelac)
* Fix: Fix animation overflow transition when navigating through subpages in the sidebar page explorer (manu)
* Fix: Ensure form builder supports custom admin form validation (John-Scott Atlakson, LB (Ben) Johnston)
* Fix: Ensure form builder correctly checks for duplicate field names when using a custom related name (John-Scott Atlakson, LB (Ben) Johnston)
* Fix: Normalize `StreamField.get_default()` to prevent creation forms from breaking (Matt Westcott)
* Fix: Prevent out-of-order migrations from skipping creation of image/document choose permissions (Matt Westcott)
* Fix: Use correct connections on multi-database setups in database search backends (Jake Howard)
* Fix: Ensure CloudFront cache invalidation is called with a list, for compatibility with current botocore versions (Jake Howard)
* Fix: Show the correct privacy status in the sidebar when creating a new page (Joel William)
* Fix: Prevent generic model edit view from unquoting non-integer primary keys multiple times (Matt Westcott)
* Fix: Ensure comments are functional when editing Page models with `read_only` `Fieldpanel`s in use (Strapchay)
* Fix: Ensure the accessible labels and tooltips reflect the correct private/public status on the live link button within pages after changing the privacy (Ayaan Qadri)
* Fix: Fix empty `th` (table heading) elements that are not compliant with accessibility standards (Jai Vignesh J)
* Fix: Ensure `MultipleChooserPanel` using images or documents work when nested within an `InlinePanel` when no other choosers are in use within the model (Elhussein Almasri)
* Fix: Ensure `MultipleChooserPanel` works after doing a search in the page chooser modal (Matt Westcott)
* Fix: Ensure new `ListBlock` instances get created with unique IDs in the admin client for accessibility and mini-map element references (Srishti Jaiswal)
* Fix: Return never-cache HTTP headers when serving pages and documents with view restrictions (Krystian Magdziarz, Dawid Bugajewski)
* Fix: Implement `get_block_by_content_path` on `ImageBlock` to prevent errors on commenting (Matt Westcott)
* Fix: Add `aria-expanded` attribute to new column button on `TypedTableBlock` to reflect menu state (Ayaan Qadri, Scott Cranfill)
* Fix: Allow page models to extend base `Page` panel definitions without importing `wagtail.admin` (Matt Westcott)
* Fix: Fix crash when loading the dashboard with only the "unlock" or "bulk delete" page permissions (Unyime Emmanuel Udoh, Sage Abdullah)
* Fix: Improve deprecation warning for `WidgetWithScript` by raising it with `stacklevel=3` (Joren Hammudoglu)
* Fix: Correctly place comment buttons next to date / datetime / time fields. (Srishti Jaiswal)
* Fix: Add missing heading and breadcrumbs in Account view (Sage Abdullah)
* Fix: Reduce confusing spacing below StreamField blocks help text (Rishabh Sharma)
* Fix: Prevent redundant calls to `Site.find_for_request()` from `Page.get_url_parts()` (Andy Babic)
* Fix: Prevent error on listings when searching and filtering by locale (Matt Westcott, Sage Abdullah)
* Fix: Add missing space in panels check warning message (Stéphane Blondon)
* Fix: Make sure alt text quality check is on by default as documented (Thibaud Colas)
* Fix: Prevent `StreamChildrenToListBlockOperation` from duplicating data across multiple StreamField instances (Joshua Munn)
* Fix: Prevent database error when calling permission_order.register on app ready (Daniel Kirkham, Matt Westcott)
* Fix: Prevent syntax error on MySQL search when query includes symbols (Matt Westcott)
* Docs: Move the model reference page from reference/pages to the references section as it covers all Wagtail core models (Srishti Jaiswal)
* Docs: Move the panels reference page from references/pages to the references section as panels are available for any model editing, merge panels API into this page (Srishti Jaiswal)
* Docs: Move the tags documentation to standalone advanced topic, instead of being inside the reference/pages section (Srishti Jaiswal)
* Docs: Refine the adding reports page so that common (page/non-page) class references are at the top and the full page only example has correct heading nesting (Alessandro Chitarrini)
* Docs: Add the `wagtail start` command to the management commands reference page (Damilola Oladele)
* Docs: Refine the project template page sections and document common issues encountered when creating custom templates (Damilola Oladele)
* Docs: Refine titles, references and URLS to better align with the documentation style guide, including US spelling (Srishti Jaiswal)
* Docs: Recommend a larger `DATA_UPLOAD_MAX_NUMBER_FIELDS` when integrating Wagtail into Django (Matt Westcott)
* Docs: Improve code highlighting and formatting for Python docstrings in core models (Srishti Jaiswal)
* Docs: Update all JavaScript inline scripts & some CSS inline style tags to a CSP compliant approach by using external scripts/styles (Aayushman Singh)
* Docs: Update usage of `mark_safe` to `format_html` for any script inclusions, to better avoid XSS issues from example code (Aayushman Singh)
* Docs: Update documentation writing guidelines to encourage better considerations of security, accessibility and good practice when writing code examples (Aayushman Singh, LB (Ben) Johnston)
* Docs: Update documentation guidelines on writing links and API reference (Sage Abdullah)
* Docs: Replace absolute URLs with intersphinx links where possible to avoid broken links (Sage Abdullah)
* Docs: Update upgrading guide and release process to better reflect the current practices (Sage Abdullah)
* Docs: Document usage of custom validation for admin form pages when using `AbstractEmailForm` or `AbstractForm` pages (John-Scott Atlakson, LB (Ben) Johnston)
* Docs: Reword `BlogTagIndexPage` example for clarity (Clifford Gama)
* Docs: Change title of blog index page in tutorial to avoid slug issues (Thibaud Colas)
* Docs: Fix `wagtailcache` and `wagtailpagecache` examples to not use quotes for the `fragment_name` (Shiv)
* Docs: Update tutorial to reflect the move of the "Add child page" action to a top-level button in the header as a '+' icon (Clifford Gama)
* Docs: Fix link to `HTTPMethod` in `Page.handle_options_request()` docs (Sage Abdullah)
* Docs: Improve the Pages Theory page with added & more consistent section headings and admonitions to aid in readability (Clifford Gama)
* Docs: Fix non-functional link to the community guidelines in the Your first contribution page (Ankit Kumar)
* Docs: Introduce tags and filters by name in "Writing templates" docs (Clifford Gama)
* Docs: Add a new headless section to the documentation, incorporating parts of the 'are we headless' website content (Sævar Öfjörð Magnússon, Alex Fulcher)
* Docs: Fix Django HTML syntax formatting issue on the documents overview page (LB (Ben) Johnston)
* Docs: Separate virtual environment creation and activation steps in tutorial (Ankit Kumar)
* Docs: Update tutorial to use plain strings in place of `FieldPanel` / `InlinePanel` where appropriate (Unyime Emmanuel Udoh)
* Docs: Update example for customizing "p-as-heading" accessibility check without overriding built-in checks (Cynthia Kiser)
* Docs: Document `get_template` method on StreamField blocks (Matt Westcott)
* Docs: Update accessibility considerations on alt text in light of contextual alt text improvements (Cynthia Kiser)
* Docs: Revert incorrect example of appending a `RichTextBlock` to a `StreamField` (Matt Westcott)
* Maintenance: Close open files when reading within utils/setup.py (Ataf Fazledin Ahamed)
* Maintenance: Avoid redundant `ALLOWED_HOSTS` check in `Site.find_for_request` (Jake Howard)
* Maintenance: Update `CloneController` to ensure that `added`/`cleared` events are not dispatched as cancelable (LB (Ben) Johnston)
* Maintenance: Remove unused `uuid` UMD module as all code is now using the NPM module (LB (Ben) Johnston)
* Maintenance: Clean up JS comments throughout codebase to be aligned to JSDoc where practical (LB (Ben) Johnston)
* Maintenance: Replace `eslint-disable no-undef` linter directives with `global` comments (LB (Ben) Johnston)
* Maintenance: Upgrade Node tooling to active LTS version 22 (LB (Ben) Johnston)
* Maintenance: Remove defunct oEmbed providers (Rahul Samant)
* Maintenance: Remove obsolete non-upsert-based code for Postgres search indexing (Jake Howard)
* Maintenance: Remove unused Rangy JS library (LB (Ben) Johnston)
* Maintenance: Update `PreviewController` usage to leverage Stimulus actions instead of calling `preventDefault` manually (Ayaan Qadri)
* Maintenance: Various performance optimizations to page publishing (Jake Howard)
* Maintenance: Remove unnecessary DOM canvas.toBlob polyfill (LB (Ben) Johnston)
* Maintenance: Ensure Storybook core files are correctly running through Eslint (LB (Ben) Johnston)
* Maintenance: Add a new Stimulus `ZoneController` (`w-zone`) to support dynamic class name changes & event handling on container elements (Ayaan Qadri)
* Maintenance: Migrate jQuery class toggling & drag/drop event handling within the multiple upload views to the Stimulus ZoneController usage (Ayaan Qadri)
* Maintenance: Test project template for warnings when run against Django pre-release versions (Sage Abdullah)
* Maintenance: Refactor redirects create/delete views to use generic views (Sage Abdullah)
* Maintenance: Add JSDoc description, adopt linting recommendations, and add more unit tests for `ModalWorkflow` (LB (Ben) Johnston)
* Maintenance: Add support for for a `delay` value in `TagController` to debounce async autocomplete tag fetch requests (Aayushman Singh)
* Maintenance: Add unit tests, Storybook stories & JSDoc items for the Stimulus `DrilldownController` (Srishti Jaiswal)
* Maintenance: Enhance sidebar preview performance by eliminating duplicate asset loads on preview error (Sage Abdullah)
* Maintenance: Remove unused `LinkController` (`w-link`) (Sage Abdullah)
* Maintenance: Refactor settings `EditView` to make better use of generic `EditView` (Sage Abdullah)
* Maintenance: Add a new Stimulus `RulesController` (`w-rules`) to support declarative conditional field enabling from other field values in a form (LB (Ben) Johnston)
* Maintenance: Migrate the conditional enabling of fields in the image URL builder view away from ad-hoc jQuery to use the `RulesController` (`w-rules`) approach (LB (Ben) Johnston)
* Maintenance: Enhance the Stimulus `ZoneController` (`w-zone`) to support inactive class and a mechanism to switch the mode based on data within events (Ayaan Qadri)
* Maintenance: Use the Stimulus `ZoneController` (`w-zone`) to remove ad-hoc jQuery for the privacy switch when toggling visibility of private/public elements (Ayaan Qadri)
* Maintenance: Remove unused `is_active` & `active_menu_items` from `wagtail.admin.menu.MenuItem` (Srishti Jaiswal)
* Maintenance: Only call `openpyxl` at runtime to improve performance for projects that do not use `ReportView`, `SpreadsheetExportMixin` and `wagtail.contrib.redirects` (Sébastien Corbin)
* Maintenance: Adopt the update value `mp` instead of `mm` for 'mystery person' as the default Gravatar if no avatar found (Harsh Dange)
* Maintenance: Refactor search promotions views to use generic views and templates (Sage Abdullah, Rohit Sharma)
* Maintenance: Use built-in `venv` instead of `pipenv` in CircleCI (Sage Abdullah)
* Maintenance: Add a new Stimulus `FormsetController` (`w-formset`) to support dynamic formset insertion/deletion behavior (LB (Ben) Johnston)
* Maintenance: Enable breadcrumbs by default on admin views using generic templates (Sage Abdullah)
* Maintenance: Refactor pages `revisions_revert` view to be a subclass of `EditView` (Sage Abdullah)
* Maintenance: Move images and documents `get_usage().count()` call to view code (Sage Abdullah)
* Maintenance: Upgrade sass-loader to resolve Sass deprecation warnings (Ayaan Qadri)
6.3.4 (xx.xx.xxxx) - IN DEVELOPMENT
~~~~~~~~~~~~~~~~~~
* Added support for Django 5.2
* Fix: Add missing “Close” label to the upgrade notification dismiss button (Sage Abdullah)
* Fix: Fix white text on white background in previews for sites that use color-scheme without a background-color (Sage Abdullah)
* Maintenance: Remove upper version boundary for django-filter (Dan Braghis)
6.3.3 (03.02.2025)
~~~~~~~~~~~~~~~~~~
* Fix: Correctly place comment buttons next to date / datetime / time fields. (Srishti Jaiswal)
* Fix: Reduce confusing spacing below StreamField blocks help text (Rishabh Sharma)
* Fix: Make sure alt text quality check is on by default as documented (Thibaud Colas)
* Fix: Prevent `StreamChildrenToListBlockOperation` from duplicating data across multiple StreamField instances (Joshua Munn)
* Fix: Prevent database error when calling permission_order.register on app ready (Daniel Kirkham, Matt Westcott)
* Fix: Prevent error on lazily loading StreamField blocks after the stream has been modified (Stefan Hammer)
* Fix: Prevent syntax error on MySQL search when query includes symbols (Matt Westcott)
* Docs: Update example for customizing "p-as-heading" accessibility check without overriding built-in checks (Cynthia Kiser)
* Docs: Update accessibility considerations on alt text in light of contextual alt text improvements (Cynthia Kiser)
* Docs: Revert incorrect example of appending a `RichTextBlock` to a `StreamField` (Matt Westcott)
6.3.2 (02.01.2025)
~~~~~~~~~~~~~~~~~~
* Fix: Ensure CloudFront cache invalidation is called with a list, for compatibility with current botocore versions (Jake Howard)
* Fix: Ensure Draftail features wrap when a large amount of features are added (Bart Cieliński)
* Fix: Implement `get_block_by_content_path` on `ImageBlock` to prevent errors on commenting (Matt Westcott)
* Docs: Update tutorial to reflect the move of the "Add child page" action to a top-level button in the header as a '+' icon (Clifford Gama)
6.3.1 (19.11.2024)
~~~~~~~~~~~~~~~~~~
* Fix: Restore ability to upload profile picture through account settings (Sage Abdullah)
* Fix: Correctly handle `ImageChooserBlock` to `ImageBlock` data conversions where all inputs to `bulk_to_python` are null (Storm Heg, Matt Westcott)
* Fix: Improve spacing of page / collection permissions table in Group settings (Sage Abdullah)
* Fix: Remove forced capitalization of site name on admin dashboard (Thibaud Colas)
* Docs: Reword `BlogTagIndexPage` example for clarity (Clifford Gama)
* Docs: Change title of blog index page in tutorial to avoid slug issues (Thibaud Colas)
* Docs: Fix `wagtailcache` and `wagtailpagecache` examples to not use quotes for the `fragment_name` (Shiv)
* Docs: Lower search result ranking for release notes on readthedocs search (Sage Abdullah)
6.3 LTS (01.11.2024)
~~~~~~~~~~~~~~~~~~~~
* Add support for Python 3.13 (Matt Westcott)
@ -32,6 +291,7 @@ Changelog
* Secondary form actions such as "Delete" are now in the header actions menu (Sage Abdullah)
* Allow setting page privacy rules when a restriction already exists on an ancestor page (Bojan Mihelac)
* Automatically create links when pasting content that contain URLs into a rich text input (Thibaud Colas)
* Add Uyghur language support
* Fix: Prevent page type business rules from blocking reordering of pages (Andy Babic, Sage Abdullah)
* Fix: Improve layout of object permissions table (Sage Abdullah)
* Fix: Fix typo in aria-label attribute of page explorer navigation link (Sébastien Corbin)
@ -47,7 +307,7 @@ Changelog
* Fix: Fix content path links in usage view to scroll to the correct element (Sage Abdullah)
* Fix: Always show the minimap toggle button (Albina Starykova)
* Fix: Ensure that dropdown button toggles show with a border in high contrast mode (Ishwari8104, LB (Ben) Johnston)
* Fix: Update email notification header to the new logo design (rahulsamant37)
* Fix: Update email notification header to the new logo design (Rahul Samant)
* Fix: Change `file_size` field on document model to avoid artificial 2Gb limit (Gabriel Getzie)
* Fix: Ensure that `TypedTableBlock` uses the correct API representations of child blocks (Matt Westcott)
* Fix: Footer action buttons now include their `media` definitions (Sage Abdullah)
@ -56,13 +316,19 @@ Changelog
* Fix: Fix datetime fields overflowing its parent wrapper in listing filters (Rohit Singh)
* Fix: Prevent multiple URLs from being combined into one when pasting links into a rich text input (Thibaud Colas)
* Fix: Improve layout of report listing tables (Sage Abdullah)
* Fix: Fix regression from creation of `AbstractGroupApprovalTask` to ensure `can_handle` checks for the abstract class correctly (Sumana Sree Angajala)
* Docs: Upgrade Sphinx to 7.3 (Matt Westcott)
* Docs: Upgrade sphinx-wagtail-theme to v6.4.0, with a new search integration and Read the Docs Addons bug fixes (Thibaud Colas)
* Docs: Document how to customize date/time format settings (Vince Salvino)
* Docs: Create a new documentation section for deployment and move fly.io deployment from the tutorial to this section (Vince Salvino)
* Docs: Clarify process for UserViewSet customization (Sage Abdullah)
* Docs: Correct `WAGTAIL_WORKFLOW_REQUIRE_REAPPROVAL_ON_EDIT` documentation to state that it defaults to `False` (Matt Westcott)
* Docs: Add an example of customizing a default accessibility check (Cynthia Kiser)
* Docs: Demonstrate access protection with `TokenAuthentication` in the Wagtail API v2 Configuration Guide (Krzysztof Jeziorny)
* Docs: Replace X links with Mastodon in the README (Alex Morega)
* Docs: Re-enable building offline formats in online documentation (Read the docs) for EPUB/PDF/HTML downloads (Joel William, Sage Abdullah)
* Docs: Resolve multiple output errors in the documentation ePub format (Sage Abdullah)
* Docs: Update social media examples to use LinkedIn, Reddit, Facebook (Ayaan Qadri)
* Maintenance: Removed support for Python 3.8 (Matt Westcott)
* Maintenance: Drop pytz dependency in favour of `zoneinfo.available_timezones` (Sage Abdullah)
* Maintenance: Relax django-taggit dependency to allow 6.0 (Matt Westcott)
@ -85,6 +351,16 @@ Changelog
* Maintenance: Remove `image_format_name_to_content_type` helper function that duplicates Willow functionality (Matt Westcott)
* Maintenance: Improve code reuse for footer actions markup across generic views (Sage Abdullah)
* Maintenance: Deprecate internal `DeleteMenuItem` API for footer actions (Sage Abdullah)
* Maintenance: Update Pillow dependency to allow 11.x (Storm Heg)
6.2.3 (01.11.2024)
~~~~~~~~~~~~~~~~~~
* Fix: Prevent multiple URLs from being combined into one when pasting links into a rich text input (Thibaud Colas)
* Fix: Fix error on workflow settings view with multiple snippet types assigned to the same workflow on Postgres (Sage Abdullah)
* Fix: Prevent history view from breaking if a log entry's revision is missing (Matt Westcott)
* Docs: Upgrade sphinx-wagtail-theme to v6.4.0, with a new search integration and Read the Docs Addons bug fixes (Thibaud Colas)
6.2.2 (24.09.2024)
@ -542,6 +818,23 @@ Changelog
* Maintenance: Remove support for Django 4.1 and below (Sage Abdullah)
5.2.8 (03.02.2025)
~~~~~~~~~~~~~~~~~~
* Fix: Prevent database error when calling permission_order.register on app ready (Daniel Kirkham, Matt Westcott)
* Fix: Handle StreamField migrations where the field value is null (Joshua Munn)
* Fix: Prevent `StreamChildrenToListBlockOperation` from duplicating data across multiple StreamField instances (Joshua Munn)
* Fix: Prevent error on lazily loading StreamField blocks after the stream has been modified (Stefan Hammer)
* Fix: Prevent syntax error on MySQL search when query includes symbols (Matt Westcott)
5.2.7 (01.11.2024)
~~~~~~~~~~~~~~~~~~
* Fix: Prevent multiple URLs from being combined into one when pasting links into a rich text input (Thibaud Colas)
* Fix: Fix error on workflow settings view with multiple snippet types assigned to the same workflow on Postgres (Sage Abdullah)
5.2.6 (11.07.2024)
~~~~~~~~~~~~~~~~~~
@ -4098,7 +4391,7 @@ Changelog
* Fix: Fixed TypeError when getting embed HTML with oembed on Python 3 (John-Scott Atlakson)
* Fix: Made HTML whitelisting in rich text fields more robust at catching disallowed URL schemes such as "jav\tascript:" (Tim Heap)
* Fix: created_at timestamps on page revisions were not being preserved on page copy, causing revisions to get out of sequence
* Fix: When copying pages recursively, revisions of sub-pages were being copied regardless of the copy_revisions flag
* Fix: When copying pages recursively, revisions of subpages were being copied regardless of the copy_revisions flag
* Fix: Updated the migration dependencies within the project template to ensure that Wagtail's own migrations consistently apply first.
* Fix: The cache of site root paths is now cleared when a site is deleted.
* Fix: Search indexing now prevents pages from being indexed multiple times, as both the base Page model and the specific subclass

Wyświetl plik

@ -5,7 +5,7 @@
* Cynthia Kiser (Caltech)
* Dan Braghis (Torchbox)
* Dawn Wages (The Wharton School)
* Jacob Topp-Mugglestone (Torchbox)
* Emily Topp-Mugglestone (Torchbox)
* Jake Howard (Torchbox)
* Kalob Taulien
* LB Johnston
@ -15,6 +15,7 @@
* Sævar Öfjörð Magnússon (Overcast)
* Sage Abdullah (Torchbox)
* Scott Cranfill (JPL)
* Sébastien Corbin
* Stefan Hammer (wunderweiss)
* Storm Heg
* Thibaud Colas (Torchbox)
@ -719,7 +720,6 @@
* Kevin Chung (kev-odin)
* valnuro
* Vitaly Babiy
* Sébastien Corbin
* Sahil Jangra
* Henry Harutyunyan
* Alex Morega
@ -743,7 +743,6 @@
* Sandro Rodrigues
* Brian Mugo
* Panagiotis H.M. Issaris
* Damilola Oladele
* Olumide Micheal
* Chiemezuo Akujobi
* Krish Soni
@ -836,7 +835,7 @@
* Shubham Mukati
* Matthew Scouten
* Ishwari8104
* rahulsamant37
* Rahul Samant
* Gabriel Getzie
* Rohit Singh
* Robin Varghese
@ -846,11 +845,44 @@
* Ankit Kumar
* Frank Yiu
* Shaurya Panchal
* Sumana Sree Angajala
* Srishti Jaiswal
* Alessandro Chitarrini
* Joel William
* Ataf Fazledin Ahamed
* Ayaan Qadri
* manu
* Aayushman Singh
* Steven Steinwand
* Clifford Gama
* Noah van der Meer
* Strapchay
* Alex Fulcher
* Harsh Dange
* Mauro Soche
* Krystian Magdziarz
* Guilhem Saurel
* James Harrington
* Unyime Emmanuel Udoh
* Joren Hammudoglu
* Rishabh Sharma
* Mike Gifford
* Stéphane Blondon
* Jatin Bhardwaj
* Mohamed Rabiaa
* Bernhard Bliem
* Mahmoud Nasser
* Prabhpreet Kaur
* Baptiste Mispelon
* Mohammad Fathi Rahman
* Ashish Nagmoti
* Dhruvi Patel
* Sylvain Boissel
## Translators
* Afrikaans: Jaco du Plessis, Jared Osborn
* Arabic: Bashar Al-Abdulhadi, Abdulaziz Alfuhigi, Roger Allen, Khaled Arnaout, Amr Awad, Mohammed Abdul Gadir, Mohamed HossamElDin, Ahmad Kiswani, Waseem Kntar, Mahmoud Marayef, Mohamed Mayla, Ahmed Miske Sidi Med, Younes Oumakhou, Ultraify Media
* Arabic: Bashar Al-Abdulhadi, Abdulaziz Alfuhigi, Roger Allen, Khaled Arnaout, Amr Awad, Tarek Berkane, Mohammed Abdul Gadir, Mohamed HossamElDin, Ahmad Kiswani, Waseem Kntar, Mahmoud Marayef, Mohamed Mayla, Ahmed Miske Sidi Med, Younes Oumakhou, Ultraify Media
* Armenian: Vachagan
* Azerbaijani: Mirza Iskandarov
* Bangla: Mahmud Abdur Rahman
@ -866,11 +898,11 @@
* Czech: Ales Dvorak, Jan Feřtek, Martin Galda, IT Management, Tomáš Jeřábek, Vláďa Macek, Eva Mikesova, Mořeplavec, Sophy O, Martina Oleksakova, Kryštof Pilnáček, Tomáš Podivínský, Ivan Pomykacz, Jiri Stepanek, Marek Turnovec, Mirek Zvolský
* Danish: Benjamin Bach, Mads Kronborg, MRostgaard, Asger Sørensen
* Divehi: Fauzaan Gasim
* Dutch: benny_AT_it_digin.com, Bram, Ramon de Jezus Brecht Dervaux, Harmen, Storm Heg, Kees Hink, Huib Keemink, Franklin Kingma, Maarten Kling, Thijs Kramer, Samuel Leeuwenburg, mahulst, Meteor0id, Rob Moorman, Benjamin van Renterghem, Michael van Tellingen, Arne Turpyn, Coen van der Kamp, Richard Voorhorst
* Dutch: benny_AT_it_digin.com, Bram, Ramon de Jezus Brecht Dervaux, Harmen, Storm Heg, Kees Hink, Huib Keemink, Franklin Kingma, Maarten Kling, Thijs Kramer, Samuel Leeuwenburg, mahulst, Meteor0id, Rob Moorman, Benjamin van Renterghem, Michael van Tellingen, Arne Turpyn, Coen van der Kamp, Joeri Vlekken, Richard Voorhorst
* English (India): Neeraj PY, Apoorv Saini
* Estonian: Erlend Eelmets, Martin, Ragnar Rebase
* Finnish: Jiri Grönroos, Eetu Häivälä, Niklas Jerva, Aarni Koskela, Rauli Laine, Valter Maasalo, Glen Somerville, Juha Yrjölä
* French: Adrien, Timothy Allen, Sebastien Andrivet, Bertrand Bordage, André Bouatchidzé, Sébastien Corbin, Aurélien Debord, Romain Dorgueil, Tom Dyson, Antonin Enfrun, Axel Haustant, Renaud Kern, Fabien Le Frapper, Léo, Pierre Marfoure, nahuel, Sophy O, Aurel Pere, Dominique Peretti, fpoulain, Loïc Teixeira, Benoît Vogel
* French: Adrien, Timothy Allen, Sebastien Andrivet, Bertrand Bordage, André Bouatchidzé, Christophe Chauvet, Sébastien Corbin, Aurélien Debord, Romain Dorgueil, Tom Dyson, Antonin Enfrun, Axel Haustant, Renaud Kern, Fabien Le Frapper, Léo, Pierre Marfoure, nahuel, Sophy O, Aurel Pere, Dominique Peretti, fpoulain, Loïc Teixeira, Benoît Vogel
* Galician: X Bello, Amós Oviedo
* Georgian: André Bouatchidzé
* German: Ettore Atalan, Bohreromir, Matti Borchers, Benedikt Breinbauer, Donald Buczek, Patrick Craston, Peter Dreuw, Oliver Engel, Stefan Hammer, Patrick Hebner, Krzysztof Jeziorny, Benjamin Kaspar, Henrik Kröger, Tibor L, Tammo van Lessen, Martin Löhle, Wasilis Mandratzis-Walz, Daniel Manser, Matthias Martin, m0rph3u5, Max Pfeiffer, Moritz Pfeiffer, Herbert Poul, Karl Sander, Tobias Schmidt, Scriptim, Johannes Spielmann, Raphael Stolt, Benjamin Thurm, Norman Uekermann, unicode_it, Jannis Vajen, Florian Vogt, Alexander Weiß, Matthew Westcott, Benedikt Willi

Wyświetl plik

@ -14,7 +14,7 @@ clean-pyc:
find . -name '*~' -exec rm -f {} +
develop: clean-pyc
pip install -e .[testing,docs]
pip install -e .[testing,docs] --config-settings editable-mode=strict
npm install --no-save && npm run build
lint-server:

Wyświetl plik

@ -19,8 +19,8 @@
<a href="https://pypi.python.org/pypi/wagtail/">
<img src="https://img.shields.io/pypi/dm/wagtail?logo=Downloads" alt="Monthly downloads" />
</a>
<a href="https://x.com/WagtailCMS">
<img src="https://img.shields.io/twitter/follow/WagtailCMS?style=social&logo=twitter" alt="follow on X">
<a href="https://fosstodon.org/@wagtail">
<img src="https://img.shields.io/mastodon/follow/109308882653647818?domain=https%3A%2F%2Ffosstodon.org&style=social" alt="Follow @wagtail@fosstodon.org">
</a>
</p>
@ -84,7 +84,7 @@ _(If you are reading this on GitHub, the details here may not be indicative of t
Wagtail supports:
- Django 4.2.x, 5.0.x and 5.1.x
- Django 4.2.x and 5.1.x
- Python 3.9, 3.10, 3.11, 3.12 and 3.13
- PostgreSQL, MySQL, MariaDB and SQLite (with JSON1) as database backends

Wyświetl plik

@ -38,7 +38,7 @@ The features below were developed thanks to the sponsorship of these organsation
- Page aliases - [The Mozilla Foundation](https://foundation.mozilla.org/en/)
- Hooks for Snippet customisation - [The Mozilla Foundation](https://foundation.mozilla.org/en/)
- Hooks for Snippet customization - [The Mozilla Foundation](https://foundation.mozilla.org/en/)
- Utility for testing hooks - [The Mozilla Foundation](https://foundation.mozilla.org/en/)

Wyświetl plik

@ -1 +1 @@
@import 'settings/variables';
@forward 'settings/variables';

Wyświetl plik

@ -3,8 +3,8 @@ These are functions and mixins.
No CSS should be produced by these files.
*/
@import 'tools/functions.breakpoints';
@import 'tools/mixins.breakpoints';
@import 'tools/mixins.general';
@import 'tools/mixins.grid';
@import 'tools/mixins.guide-line';
@forward 'tools/functions.breakpoints';
@forward 'tools/mixins.breakpoints';
@forward 'tools/mixins.general';
@forward 'tools/mixins.grid';
@forward 'tools/mixins.guide-line';

Wyświetl plik

@ -1,8 +1,13 @@
@use '../tools' as *;
.w-a11y-result__row {
@include box;
padding: theme('spacing.4');
display: flex;
justify-content: space-between;
background-color: theme('colors.surface-page');
padding: theme('spacing.4');
border-radius: theme('borderRadius.DEFAULT');
color: theme('colors.text-context');
border: 1px solid theme('colors.border-furniture');
// Shows additional details within the CMS only.
.form-side--checks & {

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
// user avatars
.avatar {
border-radius: 100%;

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.w-breadcrumbs:not(.editor-view .w-breadcrumbs) {
@apply sm:w-py-2.5;

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.bulk-actions-filter-checkbox {
.table-headers & {
> div {

Wyświetl plik

@ -3,6 +3,8 @@
// Core button styles
@use 'sass:color';
@use '../tools' as *;
@use '../settings' as *;
.button {
border-radius: theme('borderRadius.sm');
@ -321,7 +323,6 @@
}
.w-header-button {
@include more-contrast-interactive();
display: flex;
align-items: center;
justify-content: center;
@ -337,6 +338,8 @@
font-weight: theme('fontWeight.medium');
cursor: pointer;
@include more-contrast-interactive();
.icon {
width: theme('spacing.4');
height: theme('spacing.4');

Wyświetl plik

@ -1,4 +1,5 @@
@use 'sass:math';
@use '../tools' as *;
$preview-size: 2.625rem; // 42px
@ -15,7 +16,6 @@ $preview-size: 2.625rem; // 42px
// Very subdued button style specifically for choosers, as there can be a lot of
// chooser fields left unused on a page editing form.
.button.chooser__choose-button {
@include more-contrast-interactive();
@apply w-label-3;
display: flex;
align-items: center;
@ -23,6 +23,8 @@ $preview-size: 2.625rem; // 42px
border-color: transparent;
padding: theme('spacing.[1.5]');
@include more-contrast-interactive();
.icon {
@include svg-icon(theme('spacing.4'), initial);
color: inherit;

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.w-dialog {
--w-dialog-close-icon-color: theme('colors.icon-primary');

Wyświetl plik

@ -1,4 +1,7 @@
// stylelint-disable selector-attribute-name-disallowed-list
@use '../tools' as *;
@use '../settings' as *;
$separator: 1px solid theme('colors.white-15');
$radius: theme('borderRadius.sm');
@ -26,16 +29,6 @@ $radius: theme('borderRadius.sm');
width: 100%;
}
@supports not selector(:has(*)) {
// Use no corner radius and always-on borders if `:has` is not supported.
--primary-button-radius-top: 0;
--primary-button-radius-bottom: 0;
--toggle-button-radius-top: 0;
--toggle-button-radius-bottom: 0;
--first-item-border-top: #{$separator};
--last-item-border-top: #{$separator};
}
&:has(:not([hidden]) > [data-placement^='bottom']) {
--primary-button-radius-top: #{$radius};
--primary-button-radius-bottom: 0;

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.filterable {
display: grid;
grid-template-columns: 1fr minmax(theme('spacing.48'), theme('spacing.64'));
@ -25,7 +27,6 @@
}
.w-filter-button {
@include more-contrast-interactive();
position: relative;
width: theme('spacing.10');
height: theme('spacing.10');
@ -35,6 +36,8 @@
color: theme('colors.text-link-default');
background-color: theme('backgroundColor.surface-header');
@include more-contrast-interactive();
.icon {
width: theme('fontSize.16');
height: theme('fontSize.16');

Wyświetl plik

@ -1,4 +1,6 @@
@use 'sass:math';
@use '../tools' as *;
@use '../settings' as *;
.footer {
@include transition(bottom 0.5s ease 1s);
@ -116,7 +118,6 @@
.actions .button {
@apply w-leading-none w-inline-flex w-items-center;
font-size: theme('fontSize.16');
font-weight: 600;
padding: 0 theme('spacing.3');
white-space: initial;
@ -138,6 +139,7 @@
}
> .button {
font-size: theme('fontSize.16');
flex-grow: 1;
}
}

Wyświetl plik

@ -1,6 +1,7 @@
@use 'sass:color';
@use 'sass:map';
@use 'sass:math';
@use '../tools' as *;
.side-panel-open {
@apply w-overflow-y-hidden sm:w-overflow-y-auto;
@ -85,13 +86,6 @@
&:focus-within:has(:focus-visible) {
@include focus-outline;
}
@supports not selector(:focus-visible) {
&:focus-within {
/* Fallback for browsers without :focus-visible support */
@include focus-outline;
}
}
}
&__resize-grip-icon {

Wyświetl plik

@ -1,3 +1,6 @@
@use '../tools' as *;
@use '../settings' as *;
.wrapper {
@include clearfix();
@apply w-transition-sidebar;
@ -14,27 +17,30 @@
}
/**
* Increase the scroll offset to account for pages with a sticky header.
* Increase the scroll offset to account for pages with sticky areas - header or footer.
* We apply this to all pages for simplicity.
*/
@mixin slim-header-scroll-offset() {
@mixin sticky-areas-scroll-offset() {
$gap: theme('spacing.4');
// For mobile viewports, expect a sticky header over two rows.
scroll-padding-top: calc(theme('spacing.slim-header') * 2 + $gap);
@include media-breakpoint-up(sm) {
scroll-padding-top: calc(theme('spacing.slim-header') + $gap);
// Increase the scroll offset to account for pages with sticky bottom button
scroll-padding-bottom: 100px;
}
}
.content-wrapper {
@include slim-header-scroll-offset();
scroll-behavior: smooth;
width: 100%;
height: 100%; // this has no effect on desktop, but on mobile it helps aesthetics of menu popout action
float: inline-start;
position: relative;
border-bottom: 1px solid theme('colors.border-furniture');
@include sticky-areas-scroll-offset();
}
.content {

Wyświetl plik

@ -1,5 +1,7 @@
@use 'sass:math';
@use 'sass:color';
@use '../tools' as *;
@use '../settings' as *;
.w-header {
@apply w-text-text-label;

Wyświetl plik

@ -1,5 +1,6 @@
@use 'sass:color';
@use 'sass:map';
@use '../tools' as *;
// Help text formatters
.help-block {
padding: 1em;

Wyświetl plik

@ -1,4 +1,6 @@
@use 'sass:string';
@use '../tools' as *;
@use '../settings' as *;
// Set SVG icons to use the current text color in the location they appear as
// their default fill color. Can be overridden for a specific icon by either

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
/* stylelint-disable selector-max-combinators */
// General listings, like for pages, images or snippets
ul.listing {

Wyświetl plik

@ -1,4 +1,5 @@
@use 'sass:map';
@use '../settings' as *;
// Loading mask: overlays a certain area with a loading spinner and a faded out cover to prevent interaction
.loading-mask {
&.loading {

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
// Messages are specific to Django's 'Messaging' system which adds messages into the session,
// for display on the next page visited. These appear as an animated banner at the top of the page.
// For inline help text, see typography.scss

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
$zindex-modal-background: 500;
.fade {

Wyświetl plik

@ -1,3 +1,6 @@
@use '../tools' as *;
@use '../settings' as *;
$header-icon-size: theme('spacing.4');
$header-button-size: theme('spacing.6');
@ -61,7 +64,6 @@ $header-button-size: theme('spacing.6');
.w-panel__toggle,
.w-panel__controls .button.button--icon {
@include show-focus-outline-inside();
@include more-contrast-interactive();
display: inline-grid;
justify-content: center;
align-content: center;
@ -72,6 +74,8 @@ $header-button-size: theme('spacing.6');
width: $header-button-size;
height: $header-button-size;
@include more-contrast-interactive();
&:focus-visible,
&:hover {
color: theme('colors.icon-primary-hover');

Wyświetl plik

@ -1,5 +1,8 @@
@use '../tools' as *;
.w-preview {
--w-preview-background-color: var(--w-color-white);
--w-preview-color-scheme: normal;
--preview-width-ratio: min(
1,
var(--preview-panel-width, 450) / var(--preview-device-width, 375)
@ -37,6 +40,16 @@
&:empty {
// Ensure that sites without a background show with a fallback, only when iframe has loaded
background-color: var(--w-preview-background-color);
// Sites that do not have a background but have color-scheme will have the
// colors (background, text, etc.) automatically styled by the browser.
// If the color-scheme matches Wagtail's current color-scheme, the browser
// will give the iframe a transparent background. If we only set the
// white background-color above, the white background will be used
// while the rest of the content follows the color-scheme of the site,
// which might result in white text on a white background.
// Since we cannot know the actual value of the content's color-scheme,
// we set the color-scheme to normal to ensure the iframe stays opaque.
color-scheme: var(--w-preview-color-scheme);
}
[dir='rtl'] & {
@ -198,5 +211,12 @@
width: 0;
height: 0;
opacity: 0;
// Remove mask-image from radio inputs to avoid loading the default icon,
// use extra specificity to beat the default styles
&:is(input[type='radio'])::before {
content: none;
mask-image: none;
}
}
}

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.progress {
border-radius: 1.2em;
background-color: theme('colors.surface-button-hover');

Wyświetl plik

@ -1,4 +1,5 @@
@use 'sass:color';
@use '../settings' as *;
.w-status {
border-radius: 2px;
@ -56,8 +57,10 @@ button.w-status:hover {
color: theme('colors.text-button-outline-hover');
}
// Special case for text-transform: uppercase.
.page-status-tag {
@apply w-inline-flex w-items-center w-justify-center w-whitespace-nowrap w-px-1 w-ml-3 w-text-11 w-rounded-sm w-bg-transparent w-text-text-meta w-border w-border-border-furniture w-no-underline w-font-semibold hover:w-border-surface-menus hover:w-text-text-label w-transition more-contrast:w-border more-contrast:w-border-border-interactive-more-contrast hover:more-contrast:w-border-border-interactive-more-contrast-hover;
// Special case for text-transform: uppercase.
// stylelint-disable-next-line property-disallowed-list
text-transform: uppercase;
}

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.w-summary {
color: theme('colors.text-link-default');
margin-bottom: theme('spacing.3');

Wyświetl plik

@ -1,4 +1,7 @@
@use 'sass:map';
@use '../tools' as *;
@use '../settings' as *;
// free tagging tags from taggit
.tag {
border-radius: 2px;
@ -37,16 +40,16 @@ a.tag:hover {
.tagfilter {
legend {
@include media-breakpoint-up(sm) {
@include column(2);
padding-inline-start: 0;
}
font-weight: 700;
color: theme('colors.text-context');
font-size: 1.1em;
display: block;
padding: 0 0 0.8em;
@include media-breakpoint-up(sm) {
@include column(2);
padding-inline-start: 0;
}
}
a {

Wyświetl plik

@ -1,6 +1,7 @@
@use 'sass:map';
@use 'sass:math';
@use 'sass:string';
@use '../tools' as *;
// =============================================================================
// Variables

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.workflow-timeline {
@apply w-label-3;
padding: 0;
@ -41,13 +43,14 @@
position: relative;
flex-shrink: 0;
background: theme('colors.surface-page');
@media (forced-colors: active) {
background: Canvas;
}
margin-inline-end: theme('spacing.[2.5]');
width: theme('spacing.5');
height: theme('spacing.5');
z-index: theme('zIndex.10');
@media (forced-colors: active) {
background: Canvas;
}
}
&__line {

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
@include media-breakpoint-up(sm) {
.browsermessage {
margin: 0 0 0 -150px;

Wyświetl plik

@ -1,3 +1,5 @@
@use '../../settings' as *;
// file drop zones
.drop-zone {
border-radius: 5px;

Wyświetl plik

@ -1,4 +1,5 @@
@use 'sass:map';
@use '../../settings' as *;
.error-message {
border: 1px solid transparent; // ensure visible separation in Windows High Contrast mode

Wyświetl plik

@ -1,4 +1,5 @@
// Comments
@use '../../tools' as *;
$icon-size: theme('spacing.4');
$button-padding: theme('spacing.2');
@ -53,14 +54,6 @@ $button-padding: theme('spacing.2');
transform: translateY(0);
top: 0;
}
.w-field--date_field &,
.w-field--date_time_field &,
.w-field--time_field & {
position: relative;
transform: translateY(0);
top: 0;
}
}
.w-field__comment-button--add {

Wyświetl plik

@ -1,6 +1,9 @@
@use '../../tools' as *;
.w-field-row {
@include max-form-width();
gap: theme('spacing.5');
// Ensure there is enough room for a comment button within the gap.
gap: theme('spacing.7');
// For mobile viewports, we attempt to display all items in the row side by side even if not at the desired size.
display: flex;
flex-wrap: wrap;

Wyświetl plik

@ -1,4 +1,6 @@
@use 'sass:map';
@use '../../settings' as *;
@use './input-base' as *;
/**
* A container for rendering human-readable field values in forms in a way
@ -6,9 +8,7 @@
*/
.w-field__textoutput {
@include input-base();
@apply w-body-text-large;
background-color: theme('colors.surface-field-inactive');
width: 100%;
padding: theme('spacing.[1.5]') theme('spacing.5');
min-height: $text-input-height;
@ -16,6 +16,13 @@
overflow: hidden;
overflow-wrap: break-word;
@include input-base();
// stylelint-disable-next-line no-duplicate-selectors, scss/selector-no-redundant-nesting-selector
& {
background-color: theme('colors.surface-field-inactive');
}
&,
&:hover {
border-color: theme('colors.border-field-inactive');

Wyświetl plik

@ -1,4 +1,6 @@
@use 'sass:map';
@use '../../tools' as *;
@use '../../settings' as *;
/**
* The field component handles form fields layout and ancillary elements such as error messages and help text.

Wyświetl plik

@ -1,3 +1,6 @@
@use '../../tools' as *;
@use '../../settings' as *;
.w-form-width {
@include max-form-width();
}

Wyświetl plik

@ -1,15 +1,18 @@
@use '../../tools' as *;
/**
* Field styles reusable across **all** fields, including:
* Text input, textarea, checkbox, radio, select, etc.
*/
@mixin input-base() {
@include more-contrast-interactive();
appearance: none;
border-radius: theme('borderRadius.DEFAULT');
color: theme('colors.text-context');
background-color: theme('colors.surface-field');
border: 1px solid theme('colors.border-field-default');
@include more-contrast-interactive();
&:hover {
border-color: theme('colors.border-field-hover');
}

Wyświetl plik

@ -1,3 +1,6 @@
@use '../../settings' as *;
@use './input-base' as *;
// All HTML5 input types, with irrelevant ones commented out.
// input[type="button"],
// input[type="checkbox"],
@ -22,11 +25,12 @@ input[type="time"],
input[type="url"],
input[type="week"],
textarea {
@include input-base();
@apply w-body-text-large;
width: 100%;
padding: theme('spacing.[1.5]') theme('spacing.5');
min-height: $text-input-height;
@include input-base();
}
// Multiline text fields have larger top-bottom padding.
@ -39,10 +43,13 @@ textarea {
resize: none;
}
// Make non-text field types with custom widgets have a smaller width.
.w-field--date_field,
.w-field--date_time_field,
.w-field--time_field {
// Make sure comment buttons are as close as possible.
display: inline-block;
// Make non-text field types with custom widgets have a smaller width.
input {
width: auto;
max-width: 100%;

Wyświetl plik

@ -1,3 +1,6 @@
@use '../../tools' as *;
@use '../../settings' as *;
$header-icon-size: theme('spacing.4');
$icon-center-offset: 2px;
$guide-line-bottom-margin: calc($form-field-spacing / 3);
@ -18,11 +21,11 @@ $guide-line-bottom-margin: calc($form-field-spacing / 3);
}
.w-panel__content {
@include guide-line-vertical();
// Center the vertical line.
margin-inline-start: calc(-1 * var(--nesting-indent));
padding-inline-start: var(--nesting-indent);
margin-bottom: $guide-line-bottom-margin;
@include guide-line-vertical();
@include media-breakpoint-up(sm) {
// Extra pixels for better alignment with center of icon.
@ -54,10 +57,11 @@ $guide-line-bottom-margin: calc($form-field-spacing / 3);
// Styles for nested panels excluding the top level.
.w-panel--nested .w-panel {
@include guide-line-nested();
margin-inline-start: var(--nesting-indent);
margin-bottom: 0;
@include guide-line-nested();
.w-panel__content {
margin-inline-start: calc(
-1 * (var(--nesting-indent) + $icon-center-offset - var(--header-gap) / 2)
@ -80,9 +84,10 @@ $guide-line-bottom-margin: calc($form-field-spacing / 3);
}
.w-panel__divider {
@include guide-line-horizontal();
// Slightly nicer text alignment.
margin-top: 1px;
@include guide-line-horizontal();
}
.w-panel__heading--label {

Wyświetl plik

@ -7,6 +7,9 @@
.w-field--checkbox_select_multiple_with_disabled_options,
.w-field--boolean_radio_select,
.w-field--radio_select {
// Make sure comment buttons are as close as possible.
display: inline-block;
ul {
list-style: none;
padding: 0;

Wyświetl plik

@ -1,4 +1,6 @@
@use 'sass:math';
@use '../../settings' as *;
@use './input-base' as *;
// 24px input widget size.
$size: 1.5rem;
@ -9,7 +11,6 @@ $radio-checkbox-label-gap: theme('spacing.[2.5]');
// Both input types are very similar in appearance and layout.
@mixin radio-checkbox-base() {
@include input-base();
display: inline-block;
position: relative;
height: $size;
@ -19,6 +20,8 @@ $radio-checkbox-label-gap: theme('spacing.[2.5]');
// Prevent the checkbox or radio button from shrinking when the label is long.
flex-shrink: 0;
@include input-base();
&::before {
content: '';
position: absolute;
@ -39,8 +42,11 @@ $radio-checkbox-label-gap: theme('spacing.[2.5]');
input[type='radio'] {
@include radio-checkbox-base();
display: inline-block;
border-radius: theme('borderRadius.full');
// stylelint-disable-next-line no-duplicate-selectors, scss/selector-no-redundant-nesting-selector
& {
border-radius: theme('borderRadius.full');
}
&:checked::before {
mask-image: url('#{$images-root}icons/radio-full.svg');
@ -49,9 +55,13 @@ input[type='radio'] {
input[type='checkbox'] {
@include radio-checkbox-base();
border-radius: theme('borderRadius.sm');
// Legacy alignment for checkboxes, particularly within listings.
vertical-align: bottom;
// stylelint-disable-next-line no-duplicate-selectors, scss/selector-no-redundant-nesting-selector
& {
border-radius: theme('borderRadius.sm');
// Legacy alignment for checkboxes, particularly within listings.
vertical-align: bottom;
}
&:checked::before {
mask-image: url('#{$images-root}icons/check.svg');

Wyświetl plik

@ -1,3 +1,5 @@
@use '../../tools' as *;
.w-required-mark {
color: theme('colors.text-error');
margin-inline-start: 0.25ch;

Wyświetl plik

@ -1,5 +1,7 @@
@use 'sass:map';
@use 'sass:math';
@use '../../settings' as *;
@use './input-base' as *;
$select-size: $text-input-height;
$chevron-size: 0.375rem;
@ -36,7 +38,6 @@ $chevron-offset: math.div($select-size - $chevron-size, 2);
}
select {
@include input-base();
@include select-arrow();
@apply w-body-text-large;
// Firefox workaround Set a large line height (but smaller than min height) so the fields text has enough top padding.
@ -47,6 +48,8 @@ select {
// Prevent the element from overflowing the container.
max-width: 100%;
@include input-base();
@media (forced-colors: active) {
appearance: auto;
}
@ -61,3 +64,8 @@ select[multiple] {
padding: 0 theme('spacing.5');
}
}
.w-field--select {
// Make sure comment buttons are as close as possible.
display: inline-block;
}

Wyświetl plik

@ -93,12 +93,6 @@ $switch-border-radius: math.div(($switch-height + $switch-border * 2), 2);
outline: theme('colors.focus') solid $switch-outline;
}
@supports not selector(:focus-visible) {
[type='checkbox']:focus + &__toggle {
outline: theme('colors.focus') solid $switch-outline;
}
}
[type='checkbox'] {
position: absolute;
opacity: 0;

Wyświetl plik

@ -1,3 +1,5 @@
@use './input-base' as *;
.tagit {
@include input-base();

Wyświetl plik

@ -33,22 +33,22 @@ BEM: https://getbem.com/
/* Legacy vendor styles. Do not add new styles here. */
@use 'generic/normalize';
@use 'vendor/jquery-ui-1.10.3.verdant';
@use 'vendor/jquery.tagit' as tagit;
@use 'vendor/jquery.Jcrop.min' as jcrop;
@use 'vendor/jquery.tagit' as jquery-tagit;
@use 'vendor/jquery.Jcrop.min' as jquery-jcrop;
/* SETTINGS
These are variables, maps, and fonts.
* No CSS should be produced by these files
*/
@import 'settings';
@use 'settings';
/* TOOLS
These are functions and mixins.
* No CSS should be produced by these files.
*/
@import 'tools';
@use 'tools';
/* GENERIC
This is for resets and other rules that affect large collections of bare elements.
@ -60,14 +60,9 @@ These are base styles for bare HTML elements.
* Changes to them should be very rare.
*/
// These inject Tailwind's base, component and utility styles and any styles registered by plugins of each layer.
// Unused styles created within tailwinds layers won't be compiled into the compiled stylesheet
// https://tailwindcss.com/docs/adding-custom-styles#using-css-and-layer
@tailwind base;
@tailwind components;
@import 'elements/elements';
@import 'elements/typography';
@import 'elements/forms';
@use 'elements/elements';
@use 'elements/typography';
@use 'elements/forms';
/* COMPONENTS
These are classes for components.
@ -76,81 +71,87 @@ These are classes for components.
which is the preferred pattern over housing them in the scss folder.
*/
@import '../src/components/Transition/Transition';
@import '../src/components/LoadingSpinner/LoadingSpinner';
@import '../src/components/PublicationStatus/PublicationStatus';
@import '../src/components/ComboBox/ComboBox';
@import '../src/components/PageExplorer/PageExplorer';
@import '../src/components/CommentApp/main';
@use '../src/components/Transition/Transition';
@use '../src/components/LoadingSpinner/LoadingSpinner';
@use '../src/components/PublicationStatus/PublicationStatus';
@use '../src/components/ComboBox/ComboBox';
@use '../src/components/ComboBoxPreview/ComboBoxPreview';
@use '../src/components/PageExplorer/PageExplorer';
@use '../src/components/CommentApp/main';
@import 'components/avatar';
@import 'components/icons';
@import 'components/forms/input-base';
@import 'components/forms/input-text';
@import 'components/forms/radio-checkbox';
@import 'components/forms/select';
@import 'components/forms/tagit';
@import 'components/forms/radio-checkbox-multiple';
@import 'components/forms/error-message';
@import 'components/forms/required-mark';
@import 'components/forms/help';
@import 'components/forms/drop-zone';
@import 'components/forms/daterange';
@import 'components/forms/file';
@import 'components/forms/publishing';
@import 'components/forms/switch';
@import 'components/forms/title';
@import 'components/forms/field';
@import 'components/forms/field-row';
@import 'components/forms/field-comment-control';
@import 'components/forms/field-textoutput';
@import 'components/forms/form-width';
@import 'components/forms/nested-panel';
@import 'components/tabs';
@import 'components/panel';
@import 'components/dialog';
@import 'components/dismissible';
@import 'components/drilldown';
@import 'components/dropdown';
@import 'components/dropdown-button';
@import 'components/help-block';
@import 'components/button';
@import 'components/keyboard-shortcuts';
@import 'components/modals';
@import 'components/chooser';
@import 'components/tag';
@import 'components/listing';
@import 'components/filters';
@import 'components/messages';
@import 'components/messages.capability';
@import 'components/messages.status';
@import 'components/header';
@import 'components/progressbar';
@import 'components/summary';
@import 'components/whats-new';
@import 'components/grid.legacy';
@import 'components/footer';
@import 'components/loading-mask';
@import 'components/human-readable-date';
@import 'components/link.legacy';
@import 'components/indicator';
@import 'components/status-tag';
@import 'components/skiplink';
@import 'components/workflow-tasks';
@import 'components/workflow-timeline';
@import 'components/bulk_actions';
@import 'components/preview-panel';
@import 'components/preview-error';
@import 'components/form-side';
@import 'components/a11y-result';
@import 'components/userbar';
@import 'components/breadcrumbs';
@import 'components/pill';
@import 'components/ping';
@import 'components/editing-sessions';
@use 'components/avatar';
@use 'components/icons';
@use 'components/forms/input-base';
@use 'components/forms/input-text';
@use 'components/forms/radio-checkbox';
@use 'components/forms/select';
@use 'components/forms/tagit';
@use 'components/forms/radio-checkbox-multiple';
@use 'components/forms/error-message';
@use 'components/forms/required-mark';
@use 'components/forms/help';
@use 'components/forms/drop-zone';
@use 'components/forms/daterange';
@use 'components/forms/file';
@use 'components/forms/publishing';
@use 'components/forms/switch';
@use 'components/forms/title';
@use 'components/forms/field';
@use 'components/forms/field-row';
@use 'components/forms/field-comment-control';
@use 'components/forms/field-textoutput';
@use 'components/forms/form-width';
@use 'components/forms/nested-panel';
@use 'components/tabs';
@use 'components/panel';
@use 'components/dialog';
@use 'components/dismissible';
@use 'components/drilldown';
@use 'components/dropdown';
@use 'components/dropdown-button';
@use 'components/help-block';
@use 'components/button';
@use 'components/keyboard-shortcuts';
@use 'components/modals';
@use 'components/chooser';
@use 'components/tag';
@use 'components/listing';
@use 'components/filters';
@use 'components/messages';
@use 'components/messages.capability' as messages-capability;
@use 'components/messages.status' as messages-status;
@use 'components/header';
@use 'components/progressbar';
@use 'components/summary';
@use 'components/whats-new';
@use 'components/grid.legacy';
@use 'components/footer';
@use 'components/loading-mask';
@use 'components/human-readable-date';
@use 'components/link.legacy';
@use 'components/indicator';
@use 'components/status-tag';
@use 'components/skiplink';
@use 'components/workflow-tasks';
@use 'components/workflow-timeline';
@use 'components/bulk_actions';
@use 'components/preview-panel';
@use 'components/preview-error';
@use 'components/form-side';
@use 'components/a11y-result';
@use 'components/userbar';
@use 'components/breadcrumbs';
@use 'components/pill';
@use 'components/ping';
@use 'components/editing-sessions';
@import '../src/components/Sidebar/Sidebar';
@import '../src/components/Minimap/Minimap';
@use '../src/components/Sidebar/Sidebar';
@use '../src/components/Sidebar/SidebarPanel';
@use '../src/components/Sidebar/menu/MenuItem';
@use '../src/components/Sidebar/menu/SubMenuItem';
@use '../src/components/Sidebar/modules/MainMenu';
@use '../src/components/Sidebar/modules/WagtailBranding';
@use '../src/components/Minimap/Minimap';
/* OVERRIDES
These are classes that provide overrides.
@ -158,29 +159,28 @@ These are classes that provide overrides.
*/
// VENDOR: overrides of vendor styles.
@import 'overrides/vendor.datetimepicker';
@import 'overrides/vendor.handsontable';
@import 'overrides/vendor.tagit';
@import 'overrides/vendor.tippy';
@use 'overrides/vendor.datetimepicker' as vendor-datetimepicker;
@use 'overrides/vendor.handsontable' as vendor-handsontable;
@use 'overrides/vendor.tagit' as vendor-tagit;
@use 'overrides/vendor.tippy' as vendor-tippy;
// UTILITIES: classes that do one simple thing.
@import 'overrides/utilities.focus';
@use 'overrides/utilities.focus' as utilities-focus;
// Legacy utilities
@import 'overrides/utilities.legacy';
@use 'overrides/utilities.legacy' as utilities-legacy;
// TAILWIND: This is at the bottom so it can take precedence over other css classes
@tailwind utilities;
@use 'overrides/utilities.tailwind' as utilities-tailwind;
/* Legacy layout-specific styles. Do not add new styles here. */
@import 'layouts/404';
@import 'layouts/compare-revisions';
@import 'layouts/login';
@import 'layouts/account';
@import 'layouts/workflow-progress';
@import 'layouts/report';
@import 'layouts/add-multiple';
@import 'layouts/chooser-duplicate-upload';
@import 'layouts/focal-point-chooser';
@import 'layouts/redirects';
@use 'layouts/404' as layout-404;
@use 'layouts/compare-revisions';
@use 'layouts/login';
@use 'layouts/account';
@use 'layouts/workflow-progress';
@use 'layouts/report';
@use 'layouts/add-multiple';
@use 'layouts/chooser-duplicate-upload';
@use 'layouts/focal-point-chooser';
@use 'layouts/redirects';

Wyświetl plik

@ -1,3 +1,10 @@
// These inject Tailwind's base and component styles and any styles registered by plugins of each layer.
// Unused styles created within tailwinds layers won't be compiled into the compiled stylesheet
// https://tailwindcss.com/docs/adding-custom-styles#using-css-and-layer
@tailwind base;
@tailwind components;
*,
::before,
::after {

Wyświetl plik

@ -1,4 +1,5 @@
@use 'sass:map';
@use '../tools' as *;
// Legacy form reset styles. Avoid adding any new styles here.
form {
// Historically, Wagtail forms rendered all fields as list items.

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.page404__bg {
position: fixed;
top: 0;

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
$color-addition-dark: var(--color-addition-dark);
$color-addition-light: var(--color-addition-light);
$color-deletion-dark: var(--color-deletion-dark);

Wyświetl plik

@ -1,3 +1,5 @@
@use '../tools' as *;
.focal-point-chooser {
position: relative;
margin-bottom: 20px;

Wyświetl plik

@ -1,30 +1,19 @@
@mixin login-fullscreen-background() {
@at-root {
:root {
--w-login-fullscreen-background: radial-gradient(
100% 300.28% at 100% 0%,
theme('colors.primary.DEFAULT') 0%,
theme('colors.primary.DEFAULT') 32.94%,
theme('colors.primary.DEFAULT') 49.9%,
theme('colors.primary.DEFAULT') 50.2%,
theme('colors.secondary.DEFAULT') 100%
);
}
}
@use '../tools' as *;
// support older browsers that do not support radial gradient 'at' usage
background: theme('colors.surface-menus');
/* stylelint-disable-next-line declaration-block-no-duplicate-properties */
background: var(
--w-login-fullscreen-background,
theme('colors.primary.DEFAULT')
:root {
--w-login-fullscreen-background: radial-gradient(
100% 300.28% at 100% 0%,
theme('colors.primary.DEFAULT') 0%,
theme('colors.primary.DEFAULT') 32.94%,
theme('colors.primary.DEFAULT') 49.9%,
theme('colors.primary.DEFAULT') 50.2%,
theme('colors.secondary.DEFAULT') 100%
);
}
.login {
@include login-fullscreen-background;
color: theme('colors.text-label');
background: var(--w-login-fullscreen-background);
.wrapper {
align-items: center;

Wyświetl plik

@ -1,8 +1,11 @@
@use '../tools' as *;
.report {
@include nice-margin();
display: grid;
grid-column-gap: theme('spacing.12');
@include nice-margin();
&__results {
&--text {
margin: 0 theme('spacing.[1.5]') theme('spacing.[1.5]') 0;

Wyświetl plik

@ -1,16 +1,9 @@
@use '../settings' as *;
// stylelint-disable declaration-no-important
// Set global focus outline styles so they are consistent across the UI,
// without individual components having to explicitly define focus styles.
// Using !important because we want to enforce only one style is used across the UI.
// Remove :focus selectors once we stop supporting Safari 15.4.
*:focus {
outline: $focus-outline-width solid theme('colors.focus') !important;
}
*:focus:not(:focus-visible) {
outline: none !important;
}
*:focus-visible {
outline: $focus-outline-width solid theme('colors.focus') !important;
}

Wyświetl plik

@ -1,3 +1,6 @@
@use '../tools' as *;
@use '../settings' as *;
.nice-padding {
padding-inline-start: $mobile-nice-padding;
padding-inline-end: $mobile-nice-padding;

Wyświetl plik

@ -0,0 +1 @@
@tailwind utilities;

Wyświetl plik

@ -1,5 +1,6 @@
// stylelint-disable selector-max-combinators, max-nesting-depth
@use 'sass:map';
@use '../settings' as *;
.xdsoft_datetimepicker {
box-shadow: 0 5px 10px -5px theme('colors.black-35');

Wyświetl plik

@ -1,4 +1,5 @@
@use 'sass:map';
@use '../settings' as *;
// taggit tagging
.tagit {

Wyświetl plik

@ -1,5 +1,5 @@
// stylelint-disable selector-attribute-name-disallowed-list
@import '../../../node_modules/tippy.js/dist/tippy';
@use '../../../node_modules/tippy.js/dist/tippy';
.tippy-box {
// Special font size 12px for tooltips

Wyświetl plik

@ -1,5 +1,6 @@
@use 'sass:list';
@use 'sass:map';
@use '../settings' as *;
// Based upon the fine work and thoughts from Bootstrap v4.
// Copyright 2011-2018 The Bootstrap Authors
// Copyright 2011-2018 Twitter, Inc.

Wyświetl plik

@ -1,3 +1,5 @@
@use 'functions.breakpoints' as *;
// Based upon the fine work and thoughts from Bootstrap v4.
// Copyright 2011-2018 The Bootstrap Authors
// Copyright 2011-2018 Twitter, Inc.

Wyświetl plik

@ -4,6 +4,8 @@
// Please note that the mixins partial shouldn't include any classes. This is so
// it can be included in any file without accidentally producing output
@use '../settings' as *;
// Turns on font-smoothing when used. Use sparingly.
@mixin font-smoothing {
-webkit-font-smoothing: antialiased;
@ -167,3 +169,7 @@
}
}
}
@mixin focus-outline {
outline: $focus-outline-width solid theme('colors.focus');
}

Wyświetl plik

@ -1,4 +1,7 @@
@use 'sass:math';
@use '../settings' as *;
@use '../tools/mixins.breakpoints' as *;
@use '../tools/mixins.general' as *;
// grid settings
$grid-columns: 12;

Wyświetl plik

@ -14,8 +14,11 @@ const checkStatus = (response) => {
const parseJSON = (response) => response.json();
// Response timeout cancelling the promise (not the request).
// See https://github.com/github/fetch/issues/175#issuecomment-216791333.
/**
* Response timeout cancelling the promise (not the request).
*
* @see https://github.com/github/fetch/issues/175#issuecomment-216791333.
*/
const timeout = (ms, promise) => {
const race = new Promise((resolve, reject) => {
const timeoutId = setTimeout(() => {
@ -38,7 +41,7 @@ const timeout = (ms, promise) => {
};
/**
* Wrapper around fetch with sane defaults for behaviour in the face of
* Wrapper around fetch with sane defaults for behavior in the face of
* errors.
*/
const request = (method, url) => {

Wyświetl plik

@ -1,13 +1,13 @@
/* global DocumentChooserModal */
import { Chooser, ChooserFactory } from '.';
export class DocumentChooser extends Chooser {
// eslint-disable-next-line no-undef
chooserModalClass = DocumentChooserModal;
}
window.DocumentChooser = DocumentChooser;
export class DocumentChooserFactory extends ChooserFactory {
widgetClass = DocumentChooser;
// eslint-disable-next-line no-undef
chooserModalClass = DocumentChooserModal;
}

Wyświetl plik

@ -1,7 +1,8 @@
/* global ImageChooserModal */
import { Chooser, ChooserFactory } from '.';
export class ImageChooser extends Chooser {
// eslint-disable-next-line no-undef
chooserModalClass = ImageChooserModal;
initHTMLElements(id) {
@ -11,12 +12,21 @@ export class ImageChooser extends Chooser {
);
}
/**
* Constructs the initial state of the chooser from the rendered (static) HTML.
* The state is either null (no image chosen) or an object containing the image details.
*
* @returns {Object|null} The initial state of the chooser. If an image is chosen,
* the state object contains the following properties:
* - id: {number} The ID of the chosen image.
* - edit_url: {string} The URL to edit the chosen image.
* - title: {string} The title of the chosen image.
* - preview: {Object} An object containing the preview details of the chosen image:
* - url: {string} The URL of the preview image.
* - width: {string} The width of the preview image.
* - height: {string} The height of the preview image.
*/
getStateFromHTML() {
/*
Construct initial state of the chooser from the rendered (static) HTML.
State is either null (= no image chosen) or a dict of id, edit_url, title
and preview (= a dict of url, width, height).
*/
const state = super.getStateFromHTML();
if (state) {
state.preview = {
@ -24,6 +34,9 @@ export class ImageChooser extends Chooser {
width: this.previewImage.getAttribute('width'),
height: this.previewImage.getAttribute('height'),
};
state.default_alt_text = this.previewImage.getAttribute(
'data-default-alt-text',
);
}
return state;
}
@ -32,11 +45,14 @@ export class ImageChooser extends Chooser {
super.renderState(newState);
this.previewImage.setAttribute('src', newState.preview.url);
this.previewImage.setAttribute('width', newState.preview.width);
this.previewImage.setAttribute(
'data-default-alt-text',
newState.default_alt_text,
);
}
}
export class ImageChooserFactory extends ChooserFactory {
widgetClass = ImageChooser;
// eslint-disable-next-line no-undef
chooserModalClass = ImageChooserModal;
}

Wyświetl plik

@ -1,7 +1,8 @@
/* global PageChooserModal */
import { Chooser, ChooserFactory } from '.';
export class PageChooser extends Chooser {
// eslint-disable-next-line no-undef
chooserModalClass = PageChooserModal;
titleStateKey = 'adminTitle';
@ -44,7 +45,6 @@ export class PageChooser extends Chooser {
export class PageChooserFactory extends ChooserFactory {
widgetClass = PageChooser;
// eslint-disable-next-line no-undef
chooserModalClass = PageChooserModal;
getModalOptions() {

Wyświetl plik

@ -1,11 +1,13 @@
import EventEmitter from 'events';
import { ChooserModal } from '../../includes/chooserModal';
export class Chooser {
export class Chooser extends EventEmitter {
chooserModalClass = ChooserModal;
titleStateKey = 'title'; // key used in the 'state' dictionary to hold the human-readable title
editUrlStateKey = 'edit_url'; // key used in the 'state' dictionary to hold the URL of the edit page
constructor(id, opts = {}) {
super();
this.opts = opts;
this.initHTMLElements(id);
this.state = this.getStateFromHTML();
@ -83,6 +85,7 @@ export class Chooser {
setStateFromModalData(data) {
this.setState(data);
this.emit('chosen', data);
}
clear() {
@ -210,8 +213,10 @@ export class ChooserFactory {
this.modal.open(options, callback);
}
/**
* retrieve the widget object corresponding to the given HTML ID
*/
getById(id) {
/* retrieve the widget object corresponding to the given HTML ID */
return document.getElementById(`${id}-chooser`).widget;
}
}

Wyświetl plik

@ -1,24 +1,70 @@
@use '../../../scss/tools' as *;
// Ensure consistent spacing across the whole component.
// With the scrolling and show/hide of the field, correct spacing is critical.
$spacing: theme('spacing.[2.5]');
$spacing-sm: theme('spacing.5');
$spacing-sm: theme('spacing.4');
$width: clamp(300px, 75vw, 1000px);
.w-combobox {
width: min(400px, 80vw);
@include dark-theme() {
background-color: theme('colors.surface-tooltip');
}
.w-combobox-container {
background: theme('colors.surface-page');
color: theme('colors.text-context');
border-radius: theme('borderRadius.DEFAULT');
font-size: theme('fontSize.18');
box-shadow: theme('boxShadow.md');
outline: 10px solid transparent;
// Use a single column grid on smaller screens,
// and two columns on larger screens.
display: grid;
grid-template-columns: 1fr;
// Case 1: base case
// Use max-content width to minimize shifting due to content wrapping,
// constraining width to 75% of viewport for devices above 400px width.
width: max-content;
max-width: max(300px, 75vw);
@include media-breakpoint-up(md) {
grid-template-columns: min(400px, 80vw) 1fr;
}
@include media-breakpoint-up(lg) {
grid-template-columns: min(512px, 80vw) 1fr;
}
// Case 2: there's a previewable block, but the preview may or may not be active
// On smaller screens, the preview will be shown below. We don't want the
// combobox to change width when the preview is shown or hidden (e.g. due to
// a long description), so set a fixed width. It's OK that this will take up
// more than the necessary width for the combobox, as we know it's not going
// to be wider than 75% of the small screen anyway.
&:has(.w-combobox__option-preview) {
width: $width;
@include media-breakpoint-up(md) {
// On medium-up screens, the preview will be shown to the right. Revert
// the width back to max-content so it doesn't take up the whole `$width`
// when the preview is not active.
width: max-content;
}
}
// Case 3: the preview is currently active
&:has(.w-combobox-preview) {
@include media-breakpoint-up(md) {
// On larger screens, use the fixed `$width` so the width doesn't change
// for different blocks, which may have different description lengths.
width: $width;
}
}
@include dark-theme() {
background-color: theme('colors.surface-tooltip');
}
}
.w-combobox__field {
padding: $spacing;
padding-bottom: 0;
font-size: theme('fontSize.18');
@include media-breakpoint-up(sm) {
padding: $spacing-sm;
@ -43,12 +89,13 @@ $spacing-sm: theme('spacing.5');
display: grid;
grid-template-columns: 1fr 1fr;
grid-auto-flow: column;
gap: theme('spacing.[0.5]');
gap: theme('spacing.1');
padding: $spacing;
padding-top: 0;
@include media-breakpoint-up(sm) {
width: 400px;
width: 100%;
column-gap: theme('spacing.5');
padding: $spacing-sm;
padding-top: 0;
}
@ -70,21 +117,32 @@ $spacing-sm: theme('spacing.5');
}
}
.w-combobox__option {
.w-combobox__option-row {
display: grid;
grid-template-columns: theme('spacing.8') 1fr;
align-items: center;
padding: theme('spacing.2');
border: 1px solid transparent;
font-size: 0.875rem;
line-height: theme('lineHeight.tight');
border-radius: theme('borderRadius.sm');
grid-template-columns: 1fr theme('spacing.6');
}
&[aria-selected='true'] {
border-color: theme('colors.border-button-outline-default');
.w-combobox__option-preview {
@include show-focus-outline-inside();
color: theme('colors.icon-secondary');
background: none;
border: 1px solid transparent;
padding: 0;
width: 100%;
@include more-contrast-interactive();
.icon {
width: theme('spacing.3');
height: theme('spacing.3');
}
&:hover {
color: theme('colors.icon-secondary-hover');
}
&[aria-expanded='true'] {
color: theme('colors.text-link-default');
background: transparent;
cursor: pointer;
@media (forced-colors: active) {
background: Highlight;
@ -93,14 +151,37 @@ $spacing-sm: theme('spacing.5');
}
}
.w-combobox__option--col1 {
.w-combobox__option-row--col1 {
grid-column: 1 / span 1;
}
.w-combobox__option--col2 {
.w-combobox__option-row--col2 {
grid-column: 2 / span 1;
}
.w-combobox__option {
display: grid;
grid-template-columns: theme('spacing.8') 1fr;
align-items: center;
padding: theme('spacing.[2.5]');
border: 1px dotted theme('colors.border-button-small-outline-default');
font-size: 0.875rem;
line-height: theme('lineHeight.tight');
border-radius: theme('borderRadius.sm');
cursor: pointer;
&[aria-selected='true'] {
border-color: theme('colors.border-button-outline-default');
color: theme('colors.text-link-default');
background: transparent;
@media (forced-colors: active) {
background: Highlight;
color: HighlightText;
}
}
}
.w-combobox__option-icon {
color: theme('colors.icon-secondary');
height: theme('spacing.4');

Wyświetl plik

@ -40,12 +40,13 @@ describe('ComboBox', () => {
{
type: 'paragraph',
description: 'Paragraph',
icon: <span className="custom-icon">P</span>,
icon: <span className="my-icon">P</span>,
},
{
type: 'heading-one',
label: 'H1',
description: 'Heading 1',
icon: ['M 83.625 ', 'L 232.535156 '],
},
{
type: 'heading-two',
@ -70,6 +71,10 @@ describe('ComboBox', () => {
wrapper = shallow(<ComboBox {...testProps} items={items} />);
});
it('matches the snapshot', () => {
expect(wrapper).toMatchSnapshot();
});
it('shows items', () => {
const options = wrapper.find('.w-combobox__option-text');
expect(options).toHaveLength(
@ -82,8 +87,24 @@ describe('ComboBox', () => {
expect(wrapper.find(Icon).at(0).prop('name')).toBe('blockquote');
});
it('supports custom icons', () => {
expect(wrapper.find('.custom-icon').text()).toBe('P');
it('supports custom icons (as provided React component)', () => {
const paragraphOption = wrapper.findWhere(
(el) => el.key() === 'paragraph',
);
const icon = paragraphOption.find('.w-combobox__option-icon').render();
expect(icon.find('.my-icon')).toHaveLength(1);
expect(icon.text()).toBe('P');
});
it('supports custom icons (as provided path)', () => {
const paragraphOption = wrapper.findWhere(
(el) => el.key() === 'heading-one',
);
const icon = paragraphOption.find('.w-combobox__option-icon').render();
expect(icon.find('svg').hasClass('icon-custom')).toBe(true);
expect(icon.find('.icon-custom').html()).toContain('M 83.625');
});
it('supports label as icon', () => {
@ -92,8 +113,8 @@ describe('ComboBox', () => {
it('combines two categories into one, with two columns', () => {
expect(wrapper.find('.w-combobox__optgroup-label')).toHaveLength(1);
expect(wrapper.find('.w-combobox__option--col1')).toHaveLength(3);
expect(wrapper.find('.w-combobox__option--col2')).toHaveLength(2);
expect(wrapper.find('.w-combobox__option-row--col1')).toHaveLength(3);
expect(wrapper.find('.w-combobox__option-row--col2')).toHaveLength(2);
});
});
});

Wyświetl plik

@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import { useCombobox, UseComboboxStateChange } from 'downshift';
import { gettext } from '../../utils/gettext';
import ComboBoxPreview from '../ComboBoxPreview/ComboBoxPreview';
import Icon from '../Icon/Icon';
import findMatches from './findMatches';
@ -9,6 +10,7 @@ import findMatches from './findMatches';
export const comboBoxTriggerLabel = gettext('Insert a block');
export const comboBoxLabel = gettext('Search options…');
export const comboBoxNoResults = gettext('No results');
const comboBoxPreviewLabel = gettext('Preview');
export interface ComboBoxCategory<ItemType> {
type: string;
@ -21,6 +23,8 @@ export interface ComboBoxItem {
label?: string | null;
description?: string | null;
icon?: string | JSX.Element | null;
blockDefId?: string;
isPreviewable?: boolean;
category?: string;
render?: (props: { option: ComboBoxItem }) => JSX.Element | string;
}
@ -64,6 +68,7 @@ export default function ComboBox<ComboBoxOption extends ComboBoxItem>({
(category) => category.items || [],
);
const [inputItems, setInputItems] = useState<ComboBoxOption[]>(flatItems);
const [previewedIndex, setPreviewedIndex] = useState<number>(-1);
// Re-create the categories so the two-column layout flows as expected.
const categories = items.reduce<ComboBoxCategory<ComboBoxOption>[]>(
(cats, cat, index) => {
@ -114,8 +119,10 @@ export default function ComboBox<ComboBoxOption extends ComboBoxItem>({
}
},
// For not re-setting and not removing focus from combobox when pressing `Alt+Tab`
// to switch windows.
/**
* For not re-setting and not removing focus from combobox when pressing `Alt+Tab`
* to switch windows.
*/
stateReducer: (state, actionAndChanges) => {
const { type, changes } = actionAndChanges;
switch (type) {
@ -132,6 +139,9 @@ export default function ComboBox<ComboBoxOption extends ComboBoxItem>({
},
onInputValueChange: (changes) => {
// Hide any preview when the user types or clears the search input.
setPreviewedIndex(-1);
const { inputValue: val } = changes;
if (!val) {
setInputItems(flatItems);
@ -168,86 +178,129 @@ export default function ComboBox<ComboBoxOption extends ComboBoxItem>({
}
}, [inputValue]);
const previewedBlock =
previewedIndex >= 0 ? inputItems[previewedIndex] : null;
return (
<div className="w-combobox">
{/* downshift does the label-field association itself. */}
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label {...getLabelProps()} className="w-sr-only">
{label}
</label>
<div className="w-combobox__field">
<input
{...getInputProps()}
type="text"
// Prevent the field from receiving focus if its not visible.
disabled={inlineCombobox}
placeholder={placeholder}
/>
</div>
{noResults ? (
<div className="w-combobox__status">{noResultsText}</div>
) : null}
<div {...getMenuProps()} className="w-combobox__menu">
{categories.map((category) => {
const categoryItems = (category.items || []).filter((item) =>
inputItems.find((i) => i.type === item.type),
);
const itemColumns = Math.ceil(categoryItems.length / 2);
<div className="w-combobox-container">
<div className="w-combobox">
{/* downshift does the label-field association itself. */}
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label {...getLabelProps()} className="w-sr-only">
{label}
</label>
<div className="w-combobox__field">
<input
{...getInputProps()}
type="text"
// Prevent the field from receiving focus if its not visible.
disabled={inlineCombobox}
placeholder={placeholder}
/>
</div>
{noResults ? (
<div className="w-combobox__status">{noResultsText}</div>
) : null}
<div {...getMenuProps()} className="w-combobox__menu">
{categories.map((category) => {
const categoryItems = (category.items || []).filter((item) =>
inputItems.find((i) => i.type === item.type),
);
const itemColumns = Math.ceil(categoryItems.length / 2);
if (categoryItems.length === 0) {
return null;
}
if (categoryItems.length === 0) {
return null;
}
return (
<div className="w-combobox__optgroup" key={category.type}>
{category.label ? (
<div className="w-combobox__optgroup-label">
{category.label}
</div>
) : null}
{categoryItems.map((item, index) => {
const itemLabel = getItemLabel(item.type, item);
const description = getItemDescription(item);
const itemIndex = inputItems.findIndex(
(i) => i.type === item.type,
);
const itemColumn = index + 1 <= itemColumns ? 1 : 2;
const hasIcon =
typeof item.icon !== 'undefined' && item.icon !== null;
let icon: JSX.Element | null | undefined = null;
if (hasIcon) {
icon =
typeof item.icon === 'string' ? (
<Icon name={item.icon} />
) : (
item.icon
);
}
return (
<div
key={item.type}
{...getItemProps({ item, index: itemIndex })}
className={`w-combobox__option w-combobox__option--col${itemColumn}`}
>
<div className="w-combobox__option-icon">
{icon}
{/* Support for rich text options using text as an icon (for example "B" for bold). */}
{itemLabel && !hasIcon ? <span>{itemLabel}</span> : null}
</div>
<div className="w-combobox__option-text">
{item.render
? item.render({ option: item })
: description}
</div>
return (
<div className="w-combobox__optgroup" key={category.type}>
{category.label ? (
<div className="w-combobox__optgroup-label">
{category.label}
</div>
);
})}
</div>
);
})}
) : null}
{categoryItems.map((item, index) => {
const itemLabel = getItemLabel(item.type, item);
const description = getItemDescription(item);
const itemIndex = inputItems.findIndex(
(i) => i.type === item.type,
);
const itemColumn = index + 1 <= itemColumns ? 1 : 2;
const hasIcon =
typeof item.icon !== 'undefined' && item.icon !== null;
let icon: JSX.Element | null | undefined = null;
if (hasIcon) {
if (Array.isArray(item.icon)) {
icon = (
<Icon name="custom" viewBox="0 0 1024 1024">
{item.icon.map((pathData: string) => (
<path key={pathData} d={pathData} />
))}
</Icon>
);
} else {
icon =
typeof item.icon === 'string' ? (
<Icon name={item.icon} />
) : (
item.icon
);
}
}
return (
<div
key={item.type}
className={`w-combobox__option-row w-combobox__option-row--col${itemColumn}`}
>
<div
{...getItemProps({ item, index: itemIndex })}
className="w-combobox__option"
>
<div className="w-combobox__option-icon">
{icon}
{/* Support for rich text options using text as an icon (for example "B" for bold). */}
{itemLabel && !hasIcon ? (
<span>{itemLabel}</span>
) : null}
</div>
<div className="w-combobox__option-text">
{item.render
? item.render({ option: item })
: description}
</div>
</div>
{item.isPreviewable ? (
<button
className="w-combobox__option-preview"
aria-label={comboBoxPreviewLabel}
aria-expanded={previewedIndex === itemIndex}
type="button"
onClick={() =>
setPreviewedIndex(
previewedIndex === itemIndex ? -1 : itemIndex,
)
}
>
<Icon name="view" />
</button>
) : null}
</div>
);
})}
</div>
);
})}
</div>
</div>
{previewedBlock?.isPreviewable ? (
<ComboBoxPreview
item={previewedBlock}
previewLabel={comboBoxPreviewLabel}
/>
) : null}
</div>
);
}

Wyświetl plik

@ -0,0 +1,215 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ComboBox rendering matches the snapshot 1`] = `
<div
className="w-combobox-container"
>
<div
className="w-combobox"
>
<label
className="w-sr-only"
htmlFor="downshift-1-input"
id="downshift-1-label"
>
Search options…
</label>
<div
className="w-combobox__field"
>
<input
aria-activedescendant=""
aria-autocomplete="list"
aria-controls="downshift-1-menu"
aria-expanded={false}
aria-labelledby="downshift-1-label"
autoComplete="off"
disabled={false}
id="downshift-1-input"
onBlur={[Function]}
onChange={[Function]}
onClick={[Function]}
onKeyDown={[Function]}
placeholder="Search options…"
role="combobox"
type="text"
value=""
/>
</div>
<div
aria-labelledby="downshift-1-label"
className="w-combobox__menu"
id="downshift-1-menu"
onMouseLeave={[Function]}
role="listbox"
>
<div
className="w-combobox__optgroup"
key="blockTypes"
>
<div
className="w-combobox__optgroup-label"
>
Blocks
</div>
<div
className="w-combobox__option-row w-combobox__option-row--col1"
key="blockquote"
>
<div
aria-disabled={false}
aria-selected={false}
className="w-combobox__option"
id="downshift-1-item-0"
onClick={[Function]}
onMouseDown={[Function]}
onMouseMove={[Function]}
role="option"
>
<div
className="w-combobox__option-icon"
>
<Icon
name="blockquote"
/>
</div>
<div
className="w-combobox__option-text"
>
Blockquote
</div>
</div>
</div>
<div
className="w-combobox__option-row w-combobox__option-row--col1"
key="paragraph"
>
<div
aria-disabled={false}
aria-selected={false}
className="w-combobox__option"
id="downshift-1-item-1"
onClick={[Function]}
onMouseDown={[Function]}
onMouseMove={[Function]}
role="option"
>
<div
className="w-combobox__option-icon"
>
<span
className="my-icon"
>
P
</span>
</div>
<div
className="w-combobox__option-text"
>
Paragraph
</div>
</div>
</div>
<div
className="w-combobox__option-row w-combobox__option-row--col1"
key="heading-one"
>
<div
aria-disabled={false}
aria-selected={false}
className="w-combobox__option"
id="downshift-1-item-2"
onClick={[Function]}
onMouseDown={[Function]}
onMouseMove={[Function]}
role="option"
>
<div
className="w-combobox__option-icon"
>
<Icon
name="custom"
viewBox="0 0 1024 1024"
>
<path
d="M 83.625 "
key="M 83.625 "
/>
<path
d="L 232.535156 "
key="L 232.535156 "
/>
</Icon>
</div>
<div
className="w-combobox__option-text"
>
Heading 1
</div>
</div>
</div>
<div
className="w-combobox__option-row w-combobox__option-row--col2"
key="heading-two"
>
<div
aria-disabled={false}
aria-selected={false}
className="w-combobox__option"
id="downshift-1-item-3"
onClick={[Function]}
onMouseDown={[Function]}
onMouseMove={[Function]}
role="option"
>
<div
className="w-combobox__option-icon"
>
<span>
H2
</span>
</div>
<div
className="w-combobox__option-text"
>
<span
className="custom-text"
>
H2
</span>
</div>
</div>
</div>
<div
className="w-combobox__option-row w-combobox__option-row--col2"
key="link"
>
<div
aria-disabled={false}
aria-selected={false}
className="w-combobox__option"
id="downshift-1-item-4"
onClick={[Function]}
onMouseDown={[Function]}
onMouseMove={[Function]}
role="option"
>
<div
className="w-combobox__option-icon"
>
<span>
🔗
</span>
</div>
<div
className="w-combobox__option-text"
>
Link
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;

Wyświetl plik

@ -0,0 +1,59 @@
@use '../../../scss/tools' as *;
.w-combobox-preview {
padding: theme('spacing.5');
display: flex;
flex-direction: column;
gap: theme('spacing.5');
// Set a min-height to ensure it's big enough to be useful
min-height: 400px;
background-color: theme('colors.surface-header');
border-block-start: 1px solid theme('colors.border-furniture');
border-end-end-radius: inherit;
border-end-start-radius: inherit;
@include media-breakpoint-up(md) {
border-block-start: 0;
border-start-end-radius: inherit;
border-end-start-radius: 0;
border-inline-start: 1px solid theme('colors.border-furniture');
}
}
.w-combobox-preview__iframe {
// Take up remaining space
width: 100%;
height: 100%;
border: 1px solid theme('colors.border-furniture');
border-radius: theme('borderRadius.sm');
// Ensure iframe is always opaque
color-scheme: normal;
background-color: Canvas;
@include more-contrast() {
border-color: theme('colors.border-furniture-more-contrast');
}
}
.w-combobox-preview__details {
overflow: hidden;
display: flex;
flex-direction: column;
// Use 65:35 ratio between the iframe and the details, but allow the details
// to grow to a minimum of 100px in case the container is very small
// (i.e. when there are only a few blocks)
min-height: max(35%, 100px);
}
.w-combobox-preview__label {
@apply w-label-1;
}
.w-combobox-preview__description {
@apply w-help-text;
margin-top: theme('spacing.3');
margin-bottom: 0;
overflow: auto;
min-height: 0;
}

Wyświetl plik

@ -0,0 +1,39 @@
import React from 'react';
import { WAGTAIL_CONFIG } from '../../config/wagtailConfig';
interface ComboBoxItem {
label?: string | null;
description?: string | null;
// icon?: string | JSX.Element | null;
blockDefId?: string;
}
export interface ComboBoxPreviewProps {
item: ComboBoxItem;
previewLabel: string;
}
export default function ComboBoxPreview({
item: { label, description, blockDefId },
previewLabel,
}: ComboBoxPreviewProps) {
const previewURL = blockDefId
? new URL(WAGTAIL_CONFIG.ADMIN_URLS.BLOCK_PREVIEW, window.location.href)
: undefined;
previewURL?.searchParams.append('id', blockDefId || '');
return (
<div className="w-combobox-preview">
<iframe
className="w-combobox-preview__iframe"
title={previewLabel}
src={previewURL?.toString()}
/>
<div className="w-combobox-preview__details">
<div className="w-combobox-preview__label">{label}</div>
{description ? (
<p className="w-combobox-preview__description">{description}</p>
) : null}
</div>
</div>
);
}

Wyświetl plik

@ -1,5 +1,5 @@
import React from 'react';
import { createStore } from 'redux';
import { legacy_createStore as createStore } from 'redux';
import { Store, reducer } from '../../state';

Wyświetl plik

@ -1,7 +1,19 @@
.comment {
@include box;
@include more-contrast-interactive();
@use '../../../../../scss/tools' as *;
$color-box-background: theme('colors.surface-page');
$color-box-background-focused: theme('colors.surface-page');
$color-box-border: theme('colors.border-furniture');
$color-box-border-focused: theme('colors.border-field-hover');
$color-box-text: theme('colors.text-context');
$box-border-radius: 5px;
$box-padding: 20px;
.comment {
background-color: $color-box-background;
padding: $box-padding;
border-radius: $box-border-radius;
color: $color-box-text;
border: 1px solid $color-box-border;
width: 300px;
display: block;
transition:
@ -12,8 +24,57 @@
padding-bottom: 0;
inset-inline-end: 0;
@include more-contrast-interactive();
&--focused {
inset-inline-end: 25px;
background-color: $color-box-background-focused;
border: 1px solid $color-box-border-focused;
box-shadow: 3px 2px 3px -1px theme('colors.black-10');
}
textarea {
margin: 0;
padding: 12px;
width: 100%;
background-color: theme('colors.surface-field');
border: 1px solid theme('colors.border-field-default');
border-radius: 5px;
color: $color-box-text;
&::placeholder {
color: theme('colors.text-placeholder');
opacity: 1;
}
}
&__notice-placeholder {
position: relative;
padding-bottom: 40px;
}
&__notice {
background-color: theme('colors.warning.50');
color: theme('colors.grey.600');
position: absolute;
inset-inline-start: -$box-padding;
bottom: 0;
width: calc(100% + #{$box-padding} * 2);
padding: 5px 10px;
svg.icon {
color: theme('colors.warning.100');
width: 14px;
height: 14px;
margin-inline-end: 10px;
vertical-align: text-bottom;
}
}
& > &__notice-placeholder:last-child &__notice,
&__replies:last-child > :last-child &__notice {
border-end-start-radius: $box-border-radius;
border-end-end-radius: $box-border-radius;
}
&__text {
@ -26,14 +87,10 @@
padding-bottom: 10px;
word-break: break-all;
white-space: pre-wrap;
&--mode-deleting {
color: theme('colors.text-context');
}
}
form {
border-top: 1px solid $color-comment-separator;
border-top: 1px solid theme('colors.border-furniture');
}
&--mode-creating form {
@ -56,7 +113,25 @@
}
&__button {
@include button;
background-color: inherit;
border: 1px solid theme('colors.border-button-small-outline-default');
border-radius: 3px;
color: theme('colors.surface-button-default');
cursor: pointer;
font-weight: 700;
height: 30px;
padding-inline-start: 10px;
padding-inline-end: 10px;
&--primary {
color: theme('colors.text-button');
border: 1px solid theme('colors.surface-button-default');
background-color: theme('colors.surface-button-default');
}
&:disabled {
opacity: 0.3;
}
}
&__actions,

Wyświetl plik

@ -1,3 +1,5 @@
@use '../../../../../scss/tools' as *;
.comment-header {
position: relative;
@ -40,7 +42,6 @@
> button,
> details > summary {
@include more-contrast-interactive();
border-radius: theme('borderRadius.sm');
list-style-type: none; // Hides triangle on Firefox
width: 30px;
@ -50,6 +51,8 @@
border: unset;
padding: 0;
@include more-contrast-interactive();
&::-webkit-details-marker {
display: none; // Hides triangle on Chrome
}

Wyświetl plik

@ -1,5 +1,5 @@
import React from 'react';
import { createStore } from 'redux';
import { legacy_createStore as createStore } from 'redux';
import { Store, reducer } from '../../state';

Wyświetl plik

@ -105,17 +105,17 @@ export default class CommentReplyComponent extends React.Component<CommentReplyP
value={reply.newText}
onChange={onChangeText}
/>
<div className="comment-reply__actions">
<div className="comment__actions">
<button
type="submit"
disabled={reply.newText.length === 0}
className="comment-reply__button comment-reply__button--primary"
className="comment__button comment__button--primary"
>
{gettext('Save')}
</button>
<button
type="button"
className="comment-reply__button"
className="comment__button"
onClick={onCancel}
>
{gettext('Cancel')}
@ -132,8 +132,8 @@ export default class CommentReplyComponent extends React.Component<CommentReplyP
return (
<>
<CommentHeader commentReply={reply} store={store} focused={isFocused} />
<p className="comment-reply__text">{reply.text}</p>
<div className="comment-reply__progress">{gettext('Saving...')}</div>
<p className="comment__text">{reply.text}</p>
<div className="comment__progress">{gettext('Saving...')}</div>
</>
);
}
@ -150,12 +150,12 @@ export default class CommentReplyComponent extends React.Component<CommentReplyP
return (
<>
<CommentHeader commentReply={reply} store={store} focused={isFocused} />
<p className="comment-reply__text">{reply.text}</p>
<div className="comment-reply__error">
<p className="comment__text">{reply.text}</p>
<div className="comment__error">
{gettext('Save error')}
<button
type="button"
className="comment-reply__button"
className="comment__button"
onClick={onClickRetry}
>
{gettext('Retry')}
@ -187,19 +187,19 @@ export default class CommentReplyComponent extends React.Component<CommentReplyP
return (
<>
<CommentHeader commentReply={reply} store={store} focused={isFocused} />
<p className="comment-reply__text">{reply.text}</p>
<div className="comment-reply__confirm-delete">
<p className="comment__text">{reply.text}</p>
<div className="comment__confirm-delete">
{gettext('Are you sure?')}
<button
type="button"
className="comment-reply__button"
className="comment__button button button-small"
onClick={onClickCancel}
>
{gettext('Cancel')}
</button>
<button
type="button"
className="comment-reply__button comment-reply__button--primary"
className="comment__button button button-small no"
onClick={onClickDelete}
>
{gettext('Delete')}
@ -215,8 +215,8 @@ export default class CommentReplyComponent extends React.Component<CommentReplyP
return (
<>
<CommentHeader commentReply={reply} store={store} focused={isFocused} />
<p className="comment-reply__text">{reply.text}</p>
<div className="comment-reply__progress">{gettext('Deleting')}</div>
<p className="comment__text">{reply.text}</p>
<div className="comment__progress">{gettext('Deleting')}</div>
</>
);
}
@ -243,19 +243,19 @@ export default class CommentReplyComponent extends React.Component<CommentReplyP
return (
<>
<CommentHeader commentReply={reply} store={store} focused={isFocused} />
<p className="comment-reply__text">{reply.text}</p>
<div className="comment-reply__error">
<p className="comment__text">{reply.text}</p>
<div className="comment__error">
{gettext('Delete error')}
<button
type="button"
className="comment-reply__button"
className="comment__button"
onClick={onClickCancel}
>
{gettext('Cancel')}
</button>
<button
type="button"
className="comment-reply__button"
className="comment__button"
onClick={onClickRetry}
>
{gettext('Retry')}
@ -308,7 +308,7 @@ export default class CommentReplyComponent extends React.Component<CommentReplyP
onDelete={onDelete}
focused={isFocused}
/>
<p className="comment-reply__text">{reply.text}</p>
<p className="comment__text">{reply.text}</p>
{notice && (
<div className="comment__notice-placeholder">
<div className="comment__notice" role="status">

Wyświetl plik

@ -2,111 +2,13 @@
padding-top: 20px;
pointer-events: auto;
position: relative;
border-top: 1px solid $color-comment-separator;
border-top: 1px solid theme('colors.border-furniture');
&__text {
color: $color-box-text;
font-weight: 400;
font-size: 16px;
line-height: 150%;
margin-bottom: 0;
padding-top: 10px;
padding-bottom: 10px;
word-break: break-all;
white-space: pre-wrap;
&--mode-deleting {
color: theme('colors.text-context');
}
}
&--mode-deleting &__avatar {
opacity: 0.5;
}
&--mode-deleting &__text {
&--mode-deleting .comment__text {
color: theme('colors.text-meta');
}
form {
margin-top: 10px;
}
&__button {
@include button;
}
&__actions,
&__confirm-delete,
&__progress,
&__error {
&::after {
display: block;
content: '';
clear: both;
}
}
&__actions {
padding-bottom: 10px;
}
&__actions &__button {
margin-inline-end: 10px;
margin-top: 10px;
}
&__confirm-delete &__button {
margin-inline-start: 10px;
margin-bottom: 10px;
}
&__confirm-delete,
&__error {
color: $color-box-text;
font-weight: bold;
font-size: 13px;
margin-top: 10px;
button {
float: inline-end;
}
&::after {
display: block;
content: ' ';
clear: both;
}
}
&__error {
color: theme('colors.white.DEFAULT');
background-color: theme('colors.critical.200');
border-radius: 3px;
padding: 5px;
padding-inline-start: 10px;
height: 26px;
line-height: 26px;
vertical-align: middle;
button {
height: 26px;
float: inline-end;
margin-inline-start: 5px;
color: theme('colors.white.DEFAULT');
background-color: theme('colors.critical.200');
border-color: theme('colors.white.DEFAULT');
padding: 2px;
padding-inline-start: 10px;
padding-inline-end: 10px;
font-size: 0.65em;
font-weight: bold;
}
}
&__progress {
margin-top: 20px;
font-weight: bold;
font-size: 13px;
}
}

Wyświetl plik

@ -1,113 +1,6 @@
@import '../../../scss/settings/variables';
$color-comment-separator: theme('colors.border-furniture');
$color-box-background: theme('colors.surface-page');
$color-box-background-focused: theme('colors.surface-page');
$color-box-border: theme('colors.border-furniture');
$color-box-border-focused: theme('colors.border-field-hover');
$color-box-text: theme('colors.text-context');
$box-border-radius: 5px;
$box-padding: 20px;
@mixin focus-outline {
outline: theme('colors.focus') solid 3px;
}
@mixin box {
background-color: $color-box-background;
padding: $box-padding;
border-radius: $box-border-radius;
color: $color-box-text;
border: 1px solid $color-box-border;
&--focused {
background-color: $color-box-background-focused;
border: 1px solid $color-box-border-focused;
box-shadow: 3px 2px 3px -1px theme('colors.black-10');
}
textarea {
margin: 0;
padding: 12px;
width: 100%;
background-color: theme('colors.surface-field');
border: 1px solid theme('colors.border-field-default');
border-radius: 5px;
color: $color-box-text;
&::placeholder {
color: theme('colors.text-placeholder');
opacity: 1;
}
}
*:focus {
@include focus-outline;
}
&__notice-placeholder {
position: relative;
padding-bottom: 40px;
}
&__notice {
background-color: theme('colors.warning.50');
color: theme('colors.grey.600');
position: absolute;
inset-inline-start: -$box-padding;
bottom: 0;
width: calc(100% + #{$box-padding} * 2);
padding: 5px 10px;
svg.icon {
color: theme('colors.warning.100');
width: 14px;
height: 14px;
margin-inline-end: 10px;
vertical-align: text-bottom;
}
}
& > &__notice-placeholder:last-child &__notice,
&__replies:last-child > :last-child &__notice {
border-end-start-radius: $box-border-radius;
border-end-end-radius: $box-border-radius;
}
}
@mixin button {
background-color: inherit;
border: 1px solid theme('colors.border-button-small-outline-default');
border-radius: 3px;
color: theme('colors.surface-button-default');
cursor: pointer;
font-weight: 700;
height: 30px;
padding-inline-start: 10px;
padding-inline-end: 10px;
&--primary {
color: theme('colors.text-button');
border: 1px solid theme('colors.surface-button-default');
background-color: theme('colors.surface-button-default');
}
&--red {
color: theme('colors.text-button');
border: 1px solid theme('colors.critical.200');
background-color: theme('colors.critical.200');
}
&:disabled {
opacity: 0.3;
}
// Disable Firefox's focus styling because we add our own.
&::-moz-focus-inner {
border: 0;
}
}
@use 'components/CommentHeader/style' as CommentHeader;
@use 'components/Comment/style' as Comment;
@use 'components/CommentReply/style' as CommentReply;
.comments-list {
position: relative;
@ -115,8 +8,3 @@ $box-padding: 20px;
inset-inline-end: 20px;
z-index: calc(theme('zIndex.header') + 5);
}
// stylelint-disable no-invalid-position-at-import-rule
@import 'components/CommentHeader/style';
@import 'components/Comment/style';
@import 'components/CommentReply/style';

Wyświetl plik

@ -1,13 +1,20 @@
import React, { useCallback } from 'react';
import ReactDOM from 'react-dom';
import { createStore } from 'redux';
import { legacy_createStore as createStore } from 'redux';
import type { Annotation } from './utils/annotation';
import { LayoutController } from './utils/layout';
import { getOrDefault } from './utils/maps';
import { getNextCommentId, getNextReplyId } from './utils/sequences';
import { Store, reducer } from './state';
import { Comment, newCommentReply, newComment, Author } from './state/comments';
import {
Comment,
newCommentReply,
newComment,
Author,
INITIAL_STATE as INITIAL_COMMENTS_STATE,
} from './state/comments';
import { INITIAL_STATE as INITIAL_SETTINGS_STATE } from './state/settings';
import {
addComment,
addReply,
@ -27,7 +34,6 @@ import {
} from './selectors';
import CommentComponent from './components/Comment';
import { CommentFormSetComponent } from './components/Form';
import { INITIAL_STATE as INITIAL_SETTINGS_STATE } from './state/settings';
// This is done as this is serialized pretty directly from the Django model
export interface InitialCommentReply {
@ -168,8 +174,9 @@ export class CommentApp {
constructor() {
this.store = createStore(reducer, {
comments: INITIAL_COMMENTS_STATE,
settings: INITIAL_SETTINGS_STATE,
});
} as any);
this.layout = new LayoutController();
}

Some files were not shown because too many files have changed in this diff Show More