Skip to content

Commit

Permalink
fix(app): refocus branch to no-returns-required
Browse files Browse the repository at this point in the history
  • Loading branch information
Demwunz committed Apr 5, 2024
1 parent b688cbd commit ca46203
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 43 deletions.
16 changes: 0 additions & 16 deletions app/controllers/return-requirements.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ async function submitPoints (request, h) {
return h.view('return-requirements/points.njk', pageData)
}

if (pageData.checkYourAnswersVisited) {
return h.redirect(`/system/return-requirements/${sessionId}/check-your-answers`)
}

return h.redirect(`/system/return-requirements/${sessionId}/abstraction-period`)
}

Expand All @@ -275,10 +271,6 @@ async function submitPurpose (request, h) {
return h.view('return-requirements/purpose.njk', pageData)
}

if (pageData.checkYourAnswersVisited) {
return h.redirect(`/system/return-requirements/${sessionId}/check-your-answers`)
}

return h.redirect(`/system/return-requirements/${sessionId}/points`)
}

Expand All @@ -291,10 +283,6 @@ async function submitReason (request, h) {
return h.view('return-requirements/reason.njk', pageData)
}

if (pageData.checkYourAnswersVisited) {
return h.redirect(`/system/return-requirements/${sessionId}/check-your-answers`)
}

return h.redirect(`/system/return-requirements/${sessionId}/setup`)
}

Expand Down Expand Up @@ -325,10 +313,6 @@ async function submitSiteDescription (request, h) {
return h.view('return-requirements/site-description.njk', pageData)
}

if (pageData.checkYourAnswersVisited) {
return h.redirect(`/system/return-requirements/${sessionId}/check-your-answers`)
}

return h.redirect(`/system/return-requirements/${sessionId}/frequency-collected`)
}

Expand Down
1 change: 0 additions & 1 deletion app/services/return-requirements/purpose.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ async function go (sessionId) {

return {
activeNavBar: 'search',
checkYourAnswersVisited: session.data.checkYourAnswersVisited,
pageTitle: 'Select the purpose for the requirements for returns',
...formattedData
}
Expand Down
1 change: 0 additions & 1 deletion app/services/return-requirements/reason.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ async function go (sessionId) {

return {
activeNavBar: 'search',
checkYourAnswersVisited: session.data.checkYourAnswersVisited,
pageTitle: 'Select the reason for the return requirement',
...formattedData
}
Expand Down
1 change: 0 additions & 1 deletion app/services/return-requirements/setup.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ async function go (sessionId) {

return {
activeNavBar: 'search',
checkYourAnswersVisited: session.data.checkYourAnswersVisited,
pageTitle: 'How do you want to set up the return requirement?',
...formattedData
}
Expand Down
4 changes: 1 addition & 3 deletions app/services/return-requirements/submit-purpose.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ async function go (sessionId, payload) {
if (!validationResult) {
await _save(session, payload)

return {
checkYourAnswersVisited: session.data.checkYourAnswersVisited
}
return {}
}

const formattedData = SelectPurposePresenter.go(session, purposesData, payload)
Expand Down
5 changes: 1 addition & 4 deletions app/services/return-requirements/submit-reason.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ async function go (sessionId, payload) {
if (!validationResult) {
await _save(session, payload)

return {
checkYourAnswersVisited: session.data.checkYourAnswersVisited
}
return {}
}

const formattedData = ReasonPresenter.go(session, payload)

return {
activeNavBar: 'search',
checkYourAnswersVisited: session.data.checkYourAnswersVisited,
error: validationResult,
pageTitle: 'Select the reason for the return requirement',
...formattedData
Expand Down
2 changes: 0 additions & 2 deletions app/services/return-requirements/submit-setup.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ async function go (sessionId, payload) {
await _save(session, payload)

return {
checkYourAnswersVisited: session.data.checkYourAnswersVisited,
redirect: _redirect(payload.setup)
}
}
Expand All @@ -41,7 +40,6 @@ async function go (sessionId, payload) {

return {
activeNavBar: 'search',
checkYourAnswersVisited: session.data.checkYourAnswersVisited,
error: validationResult,
pageTitle: 'How do you want to set up the return requirement?',
...formattedData
Expand Down
6 changes: 1 addition & 5 deletions app/views/return-requirements/purpose.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@

{% block breadcrumbs %}
{# Back link #}
{% set backLink %}
/system/return-requirements/{{ id }}/{{ 'check-your-answers' if checkYourAnswersVisited else 'setup' }}
{% endset %}

{{
govukBackLink({
text: 'Back',
href: backLink
href: rootLink + "/setup"
})
}}
{% endblock %}
Expand Down
6 changes: 1 addition & 5 deletions app/views/return-requirements/reason.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@

{% block breadcrumbs %}
{# Back link #}
{% set backLink %}
/system/return-requirements/{{ id }}/{{ 'check-your-answers' if checkYourAnswersVisited else 'start-date' }}
{% endset %}

{{
govukBackLink({
text: 'Back',
href: backLink
href: '/system/return-requirements/' + id + '/start-date'
})
}}
{% endblock %}
Expand Down
6 changes: 1 addition & 5 deletions app/views/return-requirements/setup.njk
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@

{% block breadcrumbs %}
{# Back link #}
{% set backLink %}
/system/return-requirements/{{ id }}/{{ 'check-your-answers' if checkYourAnswersVisited else 'reason' }}
{% endset %}

{{
govukBackLink({
text: 'Back',
href: backLink
href: rootLink + '/reason'
})
}}
{% endblock %}
Expand Down

0 comments on commit ca46203

Please sign in to comment.