From b6474117cd897191fcd1ce766c0215b06a13e8ed Mon Sep 17 00:00:00 2001 From: Richard McCarthy Date: Mon, 7 Oct 2024 15:37:42 +0100 Subject: [PATCH] rename html ogllink param to current naming standard --- src/components/footer/_macro-options.md | 12 ++++++------ src/components/footer/_macro.njk | 4 ++-- src/components/footer/_macro.spec.js | 4 ++-- src/components/header/_macro-options.md | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/footer/_macro-options.md b/src/components/footer/_macro-options.md index 505e4688b9..9d8fc99d97 100644 --- a/src/components/footer/_macro-options.md +++ b/src/components/footer/_macro-options.md @@ -5,7 +5,7 @@ | cols | array`` | false | An array of objects for each of the 3 allowed [footer columns](#footercol) | | rows | array`` | false | An array for the first [footer row](#footerrow) | | legal | array`` | false | An array of for the [row of legal links](#legalrow) | -| poweredBy | HTML | false | Any HTML to render an image for example embedded `` or `` to override the default ONS logo | +| poweredBy | string | false | HTML to render an image for example embedded `` or `` to override the default ONS logo | | lang | string | false | Set the ISO language code for current page to display the correct language ONS logo. Defaults to “en”. | | newTabWarning | string | false | Leading line of text to warn users that all footer links will open a new tab | | OGLLink | object`` | false | An object containing settings for the [Open Government Licence content](#ogllink). Set to “true” to display the default values for English and Welsh | @@ -19,11 +19,11 @@ | Name | Type | Required | Description | | ---- | ------ | --------------------------- | ----------------------------------------------------- | -| pre | string | true (unless `HTML` is set) | The text before the OGL link | -| url | string | true (unless `HTML` is set) | The URL for the HTML `href` attribute of the OGL link | -| link | string | true (unless `HTML` is set) | The text label for the OGL link | -| post | string | true (unless `HTML` is set) | The text after the OGL link | -| HTML | string | false | The alternative HTML for the OGL content | +| pre | string | true (unless `html` is set) | The text before the OGL link | +| url | string | true (unless `html` is set) | The URL for the HTML `href` attribute of the OGL link | +| link | string | true (unless `html` is set) | The text label for the OGL link | +| post | string | true (unless `html` is set) | The text after the OGL link | +| html | string | false | The alternative HTML for the OGL content | ## CopyrightDeclaration diff --git a/src/components/footer/_macro.njk b/src/components/footer/_macro.njk index 28a5719cf4..ce55b8daf6 100644 --- a/src/components/footer/_macro.njk +++ b/src/components/footer/_macro.njk @@ -138,8 +138,8 @@ "iconType": 'ogl' }) -}} - {% if params.OGLLink.HTML %} - {{ params.OGLLink.HTML | safe }} + {% if params.OGLLink.html %} + {{ params.OGLLink.html | safe }} {% elif params.OGLLink %} {% from "components/external-link/_macro.njk" import onsExternalLink %} {% if params.lang == 'cy' %} diff --git a/src/components/footer/_macro.spec.js b/src/components/footer/_macro.spec.js index d7da956cb9..1d7cb84786 100644 --- a/src/components/footer/_macro.spec.js +++ b/src/components/footer/_macro.spec.js @@ -144,12 +144,12 @@ describe('macro: footer', () => { expect(iconsSpy.occurrences).toContainEqual(expect.objectContaining({ iconType: 'ogl' })); }); - it('renders raw HTML when `HTML` is provided', () => { + it('renders raw HTML when `html` is provided', () => { const $ = cheerio.load( renderComponent('footer', { OGLLink: { ...params.OGLLink, - HTML: 'Bold text.', + html: 'Bold text.', }, }), ); diff --git a/src/components/header/_macro-options.md b/src/components/header/_macro-options.md index 772598d8a8..ad91363cfe 100644 --- a/src/components/header/_macro-options.md +++ b/src/components/header/_macro-options.md @@ -23,8 +23,8 @@ | Name | Type | Required | Description | | ------------- | ----------------------- | -------- | ------------------------------------------------------------------------------ | | classes | string | false | Classes to be added. Helpful to add a margin utility class to control spacing. | -| large | HTML | false | Any HTML to render an image for example embedded `` or `` | -| small | HTML | false | Optionally provide a version of the logo more suited to mobile viewports | +| large | string | false | HTML to render an image for example embedded `` or `` | +| small | string | false | Optionally provide a version of the logo more suited to mobile viewports | | multipleLogos | object`` | false | Allows for up to three logos to be used in the masthead. | ## MultipleLogos @@ -37,18 +37,18 @@ ## LogoObject -| Name | Type | Required | Description | -| --------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------- | -| logoImage | HTML or string | false | Any HTML to render an image for example embedded `` or ``. Use 'ONS Logo' for the default ONS icon. | -| logoURL | string | false | Wraps the masthead logo in a link. Set the URL for the HTML `href` attribute for the link. | +| Name | Type | Required | Description | +| --------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------- | +| logoImage | HTML or string | false | HTML to render an image for example embedded `` or ``. Use 'ONS Logo' for the default ONS icon. | +| logoURL | string | false | Wraps the masthead logo in a link. Set the URL for the HTML `href` attribute for the link. | ## TitleLogo | Name | Type | Required | Description | | ------- | ------ | -------- | ------------------------------------------------------------------------------ | | classes | string | false | Classes to be added. Helpful to add a margin utility class to control spacing. | -| large | HTML | true | Any HTML to render an image for example embedded `` or `` | -| small | HTML | false | Optionally provide a version of the logo more suited to mobile viewports | +| large | string | true | HTML to render an image for example embedded `` or `` | +| small | string | false | Optionally provide a version of the logo more suited to mobile viewports | ## ServiceLinks