hof 22.0.0-timeout-warning-sign-in-beta.5 → 22.0.0-timeout-warning-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/automate-publish.yml +4 -4
- package/.github/workflows/automate-tag.yml +16 -16
- package/CHANGELOG.md +2 -2
- package/config/hof-defaults.js +1 -0
- package/frontend/template-partials/translations/src/en/save-and-exit.json +3 -3
- package/frontend/template-partials/views/partials/head.html +3 -0
- package/frontend/template-partials/views/partials/session-timeout-warning.html +4 -4
- package/index.js +2 -0
- package/lib/deindex.js +18 -0
- package/package.json +1 -1
- package/{pull-request-template.md → pull_request_template.md} +1 -1
- package/sandbox/apps/sandbox/translations/en/default.json +4 -8
- package/sandbox/apps/sandbox/translations/src/en/pages.json +3 -1
- package/sandbox/apps/sandbox/views/save-and-exit.html +19 -0
- package/sandbox/public/js/bundle.js +1 -1
|
@@ -8,15 +8,15 @@ on:
|
|
|
8
8
|
- completed
|
|
9
9
|
jobs:
|
|
10
10
|
auto-publish:
|
|
11
|
-
runs-on: ubuntu-
|
|
11
|
+
runs-on: ubuntu-22.04
|
|
12
12
|
if: startsWith(github.ref, 'refs/heads/master')
|
|
13
13
|
steps:
|
|
14
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
15
|
with:
|
|
16
16
|
fetch-depth: 0
|
|
17
|
-
- uses: actions/setup-node@
|
|
17
|
+
- uses: actions/setup-node@v4
|
|
18
18
|
with:
|
|
19
|
-
node-version:
|
|
19
|
+
node-version: 20
|
|
20
20
|
registry-url: https://registry.npmjs.org/
|
|
21
21
|
- name: 'Get Previous tag'
|
|
22
22
|
id: previoustag
|
|
@@ -4,14 +4,14 @@ name: Automate_Tag
|
|
|
4
4
|
on: [push]
|
|
5
5
|
jobs:
|
|
6
6
|
test:
|
|
7
|
-
runs-on: ubuntu-
|
|
7
|
+
runs-on: ubuntu-22.04
|
|
8
8
|
strategy:
|
|
9
9
|
matrix:
|
|
10
|
-
node-version: [
|
|
10
|
+
node-version: [20.x]
|
|
11
11
|
redis-version: [4, 5, 6]
|
|
12
12
|
steps:
|
|
13
|
-
- uses: actions/checkout@
|
|
14
|
-
- uses: actions/setup-node@
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: actions/setup-node@v4
|
|
15
15
|
with:
|
|
16
16
|
node-version: ${{ matrix.node-version }}
|
|
17
17
|
- name: Start Redis
|
|
@@ -25,16 +25,16 @@ jobs:
|
|
|
25
25
|
|
|
26
26
|
auto-tag-patch:
|
|
27
27
|
needs: test
|
|
28
|
-
runs-on: ubuntu-
|
|
28
|
+
runs-on: ubuntu-22.04
|
|
29
29
|
if: |
|
|
30
30
|
startsWith(github.ref, 'refs/heads/master') &&
|
|
31
31
|
!contains(github.event.head_commit.message, '[MAJOR]') &&
|
|
32
32
|
!contains(github.event.head_commit.message, '[MINOR]')
|
|
33
33
|
steps:
|
|
34
|
-
- uses: actions/checkout@
|
|
35
|
-
- uses: actions/setup-node@
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
- uses: actions/setup-node@v4
|
|
36
36
|
with:
|
|
37
|
-
node-version:
|
|
37
|
+
node-version: 20
|
|
38
38
|
registry-url: https://registry.npmjs.org/
|
|
39
39
|
- run: |
|
|
40
40
|
git config --local user.email "$(git log --format='%ae' HEAD^!)"
|
|
@@ -43,16 +43,16 @@ jobs:
|
|
|
43
43
|
|
|
44
44
|
auto-tag-minor:
|
|
45
45
|
needs: test
|
|
46
|
-
runs-on: ubuntu-
|
|
46
|
+
runs-on: ubuntu-22.04
|
|
47
47
|
if: |
|
|
48
48
|
startsWith(github.ref, 'refs/heads/master') &&
|
|
49
49
|
!contains(github.event.head_commit.message, '[MAJOR]') &&
|
|
50
50
|
contains(github.event.head_commit.message, '[MINOR]')
|
|
51
51
|
steps:
|
|
52
|
-
- uses: actions/checkout@
|
|
53
|
-
- uses: actions/setup-node@
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
- uses: actions/setup-node@v4
|
|
54
54
|
with:
|
|
55
|
-
node-version:
|
|
55
|
+
node-version: 20
|
|
56
56
|
registry-url: https://registry.npmjs.org/
|
|
57
57
|
- run: |
|
|
58
58
|
git config --local user.email "$(git log --format='%ae' HEAD^!)"
|
|
@@ -61,16 +61,16 @@ jobs:
|
|
|
61
61
|
|
|
62
62
|
auto-tag-major:
|
|
63
63
|
needs: test
|
|
64
|
-
runs-on: ubuntu-
|
|
64
|
+
runs-on: ubuntu-22.04
|
|
65
65
|
if: |
|
|
66
66
|
startsWith(github.ref, 'refs/heads/master') &&
|
|
67
67
|
contains(github.event.head_commit.message, '[MAJOR]') &&
|
|
68
68
|
!contains(github.event.head_commit.message, '[MINOR]')
|
|
69
69
|
steps:
|
|
70
|
-
- uses: actions/checkout@
|
|
71
|
-
- uses: actions/setup-node@
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
- uses: actions/setup-node@v4
|
|
72
72
|
with:
|
|
73
|
-
node-version:
|
|
73
|
+
node-version: 20
|
|
74
74
|
registry-url: https://registry.npmjs.org/
|
|
75
75
|
- run: |
|
|
76
76
|
git config --local user.email "$(git log --format='%ae' HEAD^!)"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## 2024, Version 22.0.0, @Rhodine-orleans-lindsay
|
|
1
|
+
## 2024, Version 22.0.0 (Stable), @Rhodine-orleans-lindsay
|
|
2
2
|
* Adds session timeout warning
|
|
3
3
|
- user can stay on page or exit form
|
|
4
4
|
- adds exit html
|
|
5
|
-
- user can stay signed in
|
|
5
|
+
- user can stay signed in or save and exit the form if the form is a save and exit form
|
|
6
6
|
- adds default save-and-exit html
|
|
7
7
|
- updates confirmation html to a static page
|
|
8
8
|
- allows for customisation of session timeout warning dialog content and exit page content
|
package/config/hof-defaults.js
CHANGED
|
@@ -33,6 +33,7 @@ const defaults = {
|
|
|
33
33
|
return convertPage(page);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
deIndexForm: process.env.DEINDEX_FORM || 'false',
|
|
36
37
|
gaCrossDomainTrackingTagId: process.env.GDS_CROSS_DOMAIN_GA_TAG,
|
|
37
38
|
loglevel: process.env.LOG_LEVEL || 'info',
|
|
38
39
|
ignoreMiddlewareLogs: ['/healthz'],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
"header": "You have been signed out",
|
|
3
|
+
"message": "Any answers you saved have not been affected. You can sign back in to your application by returning to the <a href='/' class='govuk-link'>start page</a>."
|
|
4
|
+
}
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
{{/cookiesAccepted}}
|
|
22
22
|
{{/gtmTagId}}
|
|
23
23
|
|
|
24
|
+
{{#deIndex}}
|
|
25
|
+
<meta name="robots" content="noindex">
|
|
26
|
+
{{/deIndex}}
|
|
24
27
|
<meta name="format-detection" content="telephone=no">
|
|
25
28
|
<noscript>
|
|
26
29
|
<meta http-equiv="refresh" content="{{sessionTimeOut}};url='{{baseUrl}}/session-timeout'"/>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
data-url-redirect="/session-timeout" class="modal-dialog dialog" role="dialog"
|
|
9
9
|
aria-live="polite" aria-labelledby="dialog-title" aria-describedby="at-timer">
|
|
10
10
|
<div class="modal-dialog__inner">
|
|
11
|
-
|
|
11
|
+
{{^showSaveAndExit}}
|
|
12
12
|
<h2 id="dialog-title" class="govuk-heading-l">
|
|
13
13
|
{{#dialogTitle}}{{#t}}pages.session-timeout-warning.dialog-title{{/t}}{{/dialogTitle}}{{^dialogTitle}}Your page will time out soon{{/dialogTitle}}
|
|
14
14
|
</h2>
|
|
@@ -20,8 +20,8 @@ data-url-redirect="/session-timeout" class="modal-dialog dialog" role="dialog"
|
|
|
20
20
|
</div>
|
|
21
21
|
<button class="govuk-button dialog-button js-dialog-close" id="timeout-continue-button" data-module="govuk-button">{{#timeoutContinueButton}}{{#t}}pages.session-timeout-warning.timeout-continue-button{{/t}}{{/timeoutContinueButton}}{{^timeoutContinueButton}}Stay on this page{{/timeoutContinueButton}}</button>
|
|
22
22
|
<a href="{{baseUrl}}/exit" class="govuk-link dialog-exit-link" role="button">{{#dialogExitLink}}{{#t}}pages.session-timeout-warning.dialog-exit-link{{/t}}{{/dialogExitLink}}{{^dialogExitLink}}Exit this form{{/dialogExitLink}}</a>
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
{{/showSaveAndExit}}
|
|
24
|
+
{{#showSaveAndExit}}
|
|
25
25
|
<h2 id="dialog-title" class="govuk-heading-l">
|
|
26
26
|
{{#dialogTitle}}{{#t}}pages.session-timeout-warning.dialog-title{{/t}}{{/dialogTitle}}{{^dialogTitle}}You will be signed out soon{{/dialogTitle}}
|
|
27
27
|
</h2>
|
|
@@ -33,6 +33,6 @@ data-url-redirect="/session-timeout" class="modal-dialog dialog" role="dialog"
|
|
|
33
33
|
</div>
|
|
34
34
|
<button class="govuk-button dialog-button js-dialog-close" id="timeout-continue-button" data-module="govuk-button">{{#timeoutContinueButton}}{{#t}}pages.session-timeout-warning.timeout-continue-button{{/t}}{{/timeoutContinueButton}}{{^timeoutContinueButton}}Stay signed in{{/timeoutContinueButton}}</button>
|
|
35
35
|
<a href="{{baseUrl}}/save-and-exit" class="govuk-link dialog-exit-link" role="button">{{#dialogExitLink}}{{#t}}pages.session-timeout-warning.dialog-exit-link{{/t}}{{/dialogExitLink}}{{^dialogExitLink}}Sign out{{/dialogExitLink}}</a>
|
|
36
|
-
|
|
36
|
+
{{/showSaveAndExit}}
|
|
37
37
|
</div>
|
|
38
38
|
</dialog>
|
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@ const router = require('./lib/router');
|
|
|
14
14
|
const health = require('./lib/health');
|
|
15
15
|
const serveStatic = require('./lib/serve-static');
|
|
16
16
|
const gaTagSetup = require('./lib/ga-tag');
|
|
17
|
+
const deIndexer = require('./lib/deindex');
|
|
17
18
|
const sessionStore = require('./lib/sessions');
|
|
18
19
|
const settings = require('./lib/settings');
|
|
19
20
|
const defaults = require('./config/hof-defaults');
|
|
@@ -205,6 +206,7 @@ function bootstrap(options) {
|
|
|
205
206
|
serveStatic(app, config);
|
|
206
207
|
settings(app, config);
|
|
207
208
|
gaTagSetup(app, config);
|
|
209
|
+
deIndexer(app, config);
|
|
208
210
|
|
|
209
211
|
const sessions = sessionStore(app, config);
|
|
210
212
|
app.use('/healthz', health(sessions));
|
package/lib/deindex.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = (app, config) => {
|
|
4
|
+
// Ensure the value of deIndex is evaluated as a boolean regardless of if single quotes are used
|
|
5
|
+
// to have the expected conditional behaviour in the Mustache template
|
|
6
|
+
const deIndex = (config.deIndexForm === 'true' || config.deIndexForm === true);
|
|
7
|
+
|
|
8
|
+
app.use((req, res, next) => {
|
|
9
|
+
// Preparing common res.locals properties
|
|
10
|
+
const properties = {
|
|
11
|
+
deIndex: deIndex
|
|
12
|
+
};
|
|
13
|
+
res.locals = Object.assign(res.locals, properties);
|
|
14
|
+
next();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
return app;
|
|
18
|
+
};
|
package/package.json
CHANGED
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
- [ ] I have created a JIRA number for my commit
|
|
13
13
|
- [ ] I have followed the chris beams method for my commit https://cbea.ms/git-commit/
|
|
14
14
|
here is an [example commit](https://github.com/UKHomeOfficeForms/hof/commit/810959f391187c7c4af6db262bcd143b50093a6e)
|
|
15
|
-
- [ ] Ensure
|
|
15
|
+
- [ ] Ensure workflow jobs are passing especially tests
|
|
16
16
|
- [ ] I will squash the commits before merging
|
|
@@ -170,14 +170,10 @@
|
|
|
170
170
|
"message": "We have cleared your information to keep it secure. Your information has not been saved."
|
|
171
171
|
},
|
|
172
172
|
"session-timeout-warning": {
|
|
173
|
-
"dialog-title": "
|
|
174
|
-
"dialog-text": "
|
|
175
|
-
"timeout-continue-button": "
|
|
176
|
-
"dialog-exit-link": "
|
|
177
|
-
},
|
|
178
|
-
"save-and-exit": {
|
|
179
|
-
"header": "You have been signed out",
|
|
180
|
-
"message": "Any answers you saved have not been affected. You can sign back in to your application at any time by returning to the <a href='/' class='govuk-link'>start page</a>."
|
|
173
|
+
"dialog-title": "Your application will close soon",
|
|
174
|
+
"dialog-text": "If that happens, your progress will not be saved.",
|
|
175
|
+
"timeout-continue-button": "Stay on this page",
|
|
176
|
+
"dialog-exit-link": "Exit this form"
|
|
181
177
|
}
|
|
182
178
|
},
|
|
183
179
|
"validation": {
|
|
@@ -65,6 +65,8 @@
|
|
|
65
65
|
},
|
|
66
66
|
"save-and-exit": {
|
|
67
67
|
"header": "You have been signed out",
|
|
68
|
-
"
|
|
68
|
+
"paragraph-1": "Your form doesn't appear to have been worked on for 30 minutes so we closed it for security.",
|
|
69
|
+
"paragraph-2": "Any answers you saved have not been affected.",
|
|
70
|
+
"paragraph-3": "You can sign back in to your application at any time by returning to the <a href='/' class='govuk-link'>start page</a>."
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{<layout}}
|
|
2
|
+
{{$journeyHeader}}
|
|
3
|
+
{{#t}}journey.header{{/t}}
|
|
4
|
+
{{/journeyHeader}}
|
|
5
|
+
|
|
6
|
+
{{$propositionHeader}}
|
|
7
|
+
{{> partials-navigation}}
|
|
8
|
+
{{/propositionHeader}}
|
|
9
|
+
|
|
10
|
+
{{$header}}
|
|
11
|
+
{{header}}
|
|
12
|
+
{{/header}}
|
|
13
|
+
|
|
14
|
+
{{$content}}
|
|
15
|
+
<p>{{#t}}pages.save-and-exit.paragraph-1{{/t}}</p>
|
|
16
|
+
<p>{{#t}}pages.save-and-exit.paragraph-2{{/t}}</p>
|
|
17
|
+
<p>{{#t}}pages.save-and-exit.paragraph-3{{/t}}</p>
|
|
18
|
+
{{/content}}
|
|
19
|
+
{{/layout}}
|
|
@@ -313,7 +313,7 @@ window.GOVUK.sessionDialog = {
|
|
|
313
313
|
$fallBackElement: $('.govuk-timeout-warning-fallback'),
|
|
314
314
|
dialogIsOpenClass: 'dialog-is-open',
|
|
315
315
|
timers: [],
|
|
316
|
-
warningTextPrefix:
|
|
316
|
+
warningTextPrefix: 'To protect your information, this page will time out in ',
|
|
317
317
|
warningTextSuffix: '.',
|
|
318
318
|
warningText: $('.dialog-text').text(),
|
|
319
319
|
warningTextExtra: '',
|