Skip to content

Commit

Permalink
Merge branch 'wagtail:main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofjeziorny authored Sep 26, 2024
2 parents a00670c + a5c31f9 commit bfea29c
Show file tree
Hide file tree
Showing 3,744 changed files with 154,146 additions and 123,262 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
18 changes: 18 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100,
"safari": 15,
"firefox": 91
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}
33 changes: 21 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,37 @@ version: 2
jobs:
backend:
docker:
- image: cimg/python:3.8.11
- image: cimg/python:3.12
environment:
PIPENV_VENV_IN_PROJECT: true
steps:
- checkout
- restore_cache:
key: pipenv-v1-{{ checksum "setup.py" }}
key: pipenv-v2-{{ checksum "setup.py" }}
# Only install if .venv wasn’t cached.
- run: |
if [[ ! -e ".venv" ]]; then
pipenv install -e .[testing,docs]
fi
- save_cache:
key: pipenv-v1-{{ checksum "setup.py" }}
key: pipenv-v2-{{ checksum "setup.py" }}
paths:
- .venv
- run: pipenv run ruff check .
- run: pipenv run black --target-version py37 --check --diff .
- 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: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
- run:
name: Run tests
command: |
export PYTHONUNBUFFERED=1
WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT=1 pipenv run python -u runtests.py --parallel=2
frontend:
docker:
- image: cimg/node:18.12
- image: cimg/node:20.9
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -58,36 +62,40 @@ jobs:

ui_tests:
docker:
- image: cimg/python:3.8.11-browsers
- image: cimg/python:3.12-browsers
environment:
PIPENV_VENV_IN_PROJECT: true
DJANGO_SETTINGS_MODULE: wagtail.test.settings_ui
DJANGO_DEBUG: true
steps:
- checkout
- attach_workspace:
at: ~/project
- restore_cache:
key: pipenv-v1-{{ checksum "setup.py" }}
key: pipenv-v2-{{ checksum "setup.py" }}
# Only install if .venv wasn’t cached.
- run: |
if [[ ! -e ".venv" ]]; then
pipenv install -e .[testing]
fi
- save_cache:
key: pipenv-v1-{{ checksum "setup.py" }}
key: pipenv-v2-{{ checksum "setup.py" }}
paths:
- .venv
- restore_cache:
key: ui_tests-npm_integration-v1-{{ checksum "client/tests/integration/package-lock.json" }}
key: ui_tests-npm_integration-v2-{{ checksum "client/tests/integration/package-lock.json" }}
# Only install if node_modules wasn’t cached.
- run: |
if [[ ! -e "client/tests/integration/node_modules" ]]; then
npm --prefix ./client/tests/integration ci
fi
- save_cache:
key: ui_tests-npm_integration-v1-{{ checksum "client/tests/integration/package-lock.json" }}
key: ui_tests-npm_integration-v2-{{ checksum "client/tests/integration/package-lock.json" }}
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:
command: pipenv run ./wagtail/test/manage.py runserver 0:8000
Expand All @@ -106,13 +114,14 @@ jobs:
- run:
command: pipenv run ./wagtail/test/manage.py collectstatic --noinput
environment:
DJANGO_DEBUG: false
STATICFILES_STORAGE: manifest
- store_test_results:
path: ./reports/jest

nightly-build:
docker:
- image: cimg/python:3.8.11-node
- image: cimg/python:3.12-node
steps:
- checkout
- run: pip install --user wheel boto3
Expand Down
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# .coveragerc to control coverage.py
[run]
branch = True
concurrency = multiprocessing,thread

source = wagtail

Expand Down
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ indent_size = 2

[*.md]
trim_trailing_whitespace = false

# Make sure this file _doesn’t_ end with a final newline. It breaks rendering.
[wagtail/admin/templates/wagtailadmin/shared/icon.html]
insert_final_newline = false
32 changes: 16 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module.exports = {
extends: [
'@wagtail/eslint-config-wagtail',
'plugin:@typescript-eslint/recommended',
'plugin:storybook/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
Expand Down Expand Up @@ -44,7 +45,7 @@ module.exports = {
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.tsx'] }],
'no-underscore-dangle': [
'error',
{ allow: ['__REDUX_DEVTOOLS_EXTENSION__'] },
{ allow: ['__REDUX_DEVTOOLS_EXTENSION__', '_tippy'] },
],
// this rule can be confusing as it forces some non-intuitive code for variable assignment
'prefer-destructuring': 'off',
Expand All @@ -54,14 +55,21 @@ module.exports = {
'import/resolver': { node: { extensions: ['.js', '.ts', '.tsx'] } },
},
overrides: [
// Rules that needs to be adjusted for TypeScript only files
{
files: ['*.ts'],
rules: {
'@typescript-eslint/no-shadow': 'error',
'no-shadow': 'off',
},
},
// Rules that we are ignoring currently due to legacy code in React components only
{
files: ['client/src/components/**'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/interactive-supports-focus': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/role-supports-aria-props': 'off',
'no-restricted-syntax': 'off',
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
Expand Down Expand Up @@ -99,7 +107,7 @@ module.exports = {
},
},
{
selector: 'property',
selector: 'classProperty',
format: ['camelCase'],
custom: {
// Use Stimulus values where possible for internal state, avoid a generic state object as these are not reactive.
Expand Down Expand Up @@ -135,11 +143,14 @@ module.exports = {
],
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
'global-require': 'off',
'import/first': 'off',
'import/no-extraneous-dependencies': 'off',
'jsx-a11y/control-has-associated-label': 'off',
'no-new': 'off',
'no-unused-expressions': 'off',
'react/function-component-definition': 'off',
'react/jsx-props-no-spreading': 'off',
Expand All @@ -148,17 +159,14 @@ module.exports = {
// Files that use jquery via a global
{
files: [
'docs/_static/**',
'wagtail/contrib/modeladmin/static_src/wagtailmodeladmin/js/prepopulate.js',
'wagtail/contrib/search_promotions/static_src/wagtailsearchpromotions/js/query-chooser-modal.js',
'wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/includes/searchpromotions_formset.js',
'wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/queries/chooser_field.js',
'wagtail/documents/static_src/wagtaildocs/js/add-multiple.js',
'wagtail/embeds/static_src/wagtailembeds/js/embed-chooser-modal.js',
'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/search/static_src/wagtailsearch/js/query-chooser-modal.js',
'wagtail/search/templates/wagtailsearch/queries/chooser_field.js',
'wagtail/snippets/static_src/wagtailsnippets/js/snippet-multiple-select.js',
'wagtail/users/static_src/wagtailusers/js/group-form.js',
],
globals: { $: 'readonly', jQuery: 'readonly' },
Expand All @@ -168,9 +176,7 @@ module.exports = {
files: ['wagtail/**/**'],
globals: {
buildExpandingFormset: 'readonly',
cancelSpinner: 'readonly',
escapeHtml: 'readonly',
jsonData: 'readonly',
ModalWorkflow: 'readonly',
DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS: 'writable',
EMBED_CHOOSER_MODAL_ONLOAD_HANDLERS: 'writable',
Expand All @@ -195,16 +201,10 @@ module.exports = {
'consistent-return': 'off',
'func-names': 'off',
'id-length': 'off',
'indent': 'off',
'key-spacing': 'off',
'new-cap': 'off',
'newline-per-chained-call': 'off',
'no-param-reassign': 'off',
'no-underscore-dangle': 'off',
'object-shorthand': 'off',
'prefer-arrow-callback': 'off',
'quote-props': 'off',
'space-before-function-paren': 'off',
'vars-on-top': 'off',
},
},
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ af942a27e41b47e257b6cd46c01a13cd381fed04
01986cfa1702929352ac8b6d58ada6070da2c700
# Initial black reformatting (#7967)
d10f15e55806c6944827d801cd9c2d53f5da4186
# Initial ruff reformatting (#11220)
f8fc2c3a2052988f7b458e26f621e058d67a76c9
39 changes: 27 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
# Contributing to Wagtail
# Contributing

Thank you for considering to help Wagtail.

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

## Using the issue tracker
## Working on an issue

The [issue tracker](https://github.com/wagtail/wagtail/issues) is
the preferred channel for [bug reports](#bugs), [features requests](#features)
and [submitting pull requests](#pull-requests). Please don't use the issue tracker
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).
👉 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.

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

Please review the
[contributing guidelines](https://docs.wagtail.org/en/latest/contributing/index.html).
You might like to start by checking issues with the
[good first issue](https://github.com/wagtail/wagtail/labels/good%20first%20issue) label.
## Reporting bugs

To report bugs, use our [issue tracker](https://github.com/wagtail/wagtail/issues).

## Feature requests

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.

## Support

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).

## Code reviews

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).
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).

## Triaging issues

We welcome help with triaging issues and pull requests. You can help by:

- Adding more details or your own perspective to bug reports or feature requests.
- 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.
- Reviewing or otherwise offering your feedback on pull requests.

View our [issue tracking guidelines](https://docs.wagtail.org/en/latest/contributing/issue_tracking.html) for more information.

## Translations

Expand Down
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
custom: ['https://wagtail.org/sponsor/']
open_collective: wagtail
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ Any other relevant information. For example, why do you consider this a bug and
- Django version: Look in your requirements.txt, or run `pip show django | grep Version`.
- Wagtail version: Look at the bottom of the Settings menu in the Wagtail admin, or run `pip show wagtail | grep Version:`.
- Browser version: You can use https://www.whatsmybrowser.org/ to find this out.

### Working on this

<!--
Do you have thoughts on skills needed?
Are you keen to work on this yourself once the issue has been accepted?
Please let us know here.
-->

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.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ assignees: ''
<!--
If you're suggesting a very specific change to the documentation, feel free to directly submit a pull request.
-->

### Working on this

<!--
Do you have thoughts on skills needed?
Are you keen to work on this yourself once the issue has been accepted?
Please let us know here.
-->

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.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,13 @@ assignees: ''
-->

(Write your answer here.)

### Working on this

<!--
Do you have thoughts on skills needed?
Are you keen to work on this yourself once the issue has been accepted?
Please let us know here.
-->

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.
27 changes: 1 addition & 26 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,26 +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). -->

Fixes #...







_Please check the following:_

- [ ] Do the tests still pass?[^1]
- [ ] Does the code comply with the style guide?
- [ ] Run `make lint` from the Wagtail root.
- [ ] For Python changes: Have you added tests to cover the new/fixed behaviour?
- [ ] For front-end changes: Did you test on all of Wagtail’s supported environments?[^2]
- [ ] **Please list the exact browser and operating system versions you tested**:
- [ ] **Please list which assistive technologies [^3] you tested**:
- [ ] For new features: Has the documentation been updated accordingly?

**Please describe additional details for testing this change**.

[^1]: [Development Testing](https://docs.wagtail.org/en/latest/contributing/developing.html#testing)
[^2]: [Browser and device support](https://docs.wagtail.org/en/latest/contributing/developing.html#browser-and-device-support)
[^3]: [Accessibility Target](https://docs.wagtail.org/en/latest/contributing/developing.html#accessibility-targets)
_Please describe the problem you're fixing here. Include the issue number, if applicable._
Loading

0 comments on commit bfea29c

Please sign in to comment.