hof 20.0.3 → 20.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,22 @@
1
+
2
+ const _ = require('lodash');
3
+ const componentDefaults = require('../../config/component-defaults');
4
+
5
+ module.exports = superclass => class extends superclass {
6
+ configure(req, res, next) {
7
+ const homeOfficeCountries = [''].concat(require('homeoffice-countries').allCountries);
8
+
9
+ const nationalityFields = componentDefaults.homeOfficeCountries;
10
+
11
+ nationalityFields.forEach(field => {
12
+ if (_.get(req, `form.options.fields[${field}].options`)) {
13
+ req.form.options.fields[field].options = homeOfficeCountries.map(country => {
14
+ const labelString = country !== '' ? country : 'Please select a country';
15
+ return { label: labelString, value: country };
16
+ });
17
+ }
18
+ });
19
+
20
+ next();
21
+ }
22
+ };
@@ -0,0 +1,15 @@
1
+
2
+ module.exports = {
3
+ componentDefaults: {
4
+ homeOfficeCountries: [
5
+ 'nationality',
6
+ 'former-nationality',
7
+ 'dual-nationality',
8
+ 'nominated-nationality',
9
+ 'nationality-error',
10
+ 'country',
11
+ 'country-of-birth',
12
+ 'someone-else-nationality'
13
+ ]
14
+ }
15
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "20.0.3",
4
+ "version": "20.0.4",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",