Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b380f87
CCM-11966: Change button text and TemplateStatus on frontend
m-salaudeen Oct 27, 2025
3bed181
CCM-11966: Refactor manage templates and SubmitLetterTemplate page to…
m-salaudeen Nov 13, 2025
78d4ede
CCM-11966: Refactor manage templates and SubmitLetterTemplate page to…
m-salaudeen Nov 13, 2025
14506d8
CCM-11966: Fix typecheck and unit test issues in piepline
m-salaudeen Nov 13, 2025
e54e4bf
CCM-11966: Add new status TEMPLATE_PROOF_APPROVED to spec template
m-salaudeen Nov 13, 2025
01f4b35
CCM-11966: Update SubmitTemplatePage component test
m-salaudeen Nov 13, 2025
907c296
CCM-11966: Feedback
m-salaudeen Nov 17, 2025
895bb77
CCM-11966: Feedback
m-salaudeen Nov 17, 2025
8fd6b8b
CCM-11966: Add Approve status to the backend
m-salaudeen Dec 16, 2025
c4a695a
CCM-11966: Fix unit test on template client
m-salaudeen Dec 18, 2025
b39c796
fix merge
m-salaudeen Dec 18, 2025
27984a0
CCM-11966: Fix typecheck issues
m-salaudeen Dec 18, 2025
7304f53
CCM-11966: Reduced the branch unit test coverage percentage
m-salaudeen Dec 18, 2025
556de3e
CCM-11966: Uncomment test coverage threshold
m-salaudeen Jan 8, 2026
419f231
CCM-11966: Merge conflicts
m-salaudeen Jan 14, 2026
24cc8e7
CCM-11966: Fixes from merge conflicts
m-salaudeen Jan 15, 2026
74fcd51
Merge remote-tracking branch 'origin/main' into feature/CCM-11966_app…
alexnuttall Jan 15, 2026
e85c4f4
rm unused test fixtures
alexnuttall Jan 15, 2026
c7cd264
coverage
alexnuttall Jan 15, 2026
deff47a
error on no template or client config
alexnuttall Jan 17, 2026
1b55fe0
test title
alexnuttall Jan 17, 2026
6768c19
coverage
alexnuttall Jan 17, 2026
f818e0e
template client / repo refactor
alexnuttall Jan 19, 2026
1937b1e
add to event schema
alexnuttall Jan 19, 2026
be15357
bump hey-api to resolve tar sve
alexnuttall Jan 19, 2026
20b05dc
increment event schema minor version
alexnuttall Jan 19, 2026
c965e9f
bump hey-api to resolve tar sve
alexnuttall Jan 19, 2026
8bf87c4
use patch version
alexnuttall Jan 19, 2026
416186d
regen deps
alexnuttall Jan 19, 2026
bf58ff1
Merge branch 'feature/CCM-11966-node-tar-cve' into feature/CCM-11966_…
alexnuttall Jan 19, 2026
4fb61b7
rename var
alexnuttall Jan 19, 2026
8b32811
Merge remote-tracking branch 'origin/main' into feature/CCM-11966_app…
alexnuttall Jan 19, 2026
17e8e0e
regen schemas
alexnuttall Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jest.mock('@forms/SubmitTemplate/server-action', () => ({
jest.mock('@providers/client-config-provider');

describe('SubmitLetterTemplate component', () => {
it('should render', () => {
it('should render with client proofing enabled', () => {
jest.mocked(useFeatureFlags).mockReturnValueOnce({ proofing: true });

const container = render(
Expand All @@ -36,7 +36,23 @@ describe('SubmitLetterTemplate component', () => {
expect(container.asFragment()).toMatchSnapshot();
});

it('should render with client proofing disabled', () => {
it('should render with client proofing and routing enabled', () => {
jest
.mocked(useFeatureFlags)
.mockReturnValueOnce({ proofing: true, routing: true });

const container = render(
<SubmitLetterTemplate
templateId='template-id'
templateName='template-name'
lockNumber={1234}
/>
);

expect(container.asFragment()).toMatchSnapshot();
});

it('should render with client proofing and routing disabled', () => {
jest.mocked(useFeatureFlags).mockReturnValueOnce({ proofing: false });

const container = render(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SubmitLetterTemplate component should render 1`] = `
exports[`SubmitLetterTemplate component should render with client proofing and routing enabled 1`] = `
<DocumentFragment>
<main
class="nhsuk-main-wrapper"
Expand All @@ -14,17 +14,17 @@ exports[`SubmitLetterTemplate component should render 1`] = `
class="nhsuk-grid-column-two-thirds"
>
<h1>
Approve and submit 'template-name'
Approve 'template-name'
</h1>
<p
class="nhsuk-body-l"
>
When you submit a letter template, it will be used by NHS Notify to set up the messages you want to send.
When you approve your template proof, your template will be ready to add to a message plan.
</p>
<h2
class="nhsuk-heading-s"
>
Before you submit this template
Before you approve this template proof
</h2>
<p>
Check that your template proof:
Expand Down Expand Up @@ -60,7 +60,7 @@ exports[`SubmitLetterTemplate component should render 1`] = `
</span>
</h2>
<p>
You cannot edit a template after you've approved and submitted it. You can only replace it with a new template.
You cannot edit a template after you've approved the template proof. You can only create a new template to replace it.
</p>
</div>
<form
Expand Down Expand Up @@ -90,6 +90,14 @@ exports[`SubmitLetterTemplate component should render 1`] = `
type="hidden"
value="1234"
/>
<button
aria-disabled="false"
class="nhsuk-button nhsuk-u-margin-right-3"
id="submit-template-button"
type="submit"
>
Approve template proof
</button>
<a
aria-disabled="false"
class="nhsuk-button nhsuk-button--secondary nhsuk-u-margin-right-3"
Expand All @@ -100,14 +108,6 @@ exports[`SubmitLetterTemplate component should render 1`] = `
>
Go back
</a>
<button
aria-disabled="false"
class="nhsuk-button"
id="submit-template-button"
type="submit"
>
Approve and submit
</button>
</form>
</div>
</div>
Expand Down Expand Up @@ -235,3 +235,118 @@ exports[`SubmitLetterTemplate component should render with client proofing disab
</main>
</DocumentFragment>
`;

exports[`SubmitLetterTemplate component should render with client proofing enabled 1`] = `
<DocumentFragment>
<main
class="nhsuk-main-wrapper"
id="maincontent"
role="main"
>
<div
class="nhsuk-grid-row"
>
<div
class="nhsuk-grid-column-two-thirds"
>
<h1>
Approve and submit 'template-name'
</h1>
<p
class="nhsuk-body-l"
>
When you submit a letter template, it will be used by NHS Notify to set up the messages you want to send.
</p>
<h2
class="nhsuk-heading-s"
>
Before you submit this template
</h2>
<p>
Check that your template proof:
</p>
<ul
class="nhsuk-list nhsuk-list--bullet"
>
<li>
looks exactly as you expect your recipient to get it
</li>
<li>
uses personalisation as you expect
</li>
<li>
shows QR codes correctly (if used)
</li>
</ul>
<div
class="nhsuk-warning-callout"
>
<h2
class="nhsuk-warning-callout__label"
>
<span
role="text"
>
<span
class="nhsuk-u-visually-hidden"
>
Important:
</span>
Important
</span>
</h2>
<p>
You cannot edit a template after you've approved and submitted it. You can only replace it with a new template.
</p>
</div>
<form
action="/action"
>
<input
name="form-id"
readonly=""
type="hidden"
value="submit-template-form"
/>
<input
name="csrf_token"
readonly=""
type="hidden"
value="no_token"
/>
<input
name="templateId"
readonly=""
type="hidden"
value="template-id"
/>
<input
name="lockNumber"
readonly=""
type="hidden"
value="1234"
/>
<button
aria-disabled="false"
class="nhsuk-button nhsuk-u-margin-right-3"
id="submit-template-button"
type="submit"
>
Approve and submit
</button>
<a
aria-disabled="false"
class="nhsuk-button nhsuk-button-background-button"
draggable="false"
href="/templates/preview-letter-template/template-id"
id="go-back-button"
role="button"
>
Go back
</a>
</form>
</div>
</div>
</main>
</DocumentFragment>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const SubmitLetterTemplateProofingDisabled: FC<
proofingFlagDisabled: {
afterSubmissionHeading,
afterSubmissionText,
buttonText,
continueButtonText,
goBackButtonText,
goBackPath,
pageHeading,
Expand Down Expand Up @@ -82,7 +82,7 @@ export const SubmitLetterTemplateProofingDisabled: FC<
{goBackButtonText}
</NHSNotifyButton>
<NHSNotifyButton id='submit-template-button'>
{buttonText}
{continueButtonText}
</NHSNotifyButton>
</NHSNotifyFormWrapper>
</div>
Expand All @@ -96,22 +96,31 @@ export const SubmitLetterTemplate: FC<Omit<ActionPageProps, 'channel'>> = ({
templateId,
lockNumber,
}) => {
const features = useFeatureFlags();

const {
buttonText,
routingFlagEnabled,
routingFlagDisabled,
goBackButtonText,
goBackPath,
leadParagraph,
pageHeading,
submitChecklistHeading,
submitChecklistIntroduction,
submitChecklistItems,
warningCalloutText,
warningCalloutLabel,
} = content.components.submitLetterTemplate;

const [_, action] = useActionState(submitTemplate, 'LETTER');

const features = useFeatureFlags();
const pageContent = features.routing
? routingFlagEnabled
: routingFlagDisabled;

const {
pageHeading,
leadParagraph,
submitChecklistHeading,
warningCalloutText,
continueButtonText,
} = pageContent;

if (!features.proofing) {
return (
Expand Down Expand Up @@ -159,16 +168,19 @@ export const SubmitLetterTemplate: FC<Omit<ActionPageProps, 'channel'>> = ({
readOnly
/>
<NHSNotifyButton
secondary
id='submit-template-button'
className='nhsuk-u-margin-right-3'
>
{continueButtonText}
</NHSNotifyButton>
<NHSNotifyButton
className='nhsuk-button-background-button'
id='go-back-button'
href={`${getBasePath()}/${goBackPath}/${templateId}`}
data-testid='back-link-bottom'
>
{goBackButtonText}
</NHSNotifyButton>
<NHSNotifyButton id='submit-template-button'>
{buttonText}
</NHSNotifyButton>
</NHSNotifyFormWrapper>
</div>
</div>
Expand Down
24 changes: 17 additions & 7 deletions frontend/src/content/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ const submitTemplate = {
const submitLetterTemplate = {
proofingFlagDisabled: {
goBackButtonText: submitTemplate.goBackButtonText,
buttonText: submitTemplate.buttonText,
continueButtonText: submitTemplate.buttonText,
pageHeading: 'Submit',
submitChecklistHeading: 'Before you submit',
submitChecklistIntroduction: 'You should check that your template:',
Expand All @@ -682,21 +682,31 @@ const submitLetterTemplate = {
warningCalloutLabel: 'Important',
warningCalloutText: `You cannot edit a template after you've submitted it. You can only replace it with a new template.`,
},
pageHeading: 'Approve and submit',
leadParagraph:
'When you submit a letter template, it will be used by NHS Notify to set up the messages you want to send.',
submitChecklistHeading: 'Before you submit this template',
routingFlagEnabled: {
pageHeading: 'Approve',
leadParagraph:
'When you approve your template proof, your template will be ready to add to a message plan.',
submitChecklistHeading: 'Before you approve this template proof',
warningCalloutText: `You cannot edit a template after you've approved the template proof. You can only create a new template to replace it.`,
continueButtonText: 'Approve template proof',
},
routingFlagDisabled: {
pageHeading: 'Approve and submit',
leadParagraph:
'When you submit a letter template, it will be used by NHS Notify to set up the messages you want to send.',
submitChecklistHeading: 'Before you submit this template',
warningCalloutText: `You cannot edit a template after you've approved and submitted it. You can only replace it with a new template.`,
continueButtonText: 'Approve and submit',
},
submitChecklistIntroduction: 'Check that your template proof:',
submitChecklistItems: [
'looks exactly as you expect your recipient to get it',
'uses personalisation as you expect',
'shows QR codes correctly (if used)',
],
warningCalloutLabel: 'Important',
warningCalloutText: `You cannot edit a template after you've approved and submitted it. You can only replace it with a new template.`,
goBackPath: 'preview-letter-template',
goBackButtonText: submitTemplate.goBackButtonText,
buttonText: 'Approve and submit',
};

const copyTemplate = {
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ pre {

.inline-block {
display: inline-block;
};l,

.nhsuk-button-background-button {
background-color: nhsuk.$nhsuk-input-border-colour;
}

.nhsuk-button-background-button:hover {
background-color: nhsuk.$nhsuk-text-colour;
}

a.nhsuk-link--no-visited-state {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,8 @@
"VALIDATION_FAILED",
"VIRUS_SCAN_FAILED",
"WAITING_FOR_PROOF",
"PROOF_AVAILABLE"
"PROOF_AVAILABLE",
"PROOF_APPROVED"
],
"type": "string"
},
Expand Down
Loading
Loading