Skip to content

Commit 381ed3b

Browse files
authored
Merge pull request #10 from torchbox/feature/remove-revision-dropdown
Remove revision dropdown on draft sharing link edit page
2 parents 0c3dc96 + 4e004f2 commit 381ed3b

File tree

4 files changed

+80
-14
lines changed

4 files changed

+80
-14
lines changed

CHANGELOG.md

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

33
## [Unreleased]
44

5+
### Changed
6+
7+
- Remove the ability to change which revision is shared on the draft sharing link edit page. (@mixxorz)
8+
59
---
610

711
## [0.2.0] - 2025-03-028

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "wagtaildraftsharing"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
description = "Share wagtail drafts with private URLs."
55
readme = "README.md"
66
requires-python = ">=3.9"

tox.ini

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,52 @@
11
[tox]
22
skipsdist=True
3-
envlist=
3+
4+
# Compatibility summary:
5+
#
6+
# Python vs Django
7+
# ----------------
8+
# Python 3.9 → Django 4.2 only
9+
# Python 3.10+ → Django 4.2, 5.1, 5.2
10+
#
11+
# Django vs Wagtail
12+
# -----------------
13+
# Django 4.2 → Wagtail 5.2, 6.3, 6.4, 7.0
14+
# Django 5.1 → Wagtail 6.3, 6.4, 7.0
15+
# Django 5.2 → Wagtail 6.3, 7.0
16+
17+
envlist =
418
lint,
5-
python{3.9,3.10,3.11,3.12}-django{3.2,4.2,5.1}-wagtail{5.1,5.2,6.1,6.2},
19+
python3.9-django4.2-wagtail5.2,
20+
python3.9-django4.2-wagtail6.3,
21+
python3.9-django4.2-wagtail6.4,
22+
python3.9-django4.2-wagtail7.0,
23+
python3.10-django4.2-wagtail5.2,
24+
python3.10-django4.2-wagtail6.3,
25+
python3.10-django4.2-wagtail6.4,
26+
python3.10-django4.2-wagtail7.0,
27+
python3.10-django5.1-wagtail6.3,
28+
python3.10-django5.1-wagtail6.4,
29+
python3.10-django5.1-wagtail7.0,
30+
python3.10-django5.2-wagtail6.3,
31+
python3.10-django5.2-wagtail7.0,
32+
python3.11-django4.2-wagtail5.2,
33+
python3.11-django4.2-wagtail6.3,
34+
python3.11-django4.2-wagtail6.4,
35+
python3.11-django4.2-wagtail7.0,
36+
python3.11-django5.1-wagtail6.3,
37+
python3.11-django5.1-wagtail6.4,
38+
python3.11-django5.1-wagtail7.0,
39+
python3.11-django5.2-wagtail6.3,
40+
python3.11-django5.2-wagtail7.0,
41+
python3.12-django4.2-wagtail5.2,
42+
python3.12-django4.2-wagtail6.3,
43+
python3.12-django4.2-wagtail6.4,
44+
python3.12-django4.2-wagtail7.0,
45+
python3.12-django5.1-wagtail6.3,
46+
python3.12-django5.1-wagtail6.4,
47+
python3.12-django5.1-wagtail7.0,
48+
python3.12-django5.2-wagtail6.3,
49+
python3.12-django5.2-wagtail7.0,
650
coverage
751

852
[testenv]
@@ -20,24 +64,23 @@ basepython=
2064
python3.12: python3.12
2165

2266
deps=
23-
wagtail5.1: wagtail>=5.1,<5.2
67+
django4.2: django>=4.2,<4.3
68+
django5.1: django>=5.1,<5.2
69+
django5.2: django>=5.2,<5.3
2470
wagtail5.2: wagtail>=5.2,<5.3
25-
wagtail6.1: wagtail>=6.1,<6.2
26-
wagtail6.2: wagtail>=6.2,<6.3
27-
28-
[testenv:python3.12-django3.2-wagtail6.1]
29-
# This permutation is not a valid install, but let's tolerate it
30-
allowlist_externals=python # take the system python to just get tox running for this combo
71+
wagtail6.3: wagtail>=6.3,<6.4
72+
wagtail6.4: wagtail>=6.4,<6.5
73+
wagtail7.0: wagtail>=7.0,<7.1
3174

3275
[testenv:lint]
33-
basepython=python3.11
76+
basepython=python3.12
3477
deps=
3578
ruff
3679
commands=
3780
ruff check wagtaildraftsharing testmanage.py
3881

3982
[testenv:coverage]
40-
basepython=python3.11
83+
basepython=python3.12
4184
deps=
4285
coverage[toml]
4386
wagtail-factories
@@ -48,7 +91,7 @@ commands=
4891
coverage xml
4992

5093
[testenv:interactive]
51-
basepython=python3.11
94+
basepython=python3.12
5295
deps=
5396
wagtail>=5.2,<5.3
5497

@@ -70,4 +113,4 @@ python =
70113
3.9: python3.9
71114
3.10: python3.10
72115
3.11: python3.11
73-
3.12: python3.12
116+
3.12: python3.12, lint, coverage

wagtaildraftsharing/snippets.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from wagtail.admin.panels import FieldPanel, ObjectList
12
from wagtail.snippets.views.snippets import SnippetViewSet
23

34
from wagtaildraftsharing.models import WagtaildraftsharingLink
@@ -15,6 +16,24 @@ class WagtaildraftsharingLinkSnippetViewSet(SnippetViewSet):
1516
list_display = ("__str__", "is_active", "created_by", "share_url")
1617
list_filter = ("is_active",)
1718

19+
edit_handler = ObjectList([
20+
FieldPanel("revision", read_only=True),
21+
FieldPanel(
22+
"is_active",
23+
help_text=(
24+
"When false, the sharing link will not be viewable."
25+
)
26+
),
27+
FieldPanel(
28+
"active_until",
29+
help_text=(
30+
"The link will not be viewable after this date. "
31+
"Leave blank if the link should never expire."
32+
)
33+
),
34+
])
35+
36+
1837
def get_queryset(self, request):
1938
return WagtaildraftsharingLink.objects.all().prefetch_related(
2039
"revision", "revision__content_object", "created_by"

0 commit comments

Comments
 (0)