Skip to content

Commit

Permalink
NRM: Add session timeout warning
Browse files Browse the repository at this point in the history
- add session-timeout-warning component and  saveExitFormContent property to hof.settings.json to customise save-and-exit page
- add /session-timeout step to common/index.js
- amend static pages to not show session timeout popup
- remove duplicate redundant session-timeout and privacy files,
- add exit step for start, feedback and verify pages
  • Loading branch information
Rhodine-orleans-lindsay committed Jan 13, 2025
1 parent 92e967e commit 1f25298
Show file tree
Hide file tree
Showing 21 changed files with 167 additions and 194 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,3 @@ There are a bunch of microservices as part of modernslavery:
for legacy information saved as part of the 'save and return' process, so users can update if required before submission.
This page should be reviewed within 12 months to see if any active cases in the 'save and return' feature are using this
field before the page can be permanently removed.



4 changes: 3 additions & 1 deletion apps/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module.exports = {
steps: {
'/start': {
next: '/verify/who-do-you-work-for'
}
},
'/session-timeout': {},
'/exit': {}
}
};
15 changes: 11 additions & 4 deletions apps/common/views/accessibility.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{{<partials-page}}
{{$page-content}}
{{<layout}}

{{$propositionHeader}}{{/propositionHeader}}

{{$header}}
Accessibility statement
{{/header}}

{{$content}}
<h1 class="govuk-heading-l">Accessibility statement</h1>
<div>
<p>This accessibility statement applies to the report modern slavery service.</p>
Expand Down Expand Up @@ -47,5 +54,5 @@ <h2 class="govuk-heading-m">Preparation of this accessibility statement</h2>
<p>This website was last tested on 20 August 2024. The test was carried out internally by the Home Office.</p>
<p>We tested the service based on a user's ability to complete key journeys. All parts of the chosen journeys were tested, including documents. Journeys were chosen on a number of factors including usage statistics, risk assessments and subject matter.</p>
</div>
{{/page-content}}
{{/partials-page}}
{{/content}}
{{/layout}}
15 changes: 11 additions & 4 deletions apps/common/views/designated-organisations.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{{<partials-page}}
{{$page-content}}
{{<layout}}

{{$propositionHeader}}{{/propositionHeader}}

{{$header}}
{{#t}}pages.designated-organisations.header{{/t}}
{{/header}}

{{$content}}
<h1 class="govuk-heading-l">{{#t}}pages.designated-organisations.header{{/t}}</h1>
<fieldset class="govuk-fieldset">
<p class="govuk-body">{{#t}}pages.designated-organisations.paragraph-1{{/t}}</p>
Expand All @@ -24,5 +31,5 @@ <h1 class="govuk-heading-l">{{#t}}pages.designated-organisations.header{{/t}}</h
<li>{{#t}}pages.designated-organisations.paragraph-1-bullet-18{{/t}}</li>
</ul>
</fieldset>
{{/page-content}}
{{/partials-page}}
{{/content}}
{{/layout}}
15 changes: 11 additions & 4 deletions apps/common/views/paper-version-download.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{{<partials-page}}
{{$page-content}}
{{<layout}}

{{$propositionHeader}}{{/propositionHeader}}

{{$header}}
{{#t}}pages.paper-version-download.header{{/t}}
{{/header}}

{{$content}}
<h1 class="govuk-heading-l">{{#t}}pages.paper-version-download.header{{/t}}</h1>
<p class="govuk-body">{{#t}}pages.paper-version-download.paragraph-1-1{{/t}} <a href="/">{{#t}}pages.paper-version-download.paragraph-1-link-1{{/t}}</a> {{#t}}pages.paper-version-download.paragraph-1-2{{/t}}</p>
<p class="govuk-body">{{#t}}pages.paper-version-download.paragraph-2{{/t}}</p>
Expand All @@ -8,5 +15,5 @@ <h1 class="govuk-heading-l">{{#t}}pages.paper-version-download.header{{/t}}</h1>
<div class="govuk-!-padding-bottom-3"></div>
<a href="prompt-sheet-for-working-offline" id="paper-version-download" role="button" class="govuk-button govuk-button--start govuk-!-margin-top-2 govuk-!-margin-bottom-8">{{#t}}pages.paper-version-download.download-button{{/t}}</a>
<div class="govuk-!-padding-bottom-1"></div>
{{/page-content}}
{{/partials-page}}
{{/content}}
{{/layout}}
16 changes: 11 additions & 5 deletions apps/common/views/privacy.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{{<partials-page}}
{{$page-content}}
{{<layout}}

{{$propositionHeader}}{{/propositionHeader}}

{{$header}}
{{#t}}pages.privacy.header{{/t}}
{{/header}}

{{$content}}
<h1 class="govuk-heading-l">{{#t}}pages.privacy.header{{/t}}</h1>
<div>
<p>{{#t}}pages.privacy.paragraph-1{{/t}}</p>
<p><a class="govuk-link" href="https://www.gov.uk/government/organisations/home-office/about/personal-information-charter">{{#t}}pages.privacy.paragraph-2-link-1{{/t}}</a> {{#t}}pages.privacy.paragraph-1{{/t}}</p>
<p>{{#t}}pages.privacy.paragraph-3{{/t}} <a class="govuk-link" href="http://www.legislation.gov.uk/ukpga/2018/12/contents">{{#t}}pages.privacy.paragraph-3-link-1{{/t}}</a></p>
<p>{{#t}}pages.privacy.paragraph-4{{/t}}</p>
Expand Down Expand Up @@ -68,5 +74,5 @@ <h3 class="govuk-heading-m">{{#t}}pages.privacy.heading-8{{/t}}</h3>
<p>{{#t}}pages.privacy.paragraph-17{{/t}}</p>
<p>{{#t}}pages.privacy.paragraph-18{{/t}}</p>
</div>
{{/page-content}}
{{/partials-page}}
{{/content}}
{{/layout}}
15 changes: 11 additions & 4 deletions apps/common/views/support-organisations.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{{<partials-page}}
{{$page-content}}
{{<layout}}

{{$propositionHeader}}{{/propositionHeader}}

{{$header}}
{{#t}}pages.support-organisations.header{{/t}}
{{/header}}

{{$content}}
<h1 class="govuk-heading-xl">{{#t}}pages.support-organisations.header{{/t}}</h1>
{{#markdown}}support-organisations{{/markdown}}
{{/page-content}}
{{/partials-page}}
{{/content}}
{{/layout}}
3 changes: 2 additions & 1 deletion apps/feedback/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
},
'/complete': {
backLink: false
}
},
'/exit': {}
}
};
37 changes: 22 additions & 15 deletions apps/feedback/views/complete.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{{<partials-page}}
{{$page-content}}
<div class="govuk-grid-row">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">
{{#t}}pages.complete.panel-title{{/t}}
</h1>
{{<layout}}

{{$propositionHeader}}{{/propositionHeader}}

{{$header}}
{{#t}}pages.complete.panel-title{{/t}}
{{/header}}

{{$content}}
<div class="govuk-grid-row">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">
{{#t}}pages.complete.panel-title{{/t}}
</h1>
</div>
<p>
<a href="/start">
{{#t}}pages.complete.paragraph-1{{/t}}
</a>.
</p>
</div>
<p>
<a href="/start">
{{#t}}pages.complete.paragraph-1{{/t}}
</a>.
</p>
</div>
{{/page-content}}
{{/partials-page}}
{{/content}}
{{/layout}}
4 changes: 4 additions & 0 deletions apps/nrm/translations/src/en/save-and-exit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"header": "Your report has been saved",
"title": "Your report has been saved"
}
5 changes: 0 additions & 5 deletions apps/nrm/views/content/session-timeout.md

This file was deleted.

14 changes: 10 additions & 4 deletions apps/nrm/views/save-and-exit.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{{<partials-page}}
{{$page-content}}
{{<layout}}

{{$propositionHeader}}{{/propositionHeader}}

{{$header}}
{{#t}}pages.save-and-exit.header{{/t}}
{{/header}}
{{$content}}
<p>You have until the {{reportExpiration}} to update or submit your report.</p>
<p>We have sent a confirmation email to: {{userEmail}}</p>
<p>You can return to your report at any time via the report modern slavery <a class="govuk-link" href="/start">start page on GOV.UK.</a></p>
{{/page-content}}
{{/partials-page}}
{{/content}}
{{/layout}}
8 changes: 0 additions & 8 deletions apps/nrm/views/session-timeout.html

This file was deleted.

15 changes: 11 additions & 4 deletions apps/nrm/views/token-invalid.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{{<partials-page}}
{{<layout}}

{{$propositionHeader}}{{/propositionHeader}}

{{$header}}
{{#t}}pages.token-invalid.header{{/t}}
{{/header}}

{{$back}}
<a class="govuk-back-link" href="{{#url}}{{backLink}}{{/url}}">{{#t}}buttons.back{{/t}}</a>
{{/back}}
{{$page-content}}
{{$content}}
{{#markdown}}token-invalid{{/markdown}}
{{/page-content}}
{{/partials-page}}
{{/content}}
{{/layout}}
3 changes: 2 additions & 1 deletion apps/verify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
},
'/check-inbox': {
behaviours: require('./behaviours/confirm-email-passer')
}
},
'/exit': {}
}
};
5 changes: 0 additions & 5 deletions apps/verify/views/content/session-timeout.md

This file was deleted.

71 changes: 0 additions & 71 deletions apps/verify/views/privacy.html

This file was deleted.

5 changes: 0 additions & 5 deletions apps/verify/views/session-timeout.html

This file was deleted.

4 changes: 3 additions & 1 deletion hof.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
"./apps/feedback"
],
"behaviours": [
"./apps/common/behaviours/sanitise-inputs"
"./apps/common/behaviours/sanitise-inputs",
"hof/components/session-timeout-warning"
],
"saveExitFormContent": true,
"getCookies": false,
"session": {
"name": "modern-slavery.hof.sid"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"axios": "^1.7.4",
"accessible-autocomplete": "^2.0.2",
"govuk-frontend": "^2.7.0",
"hof": "~21.1.0",
"hof": "22.0.0-timeout-warning-sign-in-beta.7",
"ioredis": "^4.0.0",
"jquery": "^3.5.1",
"knex": "^3.1.0",
Expand Down
Loading

0 comments on commit 1f25298

Please sign in to comment.