Skip to content

Commit bfea29c

Browse files
Merge branch 'wagtail:main' into patch-1
2 parents a00670c + a5c31f9 commit bfea29c

File tree

3,744 files changed

+154146
-123262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,744 files changed

+154146
-123262
lines changed

.babelrc.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100,
9+
"safari": 15,
10+
"firefox": 91
11+
}
12+
}
13+
],
14+
"@babel/preset-typescript",
15+
"@babel/preset-react"
16+
],
17+
"plugins": []
18+
}

.circleci/config.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,37 @@ version: 2
33
jobs:
44
backend:
55
docker:
6-
- image: cimg/python:3.8.11
6+
- image: cimg/python:3.12
77
environment:
88
PIPENV_VENV_IN_PROJECT: true
99
steps:
1010
- checkout
1111
- restore_cache:
12-
key: pipenv-v1-{{ checksum "setup.py" }}
12+
key: pipenv-v2-{{ checksum "setup.py" }}
1313
# Only install if .venv wasn’t cached.
1414
- run: |
1515
if [[ ! -e ".venv" ]]; then
1616
pipenv install -e .[testing,docs]
1717
fi
1818
- save_cache:
19-
key: pipenv-v1-{{ checksum "setup.py" }}
19+
key: pipenv-v2-{{ checksum "setup.py" }}
2020
paths:
2121
- .venv
2222
- run: pipenv run ruff check .
23-
- run: pipenv run black --target-version py37 --check --diff .
23+
- run: pipenv run ruff format --check .
2424
- run: pipenv run semgrep --config .semgrep.yml --error .
2525
- run: git ls-files '*.html' | xargs pipenv run djhtml --check
2626
- run: pipenv run curlylint --parse-only wagtail
2727
- run: pipenv run doc8 docs
28-
- run: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
28+
- run:
29+
name: Run tests
30+
command: |
31+
export PYTHONUNBUFFERED=1
32+
WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT=1 pipenv run python -u runtests.py --parallel=2
2933
3034
frontend:
3135
docker:
32-
- image: cimg/node:18.12
36+
- image: cimg/node:20.9
3337
steps:
3438
- checkout
3539
- restore_cache:
@@ -58,36 +62,40 @@ jobs:
5862

5963
ui_tests:
6064
docker:
61-
- image: cimg/python:3.8.11-browsers
65+
- image: cimg/python:3.12-browsers
6266
environment:
6367
PIPENV_VENV_IN_PROJECT: true
6468
DJANGO_SETTINGS_MODULE: wagtail.test.settings_ui
69+
DJANGO_DEBUG: true
6570
steps:
6671
- checkout
6772
- attach_workspace:
6873
at: ~/project
6974
- restore_cache:
70-
key: pipenv-v1-{{ checksum "setup.py" }}
75+
key: pipenv-v2-{{ checksum "setup.py" }}
7176
# Only install if .venv wasn’t cached.
7277
- run: |
7378
if [[ ! -e ".venv" ]]; then
7479
pipenv install -e .[testing]
7580
fi
7681
- save_cache:
77-
key: pipenv-v1-{{ checksum "setup.py" }}
82+
key: pipenv-v2-{{ checksum "setup.py" }}
7883
paths:
7984
- .venv
8085
- restore_cache:
81-
key: ui_tests-npm_integration-v1-{{ checksum "client/tests/integration/package-lock.json" }}
86+
key: ui_tests-npm_integration-v2-{{ checksum "client/tests/integration/package-lock.json" }}
8287
# Only install if node_modules wasn’t cached.
8388
- run: |
8489
if [[ ! -e "client/tests/integration/node_modules" ]]; then
8590
npm --prefix ./client/tests/integration ci
8691
fi
8792
- save_cache:
88-
key: ui_tests-npm_integration-v1-{{ checksum "client/tests/integration/package-lock.json" }}
93+
key: ui_tests-npm_integration-v2-{{ checksum "client/tests/integration/package-lock.json" }}
8994
paths:
9095
- client/tests/integration/node_modules
96+
# Also cache the global location where Puppeteer stores browsers.
97+
# https://pptr.dev/guides/configuration/#changing-the-default-cache-directory
98+
- ~/.cache/puppeteer
9199
- run: pipenv run ./wagtail/test/manage.py migrate
92100
- run:
93101
command: pipenv run ./wagtail/test/manage.py runserver 0:8000
@@ -106,13 +114,14 @@ jobs:
106114
- run:
107115
command: pipenv run ./wagtail/test/manage.py collectstatic --noinput
108116
environment:
117+
DJANGO_DEBUG: false
109118
STATICFILES_STORAGE: manifest
110119
- store_test_results:
111120
path: ./reports/jest
112121

113122
nightly-build:
114123
docker:
115-
- image: cimg/python:3.8.11-node
124+
- image: cimg/python:3.12-node
116125
steps:
117126
- checkout
118127
- run: pip install --user wheel boto3

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# .coveragerc to control coverage.py
22
[run]
33
branch = True
4+
concurrency = multiprocessing,thread
45

56
source = wagtail
67

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ indent_size = 2
2525

2626
[*.md]
2727
trim_trailing_whitespace = false
28+
29+
# Make sure this file _doesn’t_ end with a final newline. It breaks rendering.
30+
[wagtail/admin/templates/wagtailadmin/shared/icon.html]
31+
insert_final_newline = false

.eslintrc.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module.exports = {
22
extends: [
33
'@wagtail/eslint-config-wagtail',
44
'plugin:@typescript-eslint/recommended',
5+
'plugin:storybook/recommended',
56
],
67
parser: '@typescript-eslint/parser',
78
plugins: ['@typescript-eslint'],
@@ -44,7 +45,7 @@ module.exports = {
4445
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.tsx'] }],
4546
'no-underscore-dangle': [
4647
'error',
47-
{ allow: ['__REDUX_DEVTOOLS_EXTENSION__'] },
48+
{ allow: ['__REDUX_DEVTOOLS_EXTENSION__', '_tippy'] },
4849
],
4950
// this rule can be confusing as it forces some non-intuitive code for variable assignment
5051
'prefer-destructuring': 'off',
@@ -54,14 +55,21 @@ module.exports = {
5455
'import/resolver': { node: { extensions: ['.js', '.ts', '.tsx'] } },
5556
},
5657
overrides: [
58+
// Rules that needs to be adjusted for TypeScript only files
59+
{
60+
files: ['*.ts'],
61+
rules: {
62+
'@typescript-eslint/no-shadow': 'error',
63+
'no-shadow': 'off',
64+
},
65+
},
5766
// Rules that we are ignoring currently due to legacy code in React components only
5867
{
5968
files: ['client/src/components/**'],
6069
rules: {
6170
'jsx-a11y/click-events-have-key-events': 'off',
6271
'jsx-a11y/interactive-supports-focus': 'off',
6372
'jsx-a11y/no-noninteractive-element-interactions': 'off',
64-
'jsx-a11y/role-supports-aria-props': 'off',
6573
'no-restricted-syntax': 'off',
6674
'react-hooks/exhaustive-deps': 'off',
6775
'react-hooks/rules-of-hooks': 'off',
@@ -99,7 +107,7 @@ module.exports = {
99107
},
100108
},
101109
{
102-
selector: 'property',
110+
selector: 'classProperty',
103111
format: ['camelCase'],
104112
custom: {
105113
// Use Stimulus values where possible for internal state, avoid a generic state object as these are not reactive.
@@ -135,11 +143,14 @@ module.exports = {
135143
],
136144
rules: {
137145
'@typescript-eslint/no-empty-function': 'off',
146+
'@typescript-eslint/no-this-alias': 'off',
138147
'@typescript-eslint/no-unused-vars': 'off',
139148
'@typescript-eslint/no-var-requires': 'off',
140149
'global-require': 'off',
141150
'import/first': 'off',
142151
'import/no-extraneous-dependencies': 'off',
152+
'jsx-a11y/control-has-associated-label': 'off',
153+
'no-new': 'off',
143154
'no-unused-expressions': 'off',
144155
'react/function-component-definition': 'off',
145156
'react/jsx-props-no-spreading': 'off',
@@ -148,17 +159,14 @@ module.exports = {
148159
// Files that use jquery via a global
149160
{
150161
files: [
151-
'docs/_static/**',
152-
'wagtail/contrib/modeladmin/static_src/wagtailmodeladmin/js/prepopulate.js',
162+
'wagtail/contrib/search_promotions/static_src/wagtailsearchpromotions/js/query-chooser-modal.js',
153163
'wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/includes/searchpromotions_formset.js',
164+
'wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/queries/chooser_field.js',
154165
'wagtail/documents/static_src/wagtaildocs/js/add-multiple.js',
155166
'wagtail/embeds/static_src/wagtailembeds/js/embed-chooser-modal.js',
156167
'wagtail/images/static_src/wagtailimages/js/add-multiple.js',
157168
'wagtail/images/static_src/wagtailimages/js/focal-point-chooser.js',
158169
'wagtail/images/static_src/wagtailimages/js/image-url-generator.js',
159-
'wagtail/search/static_src/wagtailsearch/js/query-chooser-modal.js',
160-
'wagtail/search/templates/wagtailsearch/queries/chooser_field.js',
161-
'wagtail/snippets/static_src/wagtailsnippets/js/snippet-multiple-select.js',
162170
'wagtail/users/static_src/wagtailusers/js/group-form.js',
163171
],
164172
globals: { $: 'readonly', jQuery: 'readonly' },
@@ -168,9 +176,7 @@ module.exports = {
168176
files: ['wagtail/**/**'],
169177
globals: {
170178
buildExpandingFormset: 'readonly',
171-
cancelSpinner: 'readonly',
172179
escapeHtml: 'readonly',
173-
jsonData: 'readonly',
174180
ModalWorkflow: 'readonly',
175181
DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS: 'writable',
176182
EMBED_CHOOSER_MODAL_ONLOAD_HANDLERS: 'writable',
@@ -195,16 +201,10 @@ module.exports = {
195201
'consistent-return': 'off',
196202
'func-names': 'off',
197203
'id-length': 'off',
198-
'indent': 'off',
199-
'key-spacing': 'off',
200-
'new-cap': 'off',
201-
'newline-per-chained-call': 'off',
202204
'no-param-reassign': 'off',
203205
'no-underscore-dangle': 'off',
204206
'object-shorthand': 'off',
205207
'prefer-arrow-callback': 'off',
206-
'quote-props': 'off',
207-
'space-before-function-paren': 'off',
208208
'vars-on-top': 'off',
209209
},
210210
},

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ af942a27e41b47e257b6cd46c01a13cd381fed04
1010
01986cfa1702929352ac8b6d58ada6070da2c700
1111
# Initial black reformatting (#7967)
1212
d10f15e55806c6944827d801cd9c2d53f5da4186
13+
# Initial ruff reformatting (#11220)
14+
f8fc2c3a2052988f7b458e26f621e058d67a76c9

.github/CONTRIBUTING.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
1-
# Contributing to Wagtail
1+
# Contributing
22

33
Thank you for considering to help Wagtail.
44

55
We welcome all support, whether on bug reports, code, design, reviews, tests,
66
documentation, translations or just feature requests.
77

8-
## Using the issue tracker
8+
## Working on an issue
99

10-
The [issue tracker](https://github.com/wagtail/wagtail/issues) is
11-
the preferred channel for [bug reports](#bugs), [features requests](#features)
12-
and [submitting pull requests](#pull-requests). Please don't use the issue tracker
13-
for support - use [the 'wagtail' tag on Stack Overflow](https://stackoverflow.com/questions/tagged/wagtail) (preferred) or our [Wagtail support group](https://groups.google.com/forum/#!forum/wagtail).
10+
👉 If an issue isn’t being worked on by anyone, go for it! **No need to ask "please assign me this issue".** Add a comment to claim the issue once you’re ready to start.
1411

15-
## New code
12+
Please review the [contributing guidelines](https://docs.wagtail.org/en/latest/contributing/index.html).
13+
You might like to start by checking issues with the [good first issue](https://github.com/wagtail/wagtail/labels/good%20first%20issue) label.
1614

17-
Please review the
18-
[contributing guidelines](https://docs.wagtail.org/en/latest/contributing/index.html).
19-
You might like to start by checking issues with the
20-
[good first issue](https://github.com/wagtail/wagtail/labels/good%20first%20issue) label.
15+
## Reporting bugs
16+
17+
To report bugs, use our [issue tracker](https://github.com/wagtail/wagtail/issues).
18+
19+
## Feature requests
20+
21+
Use our [issue tracker](https://github.com/wagtail/wagtail/issues) for feature requests, or go the [Wagtail Slack](https://github.com/wagtail/wagtail/wiki/Slack) or [Discussions](https://github.com/wagtail/wagtail/discussions) if you want to discuss an idea before requesting it.
22+
23+
## Support
24+
25+
Please don't use the issue tracker for support - use [the 'wagtail' tag on Stack Overflow](https://stackoverflow.com/questions/tagged/wagtail) (preferred) or the [#support channel](https://github.com/wagtail/wagtail/wiki/Slack#support) on the [Wagtail Slack](https://github.com/wagtail/wagtail/wiki/Slack).
2126

2227
## Code reviews
2328

24-
We welcome code reviews from everyone. There's always a list of pull requests tagged ['Needs review'](https://github.com/wagtail/wagtail/pulls?q=is%3Apr+is%3Aopen+label%3A%22Needs+review%22).
29+
We welcome code reviews from everyone. There's always a list of pull requests tagged [status:Needs Review](https://github.com/wagtail/wagtail/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+label%3A%22status%3ANeeds+Review%22).
30+
31+
## Triaging issues
32+
33+
We welcome help with triaging issues and pull requests. You can help by:
34+
35+
- Adding more details or your own perspective to bug reports or feature requests.
36+
- Attempting to reproduce issues tagged [status:Unconfirmed](https://github.com/wagtail/wagtail/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Astatus%3AUnconfirmed) and sharing your findings.
37+
- Reviewing or otherwise offering your feedback on pull requests.
38+
39+
View our [issue tracking guidelines](https://docs.wagtail.org/en/latest/contributing/issue_tracking.html) for more information.
2540

2641
## Translations
2742

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
custom: ['https://wagtail.org/sponsor/']
2+
open_collective: wagtail

.github/ISSUE_TEMPLATE/BUG_REPORT.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,13 @@ Any other relevant information. For example, why do you consider this a bug and
3232
- Django version: Look in your requirements.txt, or run `pip show django | grep Version`.
3333
- Wagtail version: Look at the bottom of the Settings menu in the Wagtail admin, or run `pip show wagtail | grep Version:`.
3434
- Browser version: You can use https://www.whatsmybrowser.org/ to find this out.
35+
36+
### Working on this
37+
38+
<!--
39+
Do you have thoughts on skills needed?
40+
Are you keen to work on this yourself once the issue has been accepted?
41+
Please let us know here.
42+
-->
43+
44+
Anyone can contribute to this. View our [contributing guidelines](https://docs.wagtail.org/en/latest/contributing/index.html), add a comment to the issue once you’re ready to start.

.github/ISSUE_TEMPLATE/DOCUMENTATION.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,13 @@ assignees: ''
2929
<!--
3030
If you're suggesting a very specific change to the documentation, feel free to directly submit a pull request.
3131
-->
32+
33+
### Working on this
34+
35+
<!--
36+
Do you have thoughts on skills needed?
37+
Are you keen to work on this yourself once the issue has been accepted?
38+
Please let us know here.
39+
-->
40+
41+
Anyone can contribute to this. View our [contributing guidelines](https://docs.wagtail.org/en/latest/contributing/index.html), add a comment to the issue once you’re ready to start.

.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ assignees: ''
3939
-->
4040

4141
(Write your answer here.)
42+
43+
### Working on this
44+
45+
<!--
46+
Do you have thoughts on skills needed?
47+
Are you keen to work on this yourself once the issue has been accepted?
48+
Please let us know here.
49+
-->
50+
51+
Anyone can contribute to this. View our [contributing guidelines](https://docs.wagtail.org/en/latest/contributing/index.html), add a comment to the issue once you’re ready to start.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1 @@
1-
<!-- Thanks for contributing to Wagtail! 🎉 Please add a description below, explaining the purpose of this pull request - including the issue number of the issue you're fixing (if applicable). -->
2-
3-
Fixes #...
4-
5-
6-
7-
8-
9-
10-
11-
_Please check the following:_
12-
13-
- [ ] Do the tests still pass?[^1]
14-
- [ ] Does the code comply with the style guide?
15-
- [ ] Run `make lint` from the Wagtail root.
16-
- [ ] For Python changes: Have you added tests to cover the new/fixed behaviour?
17-
- [ ] For front-end changes: Did you test on all of Wagtail’s supported environments?[^2]
18-
- [ ] **Please list the exact browser and operating system versions you tested**:
19-
- [ ] **Please list which assistive technologies [^3] you tested**:
20-
- [ ] For new features: Has the documentation been updated accordingly?
21-
22-
**Please describe additional details for testing this change**.
23-
24-
[^1]: [Development Testing](https://docs.wagtail.org/en/latest/contributing/developing.html#testing)
25-
[^2]: [Browser and device support](https://docs.wagtail.org/en/latest/contributing/developing.html#browser-and-device-support)
26-
[^3]: [Accessibility Target](https://docs.wagtail.org/en/latest/contributing/developing.html#accessibility-targets)
1+
_Please describe the problem you're fixing here. Include the issue number, if applicable._

0 commit comments

Comments
 (0)