hof 19.13.13 → 20.0.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.nyc_output/65af88d9-aebe-4d1b-a21d-6fbf7f2bbda4.json +1 -0
- package/.nyc_output/processinfo/65af88d9-aebe-4d1b-a21d-6fbf7f2bbda4.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.vscode/settings.json +6 -0
- package/components/date/index.js +23 -34
- package/components/date/templates/date.html +15 -12
- package/controller/controller.js +39 -0
- package/frontend/govuk-template/build/config.js +3 -3
- package/frontend/govuk-template/build/govuk_template.html +104 -0
- package/frontend/govuk-template/build/index.js +2 -2
- package/frontend/govuk-template/govuk_template_generated.html +104 -0
- package/frontend/govuk-template/index.js +4 -4
- package/frontend/template-mixins/mixins/template-mixins.js +19 -8
- package/frontend/template-mixins/partials/forms/checkbox-group.html +38 -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 +12 -9
- package/frontend/template-mixins/partials/forms/option-group.html +33 -26
- package/frontend/template-mixins/partials/forms/select.html +10 -5
- package/frontend/template-mixins/partials/forms/textarea-group.html +15 -6
- package/frontend/template-mixins/partials/mixins/panel.html +1 -1
- 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 +22 -22
- 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 +1 -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/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/session-timeout.html +1 -1
- package/frontend/themes/gov-uk/client-js/cookieSettings.js +1 -1
- package/frontend/themes/gov-uk/client-js/govuk-cookies.js +122 -0
- package/frontend/themes/gov-uk/client-js/index.js +5 -0
- package/frontend/themes/gov-uk/client-js/skip-to-main.js +18 -0
- package/frontend/themes/gov-uk/styles/modules/_validation.scss +3 -3
- package/frontend/toolkit/assets/javascript/character-count.js +4 -4
- package/frontend/toolkit/assets/stylesheets/modules/_validation.scss +3 -3
- package/index.js +5 -1
- package/package.json +5 -4
- package/sandbox/.env +1 -0
- package/sandbox/apps/sandbox/fields.js +12 -5
- package/sandbox/apps/sandbox/index.js +5 -1
- package/sandbox/apps/sandbox/translations/en/default.json +212 -0
- package/sandbox/apps/sandbox/translations/src/en/fields.json +6 -4
- package/sandbox/apps/sandbox/translations/src/en/journey.json +4 -1
- package/sandbox/apps/sandbox/translations/src/en/pages.json +0 -17
- package/sandbox/apps/sandbox/translations/src/en/validation.json +1 -1
- package/sandbox/assets/js/index.js +1 -1
- package/sandbox/assets/scss/app.scss +71 -15
- package/sandbox/package.json +4 -1
- package/sandbox/public/css/app.css +9399 -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 +35644 -0
- package/sandbox/yarn.lock +767 -0
- 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/sandbox/apps/sandbox/views/confirmation.html +0 -15
@@ -1,24 +1,25 @@
|
|
1
1
|
{{#errorlist.length}}
|
2
|
-
<div class="
|
2
|
+
<div class="govuk-error-summary" aria-labelledby="error-summary-title" data-module="govuk-error-summary" role="alert" tabindex="-1">
|
3
3
|
{{$errorlist-title}}
|
4
4
|
|
5
5
|
{{#errorLength.single}}
|
6
|
-
<h2 id="error-summary-title">{{#t}}errorlist.title.single{{/t}}</h2>
|
6
|
+
<h2 class="govuk-error-summary__title" id="error-summary-title">{{#t}}errorlist.title.single{{/t}}</h2>
|
7
7
|
{{/errorLength.single}}
|
8
8
|
{{#errorLength.multiple}}
|
9
|
-
<h2 id="error-summary-title">{{#t}}errorlist.title.multiple{{/t}}</h2>
|
9
|
+
<h2 class="govuk-error-summary__title" id="error-summary-title">{{#t}}errorlist.title.multiple{{/t}}</h2>
|
10
10
|
{{/errorLength.multiple}}
|
11
11
|
|
12
12
|
{{/errorlist-title}}
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
<div class="govuk-error-summary__body">
|
14
|
+
{{<partials-validation-list}}
|
15
|
+
{{$validation-list}}
|
16
|
+
{{#errorlist}}
|
17
|
+
{{#message}}
|
18
|
+
<li><a href="#{{errorLinkId}}">{{ message }}</a></li>
|
19
|
+
{{/message}}
|
20
|
+
{{/errorlist}}
|
21
|
+
{{/validation-list}}
|
22
|
+
{{/partials-validation-list}}
|
23
|
+
</div>
|
23
24
|
</div>
|
24
25
|
{{/errorlist.length}}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{{<error}}
|
2
2
|
{{$content}}
|
3
3
|
<p>{{{content.message}}}</p>
|
4
|
-
<a href="{{startLink}}" class="button" role="button">{{#t}}buttons.start-again{{/t}}</a>
|
4
|
+
<a href="{{startLink}}" class="govuk-button" role="button">{{#t}}buttons.start-again{{/t}}</a>
|
5
5
|
{{/content}}
|
6
6
|
{{/error}}
|
@@ -35,7 +35,7 @@ function showCookieBannerSubmitted() {
|
|
35
35
|
document.getElementById('cookie-banner-info').style.display = 'none';
|
36
36
|
document.getElementById('cookie-banner-actions').style.display = 'none';
|
37
37
|
var cookieBannerSubmitted = document.getElementById('cookie-banner-submitted');
|
38
|
-
cookieBannerSubmitted.style.display = '
|
38
|
+
cookieBannerSubmitted.style.display = 'block';
|
39
39
|
cookieBannerSubmitted.focus();
|
40
40
|
}
|
41
41
|
|
@@ -0,0 +1,122 @@
|
|
1
|
+
(function () {
|
2
|
+
"use strict"
|
3
|
+
var root = this;
|
4
|
+
if(typeof root.GOVUK === 'undefined') { root.GOVUK = {}; }
|
5
|
+
|
6
|
+
/*
|
7
|
+
Cookie methods
|
8
|
+
==============
|
9
|
+
|
10
|
+
Usage:
|
11
|
+
|
12
|
+
Setting a cookie:
|
13
|
+
GOVUK.cookie('hobnob', 'tasty', { days: 30 });
|
14
|
+
|
15
|
+
Reading a cookie:
|
16
|
+
GOVUK.cookie('hobnob');
|
17
|
+
|
18
|
+
Deleting a cookie:
|
19
|
+
GOVUK.cookie('hobnob', null);
|
20
|
+
*/
|
21
|
+
GOVUK.cookie = function (name, value, options) {
|
22
|
+
if(typeof value !== 'undefined'){
|
23
|
+
if(value === false || value === null) {
|
24
|
+
return GOVUK.setCookie(name, '', { days: -1 });
|
25
|
+
} else {
|
26
|
+
return GOVUK.setCookie(name, value, options);
|
27
|
+
}
|
28
|
+
} else {
|
29
|
+
return GOVUK.getCookie(name);
|
30
|
+
}
|
31
|
+
};
|
32
|
+
GOVUK.setCookie = function (name, value, options) {
|
33
|
+
if(typeof options === 'undefined') {
|
34
|
+
options = {};
|
35
|
+
}
|
36
|
+
var cookieString = name + "=" + value + "; path=/";
|
37
|
+
if (options.days) {
|
38
|
+
var date = new Date();
|
39
|
+
date.setTime(date.getTime() + (options.days * 24 * 60 * 60 * 1000));
|
40
|
+
cookieString = cookieString + "; expires=" + date.toGMTString();
|
41
|
+
}
|
42
|
+
if (document.location.protocol == 'https:'){
|
43
|
+
cookieString = cookieString + "; Secure";
|
44
|
+
}
|
45
|
+
document.cookie = cookieString;
|
46
|
+
};
|
47
|
+
GOVUK.getCookie = function (name) {
|
48
|
+
var nameEQ = name + "=";
|
49
|
+
var cookies = document.cookie.split(';');
|
50
|
+
for(var i = 0, len = cookies.length; i < len; i++) {
|
51
|
+
var cookie = cookies[i];
|
52
|
+
while (cookie.charAt(0) == ' ') {
|
53
|
+
cookie = cookie.substring(1, cookie.length);
|
54
|
+
}
|
55
|
+
if (cookie.indexOf(nameEQ) === 0) {
|
56
|
+
return decodeURIComponent(cookie.substring(nameEQ.length));
|
57
|
+
}
|
58
|
+
}
|
59
|
+
return null;
|
60
|
+
};
|
61
|
+
}).call(this);
|
62
|
+
(function () {
|
63
|
+
'use strict'
|
64
|
+
var root = this
|
65
|
+
if (typeof root.GOVUK === 'undefined') { root.GOVUK = {} }
|
66
|
+
|
67
|
+
GOVUK.addCookieMessage = function () {
|
68
|
+
var message = document.getElementById('global-cookie-message')
|
69
|
+
|
70
|
+
var hasCookieMessage = (message && GOVUK.cookie('seen_cookie_message') === null)
|
71
|
+
|
72
|
+
if (hasCookieMessage) {
|
73
|
+
message.style.display = 'block'
|
74
|
+
GOVUK.cookie('seen_cookie_message', 'yes', { days: 28 })
|
75
|
+
|
76
|
+
document.addEventListener('DOMContentLoaded', function (event) {
|
77
|
+
if (GOVUK.analytics && typeof GOVUK.analytics.trackEvent === 'function') {
|
78
|
+
GOVUK.analytics.trackEvent('cookieBanner', 'Cookie banner shown', {
|
79
|
+
value: 1,
|
80
|
+
nonInteraction: true
|
81
|
+
})
|
82
|
+
}
|
83
|
+
})
|
84
|
+
};
|
85
|
+
}
|
86
|
+
}).call(this)
|
87
|
+
;
|
88
|
+
(function() {
|
89
|
+
"use strict"
|
90
|
+
|
91
|
+
// add cookie message
|
92
|
+
if (window.GOVUK && GOVUK.addCookieMessage) {
|
93
|
+
GOVUK.addCookieMessage();
|
94
|
+
}
|
95
|
+
|
96
|
+
// header navigation toggle
|
97
|
+
if (document.querySelectorAll && document.addEventListener){
|
98
|
+
var els = document.querySelectorAll('.js-header-toggle'),
|
99
|
+
i, _i;
|
100
|
+
for(i=0,_i=els.length; i<_i; i++){
|
101
|
+
els[i].addEventListener('click', function(e){
|
102
|
+
e.preventDefault();
|
103
|
+
var target = document.getElementById(this.getAttribute('href').substr(1)),
|
104
|
+
targetClass = target.getAttribute('class') || '',
|
105
|
+
sourceClass = this.getAttribute('class') || '';
|
106
|
+
|
107
|
+
if(targetClass.indexOf('js-visible') !== -1){
|
108
|
+
target.setAttribute('class', targetClass.replace(/(^|\s)js-visible(\s|$)/, ''));
|
109
|
+
} else {
|
110
|
+
target.setAttribute('class', targetClass + " js-visible");
|
111
|
+
}
|
112
|
+
if(sourceClass.indexOf('js-visible') !== -1){
|
113
|
+
this.setAttribute('class', sourceClass.replace(/(^|\s)js-visible(\s|$)/, ''));
|
114
|
+
} else {
|
115
|
+
this.setAttribute('class', sourceClass + " js-visible");
|
116
|
+
}
|
117
|
+
this.setAttribute('aria-expanded', this.getAttribute('aria-expanded') !== "true");
|
118
|
+
target.setAttribute('aria-hidden', target.getAttribute('aria-hidden') === "false");
|
119
|
+
});
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}).call(this);
|
@@ -8,6 +8,11 @@ var formFocus = toolkit.formFocus;
|
|
8
8
|
var characterCount = toolkit.characterCount;
|
9
9
|
var validation = toolkit.validation;
|
10
10
|
|
11
|
+
var GOVUK = require('govuk-frontend')
|
12
|
+
GOVUK.initAll();
|
13
|
+
window.GOVUK = GOVUK;
|
14
|
+
var skipToMain = require('./skip-to-main');
|
15
|
+
var cookie = require('./govuk-cookies');
|
11
16
|
var cookieSettings = require('./cookieSettings');
|
12
17
|
|
13
18
|
toolkit.detailsSummary();
|
@@ -0,0 +1,18 @@
|
|
1
|
+
const skipToMain = function () {
|
2
|
+
const skipToMainLink = document.getElementById("skip-to-main");
|
3
|
+
const firstControlId = skipToMainLink.hash.split('#')[1] ? skipToMainLink.hash.split('#')[1] : "main-content";
|
4
|
+
if(firstControlId === "main-content"){
|
5
|
+
skipToMainLink.setAttribute("href", "#main-content");
|
6
|
+
}
|
7
|
+
if(firstControlId) {
|
8
|
+
skipToMainLink.onclick = function(e) {
|
9
|
+
//here timeout added just to make this functionality asynchronous
|
10
|
+
//to focus on form as well as non form contents
|
11
|
+
setTimeout(() => {
|
12
|
+
const firstControl = document.getElementById(firstControlId);
|
13
|
+
firstControl.focus();
|
14
|
+
}, 10);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
};
|
18
|
+
skipToMain();
|
@@ -22,7 +22,7 @@
|
|
22
22
|
}
|
23
23
|
}
|
24
24
|
|
25
|
-
.
|
25
|
+
.govuk-form-group--error {
|
26
26
|
box-sizing: border-box;
|
27
27
|
padding-left: $gutter-half - $validation-bdr-size;
|
28
28
|
border-left: $validation-bdr-size-lg solid $error-colour;
|
@@ -36,7 +36,7 @@
|
|
36
36
|
}
|
37
37
|
}
|
38
38
|
|
39
|
-
.error-message {
|
39
|
+
.govuk-error-message {
|
40
40
|
display: block;
|
41
41
|
@include media(tablet) {
|
42
42
|
margin-bottom: 0.5em;
|
@@ -46,6 +46,6 @@
|
|
46
46
|
}
|
47
47
|
|
48
48
|
.invalid-input,
|
49
|
-
.
|
49
|
+
.govuk-form-group--error .date-input {
|
50
50
|
border: $validation-bdr-size solid $error-colour;
|
51
51
|
}
|
@@ -30,12 +30,12 @@ CharacterCount.prototype.updateCount = function () {
|
|
30
30
|
this.$maxlengthHint.innerHTML = 'You have ' + number + characterNoun + remainderSuffix;
|
31
31
|
|
32
32
|
if (currentLength >= this.maxLength + 1) {
|
33
|
-
helpers.removeClass(this.$maxlengthHint, '
|
34
|
-
helpers.addClass(this.$maxlengthHint, 'error-message');
|
33
|
+
helpers.removeClass(this.$maxlengthHint, 'govuk-hint');
|
34
|
+
helpers.addClass(this.$maxlengthHint, 'govuk-error-message');
|
35
35
|
helpers.addClass(this.$textarea, 'textarea-error');
|
36
36
|
} else {
|
37
|
-
helpers.addClass(this.$maxlengthHint, '
|
38
|
-
helpers.removeClass(this.$maxlengthHint, 'error-message');
|
37
|
+
helpers.addClass(this.$maxlengthHint, 'govuk-hint');
|
38
|
+
helpers.removeClass(this.$maxlengthHint, 'govuk-error-message');
|
39
39
|
helpers.removeClass(this.$textarea, 'textarea-error');
|
40
40
|
}
|
41
41
|
};
|
@@ -22,7 +22,7 @@
|
|
22
22
|
}
|
23
23
|
}
|
24
24
|
|
25
|
-
.
|
25
|
+
.govuk-form-group--error {
|
26
26
|
box-sizing: border-box;
|
27
27
|
padding-left: $gutter-half - $validation-bdr-size;
|
28
28
|
border-left: $validation-bdr-size-lg solid $error-colour;
|
@@ -36,7 +36,7 @@
|
|
36
36
|
}
|
37
37
|
}
|
38
38
|
|
39
|
-
.error-message {
|
39
|
+
.govuk-error-message {
|
40
40
|
display: block;
|
41
41
|
@include media(tablet) {
|
42
42
|
margin-bottom: 0.5em;
|
@@ -46,6 +46,6 @@
|
|
46
46
|
}
|
47
47
|
|
48
48
|
.invalid-input,
|
49
|
-
.
|
49
|
+
.govuk-form-group--error .date-input {
|
50
50
|
border: $validation-bdr-size solid $error-colour;
|
51
51
|
}
|
package/index.js
CHANGED
@@ -120,7 +120,8 @@ const getContentSecurityPolicy = (config, res) => {
|
|
120
120
|
* @param options.getTerms {boolean} Optional boolean - whether to mount the /terms endpoint
|
121
121
|
* @param options.getCookies {boolean} Optional boolean - whether to mount the /cookies endpoint
|
122
122
|
* @param options.noCache {boolean} Optional boolean - whether to disable caching
|
123
|
-
*
|
123
|
+
* @param options.getAccessibilityStatement {boolean} Optional boolean - whether to mount the /accessibility-statement endpoint
|
124
|
+
*
|
124
125
|
* @returns {object} A new HOF application using the configuration supplied in options
|
125
126
|
*/
|
126
127
|
function bootstrap(options) {
|
@@ -204,6 +205,9 @@ function bootstrap(options) {
|
|
204
205
|
}));
|
205
206
|
app.use(mixins());
|
206
207
|
app.use(markdown(config.markdown));
|
208
|
+
|
209
|
+
// Set up routing so <YOUR-SITE-URL>/assets are served from /node_modules/govuk-frontend/govuk/assets
|
210
|
+
app.use('/assets', express.static(path.join(__dirname, '/node_modules/govuk-frontend/govuk/assets')))
|
207
211
|
|
208
212
|
if (config.getAccessibility === true) {
|
209
213
|
deprecate(
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "hof",
|
3
3
|
"description": "A bootstrap for HOF projects",
|
4
|
-
"version": "
|
4
|
+
"version": "20.0.0-beta.1",
|
5
5
|
"license": "MIT",
|
6
6
|
"main": "index.js",
|
7
7
|
"author": "HomeOffice",
|
@@ -23,7 +23,7 @@
|
|
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
28
|
"test:functional": "funkie mocha ./test/functional-tests --exit",
|
29
29
|
"test:client": "karma start test/frontend/toolkit/karma.conf.js",
|
@@ -57,6 +57,7 @@
|
|
57
57
|
"findup": "^0.1.5",
|
58
58
|
"glob": "^7.2.0",
|
59
59
|
"govuk-elements-sass": "^3.1.3",
|
60
|
+
"govuk-frontend": "3.14",
|
60
61
|
"govuk_template_mustache": "^0.26.0",
|
61
62
|
"helmet": "^3.22.0",
|
62
63
|
"hogan-express-strict": "^0.5.4",
|
@@ -72,7 +73,7 @@
|
|
72
73
|
"minimist": "^1.2.0",
|
73
74
|
"mixwith": "^0.1.1",
|
74
75
|
"mkdirp": "^0.5.1",
|
75
|
-
"moment": "^2.
|
76
|
+
"moment": "^2.24.0",
|
76
77
|
"morgan": "^1.10.0",
|
77
78
|
"mustache": "^2.3.0",
|
78
79
|
"nodemailer": "^6.6.3",
|
@@ -87,7 +88,7 @@
|
|
87
88
|
"serve-static": "^1.14.1",
|
88
89
|
"uglify-js": "^3.14.3",
|
89
90
|
"underscore": "^1.12.1",
|
90
|
-
"urijs": "^1.19.
|
91
|
+
"urijs": "^1.19.10",
|
91
92
|
"winston": "^3.3.3"
|
92
93
|
},
|
93
94
|
"devDependencies": {
|
package/sandbox/.env
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
GA_TAG=UA-215558609-1
|
@@ -11,13 +11,21 @@ module.exports = {
|
|
11
11
|
legend: {
|
12
12
|
className: 'visuallyhidden'
|
13
13
|
},
|
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 }],
|
19
|
+
labelClassName: ['govuk-label--l'],
|
20
|
+
// noHeading: 'true'
|
18
21
|
},
|
19
|
-
dateOfBirth: dateComponent('dateOfBirth', {
|
20
|
-
|
22
|
+
'dateOfBirth': dateComponent('dateOfBirth', {
|
23
|
+
controlType: 'date-input',
|
24
|
+
validate: [
|
25
|
+
'required',
|
26
|
+
'date',
|
27
|
+
{ type: 'after', arguments: ['1900'] }
|
28
|
+
]
|
21
29
|
}),
|
22
30
|
building: {
|
23
31
|
validate: ['required', 'notUrl', { type: 'maxlength', arguments: 100 }]
|
@@ -81,14 +89,14 @@ module.exports = {
|
|
81
89
|
},
|
82
90
|
complaintDetails: {
|
83
91
|
mixin: 'textarea',
|
84
|
-
labelClassName: 'visuallyhidden',
|
85
92
|
// we want to ignore default formatters as we want
|
86
93
|
// to preserve white space
|
87
94
|
'ignore-defaults': true,
|
88
95
|
// apply the other default formatters
|
89
96
|
formatter: ['trim', 'hyphens'],
|
97
|
+
labelClassName: ['govuk-label--l'],
|
90
98
|
// attributes here are passed to the field element
|
91
|
-
validate: ['required', { type: 'maxlength', arguments:
|
99
|
+
validate: ['required', { type: 'maxlength', arguments: 100 }],
|
92
100
|
attributes: [{
|
93
101
|
attribute: 'rows',
|
94
102
|
value: 8
|
@@ -96,7 +104,6 @@ module.exports = {
|
|
96
104
|
},
|
97
105
|
appealStages: {
|
98
106
|
mixin: 'select',
|
99
|
-
labelClassName: 'visuallyhidden',
|
100
107
|
validate: ['required'],
|
101
108
|
options: [{
|
102
109
|
value: '',
|
@@ -30,7 +30,11 @@ module.exports = {
|
|
30
30
|
},
|
31
31
|
'/dob': {
|
32
32
|
fields: ['dateOfBirth'],
|
33
|
-
next: '/address'
|
33
|
+
next: '/address',
|
34
|
+
locals: {
|
35
|
+
step: 'dob',
|
36
|
+
labelClassName: 'govuk-input'
|
37
|
+
}
|
34
38
|
},
|
35
39
|
'/address': {
|
36
40
|
fields: ['building', 'street', 'townOrCity', 'postcode'],
|
@@ -0,0 +1,212 @@
|
|
1
|
+
{
|
2
|
+
"fields": {
|
3
|
+
"landing-page-radio": {
|
4
|
+
"legend": "Which form would you like to explore?",
|
5
|
+
"options": {
|
6
|
+
"basic-form": {
|
7
|
+
"label": "Basic form"
|
8
|
+
},
|
9
|
+
"complex-form": {
|
10
|
+
"label": "Complex form"
|
11
|
+
},
|
12
|
+
"build-your-own-form": {
|
13
|
+
"label": "Build your own form"
|
14
|
+
}
|
15
|
+
}
|
16
|
+
},
|
17
|
+
"name": {
|
18
|
+
"label": "What is your full name?"
|
19
|
+
},
|
20
|
+
"dateOfBirth": {
|
21
|
+
"legend": "What is your date of birth?",
|
22
|
+
"hint": "For example, 31 10 1990"
|
23
|
+
},
|
24
|
+
"building": {
|
25
|
+
"label": "Building and street"
|
26
|
+
},
|
27
|
+
"street": {
|
28
|
+
"label": "Address line 2"
|
29
|
+
},
|
30
|
+
"townOrCity": {
|
31
|
+
"label": "Town or city"
|
32
|
+
},
|
33
|
+
"postcode": {
|
34
|
+
"label": "Postcode"
|
35
|
+
},
|
36
|
+
"incomeTypes": {
|
37
|
+
"label": "Sources of income",
|
38
|
+
"legend": "Select the options where you receive income from",
|
39
|
+
"hint": "Select all options that apply to you.",
|
40
|
+
"options": {
|
41
|
+
"salary": {
|
42
|
+
"label": "Salary"
|
43
|
+
},
|
44
|
+
"universal_credit": {
|
45
|
+
"label": "Universal Credit"
|
46
|
+
},
|
47
|
+
"child_benefit": {
|
48
|
+
"label": "Child Benefit"
|
49
|
+
},
|
50
|
+
"housing_benefit": {
|
51
|
+
"label": "Housing Benefit"
|
52
|
+
},
|
53
|
+
"other": {
|
54
|
+
"label": "Other"
|
55
|
+
}
|
56
|
+
}
|
57
|
+
},
|
58
|
+
"countryOfHearing": {
|
59
|
+
"label": "Country of hearing",
|
60
|
+
"options": {
|
61
|
+
"englandAndWales": {
|
62
|
+
"label": "England and Wales"
|
63
|
+
},
|
64
|
+
"scotland": {
|
65
|
+
"label": "Scotland"
|
66
|
+
},
|
67
|
+
"northernIreland": {
|
68
|
+
"label": "Northern Ireland"
|
69
|
+
}
|
70
|
+
}
|
71
|
+
},
|
72
|
+
"email": {
|
73
|
+
"label": "Email address"
|
74
|
+
},
|
75
|
+
"phone": {
|
76
|
+
"label": "Phone number",
|
77
|
+
"hint": "International phone numbers require the international dialling code, for example +33235066182"
|
78
|
+
},
|
79
|
+
"int-phone-number": {
|
80
|
+
"legend": "International phone number"
|
81
|
+
},
|
82
|
+
"complaintDetails": {
|
83
|
+
"label": "Complaint details",
|
84
|
+
"hint": "Briefly summarise your complaint. Include anything that can help our investigation."
|
85
|
+
},
|
86
|
+
"countrySelect": {
|
87
|
+
"label": "Which country are you based in?",
|
88
|
+
"hint": "Start to type the country name and options will appear"
|
89
|
+
},
|
90
|
+
"appealStages": {
|
91
|
+
"label": "Appeal stage",
|
92
|
+
"hint": "Choose an appeal stage from the drop down menu",
|
93
|
+
"options": {
|
94
|
+
"null": "Select..."
|
95
|
+
}
|
96
|
+
}
|
97
|
+
},
|
98
|
+
"journey": {
|
99
|
+
"header": "HOF Bootstrap Sandbox Form",
|
100
|
+
"confirmation": {
|
101
|
+
"details": "Your reference number <br><strong>HDJ2123F</strong>"
|
102
|
+
}
|
103
|
+
},
|
104
|
+
"pages": {
|
105
|
+
"landing-page": {
|
106
|
+
"header": "Landing page",
|
107
|
+
"intro": "Choose one of the options below and press continue."
|
108
|
+
},
|
109
|
+
"build-your-own-form": {
|
110
|
+
"title": "Build your own form",
|
111
|
+
"subheader": "Access the build your own form guidance link"
|
112
|
+
},
|
113
|
+
"address": {
|
114
|
+
"header": "What is your address in the UK?",
|
115
|
+
"intro": "If you have no fixed address, enter an address where we can contact you."
|
116
|
+
},
|
117
|
+
"checkboxes": {
|
118
|
+
"header": "Where does your money come from each month?"
|
119
|
+
},
|
120
|
+
"radio": {
|
121
|
+
"header": "What country was the appeal lodged?"
|
122
|
+
},
|
123
|
+
"email": {
|
124
|
+
"header": "Enter your email address"
|
125
|
+
},
|
126
|
+
"phone-number": {
|
127
|
+
"header": "Enter your phone number"
|
128
|
+
},
|
129
|
+
"confirm": {
|
130
|
+
"header": "Check your answers before submitting your application.",
|
131
|
+
"sections": {
|
132
|
+
"applicantsDetails": {
|
133
|
+
"header": "Applicant's details"
|
134
|
+
},
|
135
|
+
"address": {
|
136
|
+
"header": "Address"
|
137
|
+
},
|
138
|
+
"income": {
|
139
|
+
"header": "Income"
|
140
|
+
},
|
141
|
+
"appealDetails": {
|
142
|
+
"header": "Appeal details"
|
143
|
+
},
|
144
|
+
"countrySelect": {
|
145
|
+
"header": "Country of residence"
|
146
|
+
},
|
147
|
+
"contactDetails": {
|
148
|
+
"header": "Contact details"
|
149
|
+
},
|
150
|
+
"complaintDetails": {
|
151
|
+
"header": "Complaint details"
|
152
|
+
}
|
153
|
+
}
|
154
|
+
},
|
155
|
+
"confirmation": {
|
156
|
+
"title": "Application sent",
|
157
|
+
"alert": "Application sent",
|
158
|
+
"subheader": "What happens next",
|
159
|
+
"content": "We’ll contact you with the decision of your application or if we need more information from you."
|
160
|
+
}
|
161
|
+
},
|
162
|
+
"validation": {
|
163
|
+
"landing-page-radio": {
|
164
|
+
"required": "Select an option below and press continue"
|
165
|
+
},
|
166
|
+
"name": {
|
167
|
+
"default": "Enter your full name"
|
168
|
+
},
|
169
|
+
"dateOfBirth": {
|
170
|
+
"default": "Enter your date of birth in the correct format; for example, 31 10 1990",
|
171
|
+
"after": "Enter a date after 1 1 1900",
|
172
|
+
"before": "Enter a date that is in the past"
|
173
|
+
},
|
174
|
+
"building": {
|
175
|
+
"default": "Enter details of your building and street"
|
176
|
+
},
|
177
|
+
"townOrCity": {
|
178
|
+
"default": "Enter a town or city",
|
179
|
+
"regex": "Enter a town or city without including digits"
|
180
|
+
},
|
181
|
+
"postcode": {
|
182
|
+
"default": "Enter your postcode"
|
183
|
+
},
|
184
|
+
"incomeTypes": {
|
185
|
+
"default": "Select all options that apply to you."
|
186
|
+
},
|
187
|
+
"countryOfHearing": {
|
188
|
+
"default": "Select where the appeal hearing is to be held"
|
189
|
+
},
|
190
|
+
"countrySelect": {
|
191
|
+
"default": "Enter a valid country of residence",
|
192
|
+
"required": "Enter your country of residence"
|
193
|
+
},
|
194
|
+
"email": {
|
195
|
+
"default": "Enter your email address in the correct format"
|
196
|
+
},
|
197
|
+
"phone": {
|
198
|
+
"default": "Enter your phone number"
|
199
|
+
},
|
200
|
+
"int-phone-number": {
|
201
|
+
"required": "Enter an international phone number",
|
202
|
+
"internationalPhoneNumber": "Enter a valid international phone number"
|
203
|
+
},
|
204
|
+
"complaintDetails": {
|
205
|
+
"default": "Enter details about why you are making a complaint",
|
206
|
+
"maxlength": "Keep to the {{maxlength}} character limit"
|
207
|
+
},
|
208
|
+
"appealStages": {
|
209
|
+
"required": "Select an appeal stage from the list"
|
210
|
+
}
|
211
|
+
}
|
212
|
+
}
|
@@ -14,10 +14,10 @@
|
|
14
14
|
}
|
15
15
|
},
|
16
16
|
"name": {
|
17
|
-
"label": "
|
17
|
+
"label": "What is your full name?"
|
18
18
|
},
|
19
19
|
"dateOfBirth": {
|
20
|
-
"legend": "
|
20
|
+
"legend": "What is your date of birth?",
|
21
21
|
"hint": "For example, 31 10 1990"
|
22
22
|
},
|
23
23
|
"building": {
|
@@ -79,14 +79,16 @@
|
|
79
79
|
"legend": "International phone number"
|
80
80
|
},
|
81
81
|
"complaintDetails": {
|
82
|
-
"label": "Complaint details"
|
82
|
+
"label": "Complaint details",
|
83
|
+
"hint": "Briefly summarise your complaint. Include anything that can help our investigation."
|
83
84
|
},
|
84
85
|
"countrySelect": {
|
85
|
-
"label": "
|
86
|
+
"label": "Which country are you based in?",
|
86
87
|
"hint": "Start to type the country name and options will appear"
|
87
88
|
},
|
88
89
|
"appealStages": {
|
89
90
|
"label": "Appeal stage",
|
91
|
+
"hint": "Choose an appeal stage from the drop down menu",
|
90
92
|
"options": {
|
91
93
|
"null": "Select..."
|
92
94
|
}
|