Skip to content

Commit

Permalink
EPP-57 amendPath add some logic to render fields in summary page
Browse files Browse the repository at this point in the history
- add confirm.html,
- update fields in summary-data-section,js
- add fields for the confirm summary page
- add initial page path for this section in apps/epp-common/index.js
  • Loading branch information
PaolaDMadd-Pro committed Dec 20, 2024
1 parent 7f78864 commit f19bcd9
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apps/epp-amend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
translations: 'apps/epp-amend/translations',
baseUrl: '/amend-license',
steps: {
'/section-one': {
'/amend-licence-number': {
behaviours: [validateAndRedirect],
backLink: '/application-type',
fields: ['amend-licence-number'],
Expand All @@ -21,7 +21,7 @@ module.exports = {
'amend-middlename',
'amend-lastname'
],
next: '/section-three'
next: '/confirm'
},
'/section-three': {
fields: ['amend-date-of-birth'],
Expand Down
14 changes: 13 additions & 1 deletion apps/epp-amend/sections/summary-data-sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,19 @@ module.exports = {
steps: [
{
step: '/amend-name-on-licence',
fields: ['amend-name-title', 'amend-firstname', 'amend-middlename', 'amend-lastname']
field: 'amend-name-title'
},
{
step: '/amend-name-on-licence',
field: 'amend-firstname'
},
{
step: '/amend-name-on-licence',
field: 'amend-middlename'
},
{
step: '/amend-name-on-licence',
field: 'amend-lastname'
}
]
}
Expand Down
27 changes: 24 additions & 3 deletions apps/epp-amend/translations/src/en/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,29 @@
"amend-name-on-licence": {
"header": "What is your name on the licence?"
},

"application-submitted": {
"confirmed": "Amendment submitted"


"confirm": {
"header": "Check your answers",
"paragraph": "Review your answers below and amend if required before proceeding to declaration and payment.",
"sections": {
"Applicant name": {
"header": "Applicant name"
}
}
},
"fields": {
"amend-name-title": {
"label" : "Title"
},
"amend-name-firstname": {
"label" : "First name"
},
"amend-name-middlename": {
"label" : "Middle name(s)"
},
"amend-name-lastname": {
"label" : "Surname"
}
}
}
12 changes: 12 additions & 0 deletions apps/epp-amend/views/partials/confirm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{<partials-page}}
{{$page-content}}
<div>
<p class="govuk-body">{{#t}}pages.confirm.paragraph{{/t}}</p>
</div>
<div>
{{#rows}}
{{> partials-summary-table}}
{{/rows}}
</div>
{{/page-content}}
{{/partials-page}}
28 changes: 28 additions & 0 deletions apps/epp-amend/views/partials/summary-table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div>
<h2 class="section-header">{{section}}</h2>
</div>
<dl>
{{#fields}}
{{^omitFromSummary}}
<div class="confirm-row">
{{#isSeparator}}
{{/isSeparator}}
{{^isSeparator}}
<dt class="confirm-label">{{label}}</dt>
<dd class="confirm-value" data-value="{{value}}">{{value}}</dd>
{{^omitChangeLink}}
{{#changeLink}}
<dd><span><a class="govuk-link" href="{{changeLink}}" id="{{field}}-change-{{index}}">{{#t}}buttons.change{{/t}} <span class="visuallyhidden">{{changeLinkDescription}} from {{value}}</span></a></span></dd>
{{/changeLink}}
{{^changeLink}}
<dd><span><a class="govuk-link" href="{{baseUrl}}{{step}}/edit#{{field}}" id="{{field}}-change">{{#t}}buttons.change{{/t}} <span class="visuallyhidden">{{changeLinkDescription}} from {{value}}</span></a></span></dd>
{{/changeLink}}
{{/omitChangeLink}}
{{#omitChangeLink}}
<dd> </dd>
{{/omitChangeLink}}
{{/isSeparator}}
</div>
{{/omitFromSummary}}
{{/fields}}
</dl>
2 changes: 1 addition & 1 deletion apps/epp-common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
}
},
{
target: '/amend-license/section-one',
target: '/amend-license/amend-licence-number',
condition: {
field: 'application-type',
value: 'amend'
Expand Down

0 comments on commit f19bcd9

Please sign in to comment.