Skip to content

Conversation

@nicki-nhs
Copy link
Contributor

@nicki-nhs nicki-nhs commented Aug 12, 2025

Description

  • Updates version of nhs-frontend to pre-release 10 ^10.0.0-internal.0 to bring in the new header with account from the design system
  • Updates some global styling to use css variables to import nhs colours from the new version of nhs-frontend
  • Refactors AuthLink to remove redundant wrapping div
  • Adds new utils
    • truncate - truncates strings and replaces excess characters with ellipses
    • token-utils - for client side handling of jwt tokens, and add getIdTokenClaims function
  • Updates amplify-utils to
    • include idToken in getSessionServer
    • use the new token-utils where relevant
  • Creates new HeaderWithAccount component which
    • includes the logo/service name
    • displays the username and client name when logged in
    • includes the existing auth link
    • uses the new styling from nhs-frontend
    • displays navigation links for "Templates" (and "Message plans" when routing feature is true in features prop)
  • Refactor content to account for new header structure and add new content/links
  • Replace Header in ClientLayout with the new HeaderWithAccount
  • Adds new routing feature flag into ClientFeatures type (doesnt yet do anything)
  • Fixes test output error from MarkdownContent by removing the ID prop, replacing use of id in the tests with data-testid and adding conditional for empty items
  • Updates ContentRenderer to account for the above
  • Refactors Footer to remove redundant html containers and update to use latest classes etc from nhs-frontend

Context

Users need to see the name of the client displayed in the header so that they can see which client they are currently creating or updating resources for

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

@nicki-nhs nicki-nhs requested a review from a team as a code owner August 12, 2025 08:05
@@ -0,0 +1,3 @@
export const truncate = (text: string, maxLength = 50): string => {
return text.length > maxLength ? text.slice(0, maxLength - 1) + '…' : text;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be good to trim any whitespace from the end after slicing so you don't end up with word …

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure on this one, but maybe always trim trailing whitespace before doing anything else. If you only discarded whitespace, you don't need an ellipsis

@alexnuttall
Copy link
Contributor

@nicki-nhs I think it would be good to add a component/sandbox test. You would need to update the pre-token-generation lambda in this repo to match your updates in IAM. It's a simplified version which takes all its input from user attributes instead of SSM + user attributes. The client name would need to be added to users as a user attribute. You can do this by adding sbx_client_name to the user pool schema. This is the same way we get clientId in a sandbox context. Client names and family name etc. can then be added to seeded users during playwright setup.

@alexnuttall
Copy link
Contributor

Client names and family name etc. can then be added to seeded users during playwright setup.

Adding name etc. to the accessibility test user would also probably be worthwhile

@nicki-nhs nicki-nhs requested a review from a team as a code owner August 13, 2025 10:23
const $ClientFeatures = schemaFor<ClientFeatures>()(
z.object({
proofing: z.boolean(),
// TODO: CCM-11148 Make routing required
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why either flag should be required here

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 can change proofing too if you want, as long as we've got fallback logic in place..
if we dont set proofing, I'm guessing it defaults to false somewhere?
and if we change it here, does that then mean we need to add testing round the proofing feature flag for this ticket?

Copy link
Contributor

@alexnuttall alexnuttall Aug 18, 2025

Choose a reason for hiding this comment

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

I don't think it's worth changing proofing unless we find we need to or some convenient opportunity comes up

'preferred_username',
'given_name',
'family_name',
] as UserIdentityAttributes[],
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the assertion is unnecessary

@nicki-nhs nicki-nhs closed this Aug 22, 2025
@nicki-nhs nicki-nhs deleted the feature/CCM-10893-header-with-account-info branch August 22, 2025 15:33
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