nhsuk-frontend icon indicating copy to clipboard operation
nhsuk-frontend copied to clipboard

Header transactional flag breaks service layout

Open xLasercut opened this issue 4 years ago • 2 comments

Bug Report

What is the issue?

If transactional flag is set while using service breaks header layout

using:

{{ header({
      "showNav": "true",
      "showSearch": "true",
      "service": {
        "name": "Digital service manual"
      },
      "transactional": "true",
      "primaryLinks": [
        {
          "url"  : "https://www.nhs.uk/conditions",
          "label" : "Health A-Z"
        },
        {
          'url' : 'https://www.nhs.uk/live-well/',
          'label' : 'Live Well'
        },
        {
          'url'  : 'https://www.nhs.uk/conditions/social-care-and-support/',
          'label' : 'Care and support'
        },
        {
          'url'  : 'https://www.nhs.uk/news/',
          'label' : 'Health news'
        },
        {
          'url' : 'https://www.nhs.uk/service-search',
          'label' : 'Services near you'
        }
      ]
    })
  }}

header_transactional

Proposed solution: Currently the transactional flag is only used to set the transactional class

{%- if params.transactional or params.transactionalService %} nhsuk-header--transactional{% endif %}

it can be delete and just let the transactional service set the class instead

Then add a check for transactionalService here:

{%- if params.service %}
  <span class="nhsuk-header__service-name">
    {{ params.service.name }}
  </span>
{%- endif %}

What was the environment where this issue occurred?

  • Device: All
  • Operating System: All
  • Browser: All
  • Browser version: All
  • NHS.UK frontend package version: 3.0.1
  • Node version:
  • npm version:

xLasercut avatar Nov 11 '19 12:11 xLasercut

Hey Tim (@xLasercut) thanks for opening this issue, the team will triage this get back to you on it.

If you wanted to open a pull request with your proposed fix that would be good - we can work on it from there.

chrimesdev avatar Nov 12 '19 13:11 chrimesdev

Thanks for opening the PR (https://github.com/nhsuk/nhsuk-frontend/pull/566), as mentioned in the PR we want to avoid another breaking change so soon. So we will include this in the next major release in the new year.

chrimesdev avatar Nov 26 '19 08:11 chrimesdev