Skip to content

Commit a9e7981

Browse files
authored
CCM-11575: reposition error summary on copy page (#784)
1 parent 83f4047 commit a9e7981

File tree

2 files changed

+51
-51
lines changed

2 files changed

+51
-51
lines changed

frontend/src/__tests__/components/forms/CopyTemplate/__snapshots__/CopyTemplate.test.tsx.snap

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,31 @@ exports[`Choose template page Client-side validation triggers 1`] = `
1414
id="maincontent"
1515
role="main"
1616
>
17+
<div
18+
aria-labelledby="error-summary-title"
19+
class="nhsuk-error-summary"
20+
role="alert"
21+
tabindex="-1"
22+
>
23+
<h2
24+
class="nhsuk-error-summary__title"
25+
data-testid="error-summary"
26+
id="error-summary-title"
27+
>
28+
There is a problem
29+
</h2>
30+
<ul
31+
class="nhsuk-list nhsuk-error-summary__list"
32+
>
33+
<li>
34+
<a
35+
href="#templateType"
36+
>
37+
Select a template type
38+
</a>
39+
</li>
40+
</ul>
41+
</div>
1742
<div
1843
class="nhsuk-grid-row"
1944
>
@@ -25,31 +50,6 @@ exports[`Choose template page Client-side validation triggers 1`] = `
2550
>
2651
Copy 'undefined'
2752
</h1>
28-
<div
29-
aria-labelledby="error-summary-title"
30-
class="nhsuk-error-summary"
31-
role="alert"
32-
tabindex="-1"
33-
>
34-
<h2
35-
class="nhsuk-error-summary__title"
36-
data-testid="error-summary"
37-
id="error-summary-title"
38-
>
39-
There is a problem
40-
</h2>
41-
<ul
42-
class="nhsuk-list nhsuk-error-summary__list"
43-
>
44-
<li>
45-
<a
46-
href="#templateType"
47-
>
48-
Select a template type
49-
</a>
50-
</li>
51-
</ul>
52-
</div>
5353
<form
5454
action="/action"
5555
>
@@ -193,6 +193,31 @@ exports[`Choose template page renders error component 1`] = `
193193
id="maincontent"
194194
role="main"
195195
>
196+
<div
197+
aria-labelledby="error-summary-title"
198+
class="nhsuk-error-summary"
199+
role="alert"
200+
tabindex="-1"
201+
>
202+
<h2
203+
class="nhsuk-error-summary__title"
204+
data-testid="error-summary"
205+
id="error-summary-title"
206+
>
207+
There is a problem
208+
</h2>
209+
<ul
210+
class="nhsuk-list nhsuk-error-summary__list"
211+
>
212+
<li>
213+
<a
214+
href="#page"
215+
>
216+
Component error message
217+
</a>
218+
</li>
219+
</ul>
220+
</div>
196221
<div
197222
class="nhsuk-grid-row"
198223
>
@@ -204,31 +229,6 @@ exports[`Choose template page renders error component 1`] = `
204229
>
205230
Copy 'undefined'
206231
</h1>
207-
<div
208-
aria-labelledby="error-summary-title"
209-
class="nhsuk-error-summary"
210-
role="alert"
211-
tabindex="-1"
212-
>
213-
<h2
214-
class="nhsuk-error-summary__title"
215-
data-testid="error-summary"
216-
id="error-summary-title"
217-
>
218-
There is a problem
219-
</h2>
220-
<ul
221-
class="nhsuk-list nhsuk-error-summary__list"
222-
>
223-
<li>
224-
<a
225-
href="#page"
226-
>
227-
Component error message
228-
</a>
229-
</li>
230-
</ul>
231-
</div>
232232
<form
233233
action="/action"
234234
>

frontend/src/components/forms/CopyTemplate/CopyTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export const CopyTemplate = ({ template }: CopyTemplate) => {
4848
<NotifyBackLink>{backLinkText}</NotifyBackLink>
4949
</Link>
5050
<NHSNotifyMain>
51+
<NhsNotifyErrorSummary errorState={errorState} />
5152
<div className='nhsuk-grid-row'>
5253
<div className='nhsuk-grid-column-two-thirds'>
5354
<h1 className='nhsuk-heading-xl'>{fullPageHeading}</h1>
54-
<NhsNotifyErrorSummary errorState={errorState} />
5555
<NHSNotifyRadioButtonForm
5656
formId='choose-a-template-type'
5757
radiosId='templateType'

0 commit comments

Comments
 (0)