From e0ae4c6d7cffbbaf726cb33f942a3f47ccaa9908 Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Thu, 20 Feb 2025 10:34:03 +0000 Subject: [PATCH 01/10] feature/CDD-2285: Add new subtitle to chart and ChartWithHeadlineAndTrendCard also updated the helptexts to give the user information on where the content will be shown --- cms/dynamic_content/cards.py | 16 ++++++++++++---- cms/dynamic_content/help_texts.py | 6 +++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cms/dynamic_content/cards.py b/cms/dynamic_content/cards.py index 1586fc680..32eaa5b95 100644 --- a/cms/dynamic_content/cards.py +++ b/cms/dynamic_content/cards.py @@ -54,7 +54,8 @@ def get_alerts(cls) -> tuple[tuple[str, str]]: class WeatherHealthAlertsCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.TextBlock(required=True, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.TextBlock( + required=True, help_text=help_texts.SUB_TITLE_FIELD) alert_type = blocks.ChoiceBlock( required=True, choices=WHAlerts.get_alerts, @@ -80,7 +81,10 @@ class Meta: class ChartWithHeadlineAndTrendCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - body = blocks.TextBlock(required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) + sub_title = blocks.TextBlock( + required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD) + body = blocks.TextBlock( + required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -132,7 +136,8 @@ class Meta: class SimplifiedChartWithLink(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.CharBlock(required=False, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.CharBlock( + required=False, help_text=help_texts.SUB_TITLE_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -187,7 +192,10 @@ class Meta: class ChartCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - body = blocks.TextBlock(required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) + sub_title = blocks.TextBlock( + required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD) + body = blocks.TextBlock( + required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, diff --git a/cms/dynamic_content/help_texts.py b/cms/dynamic_content/help_texts.py index 9436dd810..e8ea23457 100644 --- a/cms/dynamic_content/help_texts.py +++ b/cms/dynamic_content/help_texts.py @@ -179,7 +179,11 @@ """ OPTIONAL_BODY_FIELD: str = """ -An optional body of text to accompany this block. +An optional body of text to accompany this block. This text will be displayed in the about content of the chart. +""" + +OPTIONAL_CHART_SUBTITLE_FIELD: str = """ +An optional body of text to accompany this block. This text will be displayed below the chart title. """ REQUIRED_BODY_FIELD: str = """ From 2b66c6a225bc05b3b638b3b75983c7af9bdefad3 Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Thu, 20 Feb 2025 11:46:59 +0000 Subject: [PATCH 02/10] feature/CDD-2285: update for linting --- cms/dynamic_content/cards.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cms/dynamic_content/cards.py b/cms/dynamic_content/cards.py index 32eaa5b95..974df8b94 100644 --- a/cms/dynamic_content/cards.py +++ b/cms/dynamic_content/cards.py @@ -54,8 +54,7 @@ def get_alerts(cls) -> tuple[tuple[str, str]]: class WeatherHealthAlertsCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.TextBlock( - required=True, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.TextBlock(required=True, help_text=help_texts.SUB_TITLE_FIELD) alert_type = blocks.ChoiceBlock( required=True, choices=WHAlerts.get_alerts, @@ -82,9 +81,9 @@ class Meta: class ChartWithHeadlineAndTrendCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) sub_title = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD) - body = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) + required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD + ) + body = blocks.TextBlock(required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -136,8 +135,7 @@ class Meta: class SimplifiedChartWithLink(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.CharBlock( - required=False, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.CharBlock(required=False, help_text=help_texts.SUB_TITLE_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -193,9 +191,9 @@ class Meta: class ChartCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) sub_title = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD) - body = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) + required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD + ) + body = blocks.TextBlock(required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, From 06bbaf4906a3b2edcc1ebf60d2853163d29ab78b Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Thu, 20 Feb 2025 14:26:09 +0000 Subject: [PATCH 03/10] feature/CDD-2285: update to add label --- cms/dynamic_content/cards.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cms/dynamic_content/cards.py b/cms/dynamic_content/cards.py index 974df8b94..f08212982 100644 --- a/cms/dynamic_content/cards.py +++ b/cms/dynamic_content/cards.py @@ -54,7 +54,8 @@ def get_alerts(cls) -> tuple[tuple[str, str]]: class WeatherHealthAlertsCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.TextBlock(required=True, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.TextBlock( + required=True, help_text=help_texts.SUB_TITLE_FIELD) alert_type = blocks.ChoiceBlock( required=True, choices=WHAlerts.get_alerts, @@ -83,7 +84,11 @@ class ChartWithHeadlineAndTrendCard(blocks.StructBlock): sub_title = blocks.TextBlock( required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD ) - body = blocks.TextBlock(required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) + body = blocks.TextBlock( + required=False, + help_text=help_texts.OPTIONAL_BODY_FIELD, + label="About" + ) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -135,7 +140,8 @@ class Meta: class SimplifiedChartWithLink(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.CharBlock(required=False, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.CharBlock( + required=False, help_text=help_texts.SUB_TITLE_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -193,7 +199,8 @@ class ChartCard(blocks.StructBlock): sub_title = blocks.TextBlock( required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD ) - body = blocks.TextBlock(required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) + action = blocks.TextBlock( + required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, From 6f088e3ba79feffc5bfd06f8d55cccfb1f7daf1b Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Thu, 20 Feb 2025 14:32:36 +0000 Subject: [PATCH 04/10] task/CDD-2285: linting --- cms/dynamic_content/cards.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/cms/dynamic_content/cards.py b/cms/dynamic_content/cards.py index f08212982..c77ea1b8e 100644 --- a/cms/dynamic_content/cards.py +++ b/cms/dynamic_content/cards.py @@ -54,8 +54,7 @@ def get_alerts(cls) -> tuple[tuple[str, str]]: class WeatherHealthAlertsCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.TextBlock( - required=True, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.TextBlock(required=True, help_text=help_texts.SUB_TITLE_FIELD) alert_type = blocks.ChoiceBlock( required=True, choices=WHAlerts.get_alerts, @@ -85,9 +84,7 @@ class ChartWithHeadlineAndTrendCard(blocks.StructBlock): required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD ) body = blocks.TextBlock( - required=False, - help_text=help_texts.OPTIONAL_BODY_FIELD, - label="About" + required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="About" ) tag_manager_event_id = blocks.CharBlock( required=False, @@ -140,8 +137,7 @@ class Meta: class SimplifiedChartWithLink(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.CharBlock( - required=False, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.CharBlock(required=False, help_text=help_texts.SUB_TITLE_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -199,8 +195,7 @@ class ChartCard(blocks.StructBlock): sub_title = blocks.TextBlock( required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD ) - action = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) + action = blocks.TextBlock(required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, From 8efed6cbdaafa33206a6d0b09913ce14808c5c86 Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Thu, 20 Feb 2025 14:40:53 +0000 Subject: [PATCH 05/10] task/CDD-2285: fix typo --- cms/dynamic_content/cards.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cms/dynamic_content/cards.py b/cms/dynamic_content/cards.py index c77ea1b8e..b0e3bf70f 100644 --- a/cms/dynamic_content/cards.py +++ b/cms/dynamic_content/cards.py @@ -195,7 +195,9 @@ class ChartCard(blocks.StructBlock): sub_title = blocks.TextBlock( required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD ) - action = blocks.TextBlock(required=False, help_text=help_texts.OPTIONAL_BODY_FIELD) + body = blocks.TextBlock( + required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="About" + ) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, From 28e5258ec1a2b79834ea0eae927469c3aa440432 Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Thu, 20 Feb 2025 14:51:05 +0000 Subject: [PATCH 06/10] task/CDD-2285: add a default value of for empty sub-titles --- cms/dynamic_content/cards.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cms/dynamic_content/cards.py b/cms/dynamic_content/cards.py index b0e3bf70f..cf18aee74 100644 --- a/cms/dynamic_content/cards.py +++ b/cms/dynamic_content/cards.py @@ -54,7 +54,8 @@ def get_alerts(cls) -> tuple[tuple[str, str]]: class WeatherHealthAlertsCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.TextBlock(required=True, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.TextBlock( + required=True, help_text=help_texts.SUB_TITLE_FIELD) alert_type = blocks.ChoiceBlock( required=True, choices=WHAlerts.get_alerts, @@ -137,7 +138,8 @@ class Meta: class SimplifiedChartWithLink(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.CharBlock(required=False, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.CharBlock( + required=False, help_text=help_texts.SUB_TITLE_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -193,7 +195,7 @@ class Meta: class ChartCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) sub_title = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD + required=False, default="", help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD ) body = blocks.TextBlock( required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="About" From 7259ac24c9d794222561137f4b10e98e2ad5877b Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Fri, 21 Feb 2025 11:52:25 +0000 Subject: [PATCH 07/10] task/CDD-2285: update body to subtitle and new About field --- cms/dynamic_content/cards.py | 12 +++++------- cms/dynamic_content/help_texts.py | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cms/dynamic_content/cards.py b/cms/dynamic_content/cards.py index cf18aee74..4b79b2009 100644 --- a/cms/dynamic_content/cards.py +++ b/cms/dynamic_content/cards.py @@ -54,8 +54,7 @@ def get_alerts(cls) -> tuple[tuple[str, str]]: class WeatherHealthAlertsCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.TextBlock( - required=True, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.TextBlock(required=True, help_text=help_texts.SUB_TITLE_FIELD) alert_type = blocks.ChoiceBlock( required=True, choices=WHAlerts.get_alerts, @@ -138,8 +137,7 @@ class Meta: class SimplifiedChartWithLink(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.CharBlock( - required=False, help_text=help_texts.SUB_TITLE_FIELD) + sub_title = blocks.CharBlock(required=False, help_text=help_texts.SUB_TITLE_FIELD) tag_manager_event_id = blocks.CharBlock( required=False, help_text=help_texts.TAG_MANAGER_EVENT_ID_FIELD, @@ -194,11 +192,11 @@ class Meta: class ChartCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.TextBlock( - required=False, default="", help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD + About = blocks.TextBlock( + required=False, default="", help_text=help_texts.OPTIONAL_CHART_ABOUT_FIELD ) body = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="About" + required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="Sub-title" ) tag_manager_event_id = blocks.CharBlock( required=False, diff --git a/cms/dynamic_content/help_texts.py b/cms/dynamic_content/help_texts.py index e8ea23457..1a5eac016 100644 --- a/cms/dynamic_content/help_texts.py +++ b/cms/dynamic_content/help_texts.py @@ -178,11 +178,11 @@ The sub title to display for this component. """ -OPTIONAL_BODY_FIELD: str = """ +OPTIONAL_CHART_ABOUT_FIELD: str = """ An optional body of text to accompany this block. This text will be displayed in the about content of the chart. """ -OPTIONAL_CHART_SUBTITLE_FIELD: str = """ +OPTIONAL_BODY_FIELD: str = """ An optional body of text to accompany this block. This text will be displayed below the chart title. """ From aa4f866e527fb9485c2267cb5a229c3ebeda22cb Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Fri, 21 Feb 2025 12:20:55 +0000 Subject: [PATCH 08/10] task/CDD-2285: update body to subtitle --- cms/dynamic_content/cards.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cms/dynamic_content/cards.py b/cms/dynamic_content/cards.py index 4b79b2009..ca722ec6d 100644 --- a/cms/dynamic_content/cards.py +++ b/cms/dynamic_content/cards.py @@ -80,11 +80,11 @@ class Meta: class ChartWithHeadlineAndTrendCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - sub_title = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_CHART_SUBTITLE_FIELD - ) body = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="About" + required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="Subtitle" + ) + about = blocks.TextBlock( + required=False, help_text=help_texts.OPTIONAL_CHART_ABOUT_FIELD ) tag_manager_event_id = blocks.CharBlock( required=False, @@ -192,11 +192,11 @@ class Meta: class ChartCard(blocks.StructBlock): title = blocks.TextBlock(required=True, help_text=help_texts.TITLE_FIELD) - About = blocks.TextBlock( - required=False, default="", help_text=help_texts.OPTIONAL_CHART_ABOUT_FIELD - ) body = blocks.TextBlock( - required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="Sub-title" + required=False, help_text=help_texts.OPTIONAL_BODY_FIELD, label="Subtitle" + ) + about = blocks.TextBlock( + required=False, default="", help_text=help_texts.OPTIONAL_CHART_ABOUT_FIELD ) tag_manager_event_id = blocks.CharBlock( required=False, From 27c9f8f8b3869536032e90405d7a7949dd075129 Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Mon, 24 Feb 2025 13:50:12 +0000 Subject: [PATCH 09/10] CDD-2285: update migrations --- ...er_homepage_body_alter_landingpage_body.py | 1396 +++++++++++++++++ .../migrations/0017_alter_topicpage_body.py | 690 ++++++++ 2 files changed, 2086 insertions(+) create mode 100644 cms/home/migrations/0018_alter_homepage_body_alter_landingpage_body.py create mode 100644 cms/topic/migrations/0017_alter_topicpage_body.py diff --git a/cms/home/migrations/0018_alter_homepage_body_alter_landingpage_body.py b/cms/home/migrations/0018_alter_homepage_body_alter_landingpage_body.py new file mode 100644 index 000000000..a5ea7dc0c --- /dev/null +++ b/cms/home/migrations/0018_alter_homepage_body_alter_landingpage_body.py @@ -0,0 +1,1396 @@ +# Generated by Django 5.1.2 on 2025-02-24 13:49 + +import cms.dynamic_content.cards +import cms.metrics_interface.field_choices_callables +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("home", "0017_add_date_prefix_field"), + ] + + operations = [ + migrations.AlterField( + model_name="homepage", + name="body", + field=wagtail.fields.StreamField( + [("section", 66)], + block_lookup={ + 0: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe text you add here will be used as the heading for this section. \n", + "required": True, + }, + ), + 1: ( + "wagtail.blocks.RichTextBlock", + (), + { + "features": ["h2", "h3", "h4", "bold", "ul", "link"], + "help_text": "\nThis section of text will comprise this card. \nNote that this card will span the length of the available page width if sufficient text content is provided.\n", + }, + ), + 2: ("wagtail.blocks.StructBlock", [[("body", 1)]], {}), + 3: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe title to display for this component. \nNote that this will be shown in the hex colour #505A5F\n", + "required": True, + }, + ), + 4: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed below the chart title.\n", + "label": "Subtitle", + "required": False, + }, + ), + 5: ( + "wagtail.blocks.TextBlock", + (), + { + "default": "", + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed in the about content of the chart.\n", + "required": False, + }, + ), + 6: ( + "wagtail.blocks.CharBlock", + (), + { + "help_text": "\nThe ID to associate with this component. \nThis allows for tracking of events when users interact with this component.\nNote that changing this multiple times will result in the recording of different groups of events.\n", + "label": "Tag manager event ID", + "required": False, + }, + ), + 7: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nAn optional choice of what to display along the x-axis of the chart.\nIf nothing is provided, `dates` will be used by default.\nDates are used by default\n", + "required": False, + }, + ), + 8: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "", + "help_text": "\nAn optional title to display along the x-axis of the chart.\nIf nothing is provided, then no title will be displayed.\n", + "required": False, + }, + ), + 9: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nAn optional choice of what to display along the y-axis of the chart.\nIf nothing is provided, `metric value` will be used by default.\n", + "required": False, + }, + ), + 10: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "", + "help_text": "\nAn optional title to display along the y-axis of the chart.\nIf nothing is provided, then no title will be displayed.\n", + "required": False, + }, + ), + 11: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nThis is a switch to show tooltips on hover within the chart.\nDefaults to False.\n", + "required": False, + }, + ), + 12: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "Up to and including", + "help_text": "\nThis is the accompanying text for chart dates Eg: `Up to and including` 21 Oct 2024\n", + "required": True, + }, + ), + 13: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_topic_names, + "help_text": "The name of the topic to pull data e.g. COVID-19.", + }, + ), + 14: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_timeseries_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 15: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_geography_names, + "help_text": "\nThe name of the geography associated with this particular piece of data.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 16: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_geography_type_names, + "help_text": "\nThe type of geographical categorisation to apply any data filtering to.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 17: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_sex_names, + "help_text": "\nThe gender to filter for, if any.\nThe only options available are `M`, `F` and `ALL`.\nBy default, no filtering will be applied to the underlying query if no selection is made.\n", + }, + ), + 18: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_age_names, + "help_text": "\nThe age band to filter for, if any.\nBy default, no filtering will be applied to the underlying query if no selection is made.\n", + }, + ), + 19: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_stratum_names, + "help_text": "\nThe smallest subgroup a piece of data can be broken down into.\nFor example, this could be broken down by ethnicity or testing pillar.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 20: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_chart_types, + "help_text": "\nThe name of the type of chart which you want to create e.g. waffle\n", + }, + ), + 21: ( + "wagtail.blocks.DateBlock", + (), + { + "help_text": "\nThe date from which to begin the supporting plot data. \nNote that if nothing is provided, a default of 1 year ago from the current date will be applied.\n", + "required": False, + }, + ), + 22: ( + "wagtail.blocks.DateBlock", + (), + { + "help_text": "\nThe date to which to end the supporting plot data. \nNote that if nothing is provided, a default of the current date will be applied.\n", + "required": False, + }, + ), + 23: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe label to assign on the legend for this individual plot.\nE.g. `15 to 44 years old`\n", + "required": False, + }, + ), + 24: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_colours, + "help_text": '\nThe colour to apply to this individual line plot. The colours conform to the GDS specification.\nCurrently, only the `line_multi_coloured` chart type supports different line colours.\nFor all other chart types, this field will be ignored.\nNote that if nothing is provided, a default of "BLACK" will be applied.\nE.g. `GREEN`\n', + }, + ), + 25: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_chart_line_types, + "help_text": '\nThe line type to apply to this individual line plot.\nCurrently, only the `line_multi_coloured` chart type supports different line types.\nFor all other chart types, this field will be ignored.\nNote that if nothing is provided, a default of "SOLID" will be applied.\nE.g. `DASH`\n', + "required": False, + }, + ), + 26: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nIf set to true, markers are drawn on each individual data point.\nIf set to false, markers are not drawn at all.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 27: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": True, + "help_text": "\nIf set to true, draws the plot as a spline line, resulting in smooth curves between data points.\nIf set to false, draws the plot as a linear line, \nresulting in linear point-to-point lines being drawn between data points.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 28: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 14), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("chart_type", 20), + ("date_from", 21), + ("date_to", 22), + ("label", 23), + ("line_colour", 24), + ("line_type", 25), + ("use_markers", 26), + ("use_smooth_lines", 27), + ] + ], + {}, + ), + 29: ( + "wagtail.blocks.StreamBlock", + [[("plot", 28)]], + { + "help_text": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n" + }, + ), + 30: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 3), + ("body", 4), + ("about", 5), + ("tag_manager_event_id", 6), + ("x_axis", 7), + ("x_axis_title", 8), + ("y_axis", 9), + ("y_axis_title", 10), + ("show_tooltips", 11), + ("date_prefix", 12), + ("chart", 29), + ] + ], + {}, + ), + 31: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the x-axis of the chart.\n", + }, + ), + 32: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_headline_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 33: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_headline_chart_types, + "help_text": "\nThe name of the type of chart which you want to create e.g. waffle\n", + }, + ), + 34: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 32), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("chart_type", 33), + ("line_colour", 24), + ("label", 23), + ] + ], + {}, + ), + 35: ( + "wagtail.blocks.StreamBlock", + [[("plot", 34)]], + { + "help_texts": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n" + }, + ), + 36: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 3), + ("body", 4), + ("about", 5), + ("tag_manager_event_id", 6), + ("x_axis", 31), + ("x_axis_title", 8), + ("y_axis", 9), + ("y_axis_title", 10), + ("show_tooltips", 11), + ("date_prefix", 12), + ("chart", 35), + ] + ], + {}, + ), + 37: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed in the about content of the chart.\n", + "required": False, + }, + ), + 38: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 39: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed below the chart title.\n", + "required": False, + }, + ), + 40: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 38), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("body", 39), + ] + ], + { + "help_text": '\nThis component will display a key headline number type metric.\nYou can also optionally add a body of text to accompany that headline number.\nE.g. "Patients admitted"\n' + }, + ), + 41: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_change_type_metric_names, + "help_text": "\nThe name of the trend type metric to pull data e.g. \"COVID-19_headline_ONSdeaths_7daychange\". \nNote that only 'change' type metrics are available for selection for this field type.\n", + }, + ), + 42: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_percent_change_type_names, + "help_text": "\nThe name of the accompanying percentage trend type metric to pull data \ne.g. \"COVID-19_headline_ONSdeaths_7daypercentchange\". \nNote that only 'percent' type metrics are available for selection for this field type.\n", + }, + ), + 43: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 41), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("body", 39), + ("percentage_metric", 42), + ] + ], + { + "help_text": '\nThis component will display a trend number type metric.\nThis will display an arrow pointing in the direction of the metric change \nas well as colouring of the block to indicate the context of the change.\nYou can also optionally add a body of text to accompany that headline number.\nE.g. "Last 7 days"\n' + }, + ), + 44: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 38), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("body", 39), + ] + ], + { + "help_text": '\nThis component will display a percentage number type metric.\nThis will display the value of the metric appended with a % character.\nYou can also optionally add a body of text to accompany this percentage number.\nE.g. "Virus tests positivity".\n' + }, + ), + 45: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("headline_number", 40), + ("trend_number", 43), + ("percentage_number", 44), + ] + ], + { + "help_text": "\nAdd up to 2 headline or trend number column components within this space.\nNote that these figures will be displayed within the card, and above the chart itself.\n", + "max_num": 2, + "min_num": 0, + "required": False, + }, + ), + 46: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 3), + ("body", 4), + ("about", 37), + ("tag_manager_event_id", 6), + ("x_axis", 7), + ("x_axis_title", 8), + ("y_axis", 9), + ("y_axis_title", 10), + ("show_tooltips", 11), + ("date_prefix", 12), + ("chart", 29), + ("headline_number_columns", 45), + ] + ], + {}, + ), + 47: ( + "wagtail.blocks.CharBlock", + (), + { + "help_text": "\nThe sub title to display for this component.\n", + "required": False, + }, + ), + 48: ( + "cms.dynamic_content.blocks.PageLinkChooserBlock", + (), + { + "help_text": "\nThe related topic page you want to link to. Eg: `COVID-19`\n", + "page_type": ["topic.TopicPage"], + "required": True, + }, + ), + 49: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the x-axis of the chart.\n", + "ready_only": True, + }, + ), + 50: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the y-axis of the chart.\n", + }, + ), + 51: ( + "wagtail.blocks.DecimalBlock", + (), + { + "default": 0, + "help_text": "\nThis field allows you to set the first value in the chart's y-axis range. Please\nnote that a value provided here, which is higher than the lowest value in the data will\nbe overridden and the value from the dataset will be used.\n", + "required": False, + }, + ), + 52: ( + "wagtail.blocks.DecimalBlock", + (), + { + "help_text": "\nThis field allows you to set the last value in the chart's y-axis range. Please\nnote that a value provided here, which is lower than the highest value in the data will\nbe overridden and the value from the dataset will be used. \n", + "required": False, + }, + ), + 53: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_simplified_chart_types + }, + ), + 54: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nIf set to true, draws the plot as a spline line, resulting in smooth curves between data points.\nIf set to false, draws the plot as a linear line, \nresulting in linear point-to-point lines being drawn between data points.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 55: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 14), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("chart_type", 53), + ("date_from", 21), + ("date_to", 22), + ("use_smooth_lines", 54), + ] + ], + {}, + ), + 56: ( + "wagtail.blocks.StreamBlock", + [[("plot", 55)]], + { + "help_text": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n", + "max_num": 1, + "required": True, + }, + ), + 57: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 3), + ("sub_title", 47), + ("tag_manager_event_id", 6), + ("topic_page", 48), + ("x_axis", 49), + ("x_axis_title", 8), + ("y_axis", 50), + ("y_axis_title", 10), + ("y_axis_minimum_value", 51), + ("y_axis_maximum_value", 52), + ("chart", 56), + ] + ], + {}, + ), + 58: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("chart_card", 30), + ("headline_chart_card", 36), + ("chart_with_headline_and_trend_card", 46), + ("simplified_chart_with_link", 57), + ] + ], + { + "help_text": "\nHere you can add 1 or 2 columns to contain a particular chart card.\nIf you add the 1 column, then the chart card will spread across the available width.\nIf you add 2 columns, then the cards will be split across 2 columns within the available width.\n", + "max_num": 2, + "min_num": 1, + }, + ), + 59: ("wagtail.blocks.StructBlock", [[("columns", 58)]], {}), + 60: ( + "wagtail.blocks.TextBlock", + (), + { + "default": "Up to", + "help_text": "\nThis is the accompanying text for headline column dates Eg: `Up to` 27 Oct 2024 \n", + "required": True, + }, + ), + 61: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("headline_number", 40), + ("trend_number", 43), + ("percentage_number", 44), + ] + ], + { + "help_text": "\nHere you can add up to 2 rows within this column component.\nEach row can be used to add a number block. \nThis can be a headline number, a trend number or a percentage number.\nIf you only add 1 row, then that block will be rendered on the upper half of the column.\nAnd the bottom row of the column will remain empty.\n", + "max_num": 2, + "min_num": 1, + "required": True, + }, + ), + 62: ( + "wagtail.blocks.StructBlock", + [[("title", 3), ("date_prefix", 60), ("rows", 61)]], + {}, + ), + 63: ( + "wagtail.blocks.StreamBlock", + [[("column", 62)]], + { + "help_text": "\nAdd up to 5 number column components within this row. \nThe columns are ordered from left to right, top to bottom respectively. \nSo by moving 1 column component above the other, that component will be rendered in the column left of the other. \n", + "max_num": 5, + "min_num": 1, + }, + ), + 64: ("wagtail.blocks.StructBlock", [[("columns", 63)]], {}), + 65: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("text_card", 2), + ("chart_row_card", 59), + ("headline_numbers_row_card", 64), + ] + ], + { + "help_text": "\nHere you can add any number of content row cards for this section.\nNote that these cards will be displayed across the available width.\n" + }, + ), + 66: ( + "wagtail.blocks.StructBlock", + [[("heading", 0), ("content", 65)]], + {}, + ), + }, + ), + ), + migrations.AlterField( + model_name="landingpage", + name="body", + field=wagtail.fields.StreamField( + [("section", 70)], + block_lookup={ + 0: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe text you add here will be used as the heading for this section. \n", + "required": True, + }, + ), + 1: ( + "cms.dynamic_content.blocks.PageLinkChooserBlock", + (), + { + "help_text": "\nThe related index page you want to link to. Eg: `Respiratory viruses` or `Outbreaks`\n", + "page_type": ["composite.CompositePage"], + "required": False, + }, + ), + 2: ( + "wagtail.blocks.RichTextBlock", + (), + { + "features": ["h2", "h3", "h4", "bold", "ul", "link"], + "help_text": "\nThis section of text will comprise this card. \nNote that this card will span the length of the available page width if sufficient text content is provided.\n", + }, + ), + 3: ("wagtail.blocks.StructBlock", [[("body", 2)]], {}), + 4: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe title to display for this component. \nNote that this will be shown in the hex colour #505A5F\n", + "required": True, + }, + ), + 5: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed below the chart title.\n", + "label": "Subtitle", + "required": False, + }, + ), + 6: ( + "wagtail.blocks.TextBlock", + (), + { + "default": "", + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed in the about content of the chart.\n", + "required": False, + }, + ), + 7: ( + "wagtail.blocks.CharBlock", + (), + { + "help_text": "\nThe ID to associate with this component. \nThis allows for tracking of events when users interact with this component.\nNote that changing this multiple times will result in the recording of different groups of events.\n", + "label": "Tag manager event ID", + "required": False, + }, + ), + 8: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nAn optional choice of what to display along the x-axis of the chart.\nIf nothing is provided, `dates` will be used by default.\nDates are used by default\n", + "required": False, + }, + ), + 9: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "", + "help_text": "\nAn optional title to display along the x-axis of the chart.\nIf nothing is provided, then no title will be displayed.\n", + "required": False, + }, + ), + 10: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nAn optional choice of what to display along the y-axis of the chart.\nIf nothing is provided, `metric value` will be used by default.\n", + "required": False, + }, + ), + 11: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "", + "help_text": "\nAn optional title to display along the y-axis of the chart.\nIf nothing is provided, then no title will be displayed.\n", + "required": False, + }, + ), + 12: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nThis is a switch to show tooltips on hover within the chart.\nDefaults to False.\n", + "required": False, + }, + ), + 13: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "Up to and including", + "help_text": "\nThis is the accompanying text for chart dates Eg: `Up to and including` 21 Oct 2024\n", + "required": True, + }, + ), + 14: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_topic_names, + "help_text": "The name of the topic to pull data e.g. COVID-19.", + }, + ), + 15: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_timeseries_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 16: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_geography_names, + "help_text": "\nThe name of the geography associated with this particular piece of data.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 17: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_geography_type_names, + "help_text": "\nThe type of geographical categorisation to apply any data filtering to.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 18: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_sex_names, + "help_text": "\nThe gender to filter for, if any.\nThe only options available are `M`, `F` and `ALL`.\nBy default, no filtering will be applied to the underlying query if no selection is made.\n", + }, + ), + 19: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_age_names, + "help_text": "\nThe age band to filter for, if any.\nBy default, no filtering will be applied to the underlying query if no selection is made.\n", + }, + ), + 20: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_stratum_names, + "help_text": "\nThe smallest subgroup a piece of data can be broken down into.\nFor example, this could be broken down by ethnicity or testing pillar.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 21: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_chart_types, + "help_text": "\nThe name of the type of chart which you want to create e.g. waffle\n", + }, + ), + 22: ( + "wagtail.blocks.DateBlock", + (), + { + "help_text": "\nThe date from which to begin the supporting plot data. \nNote that if nothing is provided, a default of 1 year ago from the current date will be applied.\n", + "required": False, + }, + ), + 23: ( + "wagtail.blocks.DateBlock", + (), + { + "help_text": "\nThe date to which to end the supporting plot data. \nNote that if nothing is provided, a default of the current date will be applied.\n", + "required": False, + }, + ), + 24: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe label to assign on the legend for this individual plot.\nE.g. `15 to 44 years old`\n", + "required": False, + }, + ), + 25: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_colours, + "help_text": '\nThe colour to apply to this individual line plot. The colours conform to the GDS specification.\nCurrently, only the `line_multi_coloured` chart type supports different line colours.\nFor all other chart types, this field will be ignored.\nNote that if nothing is provided, a default of "BLACK" will be applied.\nE.g. `GREEN`\n', + }, + ), + 26: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_chart_line_types, + "help_text": '\nThe line type to apply to this individual line plot.\nCurrently, only the `line_multi_coloured` chart type supports different line types.\nFor all other chart types, this field will be ignored.\nNote that if nothing is provided, a default of "SOLID" will be applied.\nE.g. `DASH`\n', + "required": False, + }, + ), + 27: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nIf set to true, markers are drawn on each individual data point.\nIf set to false, markers are not drawn at all.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 28: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": True, + "help_text": "\nIf set to true, draws the plot as a spline line, resulting in smooth curves between data points.\nIf set to false, draws the plot as a linear line, \nresulting in linear point-to-point lines being drawn between data points.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 29: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 14), + ("metric", 15), + ("geography", 16), + ("geography_type", 17), + ("sex", 18), + ("age", 19), + ("stratum", 20), + ("chart_type", 21), + ("date_from", 22), + ("date_to", 23), + ("label", 24), + ("line_colour", 25), + ("line_type", 26), + ("use_markers", 27), + ("use_smooth_lines", 28), + ] + ], + {}, + ), + 30: ( + "wagtail.blocks.StreamBlock", + [[("plot", 29)]], + { + "help_text": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n" + }, + ), + 31: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 4), + ("body", 5), + ("about", 6), + ("tag_manager_event_id", 7), + ("x_axis", 8), + ("x_axis_title", 9), + ("y_axis", 10), + ("y_axis_title", 11), + ("show_tooltips", 12), + ("date_prefix", 13), + ("chart", 30), + ] + ], + {}, + ), + 32: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the x-axis of the chart.\n", + }, + ), + 33: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_headline_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 34: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_headline_chart_types, + "help_text": "\nThe name of the type of chart which you want to create e.g. waffle\n", + }, + ), + 35: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 14), + ("metric", 33), + ("geography", 16), + ("geography_type", 17), + ("sex", 18), + ("age", 19), + ("stratum", 20), + ("chart_type", 34), + ("line_colour", 25), + ("label", 24), + ] + ], + {}, + ), + 36: ( + "wagtail.blocks.StreamBlock", + [[("plot", 35)]], + { + "help_texts": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n" + }, + ), + 37: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 4), + ("body", 5), + ("about", 6), + ("tag_manager_event_id", 7), + ("x_axis", 32), + ("x_axis_title", 9), + ("y_axis", 10), + ("y_axis_title", 11), + ("show_tooltips", 12), + ("date_prefix", 13), + ("chart", 36), + ] + ], + {}, + ), + 38: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed in the about content of the chart.\n", + "required": False, + }, + ), + 39: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 40: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed below the chart title.\n", + "required": False, + }, + ), + 41: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 14), + ("metric", 39), + ("geography", 16), + ("geography_type", 17), + ("sex", 18), + ("age", 19), + ("stratum", 20), + ("body", 40), + ] + ], + { + "help_text": '\nThis component will display a key headline number type metric.\nYou can also optionally add a body of text to accompany that headline number.\nE.g. "Patients admitted"\n' + }, + ), + 42: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_change_type_metric_names, + "help_text": "\nThe name of the trend type metric to pull data e.g. \"COVID-19_headline_ONSdeaths_7daychange\". \nNote that only 'change' type metrics are available for selection for this field type.\n", + }, + ), + 43: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_percent_change_type_names, + "help_text": "\nThe name of the accompanying percentage trend type metric to pull data \ne.g. \"COVID-19_headline_ONSdeaths_7daypercentchange\". \nNote that only 'percent' type metrics are available for selection for this field type.\n", + }, + ), + 44: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 14), + ("metric", 42), + ("geography", 16), + ("geography_type", 17), + ("sex", 18), + ("age", 19), + ("stratum", 20), + ("body", 40), + ("percentage_metric", 43), + ] + ], + { + "help_text": '\nThis component will display a trend number type metric.\nThis will display an arrow pointing in the direction of the metric change \nas well as colouring of the block to indicate the context of the change.\nYou can also optionally add a body of text to accompany that headline number.\nE.g. "Last 7 days"\n' + }, + ), + 45: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 14), + ("metric", 39), + ("geography", 16), + ("geography_type", 17), + ("sex", 18), + ("age", 19), + ("stratum", 20), + ("body", 40), + ] + ], + { + "help_text": '\nThis component will display a percentage number type metric.\nThis will display the value of the metric appended with a % character.\nYou can also optionally add a body of text to accompany this percentage number.\nE.g. "Virus tests positivity".\n' + }, + ), + 46: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("headline_number", 41), + ("trend_number", 44), + ("percentage_number", 45), + ] + ], + { + "help_text": "\nAdd up to 2 headline or trend number column components within this space.\nNote that these figures will be displayed within the card, and above the chart itself.\n", + "max_num": 2, + "min_num": 0, + "required": False, + }, + ), + 47: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 4), + ("body", 5), + ("about", 38), + ("tag_manager_event_id", 7), + ("x_axis", 8), + ("x_axis_title", 9), + ("y_axis", 10), + ("y_axis_title", 11), + ("show_tooltips", 12), + ("date_prefix", 13), + ("chart", 30), + ("headline_number_columns", 46), + ] + ], + {}, + ), + 48: ( + "wagtail.blocks.CharBlock", + (), + { + "help_text": "\nThe sub title to display for this component.\n", + "required": False, + }, + ), + 49: ( + "cms.dynamic_content.blocks.PageLinkChooserBlock", + (), + { + "help_text": "\nThe related topic page you want to link to. Eg: `COVID-19`\n", + "page_type": ["topic.TopicPage"], + "required": True, + }, + ), + 50: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the x-axis of the chart.\n", + "ready_only": True, + }, + ), + 51: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the y-axis of the chart.\n", + }, + ), + 52: ( + "wagtail.blocks.DecimalBlock", + (), + { + "default": 0, + "help_text": "\nThis field allows you to set the first value in the chart's y-axis range. Please\nnote that a value provided here, which is higher than the lowest value in the data will\nbe overridden and the value from the dataset will be used.\n", + "required": False, + }, + ), + 53: ( + "wagtail.blocks.DecimalBlock", + (), + { + "help_text": "\nThis field allows you to set the last value in the chart's y-axis range. Please\nnote that a value provided here, which is lower than the highest value in the data will\nbe overridden and the value from the dataset will be used. \n", + "required": False, + }, + ), + 54: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_simplified_chart_types + }, + ), + 55: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nIf set to true, draws the plot as a spline line, resulting in smooth curves between data points.\nIf set to false, draws the plot as a linear line, \nresulting in linear point-to-point lines being drawn between data points.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 56: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 14), + ("metric", 15), + ("geography", 16), + ("geography_type", 17), + ("sex", 18), + ("age", 19), + ("stratum", 20), + ("chart_type", 54), + ("date_from", 22), + ("date_to", 23), + ("use_smooth_lines", 55), + ] + ], + {}, + ), + 57: ( + "wagtail.blocks.StreamBlock", + [[("plot", 56)]], + { + "help_text": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n", + "max_num": 1, + "required": True, + }, + ), + 58: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 4), + ("sub_title", 48), + ("tag_manager_event_id", 7), + ("topic_page", 49), + ("x_axis", 50), + ("x_axis_title", 9), + ("y_axis", 51), + ("y_axis_title", 11), + ("y_axis_minimum_value", 52), + ("y_axis_maximum_value", 53), + ("chart", 57), + ] + ], + {}, + ), + 59: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("chart_card", 31), + ("headline_chart_card", 37), + ("chart_with_headline_and_trend_card", 47), + ("simplified_chart_with_link", 58), + ] + ], + { + "help_text": "\nHere you can add chart cards to a section and the layout will change based on the number of cards added.\nA single card will expand to take up half the row. When 2 or 3 cards are added they will share the width\nof a row equally, creating either a 2 or 3 column layout.\n", + "min_num": 1, + }, + ), + 60: ("wagtail.blocks.StructBlock", [[("cards", 59)]], {}), + 61: ( + "wagtail.blocks.TextBlock", + (), + { + "default": "Up to", + "help_text": "\nThis is the accompanying text for headline column dates Eg: `Up to` 27 Oct 2024 \n", + "required": True, + }, + ), + 62: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("headline_number", 41), + ("trend_number", 44), + ("percentage_number", 45), + ] + ], + { + "help_text": "\nHere you can add up to 2 rows within this column component.\nEach row can be used to add a number block. \nThis can be a headline number, a trend number or a percentage number.\nIf you only add 1 row, then that block will be rendered on the upper half of the column.\nAnd the bottom row of the column will remain empty.\n", + "max_num": 2, + "min_num": 1, + "required": True, + }, + ), + 63: ( + "wagtail.blocks.StructBlock", + [[("title", 4), ("date_prefix", 61), ("rows", 62)]], + {}, + ), + 64: ( + "wagtail.blocks.StreamBlock", + [[("column", 63)]], + { + "help_text": "\nAdd up to 5 number column components within this row. \nThe columns are ordered from left to right, top to bottom respectively. \nSo by moving 1 column component above the other, that component will be rendered in the column left of the other. \n", + "max_num": 5, + "min_num": 1, + }, + ), + 65: ("wagtail.blocks.StructBlock", [[("columns", 64)]], {}), + 66: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe sub title to display for this component.\n", + "required": True, + }, + ), + 67: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.dynamic_content.cards.WHAlerts.get_alerts, + "help_text": "\nThis is used to select the current weather health alert type Eg: Heat or Cold alert season.\n", + }, + ), + 68: ( + "wagtail.blocks.StructBlock", + [[("title", 4), ("sub_title", 66), ("alert_type", 67)]], + {}, + ), + 69: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("text_card", 3), + ("chart_card_section", 60), + ("headline_numbers_row_card", 65), + ("weather_health_alert_card", 68), + ] + ], + { + "help_text": "\nHere you can add any number of content row cards for this section.\nNote that these cards will be displayed across the available width.\n" + }, + ), + 70: ( + "wagtail.blocks.StructBlock", + [[("heading", 0), ("page_link", 1), ("content", 69)]], + {}, + ), + }, + ), + ), + ] diff --git a/cms/topic/migrations/0017_alter_topicpage_body.py b/cms/topic/migrations/0017_alter_topicpage_body.py new file mode 100644 index 000000000..6ea985a95 --- /dev/null +++ b/cms/topic/migrations/0017_alter_topicpage_body.py @@ -0,0 +1,690 @@ +# Generated by Django 5.1.2 on 2025-02-24 13:49 + +import cms.metrics_interface.field_choices_callables +import wagtail.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("topic", "0016_add_date_prefix_field"), + ] + + operations = [ + migrations.AlterField( + model_name="topicpage", + name="body", + field=wagtail.fields.StreamField( + [("section", 66)], + block_lookup={ + 0: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe text you add here will be used as the heading for this section. \n", + "required": True, + }, + ), + 1: ( + "wagtail.blocks.RichTextBlock", + (), + { + "features": ["h2", "h3", "h4", "bold", "ul", "link"], + "help_text": "\nThis section of text will comprise this card. \nNote that this card will span the length of the available page width if sufficient text content is provided.\n", + }, + ), + 2: ("wagtail.blocks.StructBlock", [[("body", 1)]], {}), + 3: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe title to display for this component. \nNote that this will be shown in the hex colour #505A5F\n", + "required": True, + }, + ), + 4: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed below the chart title.\n", + "label": "Subtitle", + "required": False, + }, + ), + 5: ( + "wagtail.blocks.TextBlock", + (), + { + "default": "", + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed in the about content of the chart.\n", + "required": False, + }, + ), + 6: ( + "wagtail.blocks.CharBlock", + (), + { + "help_text": "\nThe ID to associate with this component. \nThis allows for tracking of events when users interact with this component.\nNote that changing this multiple times will result in the recording of different groups of events.\n", + "label": "Tag manager event ID", + "required": False, + }, + ), + 7: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nAn optional choice of what to display along the x-axis of the chart.\nIf nothing is provided, `dates` will be used by default.\nDates are used by default\n", + "required": False, + }, + ), + 8: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "", + "help_text": "\nAn optional title to display along the x-axis of the chart.\nIf nothing is provided, then no title will be displayed.\n", + "required": False, + }, + ), + 9: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nAn optional choice of what to display along the y-axis of the chart.\nIf nothing is provided, `metric value` will be used by default.\n", + "required": False, + }, + ), + 10: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "", + "help_text": "\nAn optional title to display along the y-axis of the chart.\nIf nothing is provided, then no title will be displayed.\n", + "required": False, + }, + ), + 11: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nThis is a switch to show tooltips on hover within the chart.\nDefaults to False.\n", + "required": False, + }, + ), + 12: ( + "wagtail.blocks.CharBlock", + (), + { + "default": "Up to and including", + "help_text": "\nThis is the accompanying text for chart dates Eg: `Up to and including` 21 Oct 2024\n", + "required": True, + }, + ), + 13: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_topic_names, + "help_text": "The name of the topic to pull data e.g. COVID-19.", + }, + ), + 14: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_timeseries_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 15: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_geography_names, + "help_text": "\nThe name of the geography associated with this particular piece of data.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 16: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_geography_type_names, + "help_text": "\nThe type of geographical categorisation to apply any data filtering to.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 17: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_sex_names, + "help_text": "\nThe gender to filter for, if any.\nThe only options available are `M`, `F` and `ALL`.\nBy default, no filtering will be applied to the underlying query if no selection is made.\n", + }, + ), + 18: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_age_names, + "help_text": "\nThe age band to filter for, if any.\nBy default, no filtering will be applied to the underlying query if no selection is made.\n", + }, + ), + 19: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_stratum_names, + "help_text": "\nThe smallest subgroup a piece of data can be broken down into.\nFor example, this could be broken down by ethnicity or testing pillar.\nIf nothing is provided, then no filtering will be applied for this field.\n", + }, + ), + 20: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_chart_types, + "help_text": "\nThe name of the type of chart which you want to create e.g. waffle\n", + }, + ), + 21: ( + "wagtail.blocks.DateBlock", + (), + { + "help_text": "\nThe date from which to begin the supporting plot data. \nNote that if nothing is provided, a default of 1 year ago from the current date will be applied.\n", + "required": False, + }, + ), + 22: ( + "wagtail.blocks.DateBlock", + (), + { + "help_text": "\nThe date to which to end the supporting plot data. \nNote that if nothing is provided, a default of the current date will be applied.\n", + "required": False, + }, + ), + 23: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nThe label to assign on the legend for this individual plot.\nE.g. `15 to 44 years old`\n", + "required": False, + }, + ), + 24: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_colours, + "help_text": '\nThe colour to apply to this individual line plot. The colours conform to the GDS specification.\nCurrently, only the `line_multi_coloured` chart type supports different line colours.\nFor all other chart types, this field will be ignored.\nNote that if nothing is provided, a default of "BLACK" will be applied.\nE.g. `GREEN`\n', + }, + ), + 25: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_chart_line_types, + "help_text": '\nThe line type to apply to this individual line plot.\nCurrently, only the `line_multi_coloured` chart type supports different line types.\nFor all other chart types, this field will be ignored.\nNote that if nothing is provided, a default of "SOLID" will be applied.\nE.g. `DASH`\n', + "required": False, + }, + ), + 26: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nIf set to true, markers are drawn on each individual data point.\nIf set to false, markers are not drawn at all.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 27: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": True, + "help_text": "\nIf set to true, draws the plot as a spline line, resulting in smooth curves between data points.\nIf set to false, draws the plot as a linear line, \nresulting in linear point-to-point lines being drawn between data points.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 28: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 14), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("chart_type", 20), + ("date_from", 21), + ("date_to", 22), + ("label", 23), + ("line_colour", 24), + ("line_type", 25), + ("use_markers", 26), + ("use_smooth_lines", 27), + ] + ], + {}, + ), + 29: ( + "wagtail.blocks.StreamBlock", + [[("plot", 28)]], + { + "help_text": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n" + }, + ), + 30: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 3), + ("body", 4), + ("about", 5), + ("tag_manager_event_id", 6), + ("x_axis", 7), + ("x_axis_title", 8), + ("y_axis", 9), + ("y_axis_title", 10), + ("show_tooltips", 11), + ("date_prefix", 12), + ("chart", 29), + ] + ], + {}, + ), + 31: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the x-axis of the chart.\n", + }, + ), + 32: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_headline_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 33: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_headline_chart_types, + "help_text": "\nThe name of the type of chart which you want to create e.g. waffle\n", + }, + ), + 34: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 32), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("chart_type", 33), + ("line_colour", 24), + ("label", 23), + ] + ], + {}, + ), + 35: ( + "wagtail.blocks.StreamBlock", + [[("plot", 34)]], + { + "help_texts": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n" + }, + ), + 36: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 3), + ("body", 4), + ("about", 5), + ("tag_manager_event_id", 6), + ("x_axis", 31), + ("x_axis_title", 8), + ("y_axis", 9), + ("y_axis_title", 10), + ("show_tooltips", 11), + ("date_prefix", 12), + ("chart", 35), + ] + ], + {}, + ), + 37: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed in the about content of the chart.\n", + "required": False, + }, + ), + 38: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_metric_names, + "help_text": '\nThe name of the metric to pull data for e.g. "COVID-19_deaths_ONSByDay".\n', + }, + ), + 39: ( + "wagtail.blocks.TextBlock", + (), + { + "help_text": "\nAn optional body of text to accompany this block. This text will be displayed below the chart title.\n", + "required": False, + }, + ), + 40: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 38), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("body", 39), + ] + ], + { + "help_text": '\nThis component will display a key headline number type metric.\nYou can also optionally add a body of text to accompany that headline number.\nE.g. "Patients admitted"\n' + }, + ), + 41: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_change_type_metric_names, + "help_text": "\nThe name of the trend type metric to pull data e.g. \"COVID-19_headline_ONSdeaths_7daychange\". \nNote that only 'change' type metrics are available for selection for this field type.\n", + }, + ), + 42: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_all_unique_percent_change_type_names, + "help_text": "\nThe name of the accompanying percentage trend type metric to pull data \ne.g. \"COVID-19_headline_ONSdeaths_7daypercentchange\". \nNote that only 'percent' type metrics are available for selection for this field type.\n", + }, + ), + 43: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 41), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("body", 39), + ("percentage_metric", 42), + ] + ], + { + "help_text": '\nThis component will display a trend number type metric.\nThis will display an arrow pointing in the direction of the metric change \nas well as colouring of the block to indicate the context of the change.\nYou can also optionally add a body of text to accompany that headline number.\nE.g. "Last 7 days"\n' + }, + ), + 44: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 38), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("body", 39), + ] + ], + { + "help_text": '\nThis component will display a percentage number type metric.\nThis will display the value of the metric appended with a % character.\nYou can also optionally add a body of text to accompany this percentage number.\nE.g. "Virus tests positivity".\n' + }, + ), + 45: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("headline_number", 40), + ("trend_number", 43), + ("percentage_number", 44), + ] + ], + { + "help_text": "\nAdd up to 2 headline or trend number column components within this space.\nNote that these figures will be displayed within the card, and above the chart itself.\n", + "max_num": 2, + "min_num": 0, + "required": False, + }, + ), + 46: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 3), + ("body", 4), + ("about", 37), + ("tag_manager_event_id", 6), + ("x_axis", 7), + ("x_axis_title", 8), + ("y_axis", 9), + ("y_axis_title", 10), + ("show_tooltips", 11), + ("date_prefix", 12), + ("chart", 29), + ("headline_number_columns", 45), + ] + ], + {}, + ), + 47: ( + "wagtail.blocks.CharBlock", + (), + { + "help_text": "\nThe sub title to display for this component.\n", + "required": False, + }, + ), + 48: ( + "cms.dynamic_content.blocks.PageLinkChooserBlock", + (), + { + "help_text": "\nThe related topic page you want to link to. Eg: `COVID-19`\n", + "page_type": ["topic.TopicPage"], + "required": True, + }, + ), + 49: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the x-axis of the chart.\n", + "ready_only": True, + }, + ), + 50: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_possible_axis_choices, + "help_text": "\nA required choice of what to display along the y-axis of the chart.\n", + }, + ), + 51: ( + "wagtail.blocks.DecimalBlock", + (), + { + "default": 0, + "help_text": "\nThis field allows you to set the first value in the chart's y-axis range. Please\nnote that a value provided here, which is higher than the lowest value in the data will\nbe overridden and the value from the dataset will be used.\n", + "required": False, + }, + ), + 52: ( + "wagtail.blocks.DecimalBlock", + (), + { + "help_text": "\nThis field allows you to set the last value in the chart's y-axis range. Please\nnote that a value provided here, which is lower than the highest value in the data will\nbe overridden and the value from the dataset will be used. \n", + "required": False, + }, + ), + 53: ( + "wagtail.blocks.ChoiceBlock", + [], + { + "choices": cms.metrics_interface.field_choices_callables.get_simplified_chart_types + }, + ), + 54: ( + "wagtail.blocks.BooleanBlock", + (), + { + "default": False, + "help_text": "\nIf set to true, draws the plot as a spline line, resulting in smooth curves between data points.\nIf set to false, draws the plot as a linear line, \nresulting in linear point-to-point lines being drawn between data points.\nThis is only applicable to line-type charts.\n", + "required": False, + }, + ), + 55: ( + "wagtail.blocks.StructBlock", + [ + [ + ("topic", 13), + ("metric", 14), + ("geography", 15), + ("geography_type", 16), + ("sex", 17), + ("age", 18), + ("stratum", 19), + ("chart_type", 53), + ("date_from", 21), + ("date_to", 22), + ("use_smooth_lines", 54), + ] + ], + {}, + ), + 56: ( + "wagtail.blocks.StreamBlock", + [[("plot", 55)]], + { + "help_text": "\nAdd the plots required for your chart. \nWithin each plot, you will be required to add a set of fields which will be used to fetch the supporting data \nfor that plot.\n", + "max_num": 1, + "required": True, + }, + ), + 57: ( + "wagtail.blocks.StructBlock", + [ + [ + ("title", 3), + ("sub_title", 47), + ("tag_manager_event_id", 6), + ("topic_page", 48), + ("x_axis", 49), + ("x_axis_title", 8), + ("y_axis", 50), + ("y_axis_title", 10), + ("y_axis_minimum_value", 51), + ("y_axis_maximum_value", 52), + ("chart", 56), + ] + ], + {}, + ), + 58: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("chart_card", 30), + ("headline_chart_card", 36), + ("chart_with_headline_and_trend_card", 46), + ("simplified_chart_with_link", 57), + ] + ], + { + "help_text": "\nHere you can add 1 or 2 columns to contain a particular chart card.\nIf you add the 1 column, then the chart card will spread across the available width.\nIf you add 2 columns, then the cards will be split across 2 columns within the available width.\n", + "max_num": 2, + "min_num": 1, + }, + ), + 59: ("wagtail.blocks.StructBlock", [[("columns", 58)]], {}), + 60: ( + "wagtail.blocks.TextBlock", + (), + { + "default": "Up to", + "help_text": "\nThis is the accompanying text for headline column dates Eg: `Up to` 27 Oct 2024 \n", + "required": True, + }, + ), + 61: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("headline_number", 40), + ("trend_number", 43), + ("percentage_number", 44), + ] + ], + { + "help_text": "\nHere you can add up to 2 rows within this column component.\nEach row can be used to add a number block. \nThis can be a headline number, a trend number or a percentage number.\nIf you only add 1 row, then that block will be rendered on the upper half of the column.\nAnd the bottom row of the column will remain empty.\n", + "max_num": 2, + "min_num": 1, + "required": True, + }, + ), + 62: ( + "wagtail.blocks.StructBlock", + [[("title", 3), ("date_prefix", 60), ("rows", 61)]], + {}, + ), + 63: ( + "wagtail.blocks.StreamBlock", + [[("column", 62)]], + { + "help_text": "\nAdd up to 5 number column components within this row. \nThe columns are ordered from left to right, top to bottom respectively. \nSo by moving 1 column component above the other, that component will be rendered in the column left of the other. \n", + "max_num": 5, + "min_num": 1, + }, + ), + 64: ("wagtail.blocks.StructBlock", [[("columns", 63)]], {}), + 65: ( + "wagtail.blocks.StreamBlock", + [ + [ + ("text_card", 2), + ("chart_row_card", 59), + ("headline_numbers_row_card", 64), + ] + ], + { + "help_text": "\nHere you can add any number of content row cards for this section.\nNote that these cards will be displayed across the available width.\n" + }, + ), + 66: ( + "wagtail.blocks.StructBlock", + [[("heading", 0), ("content", 65)]], + {}, + ), + }, + ), + ), + ] From d578cadc3367dcc3d43d304fab3a51e07f98693a Mon Sep 17 00:00:00 2001 From: Luke Towell Date: Tue, 25 Feb 2025 10:16:43 +0000 Subject: [PATCH 10/10] CDD-2285: Update migration file names to be more descriptive --- ...body.py => 0018_add_about_field_and_subtitle_label_to_body.py} | 0 ...body.py => 0017_add_about_field_and_subtitle_label_to_body.py} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename cms/home/migrations/{0018_alter_homepage_body_alter_landingpage_body.py => 0018_add_about_field_and_subtitle_label_to_body.py} (100%) rename cms/topic/migrations/{0017_alter_topicpage_body.py => 0017_add_about_field_and_subtitle_label_to_body.py} (100%) diff --git a/cms/home/migrations/0018_alter_homepage_body_alter_landingpage_body.py b/cms/home/migrations/0018_add_about_field_and_subtitle_label_to_body.py similarity index 100% rename from cms/home/migrations/0018_alter_homepage_body_alter_landingpage_body.py rename to cms/home/migrations/0018_add_about_field_and_subtitle_label_to_body.py diff --git a/cms/topic/migrations/0017_alter_topicpage_body.py b/cms/topic/migrations/0017_add_about_field_and_subtitle_label_to_body.py similarity index 100% rename from cms/topic/migrations/0017_alter_topicpage_body.py rename to cms/topic/migrations/0017_add_about_field_and_subtitle_label_to_body.py