diff --git a/CHANGELOG.md b/CHANGELOG.md
index e81af06d..280e7084 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
+## [1.26.0] - 2021-02-19
+
+## Added
+
+- HMRC user research banner
+
## [1.25.0] - 2021-02-17
## Updated
diff --git a/backstop_data/bitmaps_reference/backstop_default_HMRC_Header_0_document_0_phone.png b/backstop_data/bitmaps_reference/backstop_default_HMRC_Header_0_document_0_phone.png
index 1840d423..4c2707ab 100644
Binary files a/backstop_data/bitmaps_reference/backstop_default_HMRC_Header_0_document_0_phone.png and b/backstop_data/bitmaps_reference/backstop_default_HMRC_Header_0_document_0_phone.png differ
diff --git a/backstop_data/bitmaps_reference/backstop_default_HMRC_Header_0_document_1_tablet.png b/backstop_data/bitmaps_reference/backstop_default_HMRC_Header_0_document_1_tablet.png
index 05fef688..e95a4f8b 100644
Binary files a/backstop_data/bitmaps_reference/backstop_default_HMRC_Header_0_document_1_tablet.png and b/backstop_data/bitmaps_reference/backstop_default_HMRC_Header_0_document_1_tablet.png differ
diff --git a/backstop_data/bitmaps_reference/backstop_default_HMRC_User_Research_Banner_0_document_0_phone.png b/backstop_data/bitmaps_reference/backstop_default_HMRC_User_Research_Banner_0_document_0_phone.png
new file mode 100644
index 00000000..0fac019f
Binary files /dev/null and b/backstop_data/bitmaps_reference/backstop_default_HMRC_User_Research_Banner_0_document_0_phone.png differ
diff --git a/backstop_data/bitmaps_reference/backstop_default_HMRC_User_Research_Banner_0_document_1_tablet.png b/backstop_data/bitmaps_reference/backstop_default_HMRC_User_Research_Banner_0_document_1_tablet.png
new file mode 100644
index 00000000..801f7fb6
Binary files /dev/null and b/backstop_data/bitmaps_reference/backstop_default_HMRC_User_Research_Banner_0_document_1_tablet.png differ
diff --git a/check-compatibility.js b/check-compatibility.js
index d1a0c8ec..f5299a34 100644
--- a/check-compatibility.js
+++ b/check-compatibility.js
@@ -14,7 +14,7 @@ if (!knownPrototypeKitNames.includes(consumerPackageJson.name)) {
}
const compatibility = {
- 1.25: {
+ 1.26: {
'prototype-kit': ['9.12', '9.11', '9.10', '9.9', '9.8', '9.7', '9.6', '9.5', '9.4', '9.3', '9.2', '9.1', '9.0', '9.9', '9.10', '9.11'],
},
0.6: {
diff --git a/package-lock.json b/package-lock.json
index 9ea0480a..e20f181b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14129,6 +14129,12 @@
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
"dev": true
},
+ "mockdate": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mockdate/-/mockdate-3.0.2.tgz",
+ "integrity": "sha512-ldfYSUW1ocqSHGTK6rrODUiqAFPGAg0xaHqYJ5tvj1hQyFsjuHpuWgWFTZWwDVlzougN/s2/mhDr8r5nY5xDpA==",
+ "dev": true
+ },
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
diff --git a/package.json b/package.json
index c069893d..3551e434 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "hmrc-frontend",
- "version": "1.25.0",
+ "version": "1.26.0",
"description": "Design patterns for HMRC frontends",
"scripts": {
"start": "gulp dev",
@@ -10,7 +10,7 @@
"build:dist": "gulp build:dist --destination 'dist' && npm run test:build:dist",
"build": "npm run build:dist && npm run build:package",
"lint": "stylelint 'src/**/*.scss' && eslint .",
- "lint:fix": "stylelint 'src/**/*.scss' && eslint --fix .",
+ "lint:fix": "stylelint 'src/**/*.scss' --fix && eslint --fix .",
"test": "npm run build:dist && jest src && npm run lint",
"test:update-snapshots": "jest src -u",
"test:compatibility": "jest __tests__/check-compatibility.test.js",
@@ -72,6 +72,7 @@
"js-yaml": "^3.14.1",
"merge-stream": "^1.0.1",
"mkdirp": "^1.0.4",
+ "mockdate": "^3.0.2",
"node-sass": "^5.0.0",
"nodemon": "^2.0.3",
"nunjucks": "^3.2.1",
diff --git a/src/all.js b/src/all.js
index be99332f..1530472d 100644
--- a/src/all.js
+++ b/src/all.js
@@ -1,5 +1,6 @@
import AccountMenu from './components/account-menu/account-menu';
import TimeoutDialog from './components/timeout-dialog/timeout-dialog';
+import UserResearchBanner from './components/user-research-banner/user-research-banner';
function initAll() {
const $AccountMenuSelector = '[data-module="hmrc-account-menu"]';
@@ -11,10 +12,16 @@ function initAll() {
if ($TimeoutDialog) {
new TimeoutDialog($TimeoutDialog).init();
}
+
+ const $UserResearchBanner = document.querySelector('[data-module="hmrc-user-research-banner"]');
+ if ($UserResearchBanner) {
+ new UserResearchBanner($UserResearchBanner).init();
+ }
}
export default {
initAll,
AccountMenu,
TimeoutDialog,
+ UserResearchBanner,
};
diff --git a/src/components/_all.scss b/src/components/_all.scss
index 2c6c8a5b..083a4d1d 100644
--- a/src/components/_all.scss
+++ b/src/components/_all.scss
@@ -9,3 +9,4 @@
@import "add-to-a-list/add-to-a-list";
@import "timeout-dialog/timeout-dialog";
@import "status-tags-in-task-list-pages/status-tags-in-task-list-pages";
+@import "user-research-banner/user-research-banner";
diff --git a/src/components/header/_header.scss b/src/components/header/_header.scss
index 151f8912..5e147cb3 100644
--- a/src/components/header/_header.scss
+++ b/src/components/header/_header.scss
@@ -52,3 +52,9 @@
}
}
}
+
+// Shift user research banner up 10px to compensate for govuk header border
+// only when adjacent to govuk header
+.hmrc-header + .hmrc-user-research-banner {
+ top: -10px;
+}
diff --git a/src/components/header/header.yaml b/src/components/header/header.yaml
index c697fd9b..cae452ee 100644
--- a/src/components/header/header.yaml
+++ b/src/components/header/header.yaml
@@ -64,7 +64,45 @@ params:
type: string
required: false
description: Either "en" for english or "cy" for welsh.
-
+- name: displayHmrcBanner
+ type: boolean
+ required: false
+ description: Display the HMRC banner or not
+- name: userResearchBanner
+ type: object
+ required: false
+ description: User research banner parameters. If not supplied, the user research banner will not be displayed.
+ params:
+ - name: url
+ type: string
+ required: true
+ description: The URL the user research banner should link to
+- name: phaseBanner
+ type: object
+ required: false
+ description: Phase banner parameters. If not supplied, the phase banner will not be displayed.
+ params:
+ - name: text
+ type: string
+ required: true
+ description: If `html` is set, this is not required. Text to use within the phase banner. If `html` is provided, the `text` argument will be ignored.
+ - name: html
+ type: string
+ required: true
+ description: If `text` is set, this is not required. HTML to use within the phase banner. If `html` is provided, the `text` argument will be ignored.
+ - name: tag
+ type: object
+ required: false
+ description: Options for the tag component.
+ isComponent: true
+ - name: classes
+ type: string
+ required: false
+ description: Classes to add to the phase banner container.
+ - name: attributes
+ type: object
+ required: false
+ description: HTML attributes (for example data attributes) to add to the phase banner container.
previewLayout: full-width
accessibilityCriteria: |
Text and links in the Header must:
@@ -89,7 +127,13 @@ examples:
- name: default
description: The standard header as used on information pages on GOV.UK
data:
- {}
+ userResearchBanner:
+ url: '/sign-up-for-user-research'
+ phaseBanner:
+ tag:
+ text: alpha
+ html: This is a new service – your feedback will help us to improve it.
+ displayHmrcBanner: true
- name: with service name
description: If your service is more than a few pages long, you can help users understand where they are by adding the service name.
diff --git a/src/components/header/template.njk b/src/components/header/template.njk
index ad47ce0b..4c30e63d 100644
--- a/src/components/header/template.njk
+++ b/src/components/header/template.njk
@@ -1,5 +1,7 @@
{% set language = params.language | default('en') %}
{% from "../banner/macro.njk" import hmrcBanner %}
+{% from "../user-research-banner/macro.njk" import hmrcUserResearchBanner %}
+ {% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}