hof 21.0.0-instrumentation-beta.0 → 21.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/.github/workflows/automate-publish.yml +1 -1
  2. package/.github/workflows/automate-tag.yml +4 -4
  3. package/.nyc_output/39365c14-40b7-4634-b733-940b72a11984.json +1 -0
  4. package/.nyc_output/processinfo/39365c14-40b7-4634-b733-940b72a11984.json +1 -0
  5. package/.nyc_output/processinfo/index.json +1 -1
  6. package/CHANGELOG.md +21 -0
  7. package/README.md +340 -256
  8. package/build/tasks/sass/index.js +3 -1
  9. package/build/tasks/watch/index.js +1 -1
  10. package/codeReviewChecklist.md +22 -0
  11. package/components/combine-and-loop-fields/Readme.md +42 -0
  12. package/components/combine-and-loop-fields/index.js +156 -0
  13. package/components/date/index.js +3 -1
  14. package/components/date/templates/date.html +15 -12
  15. package/components/homeoffice-countries/index.js +22 -0
  16. package/components/index.js +2 -0
  17. package/components/notify/notify.js +2 -2
  18. package/components/summary/index.js +3 -2
  19. package/config/builder-defaults.js +3 -1
  20. package/config/component-defaults.js +13 -0
  21. package/config/hof-defaults.js +8 -0
  22. package/controller/controller.js +57 -1
  23. package/controller/formatting/formatters.js +12 -0
  24. package/controller/validation/index.js +2 -1
  25. package/controller/validation/validators.js +4 -0
  26. package/frontend/govuk-template/build/config.js +2 -2
  27. package/frontend/govuk-template/build/govuk_template.html +102 -0
  28. package/frontend/govuk-template/build/index.js +2 -2
  29. package/frontend/govuk-template/govuk_template_generated.html +102 -0
  30. package/frontend/govuk-template/index.js +4 -4
  31. package/frontend/template-mixins/mixins/template-mixins.js +40 -11
  32. package/frontend/template-mixins/partials/forms/checkbox-group.html +47 -0
  33. package/frontend/template-mixins/partials/forms/checkbox.html +9 -4
  34. package/frontend/template-mixins/partials/forms/input-submit.html +1 -1
  35. package/frontend/template-mixins/partials/forms/input-text-date.html +37 -0
  36. package/frontend/template-mixins/partials/forms/input-text-group.html +15 -10
  37. package/frontend/template-mixins/partials/forms/option-group.html +42 -26
  38. package/frontend/template-mixins/partials/forms/select.html +10 -5
  39. package/frontend/template-mixins/partials/forms/textarea-group.html +37 -23
  40. package/frontend/template-mixins/partials/mixins/panel.html +3 -4
  41. package/frontend/template-partials/views/accessibility.html +4 -4
  42. package/frontend/template-partials/views/cookies.html +1 -1
  43. package/frontend/template-partials/views/layout.html +24 -17
  44. package/frontend/template-partials/views/partials/back.html +1 -1
  45. package/frontend/template-partials/views/partials/bullet-list.html +1 -1
  46. package/frontend/template-partials/views/partials/confirmation-alert.html +4 -3
  47. package/frontend/template-partials/views/partials/continue.html +1 -1
  48. package/frontend/template-partials/views/partials/cookie-banner.html +27 -24
  49. package/frontend/template-partials/views/partials/cookie-settings-radio.html +6 -6
  50. package/frontend/template-partials/views/partials/external-link.html +1 -1
  51. package/frontend/template-partials/views/partials/form.html +2 -1
  52. package/frontend/template-partials/views/partials/gatag.html +0 -1
  53. package/frontend/template-partials/views/partials/head.html +23 -0
  54. package/frontend/template-partials/views/partials/maincontent-left.html +4 -4
  55. package/frontend/template-partials/views/partials/navigation.html +7 -6
  56. package/frontend/template-partials/views/partials/session-cookies-table.html +6 -6
  57. package/frontend/template-partials/views/partials/summary-table-row.html +2 -2
  58. package/frontend/template-partials/views/partials/table.html +7 -7
  59. package/frontend/template-partials/views/partials/validation-list.html +2 -2
  60. package/frontend/template-partials/views/partials/validation-summary.html +14 -13
  61. package/frontend/template-partials/views/partials/warn.html +7 -0
  62. package/frontend/template-partials/views/session-timeout.html +3 -2
  63. package/frontend/themes/gov-uk/client-js/cookieSettings.js +1 -1
  64. package/frontend/themes/gov-uk/client-js/govuk-cookies.js +121 -0
  65. package/frontend/themes/gov-uk/client-js/index.js +6 -1
  66. package/frontend/themes/gov-uk/client-js/skip-to-main.js +19 -0
  67. package/frontend/themes/gov-uk/styles/_cookie-banner.scss +51 -1
  68. package/frontend/themes/gov-uk/styles/govuk.scss +4 -0
  69. package/frontend/themes/gov-uk/styles/modules/_validation.scss +5 -5
  70. package/frontend/toolkit/assets/javascript/character-count.js +4 -4
  71. package/frontend/toolkit/assets/javascript/progressive-reveal.js +3 -1
  72. package/frontend/toolkit/assets/javascript/validation.js +5 -1
  73. package/frontend/toolkit/assets/stylesheets/modules/_validation.scss +3 -3
  74. package/index.js +15 -2
  75. package/lib/ga-tag.js +33 -7
  76. package/lib/settings.js +18 -2
  77. package/middleware/cookies.js +2 -0
  78. package/middleware/errors.js +2 -3
  79. package/middleware/not-found.js +0 -3
  80. package/middleware/rate-limiter.js +1 -0
  81. package/model/apis/axios-settings.js +21 -0
  82. package/model/apis/html-to-pdf-converter.js +10 -8
  83. package/model/index.js +102 -87
  84. package/package.json +18 -17
  85. package/pull_request.md +16 -0
  86. package/sandbox/README.md +3 -3
  87. package/sandbox/apps/sandbox/fields.js +33 -11
  88. package/sandbox/apps/sandbox/index.js +4 -0
  89. package/sandbox/apps/sandbox/sections/summary-data-sections.js +3 -0
  90. package/sandbox/apps/sandbox/translations/en/default.json +220 -0
  91. package/sandbox/apps/sandbox/translations/src/en/fields.json +11 -4
  92. package/sandbox/apps/sandbox/translations/src/en/journey.json +4 -1
  93. package/sandbox/apps/sandbox/translations/src/en/pages.json +7 -25
  94. package/sandbox/apps/sandbox/translations/src/en/validation.json +5 -1
  95. package/sandbox/assets/js/index.js +1 -1
  96. package/sandbox/assets/scss/app.scss +16 -16
  97. package/sandbox/package.json +7 -2
  98. package/sandbox/public/css/app.css +9632 -0
  99. package/sandbox/public/images/icons/icon-caret-left.png +0 -0
  100. package/sandbox/public/images/icons/icon-complete.png +0 -0
  101. package/sandbox/public/images/icons/icon-cross-remove-sign.png +0 -0
  102. package/sandbox/public/js/bundle.js +46721 -0
  103. package/sandbox/server.js +2 -1
  104. package/sandbox/yarn.lock +249 -2
  105. package/wizard/index.js +0 -13
  106. package/wizard/middleware/check-progress.js +36 -1
  107. package/.nyc_output/4d5a4574-78fc-4fcb-9412-3658f6ce33ff.json +0 -1
  108. package/.nyc_output/processinfo/4d5a4574-78fc-4fcb-9412-3658f6ce33ff.json +0 -1
  109. package/frontend/govuk-template/govuk_template.html +0 -109
  110. package/frontend/themes/gov-uk/views/partials/form.html +0 -9
  111. package/frontend/themes/gov-uk/views/partials/forms/option-group.html +0 -28
  112. package/frontend/themes/gov-uk/views/partials/mixins/panel.html +0 -3
  113. package/frontend/themes/gov-uk/views/partials/validation-summary.html +0 -24
  114. package/middleware/monitor.js +0 -20
  115. package/sandbox/apps/sandbox/views/confirmation.html +0 -15
@@ -0,0 +1,220 @@
1
+ {
2
+ "fields": {
3
+ "landing-page-radio": {
4
+ "legend": "Which form would you like to explore?",
5
+ "hint": "Choose one of the options below and press continue.",
6
+ "options": {
7
+ "basic-form": {
8
+ "label": "Basic form"
9
+ },
10
+ "complex-form": {
11
+ "label": "Complex form"
12
+ },
13
+ "build-your-own-form": {
14
+ "label": "Build your own form"
15
+ }
16
+ }
17
+ },
18
+ "name": {
19
+ "label": "Full name"
20
+ },
21
+ "dateOfBirth": {
22
+ "legend": "What is your date of birth?",
23
+ "hint": "For example, 31 10 1990"
24
+ },
25
+ "building": {
26
+ "label": "Building and street"
27
+ },
28
+ "street": {
29
+ "label": "Address line 2"
30
+ },
31
+ "townOrCity": {
32
+ "label": "Town or city"
33
+ },
34
+ "postcode": {
35
+ "label": "Postcode"
36
+ },
37
+ "incomeTypes": {
38
+ "label": "Sources of income",
39
+ "legend": "Select the options where you receive income from",
40
+ "hint": "Select all options that apply to you.",
41
+ "options": {
42
+ "salary": {
43
+ "label": "Salary"
44
+ },
45
+ "universal_credit": {
46
+ "label": "Universal Credit"
47
+ },
48
+ "child_benefit": {
49
+ "label": "Child Benefit"
50
+ },
51
+ "housing_benefit": {
52
+ "label": "Housing Benefit"
53
+ },
54
+ "other": {
55
+ "label": "Other"
56
+ }
57
+ }
58
+ },
59
+ "countryOfHearing": {
60
+ "legend": "What country was the appeal lodged?",
61
+ "options": {
62
+ "englandAndWales": {
63
+ "label": "England and Wales"
64
+ },
65
+ "scotland": {
66
+ "label": "Scotland"
67
+ },
68
+ "northernIreland": {
69
+ "label": "Northern Ireland"
70
+ }
71
+ }
72
+ },
73
+ "email": {
74
+ "label": "Email address"
75
+ },
76
+ "phone": {
77
+ "label": "Phone number",
78
+ "hint": "International phone numbers require the international dialling code, for example +33235066182"
79
+ },
80
+ "int-phone-number": {
81
+ "legend": "International phone number"
82
+ },
83
+ "complaintDetails": {
84
+ "label": "Complaint details",
85
+ "hint": "Briefly summarise your complaint. Include anything that can help our investigation."
86
+ },
87
+ "whatHappened": {
88
+ "label": "What happened",
89
+ "hint": "Briefly summarise what happened."
90
+ },
91
+ "countrySelect": {
92
+ "label": "Which country are you based in?",
93
+ "hint": "Start to type the country name and options will appear"
94
+ },
95
+ "appealStages": {
96
+ "label": "Appeal stage",
97
+ "hint": "Choose an appeal stage from the drop down menu",
98
+ "options": {
99
+ "null": "Select..."
100
+ }
101
+ }
102
+ },
103
+ "journey": {
104
+ "header": "HOF Bootstrap Sandbox Form",
105
+ "confirmation": {
106
+ "details": "Your reference number <br><strong>HDJ2123F</strong>"
107
+ }
108
+ },
109
+ "pages": {
110
+ "landing-page": {
111
+ "header": "Landing page"
112
+ },
113
+ "build-your-own-form": {
114
+ "title": "Build your own form",
115
+ "subheader": "Access the build your own form guidance link"
116
+ },
117
+ "address": {
118
+ "header": "What is your address in the UK?",
119
+ "intro": "If you have no fixed address, enter an address where we can contact you."
120
+ },
121
+ "name": {
122
+ "header": "What is your full name?"
123
+ },
124
+ "email": {
125
+ "header": "Enter your email address"
126
+ },
127
+ "phone-number": {
128
+ "header": "Enter your phone number"
129
+ },
130
+ "confirm": {
131
+ "header": "Check your answers before submitting your application.",
132
+ "sections": {
133
+ "applicantsDetails": {
134
+ "header": "Applicant's details"
135
+ },
136
+ "address": {
137
+ "header": "Address"
138
+ },
139
+ "income": {
140
+ "header": "Income"
141
+ },
142
+ "appealDetails": {
143
+ "header": "Appeal details"
144
+ },
145
+ "countrySelect": {
146
+ "header": "Country of residence"
147
+ },
148
+ "contactDetails": {
149
+ "header": "Contact details"
150
+ },
151
+ "complaintDetails": {
152
+ "header": "Complaint details"
153
+ },
154
+ "whatHappened": {
155
+ "header": "What happened"
156
+ }
157
+ }
158
+ },
159
+ "confirmation": {
160
+ "title": "Application sent",
161
+ "alert": "Application sent",
162
+ "subheader": "What happens next",
163
+ "content": "We’ll contact you with the decision of your application or if we need more information from you."
164
+ }
165
+ },
166
+ "validation": {
167
+ "landing-page-radio": {
168
+ "required": "Select an option below and press continue"
169
+ },
170
+ "name": {
171
+ "default": "Enter your full name"
172
+ },
173
+ "dateOfBirth": {
174
+ "default": "Enter your date of birth in the correct format; for example, 31 10 1990",
175
+ "after": "Enter a date after 1 1 1900",
176
+ "before": "Enter a date that is in the past"
177
+ },
178
+ "building": {
179
+ "default": "Enter details of your building and street"
180
+ },
181
+ "townOrCity": {
182
+ "default": "Enter a town or city",
183
+ "regex": "Enter a town or city without including digits"
184
+ },
185
+ "postcode": {
186
+ "default": "Enter your postcode"
187
+ },
188
+ "incomeTypes": {
189
+ "default": "Select all options that apply to you."
190
+ },
191
+ "countryOfHearing": {
192
+ "default": "Select where the appeal hearing is to be held"
193
+ },
194
+ "countrySelect": {
195
+ "default": "Enter a valid country of residence",
196
+ "required": "Enter your country of residence"
197
+ },
198
+ "email": {
199
+ "default": "Enter your email address in the correct format"
200
+ },
201
+ "phone": {
202
+ "default": "Enter your phone number"
203
+ },
204
+ "int-phone-number": {
205
+ "required": "Enter an international phone number",
206
+ "internationalPhoneNumber": "Enter a valid international phone number"
207
+ },
208
+ "complaintDetails": {
209
+ "default": "Enter details about why you are making a complaint",
210
+ "maxlength": "Keep to the {{maxlength}} character limit"
211
+ },
212
+ "whatHappened": {
213
+ "default": "Enter details about what happened",
214
+ "maxword": "Keep to the {{maxword}} word limit"
215
+ },
216
+ "appealStages": {
217
+ "required": "Select an appeal stage from the list"
218
+ }
219
+ }
220
+ }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "landing-page-radio": {
3
3
  "legend": "Which form would you like to explore?",
4
+ "hint": "Choose one of the options below and press continue.",
4
5
  "options": {
5
6
  "basic-form": {
6
7
  "label": "Basic form"
@@ -17,7 +18,7 @@
17
18
  "label": "Full name"
18
19
  },
19
20
  "dateOfBirth": {
20
- "legend": "Date of birth",
21
+ "legend": "What is your date of birth?",
21
22
  "hint": "For example, 31 10 1990"
22
23
  },
23
24
  "building": {
@@ -55,7 +56,7 @@
55
56
  }
56
57
  },
57
58
  "countryOfHearing": {
58
- "label": "Country of hearing",
59
+ "legend": "What country was the appeal lodged?",
59
60
  "options": {
60
61
  "englandAndWales": {
61
62
  "label": "England and Wales"
@@ -79,14 +80,20 @@
79
80
  "legend": "International phone number"
80
81
  },
81
82
  "complaintDetails": {
82
- "label": "Complaint details"
83
+ "label": "Complaint details",
84
+ "hint": "Briefly summarise your complaint. Include anything that can help our investigation."
85
+ },
86
+ "whatHappened": {
87
+ "label": "What happened",
88
+ "hint": "Briefly summarise what happened."
83
89
  },
84
90
  "countrySelect": {
85
- "label": "Select a country",
91
+ "label": "Which country are you based in?",
86
92
  "hint": "Start to type the country name and options will appear"
87
93
  },
88
94
  "appealStages": {
89
95
  "label": "Appeal stage",
96
+ "hint": "Choose an appeal stage from the drop down menu",
90
97
  "options": {
91
98
  "null": "Select..."
92
99
  }
@@ -1,3 +1,6 @@
1
1
  {
2
- "header": "HOF Bootstrap Sandbox Form"
2
+ "header": "HOF Bootstrap Sandbox Form",
3
+ "confirmation": {
4
+ "details": "Your reference number <br><strong>HDJ2123F</strong>"
5
+ }
3
6
  }
@@ -1,30 +1,17 @@
1
1
  {
2
2
  "landing-page": {
3
- "header": "Landing page",
4
- "intro": "Choose one of the options below and press continue."
3
+ "header": "Landing page"
5
4
  },
6
5
  "build-your-own-form": {
7
6
  "title": "Build your own form",
8
7
  "subheader": "Access the build your own form guidance link"
9
8
  },
10
- "name": {
11
- "header": "What is your full name?"
12
- },
13
- "dob": {
14
- "header": "What is your date of birth?"
15
- },
16
9
  "address": {
17
10
  "header": "What is your address in the UK?",
18
11
  "intro": "If you have no fixed address, enter an address where we can contact you."
19
12
  },
20
- "checkboxes": {
21
- "header": "Where does your money come from each month?"
22
- },
23
- "radio": {
24
- "header": "What country was the appeal lodged?"
25
- },
26
- "country-select": {
27
- "header": "What country is your address located?"
13
+ "name": {
14
+ "header": "What is your full name?"
28
15
  },
29
16
  "email": {
30
17
  "header": "Enter your email address"
@@ -32,14 +19,6 @@
32
19
  "phone-number": {
33
20
  "header": "Enter your phone number"
34
21
  },
35
- "text-input-area": {
36
- "header": "What are the details of your complaint?",
37
- "intro": "Briefly summarise your complaint. Include anything that can help our investigation."
38
- },
39
- "select":{
40
- "header": "What is the appeal stage?",
41
- "intro": "Choose an appeal stage from the drop down menu"
42
- },
43
22
  "confirm": {
44
23
  "header": "Check your answers before submitting your application.",
45
24
  "sections": {
@@ -63,6 +42,9 @@
63
42
  },
64
43
  "complaintDetails": {
65
44
  "header": "Complaint details"
45
+ },
46
+ "whatHappened": {
47
+ "header": "What happened"
66
48
  }
67
49
  }
68
50
  },
@@ -72,4 +54,4 @@
72
54
  "subheader": "What happens next",
73
55
  "content": "We’ll contact you with the decision of your application or if we need more information from you."
74
56
  }
75
- }
57
+ }
@@ -42,7 +42,11 @@
42
42
  },
43
43
  "complaintDetails": {
44
44
  "default": "Enter details about why you are making a complaint",
45
- "maxlength": "Keep to the 5000 character limit"
45
+ "maxlength": "Keep to the {{maxlength}} character limit"
46
+ },
47
+ "whatHappened": {
48
+ "default": "Enter details about what happened",
49
+ "maxword": "Keep to the {{maxword}} word limit"
46
50
  },
47
51
  "appealStages": {
48
52
  "required": "Select an appeal stage from the list"
@@ -67,4 +67,4 @@ $('.typeahead').each(function applyTypeahead() {
67
67
  }),
68
68
  limit: 100
69
69
  });
70
- });
70
+ });
@@ -8,20 +8,20 @@
8
8
  width: 65%;
9
9
  }
10
10
 
11
- .tt-suggestion {
12
- padding: 0.5em;
13
-
14
- &:hover,
15
- &.tt-cursor {
16
- color: #fff;
17
- background-color: #0097cf;
18
- }
19
-
20
- &:hover {
21
- cursor: pointer;
22
- }
11
+ .tt-suggestion {
12
+ padding: 0.5em;
13
+
14
+ &:hover,
15
+ &.tt-cursor {
16
+ color: #fff;
17
+ background-color: #0097cf;
23
18
  }
24
-
25
- .twitter-typeahead {
26
- width: 100%;
27
- }
19
+
20
+ &:hover {
21
+ cursor: pointer;
22
+ }
23
+ }
24
+
25
+ .twitter-typeahead {
26
+ width: 100%;
27
+ }
@@ -9,13 +9,18 @@
9
9
  "scripts": {
10
10
  "start": "node server.js",
11
11
  "start:dev": "HOF_SANDBOX=true ../bin/hof-build watch",
12
+ "dev": "yarn && GA_TAG=test nodemon server",
12
13
  "build": "HOF_SANDBOX=true ../bin/hof-build",
13
14
  "postinstall": "yarn run build"
14
15
  },
15
16
  "author": "",
16
17
  "dependencies": {
17
- "jquery": "^3.6.0",
18
+ "govuk-frontend": "3.14",
19
+ "jquery": "^3.7.1",
20
+ "sass": "^1.53.0",
18
21
  "typeahead-aria": "^1.0.4"
19
22
  },
20
- "devDependencies": {}
23
+ "devDependencies": {
24
+ "nodemon": "^2.0.15"
25
+ }
21
26
  }