Skip to content

Commit 3b96ff3

Browse files
committed
Merge branch 'main' into feature/CCM-8628-favicons
2 parents fc24e75 + 7b0da7f commit 3b96ff3

File tree

118 files changed

+15636
-30110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+15636
-30110
lines changed

.eslintrc.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
}
66
},
77
"extends": [
8-
"airbnb",
98
"eslint:recommended",
109
"plugin:@typescript-eslint/recommended",
1110
"plugin:jest/recommended",
1211
"plugin:jsx-a11y/recommended",
1312
"plugin:prettier/recommended",
14-
"plugin:react-hooks/recommended",
15-
"plugin:react/recommended",
1613
"plugin:security/recommended-legacy",
1714
"plugin:sonarjs/recommended-legacy",
1815
"plugin:unicorn/recommended"
@@ -24,14 +21,11 @@
2421
"jest",
2522
"jsx-a11y",
2623
"prettier",
27-
"react",
28-
"react-hooks",
2924
"security",
3025
"sonarjs",
3126
"unicorn"
3227
],
3328
"rules": {
34-
"react/display-name": "off",
3529
"no-restricted-syntax": "off",
3630
"consistent-return": "off",
3731
"prettier/prettier": "error",
@@ -45,16 +39,6 @@
4539
]
4640
}
4741
],
48-
"react/react-in-jsx-scope": "off",
49-
"react/jsx-filename-extension": "off",
50-
"react/jsx-props-no-spreading": "off",
51-
"react/function-component-definition": "off",
52-
"react/jsx-no-useless-fragment": [
53-
"error",
54-
{
55-
"allowExpressions": true
56-
}
57-
],
5842
"import/prefer-default-export": "off",
5943
"import/extensions": "off",
6044
"no-shadow": "off",
@@ -69,13 +53,10 @@
6953
],
7054
"security/detect-object-injection": "off",
7155
"sonarjs/no-duplicate-string": "off",
72-
"react/no-danger": "off",
7356
"no-param-reassign": "off",
74-
"react/require-default-props": "off",
7557
"no-useless-constructor": "off",
7658
"sonarjs/no-small-switch": "off",
7759
"sonarjs/no-unused-vars": "off",
78-
"react/jsx-no-bind": "off",
7960
"unicorn/no-null": "off",
8061
"prefer-regex-literals": "off",
8162
"class-methods-use-this": "off",

frontend/.eslintrc.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
{
22
"extends": [
3+
"../.eslintrc",
34
"next",
4-
"next/core-web-vitals",
5-
"../.eslintrc"
6-
]
5+
"next/core-web-vitals"
6+
],
7+
"rules": {
8+
"react/display-name": "off",
9+
"react/react-in-jsx-scope": "off",
10+
"react/jsx-filename-extension": "off",
11+
"react/jsx-props-no-spreading": "off",
12+
"react/function-component-definition": "off",
13+
"react/jsx-no-useless-fragment": [
14+
"error",
15+
{
16+
"allowExpressions": true
17+
}
18+
],
19+
"react/no-danger": "off",
20+
"react/require-default-props": "off",
21+
"react/jsx-no-bind": "off"
22+
}
723
}

frontend/next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ const nextConfig = (phase) => {
1818
API_BASE_URL: amplifyConfig?.meta?.api_base_url,
1919
},
2020

21+
sassOptions: {
22+
quietDeps: true,
23+
},
24+
2125
experimental: {
2226
serverActions: {
2327
allowedOrigins: [domain, domain.replace('templates', 'web-gateway')],

frontend/package.json

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,57 +18,50 @@
1818
"mock-amplify-outputs": "if [ ! -f ./amplify_outputs.json ]; then echo \"{}\" > ./amplify_outputs.json ; fi"
1919
},
2020
"dependencies": {
21-
"@aws-amplify/adapter-nextjs": "^1.2.23",
22-
"@aws-amplify/backend": "^1.2.0",
23-
"@aws-amplify/ui-react": "^6.3.1",
21+
"@aws-amplify/adapter-nextjs": "^1.4.3",
22+
"@aws-amplify/ui-react": "^6.9.1",
2423
"@aws-sdk/client-ses": "^3.637.0",
25-
"aws-amplify": "^6.6.0",
24+
"aws-amplify": "^6.12.3",
2625
"date-fns": "^4.1.0",
26+
"jsonwebtoken": "^9.0.2",
2727
"jwt-decode": "^4.0.0",
2828
"markdown-it": "^13.0.1",
2929
"mimetext": "^3.0.24",
30-
"next": "14.2.13",
31-
"next-client-cookies": "^1.1.1",
30+
"next": "^15.1.7",
31+
"next-client-cookies": "^2.0.1",
3232
"nhs-notify-backend-client": "*",
33-
"nhs-notify-web-template-management-amplify": "*",
3433
"nhs-notify-web-template-management-utils": "*",
3534
"nhsuk-frontend": "^9.1.0",
3635
"nhsuk-react-components": "^5.0.0",
3736
"path": "^0.12.7",
38-
"react": "^18",
39-
"react-dom": "^18",
37+
"react": "^19.0.0",
38+
"react-dom": "^19.0.0",
4039
"zod": "^3.23.8"
4140
},
4241
"devDependencies": {
43-
"@aws-amplify/backend-cli": "^1.2.5",
44-
"@testing-library/jest-dom": "^6.5.0",
45-
"@testing-library/react": "^16.0.1",
46-
"@testing-library/user-event": "^14.5.2",
42+
"@testing-library/jest-dom": "^6.6.3",
43+
"@testing-library/react": "^16.2.0",
44+
"@testing-library/user-event": "^14.6.1",
4745
"@types/jest": "^29.5.14",
4846
"@types/jsonwebtoken": "^9.0.8",
4947
"@types/markdown-it": "^13.0.1",
5048
"@types/node": "^22.8.1",
51-
"@types/react": "^18",
52-
"@types/react-dom": "^18",
49+
"@types/react": "^19.0.8",
50+
"@types/react-dom": "^19.0.3",
5351
"constructs": "^10.3.0",
52+
"eslint-config-next": "^15.1.7",
5453
"jest-mock-extended": "^3.0.7",
5554
"mochawesome": "^7.1.3",
56-
"pa11y": "^8.0.0",
5755
"pa11y-ci": "^3.1.0",
5856
"pa11y-ci-reporter-html": "^7.0.0",
5957
"pm2": "^5.4.2",
6058
"prettier": "^3.3.3",
61-
"sass": "^1.80.5",
59+
"sass": "^1.84.0",
6260
"ts-jest": "^29.2.5",
6361
"ts-node": "^10.9.2",
6462
"tsx": "^4.19.1",
6563
"typescript": "^5.5.4",
6664
"wait-on": "^8.0.0",
6765
"whatwg-fetch": "^3.6.20"
68-
},
69-
"overrides": {
70-
"pa11y-ci": {
71-
"pa11y": "^8.0.0"
72-
}
7366
}
7467
}

frontend/src/__tests__/app/choose-a-template-type/page.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jest.mock('next/navigation', () => ({
1313
},
1414
}));
1515

16-
jest.mock('react-dom', () => {
17-
const originalModule = jest.requireActual('react-dom');
16+
jest.mock('react', () => {
17+
const originalModule = jest.requireActual('react');
1818

1919
return {
2020
...originalModule,
21-
useFormState: (
21+
useActionState: (
2222
_: (
2323
formState: TemplateFormState,
2424
formData: FormData

frontend/src/__tests__/app/copy-template/page.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ describe('CopyTemplatePage', () => {
3636
getTemplateMock.mockResolvedValueOnce(template);
3737

3838
const page = await CopyTemplatePage({
39-
params: {
39+
params: Promise.resolve({
4040
templateId: 'template-id',
41-
},
41+
}),
4242
});
4343

4444
expect(page).toEqual(<CopyTemplate template={template} />);
4545
});
4646

4747
it('should redirect to invalid-template when no templateId is found', async () => {
4848
await CopyTemplatePage({
49-
params: {
49+
params: Promise.resolve({
5050
templateId: 'template-id',
51-
},
51+
}),
5252
});
5353

5454
expect(redirectMock).toHaveBeenCalledWith('/invalid-template', 'replace');

frontend/src/__tests__/app/create-and-submit-templates/__snapshots__/page.test.tsx.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ exports[`matches the snapshot 1`] = `
6363
<a
6464
aria-disabled="false"
6565
class="nhsuk-button"
66-
data-testid="link-button"
6766
draggable="false"
6867
href="/templates/manage-templates"
6968
role="button"

frontend/src/__tests__/app/delete-template/page.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ describe('PreviewEmailTemplatePage', () => {
4444
getTemplateMock.mockResolvedValueOnce(templateDTO);
4545

4646
const page = await DeleteTemplatePage({
47-
params: {
47+
params: Promise.resolve({
4848
templateId: 'template-id',
49-
},
49+
}),
5050
});
5151

5252
expect(page).toEqual(<DeleteTemplate template={emailTemplate} />);
5353
});
5454

5555
it('should redirect to invalid-template when no templateId is found', async () => {
5656
await DeleteTemplatePage({
57-
params: {
57+
params: Promise.resolve({
5858
templateId: 'template-id',
59-
},
59+
}),
6060
});
6161

6262
expect(redirectMock).toHaveBeenCalledWith('/invalid-template', 'replace');
@@ -74,9 +74,9 @@ describe('PreviewEmailTemplatePage', () => {
7474
});
7575

7676
await DeleteTemplatePage({
77-
params: {
77+
params: Promise.resolve({
7878
templateId: 'template-id',
79-
},
79+
}),
8080
});
8181

8282
expect(redirectMock).toHaveBeenCalledWith('/invalid-template', 'replace');
@@ -94,9 +94,9 @@ describe('PreviewEmailTemplatePage', () => {
9494
});
9595

9696
await DeleteTemplatePage({
97-
params: {
97+
params: Promise.resolve({
9898
templateId: 'template-id',
99-
},
99+
}),
100100
});
101101

102102
expect(redirectMock).toHaveBeenCalledWith('/manage-templates', 'push');

frontend/src/__tests__/app/edit-email-template/page.test.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ describe('EditEmailTemplatePage', () => {
3636
it('should redirect to invalid-template when no template is found', async () => {
3737
getTemplateMock.mockResolvedValueOnce(undefined);
3838

39-
await EditEmailTemplatePage({ params: { templateId: 'template-id' } });
39+
await EditEmailTemplatePage({
40+
params: Promise.resolve({
41+
templateId: 'template-id',
42+
}),
43+
});
4044

4145
expect(getTemplateMock).toHaveBeenCalledWith('template-id');
4246

@@ -49,7 +53,11 @@ describe('EditEmailTemplatePage', () => {
4953
templateType: TemplateType.NHS_APP,
5054
});
5155

52-
await EditEmailTemplatePage({ params: { templateId: 'template-id' } });
56+
await EditEmailTemplatePage({
57+
params: Promise.resolve({
58+
templateId: 'template-id',
59+
}),
60+
});
5361

5462
expect(getTemplateMock).toHaveBeenCalledWith('template-id');
5563

@@ -67,7 +75,9 @@ describe('EditEmailTemplatePage', () => {
6775
};
6876

6977
const page = await EditEmailTemplatePage({
70-
params: { templateId: 'template-id' },
78+
params: Promise.resolve({
79+
templateId: 'template-id',
80+
}),
7181
});
7282

7383
expect(getTemplateMock).toHaveBeenCalledWith('template-id');

frontend/src/__tests__/app/edit-nhs-app-template/page.test.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ describe('EditNhsAppTemplatePage', () => {
4242
getTemplateMock.mockResolvedValueOnce(templateDTO);
4343

4444
const page = await EditNhsAppTemplatePage({
45-
params: { templateId: 'template-id' },
45+
params: Promise.resolve({
46+
templateId: 'template-id',
47+
}),
4648
});
4749

4850
expect(page).toEqual(<NhsAppTemplateForm initialState={nhsAppTemplate} />);
@@ -52,9 +54,9 @@ describe('EditNhsAppTemplatePage', () => {
5254
getTemplateMock.mockResolvedValueOnce(undefined);
5355

5456
await EditNhsAppTemplatePage({
55-
params: {
57+
params: Promise.resolve({
5658
templateId: 'template-id',
57-
},
59+
}),
5860
});
5961

6062
expect(redirectMock).toHaveBeenCalledWith('/invalid-template', 'replace');
@@ -79,9 +81,9 @@ describe('EditNhsAppTemplatePage', () => {
7981
});
8082

8183
await EditNhsAppTemplatePage({
82-
params: {
84+
params: Promise.resolve({
8385
templateId: 'template-id',
84-
},
86+
}),
8587
});
8688

8789
expect(redirectMock).toHaveBeenCalledWith('/invalid-template', 'replace');

0 commit comments

Comments
 (0)