hof 22.0.0 → 22.0.2-ukmobilephone-validator-beta
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 +0 -13
- package/README.md +27 -111
- package/components/index.js +1 -2
- package/config/hof-defaults.js +1 -5
- package/controller/controller.js +0 -4
- package/controller/validation/validators.js +1 -1
- package/frontend/template-partials/views/confirmation.html +4 -17
- package/frontend/template-partials/views/partials/head.html +0 -3
- package/frontend/template-partials/views/partials/page.html +0 -1
- package/frontend/themes/gov-uk/client-js/index.js +0 -1
- package/frontend/themes/gov-uk/styles/govuk.scss +0 -1
- package/index.js +4 -11
- package/lib/router.js +0 -2
- package/package.json +3 -4
- package/{pull_request_template.md → pull_request.md} +1 -1
- package/sandbox/apps/sandbox/index.js +0 -4
- package/sandbox/apps/sandbox/translations/src/en/pages.json +1 -16
- package/sandbox/server.js +0 -5
- package/wizard/index.js +0 -2
- package/components/session-timeout-warning/index.js +0 -67
- package/frontend/template-partials/translations/src/en/exit.json +0 -5
- package/frontend/template-partials/translations/src/en/save-and-exit.json +0 -4
- package/frontend/template-partials/views/exit.html +0 -9
- package/frontend/template-partials/views/partials/session-timeout-warning.html +0 -38
- package/frontend/template-partials/views/save-and-exit.html +0 -17
- package/frontend/themes/gov-uk/client-js/session-timeout-dialog.js +0 -348
- package/frontend/themes/gov-uk/styles/_session-timeout-dialog.scss +0 -121
- package/sandbox/apps/sandbox/translations/src/en/exit.json +0 -4
- package/sandbox/apps/sandbox/views/save-and-exit.html +0 -19
@@ -8,15 +8,15 @@ on:
|
|
8
8
|
- completed
|
9
9
|
jobs:
|
10
10
|
auto-publish:
|
11
|
-
runs-on: ubuntu-
|
11
|
+
runs-on: ubuntu-latest
|
12
12
|
if: startsWith(github.ref, 'refs/heads/master')
|
13
13
|
steps:
|
14
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v2.2.0
|
15
15
|
with:
|
16
16
|
fetch-depth: 0
|
17
|
-
- uses: actions/setup-node@
|
17
|
+
- uses: actions/setup-node@v1
|
18
18
|
with:
|
19
|
-
node-version:
|
19
|
+
node-version: 14
|
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-latest
|
8
8
|
strategy:
|
9
9
|
matrix:
|
10
|
-
node-version: [
|
10
|
+
node-version: [14.x]
|
11
11
|
redis-version: [4, 5, 6]
|
12
12
|
steps:
|
13
|
-
- uses: actions/checkout@
|
14
|
-
- uses: actions/setup-node@
|
13
|
+
- uses: actions/checkout@v2.2.0
|
14
|
+
- uses: actions/setup-node@v1
|
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-latest
|
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@v2.2.0
|
35
|
+
- uses: actions/setup-node@v1
|
36
36
|
with:
|
37
|
-
node-version:
|
37
|
+
node-version: 14
|
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-latest
|
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@v2.2.0
|
53
|
+
- uses: actions/setup-node@v1
|
54
54
|
with:
|
55
|
-
node-version:
|
55
|
+
node-version: 14
|
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-latest
|
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@v2.2.0
|
71
|
+
- uses: actions/setup-node@v1
|
72
72
|
with:
|
73
|
-
node-version:
|
73
|
+
node-version: 14
|
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,16 +1,3 @@
|
|
1
|
-
## 2025-01-17, Version 22.0.0 (Stable), @Rhodine-orleans-lindsay
|
2
|
-
* Adds session timeout warning
|
3
|
-
- user can stay on page or exit form
|
4
|
-
- adds exit html
|
5
|
-
- user can stay signed in or save and exit the form if the form is a save and exit form
|
6
|
-
- adds default save-and-exit html
|
7
|
-
- updates confirmation html to a static page
|
8
|
-
- allows for customisation of session timeout warning dialog content, exit and save-and-exit page content, and exit and save-and-exit steps
|
9
|
-
- Potential **_breaking change_**: Static pages should use the ```{{<layout}}...{{/layout}}``` tags instead of the ```{{<partials-page}}...{{/partials-page}}``` tags if the timeout warning should not be displayed.
|
10
|
-
* Fixes accessibility issues
|
11
|
-
* Sandbox area for testing hof changes
|
12
|
-
* Updates patch and minor dependency versions
|
13
|
-
|
14
1
|
## 2024-07-22, Version 21.0.0 (Stable), @Rhodine-orleans-lindsay
|
15
2
|
* Replaces deprecated request module with axios
|
16
3
|
- refactors the hof model and apis to use axios instead of request
|
package/README.md
CHANGED
@@ -945,11 +945,11 @@ Using the translation key `fields.field-name.label` will return different values
|
|
945
945
|
|
946
946
|
# HOF Components
|
947
947
|
|
948
|
-
##
|
948
|
+
## Date Component
|
949
949
|
|
950
950
|
A component for handling the rendering and processing of 3-input date fields used in HOF Applications.
|
951
951
|
|
952
|
-
|
952
|
+
## Usage
|
953
953
|
|
954
954
|
In your fields config:
|
955
955
|
|
@@ -965,7 +965,7 @@ module.exports = {
|
|
965
965
|
|
966
966
|
The above example will create a new date component with the key `'date-field'` and will apply the validators `required` and `before` (before today).
|
967
967
|
|
968
|
-
|
968
|
+
## Configuration
|
969
969
|
|
970
970
|
The following optional configuration options are supported:
|
971
971
|
|
@@ -974,7 +974,7 @@ The following optional configuration options are supported:
|
|
974
974
|
- `dayOptional {Boolean}` - day defaults to `01` if omitted. Defaults to `false`
|
975
975
|
- `monthOptional {Boolean}` - month defaults to `01` if omitted. If true then also forces `dayOptional` to be true. Defaults to `false`
|
976
976
|
|
977
|
-
|
977
|
+
## Labels
|
978
978
|
|
979
979
|
The three intermedate fields have fallback labels of Day, Month and Year, however custom labels can be used by including the translation at the following path:
|
980
980
|
|
@@ -998,13 +998,13 @@ fields.json
|
|
998
998
|
}
|
999
999
|
```
|
1000
1000
|
|
1001
|
-
|
1001
|
+
# Summary Page Component
|
1002
1002
|
|
1003
1003
|
HOF behaviour for showing summary pages
|
1004
1004
|
|
1005
1005
|
The behaviour mixin will create a set of "locals" data which is compatible with [the `confirm` view from `hof-template-partials`](https://github.com/UKHomeOfficeForms/hof-template-partials/blob/master/views/confirm.html).
|
1006
1006
|
|
1007
|
-
|
1007
|
+
## Usage
|
1008
1008
|
|
1009
1009
|
If no sections config is passed, then the mixin will create a section for each step that has fields, and a row within each section for each field on that step.
|
1010
1010
|
|
@@ -1043,11 +1043,11 @@ Alternatively, sections can be defined manually as follows:
|
|
1043
1043
|
}
|
1044
1044
|
```
|
1045
1045
|
|
1046
|
-
|
1046
|
+
## Configuration
|
1047
1047
|
|
1048
1048
|
The `sections` configuration should be a map of arrays, where the entries in the array are the fields that should be shown within that section.
|
1049
1049
|
|
1050
|
-
|
1050
|
+
### Field configuration
|
1051
1051
|
|
1052
1052
|
Fields can be defined as simple strings of the field key, in which case all default configuration will be used.
|
1053
1053
|
|
@@ -1087,18 +1087,18 @@ The `location-addresses` field is one that the application has setup to aggregat
|
|
1087
1087
|
|
1088
1088
|
This allows the creation of summary rows based on unknown dynamic user input, i.e. we can not predict in advance how many addresses a user wants to input, what the addresses are and how many categories the user wants to attach to each address. This allows you to easily list them this way.
|
1089
1089
|
|
1090
|
-
|
1090
|
+
## Translations
|
1091
1091
|
|
1092
1092
|
The content for section headings and field labels will be loaded from translation files based on the keys.
|
1093
1093
|
|
1094
|
-
|
1094
|
+
### Section headings
|
1095
1095
|
|
1096
1096
|
Translations for section headings are looked for in the following order:
|
1097
1097
|
|
1098
1098
|
- `pages.confirm.sections.${key}.header`
|
1099
1099
|
- `pages.${key}.header`
|
1100
1100
|
|
1101
|
-
|
1101
|
+
### Field labels
|
1102
1102
|
|
1103
1103
|
Translations for field labels are looked for in the following order:
|
1104
1104
|
|
@@ -1106,11 +1106,11 @@ Translations for field labels are looked for in the following order:
|
|
1106
1106
|
- `fields.${key}.label`
|
1107
1107
|
- `fields.${key}.legend`
|
1108
1108
|
|
1109
|
-
|
1109
|
+
# Emailer Component
|
1110
1110
|
|
1111
1111
|
HOF behaviour to send emails
|
1112
1112
|
|
1113
|
-
|
1113
|
+
## Usage
|
1114
1114
|
|
1115
1115
|
```js
|
1116
1116
|
const EmailBehaviour = require('hof').components.emailer;
|
@@ -1140,7 +1140,7 @@ steps: {
|
|
1140
1140
|
}
|
1141
1141
|
```
|
1142
1142
|
|
1143
|
-
|
1143
|
+
## Options
|
1144
1144
|
|
1145
1145
|
In addition to the options passed to `hof-emailer`, the following options can be used:
|
1146
1146
|
|
@@ -1159,17 +1159,17 @@ const emailer = EmailBehaviour({
|
|
1159
1159
|
});
|
1160
1160
|
```
|
1161
1161
|
|
1162
|
-
|
1162
|
+
# HOF Emailer
|
1163
1163
|
|
1164
1164
|
An emailer service for HOF applications.
|
1165
1165
|
|
1166
|
-
|
1166
|
+
## Installation
|
1167
1167
|
|
1168
1168
|
```bash
|
1169
1169
|
$ npm install hof-emailer --save
|
1170
1170
|
```
|
1171
1171
|
|
1172
|
-
|
1172
|
+
## Usage
|
1173
1173
|
|
1174
1174
|
```js
|
1175
1175
|
// first create an emailer instance
|
@@ -1192,22 +1192,22 @@ emailer.send(to, body, subject).then(() => {
|
|
1192
1192
|
});
|
1193
1193
|
```
|
1194
1194
|
|
1195
|
-
|
1195
|
+
## Options
|
1196
1196
|
|
1197
1197
|
- `from`: <String>: Address to send emails from. Required.
|
1198
1198
|
- `transport`: <String>: Select what mechanism to use to send emails. Defaults: 'smtp'.
|
1199
1199
|
- `transportOptions`: <Object>: Set the options for the chosen transport, as defined below. Required.
|
1200
1200
|
- `layout`: <String>: Optional path to use a custom layout for email content.
|
1201
1201
|
|
1202
|
-
|
1202
|
+
## Transports
|
1203
1203
|
|
1204
1204
|
The following transport options are available:
|
1205
1205
|
|
1206
|
-
|
1206
|
+
### `smtp`
|
1207
1207
|
|
1208
1208
|
[nodemailer-smtp-transport](https://github.com/andris9/nodemailer-smtp-transport)
|
1209
1209
|
|
1210
|
-
|
1210
|
+
#### Options
|
1211
1211
|
|
1212
1212
|
- `host` <String>: Address of the mailserver. Required.
|
1213
1213
|
- `port` <String|Number>: Port of the mailserver. Required.
|
@@ -1216,11 +1216,11 @@ The following transport options are available:
|
|
1216
1216
|
- `auth.user` <String>: Mailserver authorisation username.
|
1217
1217
|
- `auth.pass` <String>: Mailserver authorisation password.
|
1218
1218
|
|
1219
|
-
|
1219
|
+
### `ses`
|
1220
1220
|
|
1221
1221
|
[nodemailer-ses-transport](https://github.com/andris9/nodemailer-ses-transport)
|
1222
1222
|
|
1223
|
-
|
1223
|
+
#### Options
|
1224
1224
|
|
1225
1225
|
- `accessKeyId` <String>: AWS accessKeyId. Required.
|
1226
1226
|
- `secretAccessKey` <String>: AWS accessKeyId. Required.
|
@@ -1230,18 +1230,18 @@ The following transport options are available:
|
|
1230
1230
|
- `rateLimit` <String>
|
1231
1231
|
- `maxConnections` <String>
|
1232
1232
|
|
1233
|
-
|
1233
|
+
### `debug`
|
1234
1234
|
|
1235
1235
|
A development option to write the html content of the email to a file for inspection.
|
1236
1236
|
|
1237
1237
|
`transport: 'debug'`
|
1238
1238
|
|
1239
|
-
|
1239
|
+
#### debug options
|
1240
1240
|
|
1241
1241
|
- `dir` <String>: The location to save html to. Default: `./.emails`. This directory will be created if it does not exist.
|
1242
1242
|
- `open` <Boolean>: If set to true, will automatically open the created html file in a browser.
|
1243
1243
|
|
1244
|
-
|
1244
|
+
#### debug example
|
1245
1245
|
|
1246
1246
|
```
|
1247
1247
|
transport: 'debug'
|
@@ -1251,94 +1251,10 @@ transportOptions: {
|
|
1251
1251
|
}
|
1252
1252
|
```
|
1253
1253
|
|
1254
|
-
|
1254
|
+
### `stub`
|
1255
1255
|
|
1256
1256
|
Disables sending email. No options are required.
|
1257
1257
|
|
1258
|
-
## Session Timeout Warning Component
|
1259
|
-
HOF component for customising session timeout related pages
|
1260
|
-
This feature allows you to customise the content related to the session timeout warning, including the messages displayed in the session timeout warning dialog and on the exit page after a user exits the form due to a session timeout.
|
1261
|
-
|
1262
|
-
### Usage
|
1263
|
-
|
1264
|
-
To enable and customise the session timeout behavior, you need to set the component in your project's `hof.settings.json` file:
|
1265
|
-
```js
|
1266
|
-
"behaviours": [
|
1267
|
-
"hof/components/session-timeout-warning"
|
1268
|
-
]
|
1269
|
-
```
|
1270
|
-
|
1271
|
-
By default, the framework uses the standard content provided by HOF. If you wish to override this with custom content at the project level, you must set the following variables to `true` in `hof.settings.json`:
|
1272
|
-
|
1273
|
-
```js
|
1274
|
-
behaviours: [
|
1275
|
-
require('../').components.sessionTimeoutWarning
|
1276
|
-
],
|
1277
|
-
sessionTimeoutWarningContent: true, // allows you to customise the content in the session timeout dialog box
|
1278
|
-
exitFormContent: true // allows you to customise the content on the exit page
|
1279
|
-
saveExitFormContent: true // allows you to customise the content on the save-and-exit page
|
1280
|
-
```
|
1281
|
-
|
1282
|
-
### Customising content in `pages.json`
|
1283
|
-
Once the variables are set, you can customise the session timeout warning and exit messages in your project's pages.json:
|
1284
|
-
|
1285
|
-
```json
|
1286
|
-
"exit": {
|
1287
|
-
"message": "We have cleared your information to keep it secure. Your information has not been saved."
|
1288
|
-
},
|
1289
|
-
"session-timeout-warning": {
|
1290
|
-
"dialog-title": "Your application will close soon",
|
1291
|
-
"dialog-text": "If that happens, your progress will not be saved.",
|
1292
|
-
"timeout-continue-button": "Stay on this page",
|
1293
|
-
"dialog-exit-link": "Exit this form"
|
1294
|
-
}
|
1295
|
-
"save-and-exit": {
|
1296
|
-
"message": "Any answers you saved have not been affected. You can sign back in to your application at any time by returning to the start page."
|
1297
|
-
},
|
1298
|
-
```
|
1299
|
-
|
1300
|
-
### Editing content on the Exit and Save-and-exit Page Header and Title
|
1301
|
-
To edit the exit or save-and-exit pages' header and title, create an `exit.json` or `save-and-exit.json` file in your project and set the desired content:
|
1302
|
-
```json
|
1303
|
-
{
|
1304
|
-
"header": "You have left this form",
|
1305
|
-
"title": "You have left this form"
|
1306
|
-
}
|
1307
|
-
```
|
1308
|
-
|
1309
|
-
### Customising exit and save-and-exit steps
|
1310
|
-
You can customise the `exit` and `save-and-exit` steps by setting the `exitStep` or `saveAndExitStep` properties in the `apps/<app_name>/index.js` to the desired path name:
|
1311
|
-
|
1312
|
-
```js
|
1313
|
-
// customising exit step name
|
1314
|
-
module.exports = {
|
1315
|
-
name: 'sandbox',
|
1316
|
-
exitStep: '/leave',
|
1317
|
-
steps: {
|
1318
|
-
...
|
1319
|
-
'/leave': {
|
1320
|
-
template: 'exit'
|
1321
|
-
}
|
1322
|
-
}
|
1323
|
-
...
|
1324
|
-
}
|
1325
|
-
```
|
1326
|
-
|
1327
|
-
```js
|
1328
|
-
// customising save-and-exit step name
|
1329
|
-
module.exports = {
|
1330
|
-
name: 'sandbox',
|
1331
|
-
saveAndExitStep: '/sign-out',
|
1332
|
-
steps: {
|
1333
|
-
...
|
1334
|
-
'/sign-out': {
|
1335
|
-
template: 'save-and-exit'
|
1336
|
-
}
|
1337
|
-
}
|
1338
|
-
...
|
1339
|
-
}
|
1340
|
-
```
|
1341
|
-
|
1342
1258
|
# UTILITIES
|
1343
1259
|
|
1344
1260
|
# Autofill Utility
|
package/components/index.js
CHANGED
@@ -8,6 +8,5 @@ module.exports = {
|
|
8
8
|
emailer: require('./emailer'),
|
9
9
|
homeOfficeCountries: require('./homeoffice-countries'),
|
10
10
|
notify: require('./notify'),
|
11
|
-
summary: require('./summary')
|
12
|
-
sessionTimeoutWarning: require('./session-timeout-warning')
|
11
|
+
summary: require('./summary')
|
13
12
|
};
|
package/config/hof-defaults.js
CHANGED
@@ -14,9 +14,6 @@ const defaults = {
|
|
14
14
|
getCookies: true,
|
15
15
|
getTerms: true,
|
16
16
|
getAccessibility: false,
|
17
|
-
sessionTimeoutWarningContent: false,
|
18
|
-
exitFormContent: false,
|
19
|
-
saveExitFormContent: false,
|
20
17
|
viewEngine: 'html',
|
21
18
|
protocol: process.env.PROTOCOL || 'http',
|
22
19
|
noCache: process.env.NO_CACHE || false,
|
@@ -50,8 +47,7 @@ const defaults = {
|
|
50
47
|
apis: {
|
51
48
|
pdfConverter: process.env.PDF_CONVERTER_URL
|
52
49
|
},
|
53
|
-
serveStatic: process.env.SERVE_STATIC_FILES !== 'false'
|
54
|
-
sessionTimeOutWarning: process.env.SESSION_TIMEOUT_WARNING || 300
|
50
|
+
serveStatic: process.env.SERVE_STATIC_FILES !== 'false'
|
55
51
|
};
|
56
52
|
|
57
53
|
module.exports = Object.assign({}, defaults, rateLimits);
|
package/controller/controller.js
CHANGED
@@ -109,14 +109,10 @@ module.exports = class Controller extends BaseController {
|
|
109
109
|
// only include fields that aren't dependents to mitigate duplicate fields on the page
|
110
110
|
fields = fields.filter(field => !req.form.options.fields[field.key].dependent);
|
111
111
|
|
112
|
-
const exitStep = req.form.options.exitStep || '/exit';
|
113
|
-
const saveAndExitStep = req.form.options.saveAndExitStep || '/save-and-exit';
|
114
112
|
return _.extend({}, locals, {
|
115
113
|
fields,
|
116
114
|
route,
|
117
115
|
baseUrl: req.baseUrl,
|
118
|
-
exitStep,
|
119
|
-
saveAndExitStep,
|
120
116
|
skipToMain: this.getFirstFormItem(req.form.options.fields),
|
121
117
|
title: this.getTitle(route, lookup, req.form.options.fields, res.locals),
|
122
118
|
journeyHeaderURL: this.getJourneyHeaderURL(req.baseUrl),
|
@@ -1,19 +1,6 @@
|
|
1
|
-
{{<
|
2
|
-
{{$
|
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}}
|
1
|
+
{{<partials-page}}
|
2
|
+
{{$page-content}}
|
15
3
|
{{>partials-confirmation-alert}}
|
16
4
|
{{#markdown}}what-happens-next{{/markdown}}
|
17
|
-
{{/content}}
|
18
|
-
{{/
|
19
|
-
|
5
|
+
{{/page-content}}
|
6
|
+
{{/partials-page}}
|
@@ -25,7 +25,4 @@
|
|
25
25
|
<meta name="robots" content="noindex">
|
26
26
|
{{/deIndex}}
|
27
27
|
<meta name="format-detection" content="telephone=no">
|
28
|
-
<noscript>
|
29
|
-
<meta http-equiv="refresh" content="{{sessionTimeOut}};url='{{baseUrl}}/session-timeout'"/>
|
30
|
-
</noscript>
|
31
28
|
<link rel="stylesheet" href="{{assetPath}}/css/app.css">
|
package/index.js
CHANGED
@@ -85,7 +85,6 @@ const getContentSecurityPolicy = (config, res) => {
|
|
85
85
|
'www.google.co.uk/ads/ga-audiences'
|
86
86
|
],
|
87
87
|
connectSrc: [
|
88
|
-
"'self'",
|
89
88
|
'https://www.google-analytics.com',
|
90
89
|
'https://region1.google-analytics.com',
|
91
90
|
'https://region1.analytics.google.com'
|
@@ -149,12 +148,6 @@ function bootstrap(options) {
|
|
149
148
|
res.locals.appName = config.appName;
|
150
149
|
res.locals.htmlLang = config.htmlLang;
|
151
150
|
res.locals.cookieName = config.session.name;
|
152
|
-
// session timeout warning configs
|
153
|
-
res.locals.sessionTimeOut = config.session.ttl;
|
154
|
-
res.locals.sessionTimeOutWarning = config.sessionTimeOutWarning;
|
155
|
-
res.locals.sessionTimeoutWarningContent = config.sessionTimeoutWarningContent;
|
156
|
-
res.locals.exitFormContent = config.exitFormContent;
|
157
|
-
res.locals.saveExitFormContent = config.saveExitFormContent;
|
158
151
|
next();
|
159
152
|
});
|
160
153
|
|
@@ -197,10 +190,10 @@ function bootstrap(options) {
|
|
197
190
|
app.use(morgan('sessionId=:id ' + morgan.combined, {
|
198
191
|
stream: config.logger.stream,
|
199
192
|
skip: (req, res) => config.loglevel !== 'debug' &&
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
193
|
+
(
|
194
|
+
res.statusCode >= 300 || !_.get(req, 'session.id') ||
|
195
|
+
config.ignoreMiddlewareLogs.some(v => req.originalUrl.includes(v))
|
196
|
+
)
|
204
197
|
}));
|
205
198
|
|
206
199
|
serveStatic(app, config);
|
package/lib/router.js
CHANGED
@@ -30,8 +30,6 @@ function getWizardConfig(config) {
|
|
30
30
|
// whitelist properties from the route's config that should be passed into the form wizard
|
31
31
|
const props = [
|
32
32
|
'confirmStep',
|
33
|
-
'exitStep',
|
34
|
-
'saveAndExitStep',
|
35
33
|
'params'
|
36
34
|
];
|
37
35
|
Object.assign(wizardConfig, _.pick(config.route, props));
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "hof",
|
3
3
|
"description": "A bootstrap for HOF projects",
|
4
|
-
"version": "22.0.
|
4
|
+
"version": "22.0.2-ukmobilephone-validator-beta",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "index.js",
|
7
7
|
"author": "HomeOffice",
|
@@ -21,13 +21,13 @@
|
|
21
21
|
"url": "https://github.com/UKHomeOfficeForms/hof/issues"
|
22
22
|
},
|
23
23
|
"scripts": {
|
24
|
-
"test": "yarn run unit && yarn run test:
|
24
|
+
"test": "yarn run unit && yarn run test:cookie-banner && yarn run test:functional && yarn run test:client && yarn run test:lint",
|
25
25
|
"unit": "LOG_LEVEL=error nyc _mocha \"test/**/*.spec.js\" \"sandbox/test/**/*.spec.js\"",
|
26
26
|
"unit:nocov": "LOG_LEVEL=error mocha \"test/**/*.spec.js\" \"sandbox/test/**/*.spec.js\"",
|
27
27
|
"test:lint": "eslint . --config ./node_modules/eslint-config-hof/default.js",
|
28
28
|
"test:functional": "funkie mocha ./test/functional-tests --timeout 20000 --exit",
|
29
29
|
"test:client": "karma start test/frontend/toolkit/karma.conf.js",
|
30
|
-
"test:
|
30
|
+
"test:cookie-banner": "jest test/frontend/jest",
|
31
31
|
"test:acceptance": "TAGS=\"${TAGS:=@feature}\" yarn run test:cucumber",
|
32
32
|
"test:acceptance_browser": "ACCEPTANCE_WITH_BROWSER=true TAGS=\"${TAGS:=@feature}\" yarn run test:cucumber",
|
33
33
|
"test:cucumber": "cucumber-js -f @cucumber/pretty-formatter \"sandbox/test/_features/**/*.feature\" --require sandbox/test/_features/test.setup.js --require \"sandbox/test/_features/step_definitions/**/*.js\" --tags $TAGS",
|
@@ -49,7 +49,6 @@
|
|
49
49
|
"csrf": "^3.1.0",
|
50
50
|
"debug": "^4.3.1",
|
51
51
|
"deprecate": "^1.0.0",
|
52
|
-
"dialog-polyfill": "^0.5.6",
|
53
52
|
"dotenv": "^4.0.0",
|
54
53
|
"duplexify": "^3.5.0",
|
55
54
|
"express": "^4.17.1",
|
@@ -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 drone builds are green especially tests
|
16
16
|
- [ ] I will squash the commits before merging
|
@@ -30,7 +30,6 @@ module.exports = {
|
|
30
30
|
},
|
31
31
|
'/dob': {
|
32
32
|
fields: ['dateOfBirth'],
|
33
|
-
locals: { showSaveAndExit: true },
|
34
33
|
next: '/address'
|
35
34
|
},
|
36
35
|
'/address': {
|
@@ -92,8 +91,5 @@ module.exports = {
|
|
92
91
|
],
|
93
92
|
next: '/confirm'
|
94
93
|
},
|
95
|
-
'/session-timeout': {},
|
96
|
-
'/exit': {},
|
97
|
-
'/save-and-exit': {}
|
98
94
|
}
|
99
95
|
};
|
@@ -50,23 +50,8 @@
|
|
50
50
|
},
|
51
51
|
"confirmation": {
|
52
52
|
"title": "Application sent",
|
53
|
-
"alert": "Application sent",
|
53
|
+
"alert": "Application sent",
|
54
54
|
"subheader": "What happens next",
|
55
55
|
"content": "We’ll contact you with the decision of your application or if we need more information from you."
|
56
|
-
},
|
57
|
-
"exit": {
|
58
|
-
"message": "We have cleared your information to keep it secure. Your information has not been saved."
|
59
|
-
},
|
60
|
-
"session-timeout-warning": {
|
61
|
-
"dialog-title": "{{^showSaveAndExit}}Your application will close soon{{/showSaveAndExit}}{{#showSaveAndExit}}You will be signed out soon{{/showSaveAndExit}}",
|
62
|
-
"dialog-text": "{{^showSaveAndExit}}If that happens, your progress will not be saved.{{/showSaveAndExit}}{{#showSaveAndExit}}Any answers you have saved will not be affected, but your progress on this page will not be saved.{{/showSaveAndExit}}",
|
63
|
-
"timeout-continue-button": "{{^showSaveAndExit}}Stay on this page{{/showSaveAndExit}}{{#showSaveAndExit}}Stay signed in{{/showSaveAndExit}}",
|
64
|
-
"dialog-exit-link": "{{^showSaveAndExit}}Exit this form{{/showSaveAndExit}}{{#showSaveAndExit}}Sign out{{/showSaveAndExit}}"
|
65
|
-
},
|
66
|
-
"save-and-exit": {
|
67
|
-
"header": "You have been signed out",
|
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>."
|
71
56
|
}
|
72
57
|
}
|
package/sandbox/server.js
CHANGED
@@ -8,16 +8,11 @@ bootstrap({
|
|
8
8
|
routes: [
|
9
9
|
require('./apps/sandbox')
|
10
10
|
],
|
11
|
-
behaviours: [
|
12
|
-
require('../').components.sessionTimeoutWarning
|
13
|
-
],
|
14
11
|
rateLimits: {
|
15
12
|
requests: {
|
16
13
|
active: true
|
17
14
|
}
|
18
15
|
},
|
19
16
|
getAccessibility: true,
|
20
|
-
sessionTimeoutWarningContent: true,
|
21
|
-
exitFormContent: true,
|
22
17
|
"port": 8082
|
23
18
|
});
|