Skip to content

CCM-13494: view render#836

Open
alexnuttall wants to merge 75 commits intomainfrom
feature/13494-render-preview
Open

CCM-13494: view render#836
alexnuttall wants to merge 75 commits intomainfrom
feature/13494-render-preview

Conversation

@alexnuttall
Copy link
Contributor

@alexnuttall alexnuttall commented Feb 12, 2026

Description

Adds non-interactive view of initial and personalised renders

other changes:

  • fixed sheet/page count rows in detail table
  • hide edit actions in detail table unless the template is NOT_YET_SUBMITTED
  • remove flaky js-check script and hardcode the nhsuk-frontend-supported flag required for the Tabs component
Screenshot 2026-02-13 at 12 17 11

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.

tab: RenderTab
): PersonalisedRenderDetails | undefined {
return tab === 'short'
? template.files.shortFormRender
Copy link
Contributor

Choose a reason for hiding this comment

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

you've got one type "short" vs "long" and another "shortFormRender" vs "longFormRender" representing basically the same thing - could just have them be the same and template.files[tab]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated, unfortunately it introduced some mapping in the other direction though

const personalisedRender = getPersonalisedRender(template, tab);
const initialRender = template.files.initialRender;

const { fileName } = personalisedRender ?? initialRender ?? {};
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't getting here without an initialRender be an error state rather than a fallback? the page.tsx doesn't allow getting here without an initialRender

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but throwing an error isn't helpful in a frontend component, is it? I'm considering making the renders properties depend on the render status in the next PR, which would remove the need to handle the undefined case

content.components.previewTemplateDetails;

function pagesAndSheetsCount(template: AuthoringLetterTemplate) {
const pages = template.files.initialRender?.pageCount ?? 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

once you've got an initial render, is it possible for it to not have a page count?

Copy link
Contributor Author

@alexnuttall alexnuttall Feb 17, 2026

Choose a reason for hiding this comment

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

Yes, you can have one in failed state, where we failed to open the docx etc. We create a FAILED render object so the spinner polling can end and inform the user

harrim91
harrim91 previously approved these changes Feb 17, 2026
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.

3 participants