From da413582f3866f6959ec5a9dced3e3615636cce7 Mon Sep 17 00:00:00 2001 From: rmccar <42928680+rmccar@users.noreply.github.com> Date: Tue, 8 Oct 2024 09:33:41 +0100 Subject: [PATCH] Rename items summary param for compatibility with Jinja (#3382) --- src/components/summary/_macro-options.md | 2 +- src/components/summary/_macro.njk | 18 +- src/components/summary/_macro.spec.js | 12 +- .../summary/example-summary-card-grouped.njk | 20 +- .../summary/example-summary-grouped-total.njk | 6 +- .../example-summary-grouped-with-errors.njk | 8 +- .../summary/example-summary-grouped.njk | 20 +- .../summary/example-summary-household.njk | 138 ++++---- .../summary/example-summary-hub-minimal.njk | 133 ++++---- .../summary/example-summary-hub.njk | 323 +++++++++--------- .../summary/example-summary-multiple.njk | 2 +- .../summary/example-summary-no-action.njk | 4 +- src/components/summary/example-summary.njk | 8 +- .../hub-and-spoke/example-hub-complete.njk | 270 +++++++-------- src/patterns/hub-and-spoke/example-hub.njk | 264 +++++++------- .../hub-and-spoke/example-spoke-summary.njk | 12 +- 16 files changed, 629 insertions(+), 611 deletions(-) diff --git a/src/components/summary/_macro-options.md b/src/components/summary/_macro-options.md index 5a2d6a51f4..31ec6ecb60 100644 --- a/src/components/summary/_macro-options.md +++ b/src/components/summary/_macro-options.md @@ -26,7 +26,7 @@ | Name | Type | Required | Description | | ------------ | ----------------------- | -------- | ------------------------------------------------------------------- | | id | string | false | The HTML `id` of the row | -| items | Array`` | true | An array of [items for the row](#summaryrowitem) | +| itemsList | Array`` | true | An array of [items for the row](#summaryrowitem) | | title | string | false | The title for the row | | error | boolean | false | Set to “true” display an [error](/components/error) on a row | | errorMessage | string | false | The error message for the row | diff --git a/src/components/summary/_macro.njk b/src/components/summary/_macro.njk index effee11c07..d041211c57 100644 --- a/src/components/summary/_macro.njk +++ b/src/components/summary/_macro.njk @@ -34,14 +34,20 @@ {% if row.errorMessage %}
{{ row.errorMessage }}
{% endif %} - {% if row.items | length > 1 and row.title %} -
{{ row.title }}
+ {% if row.itemsList | length > 1 and row.title %} +
+ {{- row.title -}} +
{% endif %} - {% for item in row.items %} -
-
+
{% if item.iconType %} {% from "components/icon/_macro.njk" import onsIcon %} diff --git a/src/components/summary/_macro.spec.js b/src/components/summary/_macro.spec.js index d7caaf4afd..ff380b7920 100644 --- a/src/components/summary/_macro.spec.js +++ b/src/components/summary/_macro.spec.js @@ -11,7 +11,7 @@ const EXAMPLE_SUMMARY_ROWS = { // Contains - row with icon, attributes and titleAttributes, other value, no action id: 'row-id-1', title: 'row title 1', - items: [ + itemsList: [ { titleAttributes: { a: 123, @@ -39,7 +39,7 @@ const EXAMPLE_SUMMARY_ROWS = { title: 'row title 2', error: true, errorMessage: 'there are errors', - items: [ + itemsList: [ { id: 'item-id-2', valueList: [ @@ -70,7 +70,7 @@ const EXAMPLE_SUMMARY_ROWS = { // Contains - row with multiple rows and multiple values id: 'row-id-3', title: 'row title 3', - items: [ + itemsList: [ { id: 'item-id-3', valueList: [ @@ -97,7 +97,7 @@ const EXAMPLE_SUMMARY_ROWS = { id: 'row-id-4', title: 'row title 4', total: true, - items: [ + itemsList: [ { id: 'item-id-5', valueList: [ @@ -139,7 +139,7 @@ const EXAMPLE_SUMMARY_GROUPS_NO_ROWS = { const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = { rows: [ { - items: [ + itemsList: [ { title: 'row item 1', valueList: [ @@ -193,7 +193,7 @@ const EXAMPLE_SUMMARY_HOUSEHOLD_GROUP = { ], }, { - items: [ + itemsList: [ { title: 'row item 4', valueList: [ diff --git a/src/components/summary/example-summary-card-grouped.njk b/src/components/summary/example-summary-card-grouped.njk index 6893ae66c0..fadf24c20c 100644 --- a/src/components/summary/example-summary-card-grouped.njk +++ b/src/components/summary/example-summary-card-grouped.njk @@ -12,7 +12,7 @@ "rows": [ { "title": "Are you John Doe?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -31,7 +31,7 @@ }, { "title": "What's your date of birth?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -50,7 +50,7 @@ }, { "title": "What is your sex?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -74,7 +74,7 @@ "rows": [ { "title": "What is your country of birth?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -93,7 +93,7 @@ }, { "title": "What passports do you hold?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -117,7 +117,7 @@ "rows": [ { "title": "Have you completed an apprenticeship?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -136,7 +136,7 @@ }, { "title": "Have you achieved a GCSE or equivalent qualification?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -159,7 +159,7 @@ "title": "Employment history", "rows": [ { - "items": [ + "itemsList": [ { "title": "Name of UK company", "valueList": [ @@ -213,7 +213,7 @@ ] }, { - "items": [ + "itemsList": [ { "title": "Name of UK company", "valueList": [ @@ -280,7 +280,7 @@ "rows": [ { "title": "What are your monthly household expenses?", - "items": [ + "itemsList": [ { "title": "Food", "valueList": [ diff --git a/src/components/summary/example-summary-grouped-total.njk b/src/components/summary/example-summary-grouped-total.njk index 7c18d51184..a9ef2a4858 100644 --- a/src/components/summary/example-summary-grouped-total.njk +++ b/src/components/summary/example-summary-grouped-total.njk @@ -8,7 +8,7 @@ "title": "Summary - Section Title", "rows": [ { - "items": [ + "itemsList": [ { "title": "Total value of acquisitions for transport assets and equipment", "valueList": [ @@ -27,7 +27,7 @@ ] }, { - "items": [ + "itemsList": [ { "title": "Total value of acquisitions for computers and peripheral devices (hardware)", "valueList": [ @@ -47,7 +47,7 @@ }, { "total": true, - "items": [ + "itemsList": [ { "title": "Grand total for value of acquisitions", "valueList": [ diff --git a/src/components/summary/example-summary-grouped-with-errors.njk b/src/components/summary/example-summary-grouped-with-errors.njk index 7e8a315b85..d2bdefe439 100644 --- a/src/components/summary/example-summary-grouped-with-errors.njk +++ b/src/components/summary/example-summary-grouped-with-errors.njk @@ -9,7 +9,7 @@ "rows": [ { "title": "For the period 1 May 2017 to 31 May 2017, what was the total turnover of Essential Enterprise Ltd?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -30,7 +30,7 @@ "title": "What was the value of the business's total sales of food?", "errorMessage": "Change one or more of the figures so they sum to £600", "error": true, - "items": [ + "itemsList": [ { "valueList": [ { @@ -50,7 +50,7 @@ { "title": "What was the value of the business's total sales of alcohol, confectionery and tobacco?", "error": true, - "items": [ + "itemsList": [ { "valueList": [ { @@ -70,7 +70,7 @@ { "title": "What was the value of the business's total sales of clothing and footwear?", "error": true, - "items": [ + "itemsList": [ { "valueList": [ { diff --git a/src/components/summary/example-summary-grouped.njk b/src/components/summary/example-summary-grouped.njk index c2159de6ff..909f991fb3 100644 --- a/src/components/summary/example-summary-grouped.njk +++ b/src/components/summary/example-summary-grouped.njk @@ -13,7 +13,7 @@ "rows": [ { "title": "Are you John Doe?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -32,7 +32,7 @@ }, { "title": "What's your date of birth?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -51,7 +51,7 @@ }, { "title": "What is your sex?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -75,7 +75,7 @@ "rows": [ { "title": "What is your country of birth?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -94,7 +94,7 @@ }, { "title": "What passports do you hold?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -118,7 +118,7 @@ "rows": [ { "title": "Have you completed an apprenticeship?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -137,7 +137,7 @@ }, { "title": "Have you achieved a GCSE or equivalent qualification?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -160,7 +160,7 @@ "title": "Employment history", "rows": [ { - "items": [ + "itemsList": [ { "title": "Name of UK company", "valueList": [ @@ -214,7 +214,7 @@ ] }, { - "items": [ + "itemsList": [ { "title": "Name of UK company", "valueList": [ @@ -281,7 +281,7 @@ "rows": [ { "title": "What are your monthly household expenses?", - "items": [ + "itemsList": [ { "title": "Food", "valueList": [ diff --git a/src/components/summary/example-summary-household.njk b/src/components/summary/example-summary-household.njk index 9942b26a41..a12402e830 100644 --- a/src/components/summary/example-summary-household.njk +++ b/src/components/summary/example-summary-household.njk @@ -1,73 +1,75 @@ {% from "components/summary/_macro.njk" import onsSummary %} -{{ onsSummary({ - "classes": "ons-u-mb-l", - "summaries": [ - { - "groups": [ - { - "rows": [ - { - "title": "Joe Bloggs (You)", - "items": [ - { - "iconType": "person", - "actions": [ - { - "text": "Change", - "visuallyHiddenText": "Change details for Joe Bloggs", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Barry Scott", - "items": [ - { - "iconType": "person", - "actions": [ - { - "text": "Change", - "visuallyHiddenText": "Change details for Barry Scott", - "url": "#0" - }, - { - "text": "Remove", - "visuallyHiddenText": "Remove Barry Scott", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Wilhelmina Susannah Clementine-Smith", - "items": [ - { - "iconType": "person", - "actions": [ - { - "text": "Change", - "visuallyHiddenText": "Change details for Susan Gill", - "url": "#0" - }, - { - "text": "Remove", - "visuallyHiddenText": "Remove Susan Gill", - "url": "#0" - } - ] - } - ] - } - ], - "summaryLink": { - "text": "Add someone to this household", - "url": "#0", - "attributes": { - "data-qa": "add-item-link" +{{ + onsSummary({ + "classes": "ons-u-mb-l", + "summaries": [ + { + "groups": [ + { + "rows": [ + { + "title": "Joe Bloggs (You)", + "itemsList": [ + { + "iconType": "person", + "actions": [ + { + "text": "Change", + "visuallyHiddenText": "Change details for Joe Bloggs", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Barry Scott", + "itemsList": [ + { + "iconType": "person", + "actions": [ + { + "text": "Change", + "visuallyHiddenText": "Change details for Barry Scott", + "url": "#0" + }, + { + "text": "Remove", + "visuallyHiddenText": "Remove Barry Scott", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Wilhelmina Susannah Clementine-Smith", + "itemsList": [ + { + "iconType": "person", + "actions": [ + { + "text": "Change", + "visuallyHiddenText": "Change details for Susan Gill", + "url": "#0" + }, + { + "text": "Remove", + "visuallyHiddenText": "Remove Susan Gill", + "url": "#0" + } + ] + } + ] + } + ], + "summaryLink": { + "text": "Add someone to this household", + "url": "#0", + "attributes": { + "data-qa": "add-item-link" + } } } ] diff --git a/src/components/summary/example-summary-hub-minimal.njk b/src/components/summary/example-summary-hub-minimal.njk index 89f149d313..936e99f5b4 100644 --- a/src/components/summary/example-summary-hub-minimal.njk +++ b/src/components/summary/example-summary-hub-minimal.njk @@ -7,68 +7,71 @@ { "groups": [ { - "title": "People who live here", - "items": [ - { - "iconType": "check", - "iconVisuallyHiddenText": "Section complete", - "actions": [ - { - "text": "View answers", - "visuallyHiddenText": "View answers for People who live here", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Mary Smith (You)", - "items": [ - { - "iconType": "check", - "iconVisuallyHiddenText": "Section complete", - "actions": [ - { - "text": "View answers", - "visuallyHiddenText": "View answers for Mary Smith", - "url": "#0" - } - ] - } - ] - }, - { - "title": "John Smith", - "items": [ - { - "actions": [ - { - "text": "Continue with section", - "visuallyHiddenText": "Continue with John Smith's section", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Billy Smith", - "items": [ - { - "actions": [ - { - "text": "Start section", - "visuallyHiddenText": "Start Billy Smith's section", - "url": "#0" - } - ] - } - ] - } - ] - } - ] - } - ] -}) }} + "rows": [ + { + "title": "People who live here", + "itemsList": [ + { + "iconType": "check", + "iconVisuallyHiddenText": "Section complete", + "actions": [ + { + "text": "View answers", + "visuallyHiddenText": "View answers for People who live here", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Mary Smith (You)", + "itemsList": [ + { + "iconType": "check", + "iconVisuallyHiddenText": "Section complete", + "actions": [ + { + "text": "View answers", + "visuallyHiddenText": "View answers for Mary Smith", + "url": "#0" + } + ] + } + ] + }, + { + "title": "John Smith", + "itemsList": [ + { + "actions": [ + { + "text": "Continue with section", + "visuallyHiddenText": "Continue with John Smith's section", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Billy Smith", + "itemsList": [ + { + "actions": [ + { + "text": "Start section", + "visuallyHiddenText": "Start Billy Smith's section", + "url": "#0" + } + ] + } + ] + } + ] + } + ] + } + ] + }) +}} diff --git a/src/components/summary/example-summary-hub.njk b/src/components/summary/example-summary-hub.njk index 0a9b53d94b..7c032f9b5c 100644 --- a/src/components/summary/example-summary-hub.njk +++ b/src/components/summary/example-summary-hub.njk @@ -7,163 +7,166 @@ { "groups": [ { - "title": "People who live here", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "visuallyHiddenText": "View answers for People who live here", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Accommodation", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "visuallyHiddenText": "View answers for Accommodation", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Mary Smith (You)", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "visuallyHiddenText": "View answers for Mary Smith", - "url": "#0" - } - ] - } - ] - }, - { - "title": "John Smith", - "items": [ - { - "valueList": [ - { - "text": "Partially completed" - } - ], - "actions": [ - { - "text": "Continue with section", - "visuallyHiddenText": "Continue with John Smith's section", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Billy Smith", - "items": [ - { - "valueList": [ - { - "text": "Not started" - } - ], - "actions": [ - { - "text": "Start section", - "visuallyHiddenText": "Start Billy Smith's section", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Sally Smith", - "items": [ - { - "valueList": [ - { - "text": "Not started" - } - ], - "actions": [ - { - "text": "Start section", - "visuallyHiddenText": "Start Sally Smith's section", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Wilhelmina Susannah Clementine-Smith (Visitor)", - "items": [ - { - "valueList": [ - { - "text": "Not started" - } - ], - "actions": [ - { - "text": "Start section", - "visuallyHiddenText": "Start Wilhelmina Susannah Clementine-Smith's section", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Vera Jones (Visitor)", - "items": [ - { - "valueList": [ - { - "text": "Not started" - } - ], - "actions": [ - { - "text": "Start section", - "visuallyHiddenText": "Start Vera Jones's section", - "url": "#0" - } - ] - } - ] - } - ] - } - ] - } - ] -}) }} + "rows": [ + { + "title": "People who live here", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "visuallyHiddenText": "View answers for People who live here", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Accommodation", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "visuallyHiddenText": "View answers for Accommodation", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Mary Smith (You)", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "visuallyHiddenText": "View answers for Mary Smith", + "url": "#0" + } + ] + } + ] + }, + { + "title": "John Smith", + "itemsList": [ + { + "valueList": [ + { + "text": "Partially completed" + } + ], + "actions": [ + { + "text": "Continue with section", + "visuallyHiddenText": "Continue with John Smith's section", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Billy Smith", + "itemsList": [ + { + "valueList": [ + { + "text": "Not started" + } + ], + "actions": [ + { + "text": "Start section", + "visuallyHiddenText": "Start Billy Smith's section", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Sally Smith", + "itemsList": [ + { + "valueList": [ + { + "text": "Not started" + } + ], + "actions": [ + { + "text": "Start section", + "visuallyHiddenText": "Start Sally Smith's section", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Wilhelmina Susannah Clementine-Smith (Visitor)", + "itemsList": [ + { + "valueList": [ + { + "text": "Not started" + } + ], + "actions": [ + { + "text": "Start section", + "visuallyHiddenText": "Start Wilhelmina Susannah Clementine-Smith's section", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Vera Jones (Visitor)", + "itemsList": [ + { + "valueList": [ + { + "text": "Not started" + } + ], + "actions": [ + { + "text": "Start section", + "visuallyHiddenText": "Start Vera Jones's section", + "url": "#0" + } + ] + } + ] + } + ] + } + ] + } + ] + }) +}} diff --git a/src/components/summary/example-summary-multiple.njk b/src/components/summary/example-summary-multiple.njk index 4394e7a7f6..765f8135cf 100644 --- a/src/components/summary/example-summary-multiple.njk +++ b/src/components/summary/example-summary-multiple.njk @@ -9,7 +9,7 @@ "rows": [ { "title": "What are your monthly household expenses?", - "items": [ + "itemsList": [ { "title": "Food", "valueList": [ diff --git a/src/components/summary/example-summary-no-action.njk b/src/components/summary/example-summary-no-action.njk index 167516665f..5e5844f658 100644 --- a/src/components/summary/example-summary-no-action.njk +++ b/src/components/summary/example-summary-no-action.njk @@ -9,7 +9,7 @@ "rows": [ { "title": "What are the dates of the sales period you are reporting for?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -21,7 +21,7 @@ }, { "title": "Total turnover", - "items": [ + "itemsList": [ { "valueList": [ { diff --git a/src/components/summary/example-summary.njk b/src/components/summary/example-summary.njk index 15249099ad..ef0360ea27 100644 --- a/src/components/summary/example-summary.njk +++ b/src/components/summary/example-summary.njk @@ -13,7 +13,7 @@ { "id": "sales-dates-row", "title": "What are the dates of the sales period you are reporting for?", - "items": [ + "itemsList": [ { "id": "sales-dates", "valueList": [ @@ -34,7 +34,7 @@ { "title": "For the period 1 January 2015 to 2 February 2017, what was the value of your total turnover, excluding VAT?", "id": "sales-value-row", - "items": [ + "itemsList": [ { "id": "sales-value", "valueList": [ @@ -55,7 +55,7 @@ { "id": "sales-reasons-row", "title": "Please indicate the reasons for any changes in the total turnover", - "items": [ + "itemsList": [ { "id": "sales-reasons", "valueList": [ @@ -80,7 +80,7 @@ { "id": "sales-detail-row", "title": "Please describe the changes in total turnover in more detail", - "items": [ + "itemsList": [ { "id": "sales-detail", "valueList": [ diff --git a/src/patterns/hub-and-spoke/example-hub-complete.njk b/src/patterns/hub-and-spoke/example-hub-complete.njk index c06c271211..5239045275 100644 --- a/src/patterns/hub-and-spoke/example-hub-complete.njk +++ b/src/patterns/hub-and-spoke/example-hub-complete.njk @@ -29,140 +29,142 @@ layout: ~

You must submit this study to complete it

{% endcall %} - {{ onsSummary({ - "variant": "hub", - "classes": "ons-u-mt-m", - "summaries": [ - { - "groups": [ - { - "rows": [ - { - "title": "People who live here", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for People who live here", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Household accommodation", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for Household accommodation", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Mary Smith", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for Mary Smith", - "url": "#0" - } - ] - } - ] - }, - { - "title": "John Smith", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for John Smith", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Billy Smith", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for Billy Smith", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Mary Susannah Smith (Visitor)", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for Mary Susannah Smith (Visitor)", - "url": "#0" - } - ] - } - ] - } - ] - } - ] - } - ] - }) }} + {{ + onsSummary({ + "variant": "hub", + "classes": "ons-u-mt-m", + "summaries": [ + { + "groups": [ + { + "rows": [ + { + "title": "People who live here", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for People who live here", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Household accommodation", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for Household accommodation", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Mary Smith", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for Mary Smith", + "url": "#0" + } + ] + } + ] + }, + { + "title": "John Smith", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for John Smith", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Billy Smith", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for Billy Smith", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Mary Susannah Smith (Visitor)", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for Mary Susannah Smith (Visitor)", + "url": "#0" + } + ] + } + ] + } + ] + } + ] + } + ] + }) + }}

By submitting this study you are confirming that, to the best of your knowledge and belief, the details provided are correct.

diff --git a/src/patterns/hub-and-spoke/example-hub.njk b/src/patterns/hub-and-spoke/example-hub.njk index 3983930398..83fe54d15b 100644 --- a/src/patterns/hub-and-spoke/example-hub.njk +++ b/src/patterns/hub-and-spoke/example-hub.njk @@ -20,137 +20,139 @@ layout: ~ {% block main %}

Choose another section to complete

- {{ onsSummary({ - "variant": "hub", - "classes": "ons-u-mt-m", - "summaries": [ - { - "groups": [ - { - "rows": [ - { - "title": "People who live here", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for People who live here", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Household accommodation", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for Household accommodation", - "url": "#0" - } - ] - } - ] - }, - { - "title": "Mary Smith", - "items": [ - { - "iconType": "check", - "valueList": [ - { - "text": "Completed" - } - ], - "actions": [ - { - "text": "View answers", - "ariaLabel": "View answers for Mary Smith", - "url": "#0" - } - ] - } - ] - }, - { - "title": "John Smith", - "items": [ - { - "valueList": [ - { - "text": "Partially completed" - } - ], - "actions": [ - { - "text": "Continue with section", - "ariaLabel": "Continue with John Smith's section", - "url": "/patterns/hub-and-spoke/examples/spoke-continue/" - } - ] - } - ] - }, - { - "title": "Billy Smith", - "items": [ - { - "valueList": [ - { - "text": "Not started" - } - ], - "actions": [ - { - "text": "Start section", - "ariaLabel": "Start Billy Smith's section", - "url": "/patterns/hub-and-spoke/examples/spoke-start/" - } - ] - } - ] - }, - { - "title": "Mary Susannah Smith (Visitor)", - "items": [ - { - "valueList": [ - { - "text": "Not started" - } - ], - "actions": [ - { - "text": "Start section", - "ariaLabel": "Start Mary Susannah Smith's section", - "url": "#0" - } - ] - } - ] - } - ] - } - ] - } - ] - }) }} + {{ + onsSummary({ + "variant": "hub", + "classes": "ons-u-mt-m", + "summaries": [ + { + "groups": [ + { + "rows": [ + { + "title": "People who live here", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for People who live here", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Household accommodation", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for Household accommodation", + "url": "#0" + } + ] + } + ] + }, + { + "title": "Mary Smith", + "itemsList": [ + { + "iconType": "check", + "valueList": [ + { + "text": "Completed" + } + ], + "actions": [ + { + "text": "View answers", + "ariaLabel": "View answers for Mary Smith", + "url": "#0" + } + ] + } + ] + }, + { + "title": "John Smith", + "itemsList": [ + { + "valueList": [ + { + "text": "Partially completed" + } + ], + "actions": [ + { + "text": "Continue with section", + "ariaLabel": "Continue with John Smith's section", + "url": "/patterns/hub-and-spoke/examples/spoke-continue/" + } + ] + } + ] + }, + { + "title": "Billy Smith", + "itemsList": [ + { + "valueList": [ + { + "text": "Not started" + } + ], + "actions": [ + { + "text": "Start section", + "ariaLabel": "Start Billy Smith's section", + "url": "/patterns/hub-and-spoke/examples/spoke-start/" + } + ] + } + ] + }, + { + "title": "Mary Susannah Smith (Visitor)", + "itemsList": [ + { + "valueList": [ + { + "text": "Not started" + } + ], + "actions": [ + { + "text": "Start section", + "ariaLabel": "Start Mary Susannah Smith's section", + "url": "#0" + } + ] + } + ] + } + ] + } + ] + } + ] + }) + }} {{ onsButton({ diff --git a/src/patterns/hub-and-spoke/example-spoke-summary.njk b/src/patterns/hub-and-spoke/example-spoke-summary.njk index 3641ef7885..be051af36c 100644 --- a/src/patterns/hub-and-spoke/example-spoke-summary.njk +++ b/src/patterns/hub-and-spoke/example-spoke-summary.njk @@ -36,7 +36,7 @@ layout: ~ "rows": [ { "title": "What type of accommodation is 68 Abingdon Road, Goathill?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -55,7 +55,7 @@ layout: ~ }, { "title": "Are all the rooms in this accommodation, including the kitchen, bathroom and toilet, behind a door that only this household can use?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -74,7 +74,7 @@ layout: ~ }, { "title": "How many bedrooms are available for use only by this household?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -93,7 +93,7 @@ layout: ~ }, { "title": "What type of central heating does have?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -112,7 +112,7 @@ layout: ~ }, { "title": "Does your household own or rent 68 Abingdon Road, Goathill?", - "items": [ + "itemsList": [ { "valueList": [ { @@ -131,7 +131,7 @@ layout: ~ }, { "title": "In total, how many cars or vans are owned, or available for use, by members of this household?", - "items": [ + "itemsList": [ { "valueList": [ {