Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
add6b34
api spec
alexnuttall Jan 29, 2026
9d77bb1
validate new letter version
alexnuttall Jan 29, 2026
c57e39c
fix template dto
alexnuttall Jan 30, 2026
3dec0b2
zod default
alexnuttall Jan 30, 2026
8338bc5
cleanup
alexnuttall Jan 30, 2026
c0831b4
rename letter version
alexnuttall Jan 30, 2026
61aae74
coverage
alexnuttall Jan 30, 2026
03b1b48
accept new letter types in rc template selection
alexnuttall Jan 30, 2026
3d543c0
rename PdfProofing etc type to Pdf
alexnuttall Jan 30, 2026
7d67efb
rm useless type guard
alexnuttall Jan 30, 2026
b858152
require version on API requests
alexnuttall Jan 30, 2026
0199399
add version field to automated test input
alexnuttall Jan 30, 2026
2644d73
Merge remote-tracking branch 'origin/main' into feature/CCM-13493-let…
alexnuttall Jan 30, 2026
6e463be
fmt fix
alexnuttall Jan 30, 2026
e35f658
typecheck fix post merge
alexnuttall Jan 30, 2026
0cb52c4
backend readme
alexnuttall Jan 30, 2026
8ad2880
fix API test assertions
alexnuttall Jan 30, 2026
118bd46
improve routing utils handling of letters
alexnuttall Jan 30, 2026
5424d31
Merge remote-tracking branch 'origin/main' into feature/CCM-13493-let…
alexnuttall Jan 30, 2026
ce1206d
use pdf types on the frontend
alexnuttall Jan 30, 2026
14e89b1
filter to PDF templates
alexnuttall Jan 30, 2026
aa7e761
allow fetching AUTHORING letters on the frontend
alexnuttall Jan 30, 2026
29b5558
rm comment
alexnuttall Jan 30, 2026
0e1c87d
rm comment
alexnuttall Jan 30, 2026
1774355
rm filter when chossing template
alexnuttall Jan 30, 2026
4f0c4f2
block some letter specific pages
alexnuttall Jan 30, 2026
ab2cfc8
details page
alexnuttall Jan 30, 2026
db2dc0b
test unit fixture fix
alexnuttall Jan 30, 2026
b800253
Merge branch 'feature/CCM-13493-letter-details' into feature/CCM-1349…
alexnuttall Jan 30, 2026
e32ef68
lint fix
alexnuttall Jan 30, 2026
802a61f
undo changes to digital channel details
alexnuttall Jan 30, 2026
18db916
coverage
alexnuttall Jan 30, 2026
b7c6a37
lint fix
alexnuttall Jan 30, 2026
6d0f3aa
rename details component
alexnuttall Jan 31, 2026
9ba8db9
hide actions on choose preview
alexnuttall Feb 2, 2026
7d81262
rename fixture
alexnuttall Feb 2, 2026
fd59f5e
rename LetterFiles
alexnuttall Feb 2, 2026
98ef76f
restore schemaFor
alexnuttall Feb 2, 2026
99c94e9
cleanup
alexnuttall Feb 2, 2026
6b1f9ae
Merge branch 'feature/CCM-13493-letter-details' into feature/CCM-1349…
alexnuttall Feb 2, 2026
d22e3dc
rm unused validators
alexnuttall Feb 2, 2026
0eb412b
fmt fix
alexnuttall Feb 2, 2026
34a4f0c
rerun typegen
alexnuttall Feb 2, 2026
eff9c52
Merge branch 'feature/CCM-13493-letter-details' into feature/CCM-1349…
alexnuttall Feb 2, 2026
d7e1051
template type everywhere
alexnuttall Feb 2, 2026
77c14ff
Merge remote-tracking branch 'origin/main' into feature/CCM-13493-let…
alexnuttall Feb 2, 2026
072addc
Merge branch 'feature/CCM-13493-letter-details' into feature/CCM-1349…
alexnuttall Feb 2, 2026
2172f50
Merge remote-tracking branch 'origin/main' into feature/CCM-13493-pag…
alexnuttall Feb 2, 2026
9ce1b84
enum refactor
alexnuttall Feb 2, 2026
269cddf
rename adapter component
alexnuttall Feb 2, 2026
ee1ed58
test coverage
alexnuttall Feb 2, 2026
f8aa759
pw tests
alexnuttall Feb 2, 2026
64c308b
backend client unit test fix
alexnuttall Feb 2, 2026
517cc76
add campaign row id
alexnuttall Feb 2, 2026
2383ca5
single campaign
alexnuttall Feb 2, 2026
fa5397e
handle missing campaign
alexnuttall Feb 2, 2026
1d0b61d
handle missing campaign
alexnuttall Feb 2, 2026
dea1459
refactor
alexnuttall Feb 2, 2026
818ddbe
campaign id test
alexnuttall Feb 2, 2026
a98efa1
ActionLink component
alexnuttall Feb 3, 2026
93e86b9
rm mixed rc tests
alexnuttall Feb 3, 2026
9b11500
Merge remote-tracking branch 'origin/main' into feature/CCM-13493-pag…
alexnuttall Feb 3, 2026
fe606c8
package lock
alexnuttall Feb 3, 2026
91fe52d
reorg preview letter unit tests
alexnuttall Feb 3, 2026
5b52634
fmt
alexnuttall Feb 3, 2026
259e52a
always display learn more links
alexnuttall Feb 3, 2026
b731694
aria hidden action linkns
alexnuttall Feb 3, 2026
83ac644
snaps
alexnuttall Feb 3, 2026
b7fa830
use css var colour
alexnuttall Feb 3, 2026
b6f11fe
rm redundant test
alexnuttall Feb 3, 2026
4cbd0d6
test cleanup
alexnuttall Feb 3, 2026
5addd6d
links in content.ts
alexnuttall Feb 3, 2026
f54c3a4
css cleanup
alexnuttall Feb 3, 2026
ea8c5aa
install @types/node in root
alexnuttall Feb 3, 2026
ff3d64e
fmt fix
alexnuttall Feb 3, 2026
63b38d3
don't throw error in test
alexnuttall Feb 3, 2026
e96c006
use interpolate for links
alexnuttall Feb 3, 2026
00a2105
use interpolate for links
alexnuttall Feb 3, 2026
f7c90ab
rm error on unexpected test data
alexnuttall Feb 4, 2026
f2cf4a8
rm error on unexpected test data
alexnuttall Feb 4, 2026
c2eab93
rm error on unexpected test data
alexnuttall Feb 4, 2026
1278c87
rm stray ! in assertion
alexnuttall Feb 4, 2026
dc26807
fix edit links
alexnuttall Feb 4, 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
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@types/js-cookie": "^3.0.6",
"@types/jsonwebtoken": "^9.0.9",
"@types/markdown-it": "^13.0.9",
"@types/node": "^22.13.12",
"@types/react": "^19.0.12",
"@types/react-dom": "^19.0.4",
"constructs": "^10.4.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`PreviewEmailTemplateFromMessagePlan page renders Email template preview
<dt
class="nhsuk-summary-list__key"
>
Type
Template type
</dt>
<dd
class="nhsuk-summary-list__value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`PreviewLargePrintLetterTemplateFromMessagePlan page renders large print
<dt
class="nhsuk-summary-list__key"
>
Type
Template type
</dt>
<dd
class="nhsuk-summary-list__value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`PreviewNhsAppTemplateFromMessagePlan page renders NHS App template prev
<dt
class="nhsuk-summary-list__key"
>
Type
Template type
</dt>
<dd
class="nhsuk-summary-list__value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`PreviewOtherLanguageLetterTemplateFromMessagePlan page renders foreign
<dt
class="nhsuk-summary-list__key"
>
Type
Template type
</dt>
<dd
class="nhsuk-summary-list__value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`PreviewStandardEnglishLetterTemplateFromMessagePlan page renders letter
<dt
class="nhsuk-summary-list__key"
>
Type
Template type
</dt>
<dd
class="nhsuk-summary-list__value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ exports[`PreviewTextMessageTemplateFromMessagePlan page renders SMS template pre
<dt
class="nhsuk-summary-list__key"
>
Type
Template type
</dt>
<dd
class="nhsuk-summary-list__value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { redirect } from 'next/navigation';
import { getTemplate } from '@utils/form-actions';
import { Language, LetterType, TemplateDto } from 'nhs-notify-backend-client';
import {
AUTHORING_LETTER_TEMPLATE,
EMAIL_TEMPLATE,
NHS_APP_TEMPLATE,
SMS_TEMPLATE,
Expand Down Expand Up @@ -63,7 +64,7 @@ describe('PreviewLetterTemplatePage', () => {
jest.resetAllMocks();
});

it('should load page', async () => {
it('should load page with PDF letter template', async () => {
getTemplateMock.mockResolvedValueOnce(templateDTO);

const page = await PreviewLetterTemplatePage({
Expand All @@ -79,6 +80,20 @@ describe('PreviewLetterTemplatePage', () => {
expect(page).toEqual(<PreviewLetterTemplate template={letterTemplate} />);
});

it('should load page with authoring letter template', async () => {
getTemplateMock.mockResolvedValueOnce(AUTHORING_LETTER_TEMPLATE);

const page = await PreviewLetterTemplatePage({
params: Promise.resolve({
templateId: AUTHORING_LETTER_TEMPLATE.id,
}),
});

expect(page).toEqual(
<PreviewLetterTemplate template={AUTHORING_LETTER_TEMPLATE} />
);
});

it('should redirect to invalid-template when no template is found', async () => {
await PreviewLetterTemplatePage({
params: Promise.resolve({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getTemplate } from '@utils/form-actions';
import { redirect } from 'next/navigation';
import { TemplateDto } from 'nhs-notify-backend-client';
import {
AUTHORING_LETTER_TEMPLATE,
EMAIL_TEMPLATE,
NHS_APP_TEMPLATE,
SMS_TEMPLATE,
Expand All @@ -29,7 +30,7 @@ const getTemplateMock = jest.mocked(getTemplate);
describe('PreviewSubmittedLetterTemplatePage', () => {
beforeEach(jest.resetAllMocks);

it('should load page', async () => {
it('should load page with PDF letter template', async () => {
const templateDTO = {
createdAt: '2025-01-13T10:19:25.579Z',
files: {
Expand Down Expand Up @@ -74,6 +75,28 @@ describe('PreviewSubmittedLetterTemplatePage', () => {
);
});

it('should load page with authoring letter template', async () => {
const templateDTO = {
...AUTHORING_LETTER_TEMPLATE,
templateStatus: 'SUBMITTED',
} satisfies TemplateDto;

getTemplateMock.mockResolvedValueOnce(templateDTO);

const page = await PreviewSubmittedLetterTemplatePage({
params: Promise.resolve({
templateId: AUTHORING_LETTER_TEMPLATE.id,
}),
});

expect(page).toEqual(
<PreviewSubmittedTemplate
initialState={templateDTO}
previewComponent={PreviewTemplateDetailsLetter}
/>
);
});

it('should redirect to invalid-template when no template is found', async () => {
await PreviewSubmittedLetterTemplatePage({
params: Promise.resolve({
Expand Down Expand Up @@ -106,6 +129,10 @@ describe('PreviewSubmittedLetterTemplatePage', () => {
...PDF_LETTER_TEMPLATE,
templateStatus: 'NOT_YET_SUBMITTED' as const,
},
{
...AUTHORING_LETTER_TEMPLATE,
templateStatus: 'NOT_YET_SUBMITTED' as const,
},
])(
'should redirect to invalid-template when template is $templateType, name is $name, and status is $templateStatus',
async (value) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { ChooseLanguageLetterTemplates } from '@forms/ChooseLanguageLetterTemplates/ChooseLanguageLetterTemplates';
import { fireEvent, render, screen, within } from '@testing-library/react';
import { PDF_LETTER_TEMPLATE, ROUTING_CONFIG } from '@testhelpers/helpers';
import {
AUTHORING_LETTER_TEMPLATE,
PDF_LETTER_TEMPLATE,
ROUTING_CONFIG,
} from '@testhelpers/helpers';
import { useActionState } from 'react';
import { ChooseLanguageLetterTemplatesFormState } from '@forms/ChooseLanguageLetterTemplates/server-action';
import { LetterTemplate } from 'nhs-notify-web-template-management-utils';
Expand Down Expand Up @@ -46,6 +50,13 @@ const SPANISH_LETTER_TEMPLATE: LetterTemplate = {
language: 'es',
};

const GERMAN_AUTHORING_LETTER_TEMPLATE: LetterTemplate = {
...AUTHORING_LETTER_TEMPLATE,
id: 'german-authoring-letter-id',
name: 'German authoring letter template',
language: 'de',
};

const languageLetterTemplates = [
FRENCH_LETTER_TEMPLATE,
POLISH_LETTER_TEMPLATE,
Expand Down Expand Up @@ -162,6 +173,20 @@ describe('ChooseLanguageLetterTemplates', () => {
});
expect(container.asFragment()).toMatchSnapshot();
});

it('renders authoring letter templates', () => {
const container = renderComponent({
templateList: [GERMAN_AUTHORING_LETTER_TEMPLATE],
});

const table = screen.getByTestId('language-templates-table');

expect(
within(table).getByText(GERMAN_AUTHORING_LETTER_TEMPLATE.name)
).toBeInTheDocument();

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

describe('when there are no templates', () => {
Expand Down
Loading