hof 20.0.2 → 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
+ };
@@ -18,7 +18,7 @@
18
18
  <a class="govuk-link" href="/cookies">View cookies</a>
19
19
  </div>
20
20
  </div>
21
- <div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="0" hidden="" id="cookie-banner-submitted" >
21
+ <div class="gem-c-cookie-banner__confirmation govuk-width-container" hidden="" id="cookie-banner-submitted" >
22
22
  <p class="gem-c-cookie-banner__confirmation-message" role="alert">
23
23
  Your cookie preferences have been saved. You can <a class="govuk-link" data-module="gem-track-click" data-track-category="cookieBanner" data-track-action="Cookie banner settings clicked from confirmation" href="/cookies">change your cookie settings</a> at any time.
24
24
  </p>
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.2",
4
+ "version": "20.0.4",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",