Skip to content

CCM-14372: Add a callout message for letter if letter authoring is di…#829

Open
m-salaudeen wants to merge 20 commits intomainfrom
feature/CCM-14372_update_letter_flows
Open

CCM-14372: Add a callout message for letter if letter authoring is di…#829
m-salaudeen wants to merge 20 commits intomainfrom
feature/CCM-14372_update_letter_flows

Conversation

@m-salaudeen
Copy link
Contributor

…sabled

Description

Context

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
  • If I have used the 'skip-trivy-package' label I have done so responsibly and in the knowledge that this is being fixed as part of a separate ticket/PR.

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.

@m-salaudeen m-salaudeen self-assigned this Feb 10, 2026
@m-salaudeen m-salaudeen requested a review from a team as a code owner February 10, 2026 09:17
.tool-versions Outdated
gitleaks 8.24.0
jq 1.6
nodejs 22.22.0
nodejs 22.16.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this being downgraded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, it was a local merge error

@m-salaudeen m-salaudeen reopened this Feb 18, 2026
@alexnuttall
Copy link
Contributor

Looks like just pa11y tests are failing? These have been disabled on main, so you should get a green pipeline if you merge in main.

warningCalloutContent: {
headingLabel: 'To create a letter template',
firstParagraph: 'You cannot upload a letter template using this service.',
secondParagraph: 'Follow our guidance to ',
Copy link
Contributor

@alexnuttall alexnuttall Mar 2, 2026

Choose a reason for hiding this comment

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

I don't think we should include trailing whitespace here

Copy link
Contributor

Choose a reason for hiding this comment

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

Could do the link with markdown and use a MarkdownContent to avoid the split entirely


await expect(chooseTemplateTypePage.templateTypeRadioButtons).toHaveCount(
4
3
Copy link
Contributor

Choose a reason for hiding this comment

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

This depends on the letter authoring flag, right? If so, we should have a test which asserts that it's 4 when authoring is true. The other removed test could also still be run with an authoring user

))}
</Radios>
</Fieldset>
{isLetterAuthoringEnabled ? null : (
Copy link
Contributor

Choose a reason for hiding this comment

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

This is temporary so maybe it doesn't matter - but I think it would be cleaner to pass in children here instead of putting something really specific in a generic component

Copy link
Contributor

@alexnuttall alexnuttall Mar 2, 2026

Choose a reason for hiding this comment

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

Alternatively, fork the component completely, call it ChooseTemplateTypeRadios or similar, add a comment to say to switch it back to NHSNotifyRadioButtonForm once we get rid of the flag.

However it's done, the conditional content should be off by default. This will allow you to remove unnecessary changes to pages which aren't related to letters at all

Copy link
Contributor

Choose a reason for hiding this comment

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

Files like PreviewDigitalTemplate.test.ts shouldn't need to be changed


jest.mock('@providers/client-config-provider', () => ({
useFeatureFlags: jest.fn().mockReturnValue({
letterAuthoring: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably need to test both on and off here?

screen.getByTestId('email-radio'),
screen.getByTestId('nhsapp-radio'),
screen.getByTestId('sms-radio'),
screen.getByTestId('letter-radio'),
Copy link
Contributor

Choose a reason for hiding this comment

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

I would explicitly check that letter-radio isn't there for the off case

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.

4 participants