diff --git a/CHANGELOG.md b/CHANGELOG.md index ac2bf68163..4baae38080 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ ## Unreleased +### Recommended changes + +#### Replace deprecated `govuk-header__link--service-name` class in the header + +If you're not using the Nunjucks macros, replace any instances in the header of the class `govuk-header__link--service-name` with `govuk-header__service-name`. + +We've deprecated the `govuk-header__link--service-name` class, and will remove it in a future major release. + +This change was introduced in [pull request #2617: Do not make the service name in the header a link if no `serviceUrl` is provided](https://github.com/alphagov/govuk-frontend/pull/2617). + +### Fixes + +We’ve made fixes to GOV.UK Frontend in the following pull requests: + +- [#2617: Do not make the service name in the header a link if no `serviceUrl` is provided](https://github.com/alphagov/govuk-frontend/pull/2617) + ## 4.1.0 (Feature release) ### New features diff --git a/app/app.test.js b/app/app.test.js index 02d77cf13c..7388e4a1b6 100644 --- a/app/app.test.js +++ b/app/app.test.js @@ -165,7 +165,7 @@ describe(`http://localhost:${PORT}`, () => { requestPath(templatePath, (err, res) => { const $ = cheerio.load(res.body) const $header = $('.govuk-header') - const $serviceName = $header.find('.govuk-header__link--service-name') + const $serviceName = $header.find('.govuk-header__service-name') expect($serviceName.html()).toContain('Nom du service') done(err) }) diff --git a/src/govuk/components/header/_index.scss b/src/govuk/components/header/_index.scss index 8d116eb89e..336fa28b45 100644 --- a/src/govuk/components/header/_index.scss +++ b/src/govuk/components/header/_index.scss @@ -142,6 +142,9 @@ } } + // The govuk-header__link--service-name class is deprecated - use + // govuk-header__service-name instead. + .govuk-header__service-name, .govuk-header__link--service-name { display: inline-block; margin-bottom: govuk-spacing(2); diff --git a/src/govuk/components/header/header.yaml b/src/govuk/components/header/header.yaml index 9cdb478abb..b8c5e1c462 100644 --- a/src/govuk/components/header/header.yaml +++ b/src/govuk/components/header/header.yaml @@ -101,6 +101,10 @@ examples: serviceName: Service Name serviceUrl: '/components/header' +- name: with service name but no service url + data: + serviceName: Service Name + - name: with navigation data: navigation: diff --git a/src/govuk/components/header/template.njk b/src/govuk/components/header/template.njk index 96dbed671a..915bcbbff4 100644 --- a/src/govuk/components/header/template.njk +++ b/src/govuk/components/header/template.njk @@ -49,9 +49,15 @@ {% if params.serviceName or params.navigation %}
{% if params.serviceName %} - - {{ params.serviceName }} - + {% if params.serviceUrl %} + + {{ params.serviceName }} + + {% else%} + + {{ params.serviceName }} + + {% endif %} {% endif %} {% if params.navigation %}