Skip to content

Commit b94cd46

Browse files
authored
v0.17 release prep (#264)
* Bump testing/linting dependency versions * Bump GHA action versions * Update chooser tabs code to use new tabs controller for Wagtail 7.1+ * Update CHANGELOG and bump version to 0.17
1 parent 4b32ed5 commit b94cd46

File tree

10 files changed

+45
-28
lines changed

10 files changed

+45
-28
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
pypi.org:443
2323
api.github.com:443
2424
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v5
2626
with:
2727
persist-credentials: false
2828
fetch-depth: 0
@@ -55,7 +55,7 @@ jobs:
5555
# Mandatory for trusted publishing
5656
id-token: write
5757
steps:
58-
- uses: actions/download-artifact@v4
58+
- uses: actions/download-artifact@v5
5959

6060
- name: 🚀 Publish package distributions to PyPI
6161
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/ruff.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020
with:
2121
persist-credentials: false
2222

23-
- run: python -Im pip install --user ruff==0.8.2
23+
- run: python -Im pip install --user ruff==0.12.9
2424

2525
- name: Run ruff
2626
working-directory: ./src

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
github.com:443
4343
pypi.org:443
4444
api.github.com:443
45-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v5
4646
with:
4747
persist-credentials: false
4848
- name: 🐍 Set up Python ${{ matrix.python-version }}
@@ -85,7 +85,7 @@ jobs:
8585
github.com:443
8686
pypi.org:443
8787
api.github.com:443
88-
- uses: actions/checkout@v4
88+
- uses: actions/checkout@v5
8989
with:
9090
persist-credentials: false
9191
fetch-depth: 0
@@ -97,7 +97,7 @@ jobs:
9797
- run: python -Im pip install --upgrade coverage
9898

9999
- name: Download coverage data
100-
uses: actions/download-artifact@v4
100+
uses: actions/download-artifact@v5
101101
with:
102102
pattern: coverage-data-*
103103
merge-multiple: true

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ repos:
1919
- id: end-of-file-fixer
2020
- id: trailing-whitespace
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: 'v0.8.2' # keep in sync with .github/workflows/ruff.yml
22+
rev: 'v0.12.9' # keep in sync with .github/workflows/ruff.yml
2323
hooks:
24-
- id: ruff
25-
args: [--fix, --exit-non-zero-on-fix]
24+
- id: ruff-check
25+
args: [--fix]
2626
- id: ruff-format

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,21 @@
22

33
## [Unreleased]
44

5+
## [0.17.0] - 2025-08-20
6+
57
### Added
68

79
- Support for Wagtail 7.1 ([#262](https://github.com/torchbox/wagtailmedia/pull/262)) @damwaingames
810

11+
### Fixed
12+
13+
- Pagination when using typed choosers ([#260](https://github.com/torchbox/wagtailmedia/pull/260)) @WilliamHenryTanza
14+
15+
### Changed
16+
17+
- Use the new Tabs controller with Wagtail 7.1 @zerolab
18+
This no longer includes the modified `tabs.js` as a workaround.
19+
920
## [0.16.0] - 2025-05-06
1021

1122
### Added
@@ -329,6 +340,7 @@ Initial release
329340
---
330341

331342
[unreleased]: https://github.com/torchbox/wagtailmedia/compare/v0.16.0...HEAD
343+
[0.17.0]: https://github.com/torchbox/wagtailmedia/compare/v0.16.0...v0.17.0
332344
[0.16.0]: https://github.com/torchbox/wagtailmedia/compare/v0.15.2...v0.16.0
333345
[0.15.2]: https://github.com/torchbox/wagtailmedia/compare/v0.15.1...v0.15.2
334346
[0.15.1]: https://github.com/torchbox/wagtailmedia/compare/v0.15.0...v0.15.1

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ dependencies = [
3333

3434
[project.optional-dependencies]
3535
testing = [
36-
"coverage>=7.8.0",
36+
"coverage>=7.10.0",
37+
"tox>=4.28.4",
3738
]
3839
linting = [
39-
"pre-commit>=4.2.0",
40+
"pre-commit>=4.3.0",
4041
]
4142

4243
[project.urls]

src/wagtailmedia/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.16.0"
1+
__version__ = "0.17.0"

src/wagtailmedia/templates/wagtailmedia/chooser/chooser.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% load i18n wagtailadmin_tags %}
22
{% include "wagtailadmin/shared/header.html" with title=title icon=icon merged=1 %}
33

4-
{# TODO: drop data-wmtabs and the tabs.js include when a better tabs framework is in place #}
5-
{# See https://github.com/wagtail/wagtail/issues/8408. #}
6-
<div class="w-tabs wagtailmedia-tabs" data-tabs data-tabs-animate data-tabs-disable-url data-wm-tabs>
4+
{# TODO: drop data-wmtabs and the tabs.js include once we drop support for Wagtail < 7.1 #}
5+
<div class="w-tabs wagtailmedia-tabs"
6+
data-controller="w-tabs" data-w-tabs-active-class="animate-in"
7+
data-tabs data-tabs-animate data-tabs-disable-url data-wm-tabs>
78
{% if uploadforms %}
89
{# Both auth and video forms are powered by the same media form, so use one of them #}
910
{% if uploadforms.video %}
@@ -16,7 +17,10 @@
1617

1718
<div class="w-tabs__wrapper w-overflow-hidden">
1819
{# Using nice-padding and full width class until the modal header is restyled #}
19-
<div role="tablist" class="w-tabs__list w-w-full nice-padding">
20+
<div role="tablist"
21+
class="w-tabs__list w-w-full nice-padding"
22+
data-action="keydown.right->w-tabs#selectNext keydown.left->w-tabs#selectPrevious keydown.home->w-tabs#selectFirst keydown.end->w-tabs#selectLast"
23+
>
2024
{% trans "Search" as search_text %}
2125
{% include 'wagtailadmin/shared/tabs/tab_nav_link.html' with tab_id='search' title=search_text %}
2226
{% if uploadforms.audio %}
@@ -40,7 +44,7 @@
4044
{% endif %}
4145

4246
<div class="tab-content">
43-
<section id="tab-search" class="w-tabs__panel" role="tabpanel" aria-labelledby="tab-label-search">
47+
<section id="tab-search" class="w-tabs__panel" role="tabpanel" data-w-tabs-target="panel" aria-labelledby="tab-label-search">
4448
<form action="{{ chooser_url }}" method="GET" role="search" class="media-search search-bar" novalidate data-chooser-modal-search>
4549
<ul class="fields">
4650
{% for field in searchform %}
@@ -66,7 +70,7 @@ <h3>{% trans 'Popular tags' %}</h3>
6670
</section>
6771
{% if uploadforms %}
6872
{% for form_type, uploadform in uploadforms.items %}
69-
<section id="tab-upload-{{ form_type }}" class="w-tabs__panel" role="tabpanel" aria-labelledby="tab-label-upload-{{ form_type }}" hidden>
73+
<section id="tab-upload-{{ form_type }}" class="w-tabs__panel" role="tabpanel" data-w-tabs-target="panel" aria-labelledby="tab-label-upload-{{ form_type }}" hidden>
7074
{% include "wagtailadmin/shared/non_field_errors.html" with form=uploadform %}
7175
<form class="media-upload" action="{% url 'wagtailmedia:chooser_upload' form_type %}" method="POST" enctype="multipart/form-data" novalidate>
7276
{% csrf_token %}

src/wagtailmedia/widgets.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ def render_js_init(self, id_, name, value):
4545

4646
@property
4747
def media(self):
48-
return forms.Media(
49-
js=[
50-
"wagtailmedia/js/tabs.js",
51-
"wagtailmedia/js/media-chooser-modal.js",
52-
"wagtailmedia/js/media-chooser.js",
53-
]
54-
)
48+
tab_js = ["wagtailmedia/js/tabs.js"] if WAGTAIL_VERSION >= (7, 1) else []
49+
js = [
50+
*tab_js,
51+
"wagtailmedia/js/media-chooser-modal.js",
52+
"wagtailmedia/js/media-chooser.js",
53+
]
54+
return forms.Media(js=js)
5555

5656

5757
class AdminAudioChooser(AdminMediaChooser):

tests/test_compare.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def test_has_changed(self):
7575
diff = comparison.htmldiff()
7676
self.assertHTMLEqual(
7777
diff,
78-
f'<div class="comparison--media deletion">{ format_audio_html(self.audio_a) }</div>'
79-
f'<div class="comparison--media addition">{ format_audio_html(self.audio_b) }</div>',
78+
f'<div class="comparison--media deletion">{format_audio_html(self.audio_a)}</div>'
79+
f'<div class="comparison--media addition">{format_audio_html(self.audio_b)}</div>',
8080
)
8181
self.assertIsInstance(diff, SafeString)
8282

0 commit comments

Comments
 (0)