hof 21.0.0-instrumentation-beta.0 → 21.0.2-axios-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 +1 -1
- package/.github/workflows/automate-tag.yml +4 -4
- package/.nyc_output/4fc007c9-d6c8-4614-89ce-04c7d6ce9fe5.json +1 -0
- package/.nyc_output/processinfo/4fc007c9-d6c8-4614-89ce-04c7d6ce9fe5.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/README.md +340 -256
- package/build/tasks/sass/index.js +3 -1
- package/build/tasks/watch/index.js +1 -1
- package/components/combine-and-loop-fields/Readme.md +42 -0
- package/components/combine-and-loop-fields/index.js +156 -0
- package/components/date/index.js +3 -1
- package/components/date/templates/date.html +15 -12
- package/components/homeoffice-countries/index.js +22 -0
- package/components/index.js +2 -0
- package/components/notify/notify.js +2 -2
- package/components/summary/index.js +3 -2
- package/config/builder-defaults.js +3 -1
- package/config/component-defaults.js +13 -0
- package/controller/controller.js +57 -1
- package/controller/formatting/formatters.js +12 -0
- package/controller/validation/index.js +2 -1
- package/controller/validation/validators.js +4 -0
- package/frontend/govuk-template/build/config.js +2 -2
- package/frontend/govuk-template/build/govuk_template.html +104 -0
- package/frontend/govuk-template/build/index.js +2 -2
- package/frontend/govuk-template/index.js +4 -4
- package/frontend/template-mixins/mixins/template-mixins.js +39 -11
- package/frontend/template-mixins/partials/forms/checkbox-group.html +47 -0
- package/frontend/template-mixins/partials/forms/checkbox.html +4 -4
- package/frontend/template-mixins/partials/forms/input-submit.html +1 -1
- package/frontend/template-mixins/partials/forms/input-text-date.html +37 -0
- package/frontend/template-mixins/partials/forms/input-text-group.html +15 -10
- package/frontend/template-mixins/partials/forms/option-group.html +42 -26
- package/frontend/template-mixins/partials/forms/select.html +10 -5
- package/frontend/template-mixins/partials/forms/textarea-group.html +37 -23
- package/frontend/template-mixins/partials/mixins/panel.html +3 -4
- package/frontend/template-partials/views/accessibility.html +4 -4
- package/frontend/template-partials/views/cookies.html +1 -1
- package/frontend/template-partials/views/layout.html +24 -17
- package/frontend/template-partials/views/partials/back.html +1 -1
- package/frontend/template-partials/views/partials/bullet-list.html +1 -1
- package/frontend/template-partials/views/partials/confirmation-alert.html +4 -3
- package/frontend/template-partials/views/partials/continue.html +1 -1
- package/frontend/template-partials/views/partials/cookie-banner.html +27 -24
- package/frontend/template-partials/views/partials/cookie-settings-radio.html +6 -6
- package/frontend/template-partials/views/partials/external-link.html +1 -1
- package/frontend/template-partials/views/partials/form.html +2 -1
- package/frontend/template-partials/views/partials/maincontent-left.html +4 -4
- package/frontend/template-partials/views/partials/navigation.html +7 -6
- package/frontend/template-partials/views/partials/session-cookies-table.html +6 -6
- package/frontend/template-partials/views/partials/summary-table-row.html +2 -2
- package/frontend/template-partials/views/partials/table.html +7 -7
- package/frontend/template-partials/views/partials/validation-list.html +2 -2
- package/frontend/template-partials/views/partials/validation-summary.html +14 -13
- package/frontend/template-partials/views/partials/warn.html +7 -0
- package/frontend/template-partials/views/session-timeout.html +3 -2
- package/frontend/themes/gov-uk/client-js/cookieSettings.js +1 -1
- package/frontend/themes/gov-uk/client-js/govuk-cookies.js +121 -0
- package/frontend/themes/gov-uk/client-js/index.js +6 -1
- package/frontend/themes/gov-uk/client-js/skip-to-main.js +19 -0
- package/frontend/themes/gov-uk/styles/_cookie-banner.scss +51 -1
- package/frontend/themes/gov-uk/styles/govuk.scss +4 -0
- package/frontend/themes/gov-uk/styles/modules/_validation.scss +5 -5
- package/frontend/toolkit/assets/javascript/character-count.js +4 -4
- package/frontend/toolkit/assets/javascript/progressive-reveal.js +3 -1
- package/frontend/toolkit/assets/javascript/validation.js +5 -1
- package/frontend/toolkit/assets/stylesheets/modules/_validation.scss +3 -3
- package/index.js +15 -2
- package/lib/ga-tag.js +1 -1
- package/lib/settings.js +18 -2
- package/middleware/errors.js +2 -3
- package/middleware/not-found.js +0 -3
- package/middleware/rate-limiter.js +1 -0
- package/model/apis/axios-settings.js +9 -0
- package/model/apis/html-to-pdf-converter.js +9 -8
- package/model/index.js +29 -28
- package/package.json +17 -14
- package/sandbox/README.md +3 -3
- package/sandbox/apps/sandbox/fields.js +33 -11
- package/sandbox/apps/sandbox/index.js +4 -0
- package/sandbox/apps/sandbox/sections/summary-data-sections.js +3 -0
- package/sandbox/apps/sandbox/translations/en/default.json +224 -0
- package/sandbox/apps/sandbox/translations/src/en/fields.json +11 -4
- package/sandbox/apps/sandbox/translations/src/en/journey.json +4 -1
- package/sandbox/apps/sandbox/translations/src/en/pages.json +7 -25
- package/sandbox/apps/sandbox/translations/src/en/validation.json +5 -1
- package/sandbox/assets/js/index.js +1 -1
- package/sandbox/assets/scss/app.scss +16 -16
- package/sandbox/package.json +6 -1
- package/sandbox/public/css/app.css +2793 -0
- package/sandbox/public/images/icons/icon-caret-left.png +0 -0
- package/sandbox/public/images/icons/icon-complete.png +0 -0
- package/sandbox/public/images/icons/icon-cross-remove-sign.png +0 -0
- package/sandbox/public/js/bundle.js +32888 -0
- package/sandbox/server.js +2 -1
- package/sandbox/yarn.lock +243 -1
- package/wizard/index.js +0 -13
- package/wizard/middleware/check-progress.js +36 -1
- package/.nyc_output/4d5a4574-78fc-4fcb-9412-3658f6ce33ff.json +0 -1
- package/.nyc_output/processinfo/4d5a4574-78fc-4fcb-9412-3658f6ce33ff.json +0 -1
- package/frontend/govuk-template/govuk_template.html +0 -109
- package/frontend/themes/gov-uk/views/partials/form.html +0 -9
- package/frontend/themes/gov-uk/views/partials/forms/option-group.html +0 -28
- package/frontend/themes/gov-uk/views/partials/mixins/panel.html +0 -3
- package/frontend/themes/gov-uk/views/partials/validation-summary.html +0 -24
- package/middleware/monitor.js +0 -20
- package/sandbox/apps/sandbox/views/confirmation.html +0 -15
package/index.js
CHANGED
@@ -78,8 +78,16 @@ const getContentSecurityPolicy = (config, res) => {
|
|
78
78
|
styleSrc: ['www.googletagmanager.com', 'fonts.googleapis.com', 'tagmanager.google.com'],
|
79
79
|
fontSrc: ['fonts.gstatic.com '],
|
80
80
|
scriptSrc: ['www.google-analytics.com', 'ssl.google-analytics.com'],
|
81
|
-
imgSrc: [
|
82
|
-
|
81
|
+
imgSrc: [
|
82
|
+
'www.google-analytics.com',
|
83
|
+
'ssl.gstatic.com',
|
84
|
+
'www.google.co.uk/ads/ga-audiences'
|
85
|
+
],
|
86
|
+
connectSrc: [
|
87
|
+
'https://www.google-analytics.com',
|
88
|
+
'https://region1.google-analytics.com',
|
89
|
+
'https://region1.analytics.google.com'
|
90
|
+
]
|
83
91
|
};
|
84
92
|
|
85
93
|
if (config.gaTagId) {
|
@@ -120,6 +128,8 @@ const getContentSecurityPolicy = (config, res) => {
|
|
120
128
|
* @param options.getTerms {boolean} Optional boolean - whether to mount the /terms endpoint
|
121
129
|
* @param options.getCookies {boolean} Optional boolean - whether to mount the /cookies endpoint
|
122
130
|
* @param options.noCache {boolean} Optional boolean - whether to disable caching
|
131
|
+
* @param options.getAccessibilityStatement {boolean} Optional boolean - whether to mount the
|
132
|
+
* /accessibility-statement endpoint
|
123
133
|
*
|
124
134
|
* @returns {object} A new HOF application using the configuration supplied in options
|
125
135
|
*/
|
@@ -209,6 +219,9 @@ function bootstrap(options) {
|
|
209
219
|
app.use(hofMiddleware.rateLimiter(config, 'requests'));
|
210
220
|
}
|
211
221
|
|
222
|
+
// Set up routing so <YOUR-SITE-URL>/assets are served from /node_modules/govuk-frontend/govuk/assets
|
223
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/govuk/assets')));
|
224
|
+
|
212
225
|
if (config.getAccessibility === true) {
|
213
226
|
deprecate(
|
214
227
|
'`getAccessibility` option is deprecated and may be removed in future versions.',
|
package/lib/ga-tag.js
CHANGED
@@ -45,7 +45,7 @@ module.exports = (app, config) => {
|
|
45
45
|
const gaCrossDomainTrackingTagId = config.gaCrossDomainTrackingTagId;
|
46
46
|
const routes = config.routes;
|
47
47
|
|
48
|
-
if (gaTagId) {
|
48
|
+
if (gaTagId || ga4TagId) {
|
49
49
|
const pageMap = setupPageMap(routes);
|
50
50
|
|
51
51
|
app.use((req, res, next) => {
|
package/lib/settings.js
CHANGED
@@ -7,7 +7,22 @@ const hoganExpressStrict = require('hogan-express-strict');
|
|
7
7
|
const expressPartialTemplates = require('express-partial-templates');
|
8
8
|
const bodyParser = require('body-parser');
|
9
9
|
|
10
|
-
|
10
|
+
const dirExists = dir => {
|
11
|
+
try {
|
12
|
+
if (fs.existsSync(dir)) {
|
13
|
+
return true;
|
14
|
+
}
|
15
|
+
return false;
|
16
|
+
} catch(err) {
|
17
|
+
throw new Error(`${err}: Cannot check if the directory path exists`);
|
18
|
+
}
|
19
|
+
};
|
20
|
+
|
21
|
+
const filterEmptyViews = views => {
|
22
|
+
return views.filter(view => dirExists(view));
|
23
|
+
};
|
24
|
+
|
25
|
+
module.exports = async (app, config) => {
|
11
26
|
const viewEngine = config.viewEngine || 'html';
|
12
27
|
|
13
28
|
app.use((req, res, next) => {
|
@@ -17,7 +32,8 @@ module.exports = (app, config) => {
|
|
17
32
|
|
18
33
|
app.use(config.theme());
|
19
34
|
|
20
|
-
const
|
35
|
+
const filteredViews = filterEmptyViews(config.theme.views);
|
36
|
+
const viewPaths = [].concat(filteredViews);
|
21
37
|
app.set('view engine', viewEngine);
|
22
38
|
app.enable('view cache');
|
23
39
|
|
package/middleware/errors.js
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
const rateLimitsConfig = require('../config/rate-limits');
|
5
|
-
const monitor = require('./monitor');
|
6
5
|
|
7
6
|
const errorTitle = code => `${code}_ERROR`;
|
8
7
|
const errorMsg = code => `There is a ${code}_ERROR`;
|
@@ -13,6 +12,8 @@ const getContent = (err, translate) => {
|
|
13
12
|
if (err.code === 'SESSION_TIMEOUT') {
|
14
13
|
err.status = 401;
|
15
14
|
err.template = 'session-timeout';
|
15
|
+
err.title = (translate && translate('errors.session.title'));
|
16
|
+
err.message = (translate && translate('errors.session.message'));
|
16
17
|
content.title = (translate && translate('errors.session.title'));
|
17
18
|
content.message = (translate && translate('errors.session.message'));
|
18
19
|
}
|
@@ -90,8 +91,6 @@ module.exports = options => {
|
|
90
91
|
baseUrl: returnBaseUrl(req.path)
|
91
92
|
};
|
92
93
|
|
93
|
-
monitor(req, res, err.status);
|
94
|
-
|
95
94
|
if (logger && logger.error) {
|
96
95
|
logger.error(err.message || err.error, err);
|
97
96
|
}
|
package/middleware/not-found.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
'use strict';
|
2
|
-
const monitor = require('./monitor');
|
3
2
|
|
4
3
|
const getTranslations = translate => {
|
5
4
|
const translations = {
|
@@ -27,8 +26,6 @@ module.exports = options => {
|
|
27
26
|
logger.warn(`Cannot find: ${req.url}`);
|
28
27
|
}
|
29
28
|
|
30
|
-
monitor(req, res, '404');
|
31
|
-
|
32
29
|
res.status(404).render('404', {
|
33
30
|
title: translations.title,
|
34
31
|
description: translations.description,
|
@@ -4,6 +4,7 @@ const redis = require('redis');
|
|
4
4
|
const config = require('./../config/hof-defaults');
|
5
5
|
|
6
6
|
module.exports = (options, rateLimitType) => {
|
7
|
+
// eslint-disable-next-line no-console
|
7
8
|
const logger = options.logger || { log: (func, msg) => console[func](msg) };
|
8
9
|
const rateLimits = options.rateLimits[rateLimitType];
|
9
10
|
const timestampName = `${rateLimitType}TimeStamp`;
|
@@ -17,17 +17,18 @@ module.exports = class PDFModel extends Model {
|
|
17
17
|
}
|
18
18
|
|
19
19
|
handleResponse(response, callback) {
|
20
|
-
if (isPdf(Buffer.from(response.
|
21
|
-
return this.parseResponse(response.
|
20
|
+
if (isPdf(Buffer.from(response.data))) {
|
21
|
+
return this.parseResponse(response.status, response.data, callback);
|
22
22
|
}
|
23
23
|
const err = new Error();
|
24
|
-
|
25
|
-
|
26
|
-
err.
|
24
|
+
|
25
|
+
if (parseInt(response.status, 10) === 400) {
|
26
|
+
err.title = response.status;
|
27
|
+
err.message = response.statusText;
|
27
28
|
} else {
|
28
|
-
err.body = response.
|
29
|
+
err.body = response.data;
|
29
30
|
}
|
30
|
-
err.status = response.
|
31
|
-
return callback(err, null, response.
|
31
|
+
err.status = response.status;
|
32
|
+
return callback(err, null, response.status);
|
32
33
|
}
|
33
34
|
};
|
package/model/index.js
CHANGED
@@ -2,10 +2,12 @@
|
|
2
2
|
'use strict';
|
3
3
|
|
4
4
|
const _ = require('lodash');
|
5
|
-
const
|
5
|
+
const axios = require('axios').default;
|
6
6
|
const url = require('url');
|
7
7
|
const EventEmitter = require('events').EventEmitter;
|
8
8
|
|
9
|
+
const axiosSetting = require('./apis/axios-settings')
|
10
|
+
|
9
11
|
const REFERENCE = /^\$ref:/;
|
10
12
|
|
11
13
|
function timeDiff(from, to, d) {
|
@@ -27,7 +29,7 @@ module.exports = class Model extends EventEmitter {
|
|
27
29
|
this.set(attributes, {
|
28
30
|
silent: true
|
29
31
|
});
|
30
|
-
this._request =
|
32
|
+
this._request = axios;
|
31
33
|
}
|
32
34
|
|
33
35
|
save(options, callback) {
|
@@ -47,7 +49,6 @@ module.exports = class Model extends EventEmitter {
|
|
47
49
|
'Content-Type': 'application/json',
|
48
50
|
'Content-Length': Buffer.byteLength(data)
|
49
51
|
}, reqConf.headers || {});
|
50
|
-
|
51
52
|
return this.request(reqConf, data, callback);
|
52
53
|
});
|
53
54
|
}
|
@@ -94,22 +95,23 @@ module.exports = class Model extends EventEmitter {
|
|
94
95
|
|
95
96
|
let settings = Object.assign({}, originalSettings);
|
96
97
|
settings.timeout = settings.timeout || this.options.timeout;
|
97
|
-
settings
|
98
|
-
settings
|
99
|
-
|
100
|
-
settings = _.omit(settings, urlKeys, 'data', 'url');
|
98
|
+
settings = axiosSetting(settings, body)
|
99
|
+
settings = _.omit(settings, urlKeys);
|
101
100
|
this.emit('sync', originalSettings);
|
102
101
|
|
103
102
|
const promise = Promise.resolve().then(() => this.auth()).then(authData => {
|
104
|
-
|
105
|
-
if (typeof
|
106
|
-
const auth =
|
107
|
-
|
103
|
+
let authVal = authData;
|
104
|
+
if (typeof authVal === 'string') {
|
105
|
+
const auth = authVal.split(':');
|
106
|
+
authVal = {
|
108
107
|
user: auth.shift(),
|
109
108
|
pass: auth.join(':'),
|
110
109
|
sendImmediately: true
|
111
110
|
};
|
112
111
|
}
|
112
|
+
if(authVal) {
|
113
|
+
settings.headers = Object.assign({}, settings.headers, {Authorization: `Bearer ${authVal.bearer}`});
|
114
|
+
}
|
113
115
|
})
|
114
116
|
.then(() => {
|
115
117
|
const startTime = process.hrtime();
|
@@ -124,7 +126,6 @@ module.exports = class Model extends EventEmitter {
|
|
124
126
|
|
125
127
|
const endTime = process.hrtime();
|
126
128
|
const responseTime = timeDiff(startTime, endTime);
|
127
|
-
|
128
129
|
if (err) {
|
129
130
|
this.emit('fail', err, data, originalSettings, statusCode, responseTime);
|
130
131
|
} else {
|
@@ -136,23 +137,23 @@ module.exports = class Model extends EventEmitter {
|
|
136
137
|
resolve(data);
|
137
138
|
}
|
138
139
|
};
|
139
|
-
|
140
|
-
this._request(settings
|
141
|
-
|
140
|
+
console.log("settings ::", settings);
|
141
|
+
this._request(settings)
|
142
|
+
.then(response => {
|
143
|
+
return this.handleResponse(response, (error, data, status) => {
|
144
|
+
if (error) {
|
145
|
+
error.headers = response.headers;
|
146
|
+
}
|
147
|
+
_callback(error, data, status);
|
148
|
+
});
|
149
|
+
}).catch(err => {
|
142
150
|
if (err.code === 'ETIMEDOUT' || err.code === 'ESOCKETTIMEDOUT') {
|
143
151
|
err.message = 'Connection timed out';
|
144
152
|
err.status = 504;
|
145
153
|
}
|
146
|
-
err.status = err.status ||
|
154
|
+
err.status = err.status || 503;
|
147
155
|
return _callback(err, null, err.status);
|
148
|
-
}
|
149
|
-
return this.handleResponse(response, (error, data, status) => {
|
150
|
-
if (error) {
|
151
|
-
error.headers = response.headers;
|
152
|
-
}
|
153
|
-
_callback(error, data, status);
|
154
156
|
});
|
155
|
-
});
|
156
157
|
});
|
157
158
|
});
|
158
159
|
|
@@ -165,13 +166,13 @@ module.exports = class Model extends EventEmitter {
|
|
165
166
|
handleResponse(response, callback) {
|
166
167
|
let data = {};
|
167
168
|
try {
|
168
|
-
data = JSON.parse(response.
|
169
|
+
data = typeof response.data === 'object' ? response.data : JSON.parse(response.data || '{}');
|
169
170
|
} catch (err) {
|
170
|
-
err.status = response.
|
171
|
-
err.body = response.
|
172
|
-
return callback(err, null, response.
|
171
|
+
err.status = response.status;
|
172
|
+
err.body = response.data;
|
173
|
+
return callback(err, null, response.status);
|
173
174
|
}
|
174
|
-
return this.parseResponse(response.
|
175
|
+
return this.parseResponse(response.status, data, callback);
|
175
176
|
}
|
176
177
|
|
177
178
|
parseResponse(statusCode, data, callback) {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "hof",
|
3
3
|
"description": "A bootstrap for HOF projects",
|
4
|
-
"version": "21.0.
|
4
|
+
"version": "21.0.2-axios-beta",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "index.js",
|
7
7
|
"author": "HomeOffice",
|
@@ -23,19 +23,21 @@
|
|
23
23
|
"scripts": {
|
24
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
|
-
"unit:nocov": "LOG_LEVEL=error mocha",
|
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
|
-
"test:functional": "funkie mocha ./test/functional-tests --exit",
|
28
|
+
"test:functional": "funkie mocha ./test/functional-tests --timeout 20000 --exit",
|
29
29
|
"test:client": "karma start test/frontend/toolkit/karma.conf.js",
|
30
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",
|
34
34
|
"ci": "travis-conditions",
|
35
|
-
"postversion": "git push && git push --tags"
|
35
|
+
"postversion": "git push && git push --tags",
|
36
|
+
"test-single": "mocha"
|
36
37
|
},
|
37
38
|
"dependencies": {
|
38
39
|
"aliasify": "^2.1.0",
|
40
|
+
"axios": "^1.5.1",
|
39
41
|
"bluebird": "^3.7.2",
|
40
42
|
"body-parser": "^1.15.1",
|
41
43
|
"browserify": "^17.0.0",
|
@@ -45,7 +47,7 @@
|
|
45
47
|
"connect-redis": "^5.2.0",
|
46
48
|
"cookie-parser": "^1.4.6",
|
47
49
|
"cp": "^0.2.0",
|
48
|
-
"csrf": "^3.0
|
50
|
+
"csrf": "^3.1.0",
|
49
51
|
"debug": "^4.3.1",
|
50
52
|
"deprecate": "^1.0.0",
|
51
53
|
"dotenv": "^4.0.0",
|
@@ -57,6 +59,7 @@
|
|
57
59
|
"findup": "^0.1.5",
|
58
60
|
"glob": "^7.2.0",
|
59
61
|
"govuk-elements-sass": "^3.1.3",
|
62
|
+
"govuk-frontend": "3.14",
|
60
63
|
"govuk_template_mustache": "^0.26.0",
|
61
64
|
"helmet": "^3.22.0",
|
62
65
|
"hogan-express-strict": "^0.5.4",
|
@@ -68,27 +71,27 @@
|
|
68
71
|
"libphonenumber-js": "^1.9.37",
|
69
72
|
"lodash": "^4.17.21",
|
70
73
|
"markdown-it": "^12.3.2",
|
71
|
-
"minimatch": "^3.0.
|
74
|
+
"minimatch": "^3.0.7",
|
72
75
|
"minimist": "^1.2.6",
|
73
76
|
"mixwith": "^0.1.1",
|
74
77
|
"moment": "^2.29.4",
|
75
78
|
"morgan": "^1.10.0",
|
76
|
-
"mustache": "^2.
|
79
|
+
"mustache": "^4.2.0",
|
77
80
|
"nodemailer": "^6.6.3",
|
78
|
-
"nodemailer-ses-transport": "^1.5.
|
81
|
+
"nodemailer-ses-transport": "^1.5.1",
|
79
82
|
"nodemailer-smtp-transport": "^2.7.4",
|
80
83
|
"nodemailer-stub-transport": "^1.1.0",
|
81
|
-
"notifications-node-client": "^
|
82
|
-
"
|
84
|
+
"notifications-node-client": "^6.0.0",
|
85
|
+
"object-mapper": "^6.2.0",
|
83
86
|
"redis": "^3.1.2",
|
84
87
|
"reqres": "^3.0.1",
|
85
|
-
"request": "^2.79.0",
|
86
88
|
"rimraf": "^3.0.2",
|
87
|
-
"sass": "^1.
|
89
|
+
"sass": "^1.56.2",
|
88
90
|
"serve-static": "^1.14.1",
|
89
91
|
"uglify-js": "^3.14.3",
|
90
|
-
"underscore": "^1.
|
92
|
+
"underscore": "^1.13.6",
|
91
93
|
"urijs": "^1.19.11",
|
94
|
+
"uuid": "^8.3.2",
|
92
95
|
"winston": "^3.7.2"
|
93
96
|
},
|
94
97
|
"devDependencies": {
|
@@ -134,7 +137,7 @@
|
|
134
137
|
"reporter": "spec",
|
135
138
|
"require": "test/common.js",
|
136
139
|
"recursive": "true",
|
137
|
-
"timeout": "
|
140
|
+
"timeout": "9000",
|
138
141
|
"exit": "true"
|
139
142
|
},
|
140
143
|
"resolutions": {
|
package/sandbox/README.md
CHANGED
@@ -45,10 +45,10 @@ Install the dependencies
|
|
45
45
|
yarn
|
46
46
|
```
|
47
47
|
|
48
|
-
Move into the
|
48
|
+
Move into the sandbox folder
|
49
49
|
|
50
50
|
```bash
|
51
|
-
cd
|
51
|
+
cd sandbox
|
52
52
|
```
|
53
53
|
|
54
54
|
Install any example app specific dependencies
|
@@ -63,4 +63,4 @@ Run in development mode
|
|
63
63
|
yarn start:dev
|
64
64
|
```
|
65
65
|
|
66
|
-
go to http://localhost:
|
66
|
+
go to http://localhost:8082/
|
@@ -8,16 +8,23 @@ module.exports = {
|
|
8
8
|
'landing-page-radio': {
|
9
9
|
mixin: 'radio-group',
|
10
10
|
validate: ['required'],
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
isPageHeading: true,
|
12
|
+
// Design system says to avoid in-line unless it's two options,
|
13
|
+
// so just added as an example below but by default it isn't
|
14
|
+
className: ['govuk-radios--inline'],
|
14
15
|
options: ['basic-form', 'complex-form', 'build-your-own-form']
|
15
16
|
},
|
16
17
|
name: {
|
17
18
|
validate: ['required', 'notUrl', { type: 'maxlength', arguments: 200 }],
|
18
19
|
},
|
19
|
-
dateOfBirth: dateComponent('dateOfBirth', {
|
20
|
-
|
20
|
+
'dateOfBirth': dateComponent('dateOfBirth', {
|
21
|
+
mixin: 'input-date',
|
22
|
+
isPageHeading: 'true',
|
23
|
+
validate: [
|
24
|
+
'required',
|
25
|
+
'date',
|
26
|
+
{ type: 'after', arguments: ['1900'] }
|
27
|
+
]
|
21
28
|
}),
|
22
29
|
building: {
|
23
30
|
validate: ['required', 'notUrl', { type: 'maxlength', arguments: 100 }]
|
@@ -37,6 +44,7 @@ module.exports = {
|
|
37
44
|
formatter: ['removespaces', 'uppercase']
|
38
45
|
},
|
39
46
|
incomeTypes: {
|
47
|
+
isPageHeading: 'true',
|
40
48
|
mixin: 'checkbox-group',
|
41
49
|
labelClassName: 'visuallyhidden',
|
42
50
|
validate: ['required'],
|
@@ -49,11 +57,9 @@ module.exports = {
|
|
49
57
|
]
|
50
58
|
},
|
51
59
|
countryOfHearing: {
|
60
|
+
isPageHeading: 'true',
|
52
61
|
mixin: 'radio-group',
|
53
62
|
validate: ['required'],
|
54
|
-
legend: {
|
55
|
-
className: 'visuallyhidden'
|
56
|
-
},
|
57
63
|
options: [
|
58
64
|
'englandAndWales',
|
59
65
|
'scotland',
|
@@ -72,6 +78,7 @@ module.exports = {
|
|
72
78
|
},
|
73
79
|
countrySelect: {
|
74
80
|
mixin: 'select',
|
81
|
+
isPageHeading: 'true',
|
75
82
|
className: ['typeahead'],
|
76
83
|
options:[''].concat(require('homeoffice-countries').allCountries),
|
77
84
|
legend: {
|
@@ -81,14 +88,29 @@ module.exports = {
|
|
81
88
|
},
|
82
89
|
complaintDetails: {
|
83
90
|
mixin: 'textarea',
|
84
|
-
labelClassName: 'visuallyhidden',
|
85
91
|
// we want to ignore default formatters as we want
|
86
92
|
// to preserve white space
|
87
93
|
'ignore-defaults': true,
|
88
94
|
// apply the other default formatters
|
89
95
|
formatter: ['trim', 'hyphens'],
|
96
|
+
isPageHeading: 'true',
|
90
97
|
// attributes here are passed to the field element
|
91
|
-
validate: ['required', { type: 'maxlength', arguments:
|
98
|
+
validate: ['required', { type: 'maxlength', arguments: 10 }],
|
99
|
+
attributes: [{
|
100
|
+
attribute: 'rows',
|
101
|
+
value: 8
|
102
|
+
}]
|
103
|
+
},
|
104
|
+
whatHappened: {
|
105
|
+
mixin: 'textarea',
|
106
|
+
// we want to ignore default formatters as we want
|
107
|
+
// to preserve white space
|
108
|
+
'ignore-defaults': true,
|
109
|
+
// apply the other default formatters
|
110
|
+
formatter: ['trim', 'hyphens'],
|
111
|
+
isPageHeading: 'true',
|
112
|
+
// attributes here are passed to the field element
|
113
|
+
validate: ['required', { type: 'maxword', arguments: 10 }],
|
92
114
|
attributes: [{
|
93
115
|
attribute: 'rows',
|
94
116
|
value: 8
|
@@ -96,7 +118,7 @@ module.exports = {
|
|
96
118
|
},
|
97
119
|
appealStages: {
|
98
120
|
mixin: 'select',
|
99
|
-
|
121
|
+
isPageHeading: 'true',
|
100
122
|
validate: ['required'],
|
101
123
|
options: [{
|
102
124
|
value: '',
|