Skip to content

Conversation

@nicki-nhs
Copy link
Contributor

@nicki-nhs nicki-nhs commented Nov 26, 2025

Description

  • Adds additional versions of MessagePlanChannelTemplate component for accessible formats and foreign language templates
  • Adds alternative letter formats to the "Choose templates" page - Large print and translated languages
  • Updates remove templates logic to account for conditional templates

Screenshots

Without templates selected:
image
With templates selected:
image

Context

As an integrator I Want to link accessible format (Large print and Other languages) to a message plan
And review it So that I can verify if the message plan is correct

Choosing accessible format letter will be possible but it is optional. The user will be able to select the template they need and also remove it or change it.

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 November 26, 2025 21:02
bhansell1
bhansell1 previously approved these changes Nov 27, 2025
Copy link
Contributor

@harrim91 harrim91 left a comment

Choose a reason for hiding this comment

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

Just a couple of tiny things

return null;
}

const accessibleFormats = ACCESSIBLE_FORMATS;
Copy link
Contributor

Choose a reason for hiding this comment

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

Really unimportant but why is this assignment needed?

/**
* Collects all remaining language types from the cascade
*/
export function getRemainingLanguages(cascade: CascadeItem[]): Language[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can these be called getCascadeLanguages rather than getRemaining... - I wasn't sure what "remaining" was referring to until I saw how the context in which the function was being called.

);
}

export function MessagePlanLanguageTemplate({
Copy link
Contributor

Choose a reason for hiding this comment

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

(Opinionated): Putting these into separate files would improve readability and would discourage growing the file excessively in the future.

/**
* Collects all remaining accessible format types from the cascade
*/
export function getRemainingAccessibleFormats(
Copy link
Contributor

Choose a reason for hiding this comment

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

(Opinionated): You can avoid the continue and nested ifs with something like:

export function getRemainingAccessibleFormatsAlt(cascade: CascadeItem[]): LetterType[] {
  const formats = cascade
    .filter((item) => item.conditionalTemplates)
    .flatMap((item) => item.conditionalTemplates)
    .filter((template) => 'accessibleFormat' in template && template.templateId)
    .map((template) => template.accessibleFormat)
    .reduce((acc, format) => acc.add(format), new Set<LetterType>());

  return [...formats];
}

@nicki-nhs
Copy link
Contributor Author

superseded by #778

@nicki-nhs nicki-nhs closed this Dec 15, 2025
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