Skip to content

CCM-14754: approval confirmation#884

Open
alexnuttall wants to merge 10 commits intomainfrom
feature/CCM-14754-approved-letter
Open

CCM-14754: approval confirmation#884
alexnuttall wants to merge 10 commits intomainfrom
feature/CCM-14754-approved-letter

Conversation

@alexnuttall
Copy link
Contributor

@alexnuttall alexnuttall commented Mar 19, 2026

Description

Screenshot 2026-03-19 at 08 08 45

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.

@alexnuttall alexnuttall requested a review from a team as a code owner March 19, 2026 08:03
@alexnuttall alexnuttall added the skip-trivy-package Skip the Trivy Package Scan label Mar 19, 2026
bhansell1
bhansell1 previously approved these changes Mar 19, 2026
@alexnuttall alexnuttall removed the skip-trivy-package Skip the Trivy Package Scan label Mar 20, 2026
const validatedTemplate = validateLetterTemplate(template);

if (!validatedTemplate || validatedTemplate.letterVersion !== 'AUTHORING') {
return redirect('/invalid-template', RedirectType.replace);
Copy link
Contributor

Choose a reason for hiding this comment

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

out of interest, if we're being helpful by redirecting them to preview-letter-template if they end up here and the template isnt in the right state, why aren't we doing similar here and redirecting to preview-submitted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean redirect to preview-approved-letter-template if the status is specifically SUBMITTED?

Copy link
Contributor Author

@alexnuttall alexnuttall Mar 20, 2026

Choose a reason for hiding this comment

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

I think a double redirect is preferable to adding more logic here, considering how edge-casey it is - though I notice that redirect isn't in Chris' PR currently

{
type: 'text',
text: 'You can now use this letter in your [message plans]({{basePath}}/message-plans).',
overrides: { a: { props: { 'data-testid': 'message-plans-link' } } },
Copy link
Contributor

Choose a reason for hiding this comment

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

fully appreciate that I created this problem with testMessageBanner but I've only just realised these links that are within /templates coming via MarkdownContent will be missing out on the benefits of the next <Link> component 🤔
does overrides support overriding the component?

Copy link
Contributor Author

@alexnuttall alexnuttall Mar 20, 2026

Choose a reason for hiding this comment

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

You can't put JSX in content.ts (I wouldn't want to either since it defeats the purpose)

You can do something like this in page.tsx:

        <MarkdownContent
          content={useThisLetter}
          overrides={{ a: <Link href='href'>{'text'}</Link> }}
        />

But it's pretty wierd! I feel like the only reasonable alternative to what I have is to have the content inline in page.tsx. This doesn't feel right:

<p>
  {content.prefix} <Link href="content.href">{content.linkText}</Link>.
</p>

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