Skip to content

Commit 859def3

Browse files
committed
init
1 parent e3e2dad commit 859def3

File tree

20 files changed

+4
-77
lines changed

20 files changed

+4
-77
lines changed

frontend/jest.setup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ Object.assign(global, {
3232
createMocks();
3333

3434
// set feature flag
35-
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'true';
3635
process.env.NEXT_PUBLIC_ENABLE_PROOFING = 'true';

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,3 @@ test('ChooseATemplateTypePage', async () => {
4141
expect(await generateMetadata()).toEqual({ title: pageTitle });
4242
expect(container.asFragment()).toMatchSnapshot();
4343
});
44-
45-
test('ChooseATemplateTypePage - LETTER option is hidden when feature flag is not enabled', async () => {
46-
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'false';
47-
48-
const page = await ChooseATemplateTypePage();
49-
50-
const container = render(page);
51-
52-
expect(container.asFragment()).toMatchSnapshot();
53-
});
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
import { render } from '@testing-library/react';
22
import HomePage from '@app/create-and-submit-templates/page';
33

4-
const OLD_ENV = { ...process.env };
5-
64
beforeEach(() => {
75
jest.resetAllMocks();
8-
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'true';
9-
});
10-
11-
afterAll(() => {
12-
process.env = OLD_ENV;
136
});
147

158
it('matches the snapshot', () => {
169
const { container } = render(<HomePage />);
1710
expect(container).toMatchSnapshot();
1811
});
19-
20-
it('matches the snapshot with letters feature flag disabled', () => {
21-
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'false';
22-
23-
const { container } = render(<HomePage />);
24-
expect(container).toMatchSnapshot();
25-
});

frontend/src/__tests__/app/create-letter-template/page.test.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,14 @@
33
*/
44
import CreateLetterTemplatePage from '@app/create-letter-template/page';
55

6-
const OLD_ENV = { ...process.env };
7-
86
describe('CreateLetterTemplatePage', () => {
97
beforeEach(() => {
108
jest.resetAllMocks();
11-
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'true';
12-
});
13-
14-
afterAll(() => {
15-
process.env = OLD_ENV;
169
});
1710

1811
it('should render CreateLetterTemplatePage', async () => {
1912
const page = await CreateLetterTemplatePage();
2013

2114
expect(page).toMatchSnapshot();
2215
});
23-
24-
it('returns 404 when letters feature flag is not enabled', async () => {
25-
process.env.NEXT_PUBLIC_ENABLE_LETTERS = 'false';
26-
27-
await expect(CreateLetterTemplatePage()).rejects.toThrow(
28-
'NEXT_HTTP_ERROR_FALLBACK;404'
29-
);
30-
});
3116
});

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ export async function generateMetadata(): Promise<Metadata> {
1414
}
1515

1616
const ChooseATemplateTypePage = async () => {
17-
const templateTypes = TEMPLATE_TYPE_LIST.filter(
18-
(t) => process.env.NEXT_PUBLIC_ENABLE_LETTERS === 'true' || t !== 'LETTER'
19-
);
20-
21-
return <ChooseTemplate templateTypes={templateTypes} />;
17+
return <ChooseTemplate templateTypes={TEMPLATE_TYPE_LIST} />;
2218
};
2319

2420
export default ChooseATemplateTypePage;

frontend/src/app/create-and-submit-templates/page.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ export const metadata: Metadata = {
1010
};
1111

1212
export default function HomePage() {
13-
const channelList =
14-
process.env.NEXT_PUBLIC_ENABLE_LETTERS === 'true'
15-
? [...homePageContent.list, 'letters']
16-
: homePageContent.list;
17-
1813
return (
1914
<NHSNotifyMain>
2015
<div className='nhsuk-grid-row' data-testid='page-content-wrapper'>
@@ -27,7 +22,7 @@ export default function HomePage() {
2722
<p>{homePageContent.text2}</p>
2823

2924
<ul className='nhsuk-list nhsuk-list--bullet'>
30-
{channelList.map((channel, i) => (
25+
{homePageContent.channelList.map((channel, i) => (
3126
<li key={`template${i + 1}`}>{channel}</li>
3227
))}
3328
</ul>

frontend/src/app/create-letter-template/page.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { notFound } from 'next/navigation';
21
import { CreateLetterTemplate } from 'nhs-notify-web-template-management-utils';
32
import { LetterTemplateForm } from '@forms/LetterTemplateForm/LetterTemplateForm';
43

54
const CreateLetterTemplatePage = async () => {
6-
if (process.env.NEXT_PUBLIC_ENABLE_LETTERS !== 'true') notFound();
7-
85
const initialState: CreateLetterTemplate = {
96
templateType: 'LETTER',
107
name: '',

frontend/src/content/content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const homePage = {
170170
text1:
171171
'Use this tool to create and submit templates you want to send as messages using NHS Notify.',
172172
text2: 'You can create templates for:',
173-
list: ['NHS App messages', 'emails', 'text messages (SMS)'],
173+
channelList: ['NHS App messages', 'emails', 'text messages (SMS)', 'letters'],
174174
text3:
175175
'When you submit a template, it will be used by NHS Notify to set up the messages you want to send.',
176176
pageSubHeading: 'Before you start',

infrastructure/terraform/components/app/amplify_app.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ resource "aws_amplify_app" "main" {
3232
AMPLIFY_MONOREPO_APP_ROOT = "frontend"
3333
API_BASE_URL = module.backend_api.api_base_url
3434
CSRF_SECRET = aws_ssm_parameter.csrf_secret.value
35-
NEXT_PUBLIC_ENABLE_LETTERS = var.enable_letters
3635
NEXT_PUBLIC_ENABLE_PROOFING = var.enable_proofing
3736
NEXT_PUBLIC_PROMPT_SECONDS_BEFORE_LOGOUT = 120
3837
NEXT_PUBLIC_TIME_TILL_LOGOUT_SECONDS = 900

infrastructure/terraform/components/app/module_backend_api.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module "backend_api" {
2121

2222
enable_backup = var.destination_vault_arn != null ? true : false
2323

24-
enable_letters = var.enable_letters
2524
enable_proofing = var.enable_proofing
2625
letter_suppliers = var.letter_suppliers
2726
log_destination_arn = "arn:aws:logs:${var.region}:${var.observability_account_id}:destination:nhs-notify-main-acct-firehose-logs"

0 commit comments

Comments
 (0)