Skip to content

Commit

Permalink
Merge branch 'wagtail:main' into 5950
Browse files Browse the repository at this point in the history
  • Loading branch information
TopDevPros committed Sep 22, 2023
2 parents e3582c7 + e6e29b5 commit 41a5859
Show file tree
Hide file tree
Showing 58 changed files with 1,951 additions and 1,355 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ repos:
args: ['--target-version', 'py38']

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.0.272'
rev: 'v0.0.290'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.1
rev: v3.0.3
hooks:
- id: prettier
types_or: [css, scss, javascript, ts, tsx, json, yaml]
additional_dependencies:
# Keep in sync with package.json
- prettier@3.0.1
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.8.0
rev: v8.49.0
hooks:
- id: eslint
types: [file]
Expand All @@ -37,7 +37,7 @@ repos:
- '@typescript-eslint/parser@6.2.1'
- '@wagtail/eslint-config-wagtail@0.4.0'
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v14.2.0
rev: v15.10.3
hooks:
- id: stylelint
files: \.scss$
Expand All @@ -51,11 +51,11 @@ repos:
- id: curlylint
args: ['--parse-only']
- repo: https://github.com/rtts/djhtml
rev: v1.5.2
rev: 3.0.6
hooks:
- id: djhtml
- repo: https://github.com/returntocorp/semgrep
rev: v1.3.0
rev: v1.40.0
hooks:
- id: semgrep
args: ['--config', '.semgrep.yml', '--error']
6 changes: 6 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ Changelog
* Add breadcrumbs to generic model views (Sage Abdullah)
* Support passing extra context variables via the `{% component %}` tag (Matt Westcott)
* Allow subclasses of `PagesAPIViewSet` override default Page model via the `model` attribute (Neeraj Yetheendran, Herbert Poul)
* Allow `ModelViewSet` to be used with models that have non-integer primary keys (Sage Abdullah)
* Fix: Ensure that StreamField's `FieldBlock`s correctly set the `required` and `aria-describedby` attributes (Storm Heg)
* Fix: Avoid an error when the moderation panel (admin dashboard) contains both snippets and private pages (Matt Westcott)
* Fix: When deleting collections, ensure the collection name is correctly shown in the success message (LB (Ben) Johnston)
* Fix: Filter out comments on Page editing counts that do not correspond to a valid field / block path on the page such as when a field has been removed (Matt Westcott)
* Fix: Allow `PublishMenuItem` to more easily support overriding its label via `construct_page_action_menu` (Sébastien Corbin)
* Fix: Allow locale selection when creating a page at the root level (Sage Abdullah)
* Fix: Ensure the admin login template correctly displays all `non_fields_errors` for any custom form validation (Sébastien Corbin)
* Docs: Document `WAGTAILADMIN_BASE_URL` on "Integrating Wagtail into a Django project" page (Shreshth Srivastava)
* Docs: Replace incorrect screenshot for authors listing on tutorial (Shreshth Srivastava)
* Docs: Add documentation for building non-model-based choosers using the _queryish_ library (Matt Westcott)
Expand All @@ -61,6 +64,9 @@ Changelog
* Maintenance: Migrate all other `data-tippy` HTML attribute usage to the Stimulus data-*-value attributes for w-tooltip & w-dropdown (Subhajit Ghosh, LB (Ben) Johnston)
* Maintenance: Replace `@total_ordering` usage with comparison functions implementation (Virag Jain)
* Maintenance: Replace `<script type="text/django-form-template"><-/script>` template approach with HTML `template` elements in InlinePanel and expanding formset (Mansi Gundre, Subhajit Ghosh, LB (Ben) Johnston)
* Maintenance: Refactor side panels code for better reuse in pages and snippets (Sage Abdullah)
* Maintenance: Deprecate legacy URL redirects in `ModelViewSet` and `SnippetViewSet` (Sage Abdullah)
* Maintenance: Simplify code for registering page listing action buttons (Matt Westcott)


5.1.2 (xx.xx.20xx) - IN DEVELOPMENT
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<h1 align="center">
<img width="343" src=".github/wagtail.svg#gh-light-mode-only" alt="Wagtail">
<img width="343" src=".github/wagtail-inverse.svg#gh-dark-mode-only" alt="Wagtail">
<picture>
<source media="(prefers-color-scheme: light)" srcset=".github/wagtail.svg">
<source media="(prefers-color-scheme: dark)" srcset=".github/wagtail-inverse.svg">
<img width="343" src=".github/wagtail.svg" alt="Wagtail">
</picture>
</h1>
<p align="center">
<br>
Expand Down
1 change: 0 additions & 1 deletion client/scss/components/_bulk_actions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
.listing:not(.full-width) {
thead th.bulk-actions-filter-checkbox,
td.bulk-action-checkbox-cell {
padding: 0;
width: 50px;
text-align: center;

Expand Down
2 changes: 1 addition & 1 deletion client/scss/components/_dropdown.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.w-dropdown__toggle {
@apply w-p-2 w-text-text-label w-bg-transparent;
@apply w-px-2 w-text-text-label w-bg-transparent;
}

.w-dropdown__toggle--icon {
Expand Down
47 changes: 22 additions & 25 deletions client/scss/components/_listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ul.listing {

ul {
list-style-type: none;
margin: 0;
padding-inline-start: 0;
}

Expand Down Expand Up @@ -37,6 +38,15 @@ ul.listing {
padding: 0.6em 1em;
}

td {
vertical-align: top;
}

td.title {
padding: 1em;
line-height: 2em;
}

thead {
font-size: 1.1em;
color: theme('colors.text-context');
Expand Down Expand Up @@ -106,11 +116,6 @@ ul.listing {
border: 0;
}

&.align-top td,
td.align-top {
vertical-align: top;
}

&.chooser {
tbody .parent-page {
font-size: 1.15em;
Expand Down Expand Up @@ -207,7 +212,9 @@ ul.listing {
.title-wrapper,
h2 {
@apply w-label-1;
display: inline;
margin: 0;
vertical-align: middle;

a {
color: inherit;
Expand All @@ -219,13 +226,17 @@ ul.listing {
}
}
}

.icon.initial {
margin: 3px 0.3em 0 0;
vertical-align: top;
}
}

.actions {
@include clearfix();
margin-top: 0.8em;
margin-bottom: -0.5em;
float: right;
font-size: 0.8rem;
margin: 0;

a {
text-decoration: none;
Expand All @@ -234,9 +245,7 @@ ul.listing {
> li {
float: left;
padding: 0 0.5em 0 0;
margin: 0 0 0.5em;

// line-height: 1em;
vertical-align: middle;
}
}

Expand Down Expand Up @@ -280,7 +289,7 @@ ul.listing {

a {
display: block;
padding: 2em 0;
padding: 0;
}
}

Expand All @@ -299,6 +308,7 @@ ul.listing {
color: theme('colors.text-button-outline-default');
display: block;
text-align: center;
line-height: 3rem;

.icon {
width: 1.5rem;
Expand Down Expand Up @@ -558,19 +568,6 @@ table.listing {
}
}

.actions {
visibility: hidden;
}

.index .actions {
visibility: visible;
}

td:hover .actions,
td:focus-within .actions {
visibility: visible;
}

.bulk-action-checkbox {
opacity: 0;

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced_topics/images/renditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_images_uploaded_by_user(user):
The above can be modified slightly to prefetch the renditions of the images returned:

```python
def get_images_uploaded_by_user(user)::
def get_images_uploaded_by_user(user):
return ImageModel.objects.filter(uploaded_by_user=user).prefetch_renditions()
```

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Called when Wagtail needs to find out what objects exist in a collection, if any

Registers a new settings panel class to add to the "Account" view in the admin.

This hook can be added to a sub-class of `BaseSettingsPanel`. For example:
This hook can be added to a subclass of `BaseSettingsPanel`. For example:

```python
from wagtail.admin.views.account import BaseSettingsPanel
Expand Down Expand Up @@ -1327,7 +1327,7 @@ Hooks for registering and customising bulk actions. See [](custom_bulk_actions)

Registers a new bulk action to add to the list of bulk actions in the explorer

This hook must be registered with a sub-class of `BulkAction` . For example:
This hook must be registered with a subclass of `BulkAction` . For example:

```python
from wagtail.admin.views.bulk_action import BulkAction
Expand Down
20 changes: 20 additions & 0 deletions docs/releases/5.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ depth: 1
* Add breadcrumbs to generic model views (Sage Abdullah)
* Support passing extra context variables via the `{% component %}` tag (Matt Westcott)
* Allow subclasses of `PagesAPIViewSet` override default Page model via the `model` attribute (Neeraj Yetheendran, Herbert Poul)
* Allow `ModelViewSet` to be used with models that have non-integer primary keys (Sage Abdullah)

### Bug fixes

Expand All @@ -50,6 +51,8 @@ depth: 1
* When deleting collections, ensure the collection name is correctly shown in the success message (LB (Ben) Johnston)
* Filter out comments on Page editing counts that do not correspond to a valid field / block path on the page such as when a field has been removed (Matt Westcott)
* Allow `PublishMenuItem` to more easily support overriding its label via `construct_page_action_menu` (Sébastien Corbin)
* Allow locale selection when creating a page at the root level (Sage Abdullah)
* Ensure the admin login template correctly displays all `non_fields_errors` for any custom form validation (Sébastien Corbin)

### Documentation

Expand Down Expand Up @@ -82,6 +85,9 @@ depth: 1
* Migrate all other `data-tippy` HTML attribute usage to the Stimulus data-*-value attributes for w-tooltip & w-dropdown (Subhajit Ghosh, LB (Ben) Johnston)
* Replace `@total_ordering` usage with comparison functions implementation (Virag Jain)
* Replace `<script type="text/django-form-template"><-/script>` template approach with HTML `template` elements in InlinePanel and expanding formset (Mansi Gundre, Subhajit Ghosh, LB (Ben) Johnston)
* Refactor side panels code for better reuse in pages and snippets (Sage Abdullah)
* Deprecate legacy URL redirects in `ModelViewSet` and `SnippetViewSet` (Sage Abdullah)
* Simplify code for registering page listing action buttons (Matt Westcott)


## Upgrade considerations - changes affecting all projects
Expand All @@ -96,6 +102,20 @@ Wagtail now uses the Willow feature of providing the image MIME type, which uses

## Upgrade considerations - changes affecting Wagtail customisations

### Edit and delete URLs in `ModelViewSet` changed to allow non-integer primary keys

To accommodate models with non-integer primary keys, the URL patterns for the edit and delete views in {class}`~wagtail.admin.viewsets.model.ModelViewSet` have been changed.

Relative to the viewset's {attr}`~wagtail.admin.viewsets.base.ViewSet.url_prefix`, the following changes have been made:
- The edit URL pattern has been changed from `<int:pk>/` to `edit/<str:pk>/`
- The delete URL pattern has been changed from `<int:pk>/delete/` to `delete/<str:pk>/`

If you use {func}`~django.urls.reverse` with {meth}`~wagtail.admin.viewsets.base.ViewSet.get_url_name` to generate the URLs for these views, no changes are needed. However, if you have hard-coded these URLs in your code, you will need to update them to match the new patterns.

Redirects for the legacy URLs are in place for backwards compatibility, but will be removed in a future release.

The URLs for snippets underwent similar changes in Wagtail 2.14. The redirects for the legacy URLs in {class}`~wagtail.snippets.views.snippets.SnippetViewSet` have now been marked for removal in a future release.

### `ModelViewSet` automatically registers the model to the reference index

Models that are registered with a `ModelViewSet` now have reference index tracking enabled by default. This means that you no longer need to call `ReferenceIndex.register_model()` in your app's `ready()` method for such models. If this is undesired, you can disable it by setting {attr}`~wagtail.admin.viewsets.model.ModelViewSet.add_to_reference_index` to `False` on the `ModelViewSet` subclass. For more details, see [](managing_the_reference_index).
Expand Down

0 comments on commit 41a5859

Please sign in to comment.