-
Notifications
You must be signed in to change notification settings - Fork 109
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
Show account information and links in the header #1063
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
39bbc90
Add account links to header
paulrobertlloyd eced9ad
Don’t link to header example with custom HTML
paulrobertlloyd 932270d
Update backstop references for header component
paulrobertlloyd 5cf529e
Remove unused backstop images for header component
paulrobertlloyd 813ddaf
Add backstop images for header component with account links
paulrobertlloyd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{% set html_style = "background-color: #f0f4f5;" %} | ||
{% set title = "Header with account (logged in, custom html)" %} | ||
{% from "components/header/macro.njk" import header %} | ||
{% extends "layout.njk" %} | ||
|
||
{% block body %} | ||
<style> | ||
.app-count { | ||
align-self: center; | ||
align-items: center; | ||
background-color: #d5281b; | ||
border-radius: 1em; | ||
color: #fff; | ||
font-size: 14px; | ||
height: 1.5em; | ||
line-height: 1.5em; | ||
min-width: 1.5em; | ||
padding: 0.25em; | ||
display: inline-flex; | ||
justify-content: center; | ||
} | ||
</style> | ||
|
||
{{ header({ | ||
account: { | ||
items: [ | ||
{ | ||
href: "#", | ||
text: "Check your profile" | ||
}, | ||
{ | ||
html: '<a class="nhsuk-header__account-link" href="#">Notifications</a> <span class="app-count">8</span>' | ||
}, | ||
{ | ||
href: "#", | ||
text: "Sign out" | ||
} | ||
] | ||
}, | ||
service: { | ||
name: "Profile manager" | ||
} | ||
}) }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{% set html_style = "background-color: #f0f4f5;" %} | ||
{% set title = "Header with account (logged in)" %} | ||
{% from "components/header/macro.njk" import header %} | ||
{% extends "layout.njk" %} | ||
|
||
{% block body %} | ||
{{ header({ | ||
account: { | ||
items: [ | ||
{ | ||
href: "#", | ||
text: "[email protected]", | ||
icon: true | ||
}, | ||
{ | ||
href: "#", | ||
text: "Log out" | ||
} | ||
] | ||
}, | ||
primaryLinks: [ | ||
{ | ||
url: "#", | ||
label: "Home" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Services" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Your health" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Messages" | ||
}, { | ||
url: "#", | ||
label: "Help and support" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% set html_style = "background-color: #f0f4f5;" %} | ||
{% set title = "Header with account (logged out)" %} | ||
{% from "components/header/macro.njk" import header %} | ||
{% extends "layout.njk" %} | ||
|
||
{% block body %} | ||
{{ header({ | ||
account: { | ||
items: [ | ||
{ | ||
href: "#", | ||
text: "Log in" | ||
} | ||
] | ||
} | ||
}) }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{% set html_style = "background-color: #f0f4f5;" %} | ||
{% set title = "Header with account (logged in, RBAC)" %} | ||
{% from "components/header/macro.njk" import header %} | ||
{% extends "layout.njk" %} | ||
|
||
{% block body %} | ||
{{ header({ | ||
account: { | ||
items: [ | ||
{ | ||
href: "#", | ||
text: "Florence Nightingale", | ||
icon: true | ||
}, | ||
{ | ||
text: "RA Manager, Hull and East Yorkshire Hospitals NHS Trust (RWA)" | ||
}, | ||
{ | ||
href: "#", | ||
text: "Change role" | ||
}, | ||
{ | ||
href: "#", | ||
text: "Log out" | ||
} | ||
] | ||
}, | ||
search: { | ||
placeholder: "User name, UUID or NI number", | ||
visuallyHiddenLabel: "Search for a user" | ||
}, | ||
service: { | ||
name: "CIS2 - Care Identity Management" | ||
}, | ||
primaryLinks: [ | ||
{ | ||
url: "#", | ||
label: "Home" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Create user" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Find user" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{% set html_style = "background-color: #f0f4f5;" %} | ||
{% set title = "Header organisational with white header and account" %} | ||
{% from "components/header/macro.njk" import header %} | ||
{% extends "layout.njk" %} | ||
|
||
{% block body %} | ||
|
||
{{ header({ | ||
classes: "nhsuk-header--white nhsuk-header--white-nav", | ||
account: { | ||
items: [ | ||
{ | ||
text: "Florence Nightingale", | ||
icon: true | ||
}, | ||
{ | ||
href: "#", | ||
text: "Log out" | ||
} | ||
] | ||
}, | ||
organisation: { | ||
name: "Anytown Anyplace", | ||
split: "Anywhere", | ||
descriptor: "NHS Foundation Trust" | ||
}, | ||
primaryLinks: [ | ||
{ | ||
url: "#", | ||
label: "Your hospital visit" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Wards and departments" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Conditions and treatments" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Our people" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Our research" | ||
} | ||
], | ||
search: { | ||
visuallyHiddenLabel: "Search the Anytown Anyplace Anywhere website" | ||
} | ||
}) | ||
}} | ||
|
||
{% endblock %} |
51 changes: 51 additions & 0 deletions
51
app/components/header/header-service-name-with-account-search-nav.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{% set html_style = "background-color: #f0f4f5;" %} | ||
{% set title = "Header with account, navigation and search" %} | ||
{% from "components/header/macro.njk" import header %} | ||
{% extends "layout.njk" %} | ||
|
||
{% block body %} | ||
{{ header({ | ||
account: { | ||
items: [ | ||
{ | ||
text: "Florence Nightingale", | ||
icon: true | ||
}, | ||
{ | ||
href: "#", | ||
text: "Log out" | ||
} | ||
] | ||
}, | ||
service: { | ||
name: "Digital service manual" | ||
}, | ||
search: true, | ||
primaryLinks: [ | ||
{ | ||
url: "#", | ||
label: "NHS service standard" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Design system" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Design principles" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Content guide" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Accessibility" | ||
}, | ||
{ | ||
url: "#", | ||
label: "Community and contribution" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps in this example the notification count out to be part of the link (so that it’s clickable and more accessible if the link is read out out-of-context)? Would save having to add the html for the link tag too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, thoughts @paulrobertlloyd?
I think we'll want to re-review the examples before release anyway, but would be good to decide this before I merge into header breaking changes PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will update this PR now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve opted to remove the link to the custom HTML example in eced9ad, but keep the page so we can use it for regression tests. This is because: