Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change primaryLinks to use href and text instead of url and label #1083

Merged
merged 18 commits into from
Nov 29, 2024

Conversation

frankieroberto
Copy link
Contributor

@frankieroberto frankieroberto commented Nov 27, 2024

Currently we have a mix of components which use href and text for links (Action link, Back link, Breadcrumbs, Card, Contents list, Summary list, Skip link, Task list) and those which use url and label (Header and Footer)

This is pretty confusing, and caught me out again the other day.

Given we’re changing the Header component anyway, maybe now is the time to switch it over to href and text for improved consistency?

We could continue to support the old param names (as this PR current does) for backwards-compatibility, or drop them and advise people to switch over straight away?

frankieroberto and others added 16 commits November 12, 2024 22:12
Removes the link to `"/"` labelled `"Home"`, which is currently hardcoded, and only shows up within the navigation menu on mobile screen widths.

This link may not be appropriate for all services, which might not have a homepage, or might use a different path for it.

It is also unclear whether having a homepage link is always needed in the navigation if the NHS logo also goes to the homepage.
Change the primaryLinks in the Header component to use `href` and `text` param names instead of `url` and `label`.

This improves consistency with other components.

The previous param names are still supported for backwards-compatibility (but could be dropped in future?)
@paulrobertlloyd
Copy link
Contributor

Yes, been meaning to suggest this. Worth making the corresponding change to the footer component too?

While we're at it, shall we change primaryLinks to navigation?

Copy link
Contributor

@edwardhorsford edwardhorsford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm this is not a breaking change?

@frankieroberto
Copy link
Contributor Author

@edwardhorsford depends if we want to keep it backwards-compatible or not (currently in the PR it is). But I was thinking that this would go out with all the other Header changes in the next breaking change release – this PR is to merge into the other PR for that, #1058.

@frankieroberto
Copy link
Contributor Author

I'll merge this into #1058 for now, and we can decide whether to keep the backwards-compatibility later.

@frankieroberto frankieroberto merged commit 230bf09 into header-breaking-changes Nov 29, 2024
5 checks passed
@frankieroberto frankieroberto deleted the header-change-nunjucks-params branch November 29, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants