From 30e247548b79b99673d8721dd929a21fc6205d48 Mon Sep 17 00:00:00 2001 From: SriHV Date: Tue, 7 May 2024 11:49:14 +0100 Subject: [PATCH 1/7] Removed .push method --- src/components/share-page/_macro.njk | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/share-page/_macro.njk b/src/components/share-page/_macro.njk index c2bd576e6e..b8e1998539 100644 --- a/src/components/share-page/_macro.njk +++ b/src/components/share-page/_macro.njk @@ -17,8 +17,6 @@ "target": '_blank' } %} - - {% set list = (list.push(facebook), list) %} {% endif %} {% if params.twitter and params.twitter == true %} {% set twitter = @@ -30,17 +28,13 @@ "target": '_blank' } %} - - {% set list = (list.push(twitter), list) %} - {% endif %} - {{ onsList({ "variants": 'inline', "iconPosition": 'before', "iconSize": params.iconSize | default("xxl"), - "itemsList": list + "itemsList": [facebook, twitter] }) }} {% endmacro %} From 8d2d89c14b8f85b7908b00feee2d29ebb92a4200 Mon Sep 17 00:00:00 2001 From: SriHV Date: Wed, 8 May 2024 10:43:28 +0100 Subject: [PATCH 2/7] Changed items name --- src/components/timeline/_macro-options.md | 10 +++++----- src/components/timeline/_macro.njk | 2 +- src/components/timeline/_macro.spec.js | 2 +- src/components/timeline/example-timeline.njk | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/timeline/_macro-options.md b/src/components/timeline/_macro-options.md index c5c7ac436a..a44b8f7938 100644 --- a/src/components/timeline/_macro-options.md +++ b/src/components/timeline/_macro-options.md @@ -1,8 +1,8 @@ -| Name | Type | Required | Description | -| -------- | ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------- | -| classes | string | false | Classes to add to the component | -| titleTag | string | false | The HTML heading tag to wrap the title text in for it’s correct semantic order on the page. Will default to an `h2`. | -| items | array`` | true | An array of [timeline items](#timelineitems) | +| Name | Type | Required | Description | +| -------------- | ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------- | +| classes | string | false | Classes to add to the component | +| titleTag | string | false | The HTML heading tag to wrap the title text in for it’s correct semantic order on the page. Will default to an `h2`. | +| items_timeline | array`` | true | An array of [timeline items](#timelineitems) | ## TimelineItems diff --git a/src/components/timeline/_macro.njk b/src/components/timeline/_macro.njk index 794ecb84c7..da3566e669 100644 --- a/src/components/timeline/_macro.njk +++ b/src/components/timeline/_macro.njk @@ -4,7 +4,7 @@
{% set titleTag = params.titleTag | default("h2") %} - {% for item in params.items %} + {% for item in params.items_timeline %}
<{{ titleTag }} class="ons-timeline__heading">{{ item.heading }} {% if item.itemsList %} diff --git a/src/components/timeline/_macro.spec.js b/src/components/timeline/_macro.spec.js index 1660bc29b1..9876f5f2c2 100644 --- a/src/components/timeline/_macro.spec.js +++ b/src/components/timeline/_macro.spec.js @@ -6,7 +6,7 @@ import axe from '../../tests/helpers/axe'; import { renderComponent, templateFaker } from '../../tests/helpers/rendering'; const EXAMPLE_TIMELINE = { - items: [ + items_timeline: [ { heading: 'January 2020', content: 'Timeline entry 1', diff --git a/src/components/timeline/example-timeline.njk b/src/components/timeline/example-timeline.njk index 5e5bd8d88b..82cc675e9a 100644 --- a/src/components/timeline/example-timeline.njk +++ b/src/components/timeline/example-timeline.njk @@ -2,7 +2,7 @@ {{ onsTimeline({ - "items": [ + "items_timeline": [ { "heading": 'September to October 2020', "itemsList": [ From 931d4456b40763567872bc80cdcf24aa7ca1b242 Mon Sep 17 00:00:00 2001 From: SriHV Date: Wed, 8 May 2024 10:55:26 +0100 Subject: [PATCH 3/7] Removing conflicts --- src/components/share-page/_macro.njk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/share-page/_macro.njk b/src/components/share-page/_macro.njk index b8e1998539..c2bd576e6e 100644 --- a/src/components/share-page/_macro.njk +++ b/src/components/share-page/_macro.njk @@ -17,6 +17,8 @@ "target": '_blank' } %} + + {% set list = (list.push(facebook), list) %} {% endif %} {% if params.twitter and params.twitter == true %} {% set twitter = @@ -28,13 +30,17 @@ "target": '_blank' } %} + + {% set list = (list.push(twitter), list) %} + {% endif %} + {{ onsList({ "variants": 'inline', "iconPosition": 'before', "iconSize": params.iconSize | default("xxl"), - "itemsList": [facebook, twitter] + "itemsList": list }) }} {% endmacro %} From 7a7d7f51d4ded297136b9ac2e48f0f318c6ab73f Mon Sep 17 00:00:00 2001 From: SriHV Date: Thu, 9 May 2024 14:43:26 +0100 Subject: [PATCH 4/7] changes as per comments --- src/components/timeline/_macro-options.md | 10 +++++----- src/components/timeline/_macro.njk | 2 +- src/components/timeline/_macro.spec.js | 2 +- src/components/timeline/example-timeline.njk | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/timeline/_macro-options.md b/src/components/timeline/_macro-options.md index a44b8f7938..d4a7de1cf6 100644 --- a/src/components/timeline/_macro-options.md +++ b/src/components/timeline/_macro-options.md @@ -1,8 +1,8 @@ -| Name | Type | Required | Description | -| -------------- | ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------- | -| classes | string | false | Classes to add to the component | -| titleTag | string | false | The HTML heading tag to wrap the title text in for it’s correct semantic order on the page. Will default to an `h2`. | -| items_timeline | array`` | true | An array of [timeline items](#timelineitems) | +| Name | Type | Required | Description | +| ------------- | ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------- | +| classes | string | false | Classes to add to the component | +| titleTag | string | false | The HTML heading tag to wrap the title text in for it’s correct semantic order on the page. Will default to an `h2`. | +| timelineItems | array`` | true | An array of [timeline items](#timelineitems) | ## TimelineItems diff --git a/src/components/timeline/_macro.njk b/src/components/timeline/_macro.njk index da3566e669..86fb9f26bd 100644 --- a/src/components/timeline/_macro.njk +++ b/src/components/timeline/_macro.njk @@ -4,7 +4,7 @@
{% set titleTag = params.titleTag | default("h2") %} - {% for item in params.items_timeline %} + {% for item in params.timelineItems %}
<{{ titleTag }} class="ons-timeline__heading">{{ item.heading }} {% if item.itemsList %} diff --git a/src/components/timeline/_macro.spec.js b/src/components/timeline/_macro.spec.js index 9876f5f2c2..30b3295128 100644 --- a/src/components/timeline/_macro.spec.js +++ b/src/components/timeline/_macro.spec.js @@ -6,7 +6,7 @@ import axe from '../../tests/helpers/axe'; import { renderComponent, templateFaker } from '../../tests/helpers/rendering'; const EXAMPLE_TIMELINE = { - items_timeline: [ + timelineItems: [ { heading: 'January 2020', content: 'Timeline entry 1', diff --git a/src/components/timeline/example-timeline.njk b/src/components/timeline/example-timeline.njk index 82cc675e9a..11798f22c6 100644 --- a/src/components/timeline/example-timeline.njk +++ b/src/components/timeline/example-timeline.njk @@ -2,7 +2,7 @@ {{ onsTimeline({ - "items_timeline": [ + "timelineItems": [ { "heading": 'September to October 2020', "itemsList": [ From e0cbe410a32adddcf3447f9fd3d58cc523d62d75 Mon Sep 17 00:00:00 2001 From: SriHV Date: Thu, 9 May 2024 15:56:21 +0100 Subject: [PATCH 5/7] changes as per comments --- src/components/timeline/example-timeline.njk | 60 ++++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/components/timeline/example-timeline.njk b/src/components/timeline/example-timeline.njk index 11798f22c6..9e04383ee2 100644 --- a/src/components/timeline/example-timeline.njk +++ b/src/components/timeline/example-timeline.njk @@ -2,34 +2,34 @@ {{ onsTimeline({ - "timelineItems": [ - { - "heading": 'September to October 2020', - "itemsList": [ - { - "text": "Meet your Community Engagement Manager and set up regular catch up meetings" - }, - { - "text": "Local Authority Toolkit available online" - } - ] - }, - { - "heading": 'September 2020', - "content": '

ONS to provide Councillor Handbook for distribution

' - }, - { - "heading": 'November 2020', - "content": '

ONS to provide you with content for magazines and publications

' - }, - { - "heading": 'January to March 2021', - "content": '

ONS to provide a range of press releases for external use

' - }, - { - "heading": 'February to April 2021', - "content": '

Promote your local Census Support Centres

' - } - ] - }) + "timelineItems": [ + { + "heading": 'September to October 2020', + "itemsList": [ + { + "text": "Meet your Community Engagement Manager and set up regular catch up meetings" + }, + { + "text": "Local Authority Toolkit available online" + } + ] + }, + { + "heading": 'September 2020', + "content": '

ONS to provide Councillor Handbook for distribution

' + }, + { + "heading": 'November 2020', + "content": '

ONS to provide you with content for magazines and publications

' + }, + { + "heading": 'January to March 2021', + "content": '

ONS to provide a range of press releases for external use

' + }, + { + "heading": 'February to April 2021', + "content": '

Promote your local Census Support Centres

' + } + ] + }) }} From 1d284fca197c675a2b748a6d048784b0be24d325 Mon Sep 17 00:00:00 2001 From: SriHV Date: Fri, 10 May 2024 12:19:16 +0100 Subject: [PATCH 6/7] Changing indentation --- src/components/timeline/example-timeline.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/timeline/example-timeline.njk b/src/components/timeline/example-timeline.njk index 9e04383ee2..77ad793365 100644 --- a/src/components/timeline/example-timeline.njk +++ b/src/components/timeline/example-timeline.njk @@ -31,5 +31,5 @@ "content": '

Promote your local Census Support Centres

' } ] - }) + }) }} From d2978762e500b247697c23d8228084752e2e4a92 Mon Sep 17 00:00:00 2001 From: SriHV <123635670+SriHV@users.noreply.github.com> Date: Fri, 10 May 2024 13:20:44 +0100 Subject: [PATCH 7/7] Update src/components/timeline/example-timeline.njk Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> --- src/components/timeline/example-timeline.njk | 56 ++++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/components/timeline/example-timeline.njk b/src/components/timeline/example-timeline.njk index 77ad793365..1e9a133bd6 100644 --- a/src/components/timeline/example-timeline.njk +++ b/src/components/timeline/example-timeline.njk @@ -3,33 +3,33 @@ {{ onsTimeline({ "timelineItems": [ - { - "heading": 'September to October 2020', - "itemsList": [ - { - "text": "Meet your Community Engagement Manager and set up regular catch up meetings" - }, - { - "text": "Local Authority Toolkit available online" - } - ] - }, - { - "heading": 'September 2020', - "content": '

ONS to provide Councillor Handbook for distribution

' - }, - { - "heading": 'November 2020', - "content": '

ONS to provide you with content for magazines and publications

' - }, - { - "heading": 'January to March 2021', - "content": '

ONS to provide a range of press releases for external use

' - }, - { - "heading": 'February to April 2021', - "content": '

Promote your local Census Support Centres

' - } - ] + { + "heading": 'September to October 2020', + "itemsList": [ + { + "text": "Meet your Community Engagement Manager and set up regular catch up meetings" + }, + { + "text": "Local Authority Toolkit available online" + } + ] + }, + { + "heading": 'September 2020', + "content": '

ONS to provide Councillor Handbook for distribution

' + }, + { + "heading": 'November 2020', + "content": '

ONS to provide you with content for magazines and publications

' + }, + { + "heading": 'January to March 2021', + "content": '

ONS to provide a range of press releases for external use

' + }, + { + "heading": 'February to April 2021', + "content": '

Promote your local Census Support Centres

' + } + ] }) }}