Skip to content

Commit

Permalink
EPP-146-amend CHANGE SUBSTANCES page
Browse files Browse the repository at this point in the history
- add change-substances.html
- add fields in index.js, fields.json and pages.json and fiels/index.js
- add summary-data-section.js
- add some path to next page
  • Loading branch information
PaolaDMadd-Pro committed Feb 17, 2025
1 parent 32885e9 commit 2b1769b
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 3 deletions.
9 changes: 9 additions & 0 deletions apps/epp-amend/fields/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ module.exports = {
legend: { className: 'bold' },
validate: ['required', 'date', 'before']
}),
'amend-change-substances-options': {
mixin: 'radio-group',
legend: {
className: 'govuk-label--m'
},
className: ['govuk-radios', 'govuk-radios--inline'],
options: ['yes', 'no'],
validate: 'required'
},
'amend-precursor-field': {
mixin: 'select',
validate: ['required'],
Expand Down
22 changes: 19 additions & 3 deletions apps/epp-amend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,27 @@ module.exports = {
next: '/change-substances'
},
'/change-substances': {
fields: ['amend-explosive-precusor-type'],
fields: ['amend-change-substances-options'],
forks: [
{
target: '/countersignatory-details',
condition: req =>
req.sessionModel.get('amend-change-substances-options') === 'no' && req.sessionModel.get('amend-name-options') === 'yes' || req.sessionModel.get('amend-home-address-options') === 'yes'
},
{
target: '/no-details-amend',
condition: req =>
req.sessionModel.get('amend-change-substances-options') === 'no' && req.sessionModel.get('amend-name-options') === 'no' && req.sessionModel.get('amend-home-address-options') === 'no'
}
],
continueOnEdit:true,
locals: { captionHeading: 'Section 13 of 23' },
next: '/section-fourteen'
next: '/explosives-precursors'
},
'/no-details-amend':{
locals: { captionHeading: 'Section 13 of 23' },
},
'/section-fourteen': {
'/explosives-precursors': {
fields: ['amend-poison-type'],
next: '/select-precursor'
},
Expand Down
8 changes: 8 additions & 0 deletions apps/epp-amend/sections/summary-data-sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ module.exports = {
}
]
},
'amend-change-substances': {
steps: [
{
step: '/change-home-address',
field: 'amend-change-substances-options'
}
]
},
'amend-explosives-precursor': {
steps: [
{
Expand Down
11 changes: 11 additions & 0 deletions apps/epp-amend/translations/src/en/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@
"legend": "What date did you change your address?",
"hint": " For example, 30 09 1969"
},
"amend-change-substances-options":{
"legend": "Do you need to amend the substances on your licence?",
"options": {
"yes": {
"label": "Yes"
},
"no": {
"label": "No"
}
}
},
"amend-precursor-field": {
"hint": "Select an explosives precursor",
"options":{
Expand Down
13 changes: 13 additions & 0 deletions apps/epp-amend/translations/src/en/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
"not-uploaded": "No files uploaded",
"uploaded": "File uploaded"
},
"change-substances": {
"header": "Change in substances",
"paragraph1": "You must amend the substances on your licence if you:",
"li1": "need to add or remove substances you can acquire, possess or use",
"li2": "need to change the concentration or volume of substances that your licence covers",
"li3": "have changed your storage or usage address since your current licence was issued"
},
"select-precursor": {
"header": "Explosives precursors",
"p1": "Tell us which explosives precursors you want to import acquire use or possess.",
Expand Down Expand Up @@ -100,6 +107,9 @@
"amend-new-home-address": {
"header": "New address"
},
"amend-change-substances": {
"header": "Amend substances"
},
"amend-explosives-precursor": {
"header": "Explosives precursors"
}
Expand Down Expand Up @@ -177,6 +187,9 @@
"amend-new-country": {
"label": "Country"
},
"amend-home-address-options": {
"label": "Do you need to amend the substances on your licence?"
},
"amend-precursor-field": {
"label": "Explosives precursor"
}
Expand Down
17 changes: 17 additions & 0 deletions apps/epp-amend/views/change-substances.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{<partials-page}}
{{$page-content}}
<div>
<p class="govuk-body">{{#t}}pages.change-substances.paragraph1{{/t}}</p>
<ul class="govuk-list govuk-list--bullet">
<li>{{#t}}pages.change-substances.li1{{/t}}</li>
<li>{{#t}}pages.change-substances.li2{{/t}}</li>
<li>{{#t}}pages.change-substances.li3{{/t}}</li>
</ul>
</div>

{{#fields}}
{{#renderField}}amend-change-substances-options{{/renderField}}
{{/fields}}
{{#input-submit}}continue{{/input-submit}}
{{/page-content}}
{{/partials-page}}

0 comments on commit 2b1769b

Please sign in to comment.