Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper text #418

Merged
merged 6 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Error message when list_items is broken
- Consistent labelling on import forms
- Fix class_name warning: RemovedInWagtail60Warning
- Helper texts for some ordered content sets
### Removed
- Locale field on exports
-->
Expand Down
73 changes: 73 additions & 0 deletions home/migrations/0090_alter_orderedcontentset_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Generated by Django 4.2.17 on 2025-02-17 07:41

from django.db import migrations
import wagtail.blocks
import wagtail.fields


class Migration(migrations.Migration):

dependencies = [
("home", "0089_alter_assessment_options"),
]

operations = [
migrations.AlterField(
model_name="orderedcontentset",
name="pages",
field=wagtail.fields.StreamField(
[
(
"pages",
wagtail.blocks.StructBlock(
[
("contentpage", wagtail.blocks.PageChooserBlock()),
(
"time",
wagtail.blocks.IntegerBlock(
help_text="When should this message be sent? Set the number of hours, days, months or year.",
min_value=0,
required=False,
),
),
(
"unit",
wagtail.blocks.ChoiceBlock(
choices=[
("minutes", "Minutes"),
("hours", "Hours"),
("days", "Days"),
("months", "Months"),
],
help_text="Choose the unit of time to use.",
required=False,
),
),
(
"before_or_after",
wagtail.blocks.ChoiceBlock(
choices=[
("after", "After"),
("before", "Before"),
],
help_text="Is it ‘before’ or ‘after’ the reference point for your timings, which is set in the contact field below.",
required=False,
),
),
(
"contact_field",
wagtail.blocks.CharBlock(
help_text="This is the reference point used to base the timing of message on. For example, edd (estimated date of birth) or dob (date of birth).",
required=False,
),
),
]
),
)
],
blank=True,
null=True,
use_json_field=True,
),
),
]
12 changes: 11 additions & 1 deletion home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,14 @@ def latest_draft_profile_fields(self):
blocks.StructBlock(
[
("contentpage", blocks.PageChooserBlock()),
("time", blocks.IntegerBlock(min_value=0, required=False)),
(
"time",
blocks.IntegerBlock(
min_value=0,
required=False,
help_text="When should this message be sent? Set the number of hours, days, months or year.",
),
),
(
"unit",
blocks.ChoiceBlock(
Expand All @@ -1217,6 +1224,7 @@ def latest_draft_profile_fields(self):
("days", "Days"),
("months", "Months"),
],
help_text="Choose the unit of time to use.",
required=False,
),
),
Expand All @@ -1227,12 +1235,14 @@ def latest_draft_profile_fields(self):
("after", "After"),
("before", "Before"),
],
help_text="Is it ‘before’ or ‘after’ the reference point for your timings, which is set in the contact field below.",
required=False,
),
),
(
"contact_field",
blocks.CharBlock(
help_text="This is the reference point used to base the timing of message on. For example, edd (estimated date of birth) or dob (date of birth).",
required=False,
),
),
Expand Down