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

New header and primary navigation for candidate support and provider #10261

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

CatalinVoineag
Copy link
Contributor

@CatalinVoineag CatalinVoineag commented Jan 14, 2025

Context

New header design proposed
image (2)

With the introduction of one login and the fact that we need a new
header and primary navigation for the candidate path, to allow the
candidate to manage their one login account.

We decided to implement the header and primary navigation for our other users.
providers and support as well as candidates.

I have not changed these components for our api users. The content
that's already there needs a bit more work before, I think.

This should show the GOV.UK One Login account link for candidates if the
one login feature is enabled.

I could have gone down the rabbit hole of refactoring the code for our headers.
I think we can really simplify how we do them but I don't think this is the PR/ticket to do it.

Changes proposed in this pull request

_header.html.erb partial
navigation helper
CSS changes to allow the govuk components to align links on the right
Specs to accommodate the new header

Guidance to review

Screencast.2025-01-15.10.36.25.mp4

Go onto QA or review and please have a look at the header and the primary navigation at the top for all our users. Candidate, Provider, Support.

Bonus points if you change your one login account password and try to login again.

Link to Trello card

https://trello.com/c/weh5myMB

Things to check

  • If the code removes any existing feature flags, a data migration has also been added to delete the entry from the database
  • This code does not rely on migrations in the same Pull Request
  • If this code includes a migration adding or changing columns, it also backfills existing records for consistency
  • If this code adds a column to the DB, decide whether it needs to be in analytics yml file or analytics blocklist, if included inform data insights team of the changes
  • If this code adds a column that may include PII, the sanitise.sql script and 0025-protecting-personal-data-in-production-dump.md ADR have been updated.
  • API release notes have been updated if necessary
  • If it adds a significant user-facing change, is it documented in the CHANGELOG?
  • Attach the PR to the Trello card

end
end

def one_login_svg
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is copied straight from the one login header component https://github.com/govuk-one-login/service-header

With minor changes to make it fit in our header, the width and height are reduced

items_right: [NavigationItems::NavigationItem.new('Sign out', sign_out_path)],
)) %>
<% end %>
<%= render(
Copy link
Contributor Author

@CatalinVoineag CatalinVoineag Jan 15, 2025

Choose a reason for hiding this comment

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

The changes in this file are mostly to switch to using govuk_service_navigation instead of PrimaryNavigationComponent

And changing the HeaderComponent params, we don't need a service name or product name

candidate_interface_application_offer_dashboard_path,
true,
),
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The logic in this file is the same, just changed the format to allow us to use govuk-service-navigation

items = []

if FeatureFlag.active?(:one_login_candidate_sign_in) && !OneLogin.bypass?
items << NavigationItem.new("GOV.UK One Login #{one_login_svg}".html_safe, ENV['GOVUK_ONE_LOGIN_ACCOUNT_URL'], false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't find another way to pass the SVG to the govuk-service-navigation so we have to call html_safe here with a string of the svg

Copy link
Contributor

@elceebee elceebee left a comment

Choose a reason for hiding this comment

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

I've tested on qa and it seems fine! nice work

With the introduction of one login and the fact that we need a new
header and primary navigation for the candidate path, to allow the
candidate to manage their one login account.

We decided to implement the header and primary navigation for our other users.
providers and support as well as candidates.

I have not changed these components for our api users. The content
that's already there needs a bit more work before, I think.

This should show the GOV.UK One Login account link for candidates if the
one login feature is enabled.
@CatalinVoineag CatalinVoineag merged commit fcda817 into main Jan 16, 2025
24 checks passed
@CatalinVoineag CatalinVoineag deleted the cv/one-login-component branch January 16, 2025 08:28
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.

2 participants