@defra/forms-engine-plugin 5.0.0-alpha.2 → 5.0.0-alpha.5
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/.public/javascripts/application.min.js +1 -1
- package/.public/javascripts/application.min.js.map +1 -1
- package/.public/javascripts/shared.min.js +1 -1
- package/.public/javascripts/shared.min.js.map +1 -1
- package/.server/client/javascripts/file-upload.js +5 -3
- package/.server/client/javascripts/file-upload.js.map +1 -1
- package/.server/client/javascripts/geospatial-map.js +31 -26
- package/.server/client/javascripts/geospatial-map.js.map +1 -1
- package/.server/client/javascripts/location-map.js +9 -1
- package/.server/client/javascripts/location-map.js.map +1 -1
- package/.server/client/javascripts/sssi-dataset.d.ts +18 -20
- package/.server/client/javascripts/sssi-dataset.js +37 -40
- package/.server/client/javascripts/sssi-dataset.js.map +1 -1
- package/.server/server/plugins/engine/components/AutocompleteField.d.ts +1 -0
- package/.server/server/plugins/engine/components/DatePartsField.d.ts +1 -0
- package/.server/server/plugins/engine/components/DeclarationField.d.ts +1 -0
- package/.server/server/plugins/engine/components/Details.d.ts +1 -0
- package/.server/server/plugins/engine/components/EastingNorthingField.d.ts +2 -0
- package/.server/server/plugins/engine/components/EmailAddressField.d.ts +1 -0
- package/.server/server/plugins/engine/components/FileUploadField.js +2 -2
- package/.server/server/plugins/engine/components/FileUploadField.js.map +1 -1
- package/.server/server/plugins/engine/components/FormComponent.d.ts +1 -0
- package/.server/server/plugins/engine/components/GeospatialField.d.ts +1 -0
- package/.server/server/plugins/engine/components/Html.d.ts +1 -0
- package/.server/server/plugins/engine/components/InsetText.d.ts +1 -0
- package/.server/server/plugins/engine/components/LatLongField.d.ts +2 -0
- package/.server/server/plugins/engine/components/List.d.ts +1 -0
- package/.server/server/plugins/engine/components/ListFormComponent.d.ts +1 -0
- package/.server/server/plugins/engine/components/LocationFieldBase.d.ts +2 -0
- package/.server/server/plugins/engine/components/LocationFieldHelpers.d.ts +2 -0
- package/.server/server/plugins/engine/components/Markdown.d.ts +1 -0
- package/.server/server/plugins/engine/components/MonthYearField.d.ts +1 -0
- package/.server/server/plugins/engine/components/MultilineTextField.d.ts +1 -0
- package/.server/server/plugins/engine/components/NotificationBanner.d.ts +1 -0
- package/.server/server/plugins/engine/components/NumberField.d.ts +1 -0
- package/.server/server/plugins/engine/components/PaymentField.d.ts +2 -0
- package/.server/server/plugins/engine/components/PaymentField.js +8 -1
- package/.server/server/plugins/engine/components/PaymentField.js.map +1 -1
- package/.server/server/plugins/engine/components/SelectField.d.ts +1 -0
- package/.server/server/plugins/engine/components/SelectionControlField.d.ts +1 -0
- package/.server/server/plugins/engine/components/TelephoneNumberField.d.ts +1 -0
- package/.server/server/plugins/engine/components/UkAddressField.d.ts +1 -0
- package/.server/server/plugins/engine/components/types.d.ts +1 -0
- package/.server/server/plugins/engine/components/types.js.map +1 -1
- package/.server/server/plugins/engine/i18n/createFormTranslator.js +7 -0
- package/.server/server/plugins/engine/i18n/createFormTranslator.js.map +1 -1
- package/.server/server/plugins/engine/i18n/translations/cy.json +53 -3
- package/.server/server/plugins/engine/i18n/translations/en-GB.json +24 -2
- package/.server/server/plugins/engine/i18n/types.d.ts +1 -0
- package/.server/server/plugins/engine/i18n/types.js.map +1 -1
- package/.server/server/plugins/engine/pageControllers/FileUploadPageController.js +20 -7
- package/.server/server/plugins/engine/pageControllers/FileUploadPageController.js.map +1 -1
- package/.server/server/plugins/engine/pageControllers/QuestionPageController.js +5 -1
- package/.server/server/plugins/engine/pageControllers/QuestionPageController.js.map +1 -1
- package/.server/server/plugins/engine/views/components/fileuploadfield.html +1 -1
- package/.server/server/plugins/engine/views/components/multilinetextfield.html +12 -1
- package/.server/server/plugins/engine/views/components/paymentfield.html +1 -1
- package/.server/server/plugins/engine/views/partials/preview-banner.html +3 -1
- package/package.json +1 -1
- package/src/client/javascripts/file-upload.js +10 -3
- package/src/client/javascripts/geospatial-map.js +32 -30
- package/src/client/javascripts/location-map.js +7 -1
- package/src/client/javascripts/sssi-dataset.js +39 -42
- package/src/server/plugins/engine/components/FileUploadField.ts +2 -2
- package/src/server/plugins/engine/components/PaymentField.ts +6 -1
- package/src/server/plugins/engine/components/types.ts +1 -0
- package/src/server/plugins/engine/i18n/createFormTranslator.ts +21 -1
- package/src/server/plugins/engine/i18n/translations/cy.json +53 -3
- package/src/server/plugins/engine/i18n/translations/en-GB.json +24 -2
- package/src/server/plugins/engine/i18n/types.ts +1 -0
- package/src/server/plugins/engine/pageControllers/FileUploadPageController.ts +16 -6
- package/src/server/plugins/engine/pageControllers/QuestionPageController.ts +8 -3
- package/src/server/plugins/engine/views/components/fileuploadfield.html +1 -1
- package/src/server/plugins/engine/views/components/multilinetextfield.html +12 -1
- package/src/server/plugins/engine/views/components/paymentfield.html +1 -1
- package/src/server/plugins/engine/views/partials/preview-banner.html +3 -1
|
@@ -49,50 +49,47 @@ export function sssiScotlandRequestTransformer(url, { bbox }) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export default
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
transformRequest: sssiEnglandRequestTransformer
|
|
61
|
-
},
|
|
62
|
-
minZoom,
|
|
63
|
-
style,
|
|
64
|
-
showInKey: true,
|
|
65
|
-
showInMenu: false
|
|
52
|
+
export default [
|
|
53
|
+
{
|
|
54
|
+
id: 'sssi-england',
|
|
55
|
+
label: 'Sites of Special Scientific Interest',
|
|
56
|
+
dynamicGeoJSON: {
|
|
57
|
+
url: englandWFS,
|
|
58
|
+
idProperty: 'ref_code',
|
|
59
|
+
transformRequest: sssiEnglandRequestTransformer
|
|
66
60
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
minZoom,
|
|
62
|
+
style,
|
|
63
|
+
showInKey: true,
|
|
64
|
+
showInMenu: false
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'sssi-wales',
|
|
68
|
+
label: 'SSSI Wales',
|
|
69
|
+
dynamicGeoJSON: {
|
|
70
|
+
url: walesWFS,
|
|
71
|
+
idProperty: 'id',
|
|
72
|
+
transformRequest: sssiWalesRequestTransformer
|
|
79
73
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
74
|
+
minZoom,
|
|
75
|
+
style,
|
|
76
|
+
showInKey: false,
|
|
77
|
+
showInMenu: false
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'sssi-scotland',
|
|
81
|
+
label: 'SSSI Scotland',
|
|
82
|
+
dynamicGeoJSON: {
|
|
83
|
+
url: scotlandWFS,
|
|
84
|
+
idProperty: 'OBJECTID',
|
|
85
|
+
transformRequest: sssiScotlandRequestTransformer
|
|
86
|
+
},
|
|
87
|
+
minZoom,
|
|
88
|
+
style,
|
|
89
|
+
showInKey: false,
|
|
90
|
+
showInMenu: false
|
|
91
|
+
}
|
|
92
|
+
]
|
|
96
93
|
/**
|
|
97
94
|
* @typedef {object} TransformRequestOptions
|
|
98
95
|
* @property {string[]} bbox - the bounding box coordinates
|
|
@@ -169,7 +169,7 @@ export class FileUploadField extends FormComponent {
|
|
|
169
169
|
return ''
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
return translator.t('
|
|
172
|
+
return translator.t('pages.summary.fileUpload', {
|
|
173
173
|
count: files.length
|
|
174
174
|
})
|
|
175
175
|
}
|
|
@@ -244,7 +244,7 @@ export class FileUploadField extends FormComponent {
|
|
|
244
244
|
|
|
245
245
|
items.push({
|
|
246
246
|
href,
|
|
247
|
-
text: '
|
|
247
|
+
text: t('pages.fileUpload.remove'),
|
|
248
248
|
classes: 'govuk-link--no-visited-state',
|
|
249
249
|
attributes: { id: `${id}__${index}` },
|
|
250
250
|
visuallyHiddenText: file.filename
|
|
@@ -45,6 +45,7 @@ export class PaymentField extends FormComponent {
|
|
|
45
45
|
declare options: PaymentFieldComponent['options']
|
|
46
46
|
declare formSchema: ObjectSchema
|
|
47
47
|
declare stateSchema: ObjectSchema
|
|
48
|
+
declare def: PaymentFieldComponent
|
|
48
49
|
isAppendageStateSingleObject = true
|
|
49
50
|
|
|
50
51
|
constructor(
|
|
@@ -54,6 +55,7 @@ export class PaymentField extends FormComponent {
|
|
|
54
55
|
super(def, props)
|
|
55
56
|
|
|
56
57
|
this.options = def.options
|
|
58
|
+
this.def = def
|
|
57
59
|
|
|
58
60
|
const paymentStateSchema = joi
|
|
59
61
|
.object({
|
|
@@ -110,6 +112,8 @@ export class PaymentField extends FormComponent {
|
|
|
110
112
|
getViewModel(context: RenderContext) {
|
|
111
113
|
const { payload } = context
|
|
112
114
|
const viewModel = super.getViewModel(context)
|
|
115
|
+
const { translator } = context
|
|
116
|
+
const { tComponent } = translator
|
|
113
117
|
|
|
114
118
|
// Payload is pre-populated from state if a payment has already been made
|
|
115
119
|
const paymentState = this.isPaymentState(payload[this.name] as unknown)
|
|
@@ -124,7 +128,8 @@ export class PaymentField extends FormComponent {
|
|
|
124
128
|
return {
|
|
125
129
|
...viewModel,
|
|
126
130
|
amount: formatCurrency(amount),
|
|
127
|
-
description:
|
|
131
|
+
description:
|
|
132
|
+
tComponent(this.def, 'paymentDescription') || this.options.description,
|
|
128
133
|
paymentState
|
|
129
134
|
}
|
|
130
135
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
yesNoListNoItemId,
|
|
3
|
+
yesNoListYesItemId,
|
|
4
|
+
type FormDefinition
|
|
5
|
+
} from '@defra/forms-model'
|
|
2
6
|
import { type i18n } from 'i18next'
|
|
3
7
|
|
|
4
8
|
import { createTranslator } from './createTranslator.js'
|
|
@@ -28,6 +32,22 @@ export function loadFormTranslations(def: FormDefinition, i18nInstance: i18n) {
|
|
|
28
32
|
if (formTranslations) {
|
|
29
33
|
for (const [lng, resources] of Object.entries(formTranslations)) {
|
|
30
34
|
i18nInstance.addResourceBundle(lng, 'form', resources, true, true)
|
|
35
|
+
|
|
36
|
+
// Temporary workaround - until we develop a better solution
|
|
37
|
+
if (lng === 'cy') {
|
|
38
|
+
i18nInstance.addResource(
|
|
39
|
+
lng,
|
|
40
|
+
'form',
|
|
41
|
+
`listItems.${yesNoListYesItemId}.text`,
|
|
42
|
+
'Ie'
|
|
43
|
+
)
|
|
44
|
+
i18nInstance.addResource(
|
|
45
|
+
lng,
|
|
46
|
+
'form',
|
|
47
|
+
`listItems.${yesNoListNoItemId}.text`,
|
|
48
|
+
'Nage'
|
|
49
|
+
)
|
|
50
|
+
}
|
|
31
51
|
}
|
|
32
52
|
}
|
|
33
53
|
}
|
|
@@ -60,6 +60,12 @@
|
|
|
60
60
|
"totalAmount": "Cyfanswm",
|
|
61
61
|
"reference": "Cyfeirnod",
|
|
62
62
|
"dateOfPayment": "Dyddiad talu",
|
|
63
|
+
"fileUpload_zero": "Ni uwchlwythwyd unrhyw ffeiliau",
|
|
64
|
+
"fileUpload_one": "Uwchlwythwyd [[count]] ffeil",
|
|
65
|
+
"fileUpload_two": "Uwchlwythwyd dwy feil",
|
|
66
|
+
"fileUpload_few": "Uwchlwythwyd [[count]] ffeil",
|
|
67
|
+
"fileUpload_many": "Uwchlwythwyd [[count]] o ffeiliau",
|
|
68
|
+
"fileUpload_other": "Uwchlwythwyd [[count]] ffeil",
|
|
63
69
|
"submissionFailed": "Roedd problem ac ni chyflwynwyd eich ffurflen. Ceisiwch gyflwyno'r ffurflen eto",
|
|
64
70
|
"submissionFailedContactSuffix": " neu gallwch [[contactUsLink]] a dyfynnu'ch cyfeirnod i drefnu ad-daliad",
|
|
65
71
|
"contactUsLinkText": "cysylltu â ni (yn agor mewn tab newydd)",
|
|
@@ -79,17 +85,34 @@
|
|
|
79
85
|
"change": "Newid",
|
|
80
86
|
"notProvided": "Heb ei ddarparu",
|
|
81
87
|
"visuallyHiddenItem": "eitem [[index]]",
|
|
88
|
+
"pageTitle_zero": "Nid ydych wedi ychwanegu unrhyw atebion",
|
|
82
89
|
"pageTitle_one": "Rydych wedi ychwanegu [[count]] ateb",
|
|
90
|
+
"pageTitle_two": "Rydych wedi ychwanegu dau ateb",
|
|
91
|
+
"pageTitle_few": "Rydych wedi ychwanegu [[count]] ateb",
|
|
92
|
+
"pageTitle_many": "Rydych wedi ychwanegu [[count]] o atebion",
|
|
83
93
|
"pageTitle_other": "Rydych wedi ychwanegu [[count]] ateb",
|
|
94
|
+
"tooMany_zero": "Ni allwch ychwanegu unrhyw atebion",
|
|
84
95
|
"tooMany_one": "Dim ond hyd at [[count]] ateb y gallwch ei ychwanegu",
|
|
96
|
+
"tooMany_two": "Dim ond hyd at ddau gateb y gallwch eu hychwanegu",
|
|
97
|
+
"tooMany_few": "Dim ond hyd at [[count]] ateb y gallwch eu hychwanegu",
|
|
98
|
+
"tooMany_many": "Dim ond hyd at [[count]] o atebion y gallwch eu hychwanegu",
|
|
85
99
|
"tooMany_other": "Dim ond hyd at [[count]] ateb y gallwch eu hychwanegu",
|
|
100
|
+
"tooFew_zero": "Rhaid i chi ychwanegu atebion",
|
|
86
101
|
"tooFew_one": "Rhaid i chi ychwanegu o leiaf [[count]] ateb",
|
|
102
|
+
"tooFew_two": "Rhaid i chi ychwanegu o leiaf ddau gateb",
|
|
103
|
+
"tooFew_few": "Rhaid i chi ychwanegu o leiaf [[count]] ateb",
|
|
104
|
+
"tooFew_many": "Rhaid i chi ychwanegu o leiaf [[count]] o atebion",
|
|
87
105
|
"tooFew_other": "Rhaid i chi ychwanegu o leiaf [[count]] ateb"
|
|
88
106
|
},
|
|
89
107
|
|
|
90
108
|
"fileUpload": {
|
|
91
109
|
"upload": "Uwchlwytho ffeil",
|
|
92
|
-
"maxFilesReached": "Rydych wedi cyrraedd nifer uchaf y ffeiliau. Tynnwch ffeil i uwchlwytho rhagor."
|
|
110
|
+
"maxFilesReached": "Rydych wedi cyrraedd nifer uchaf y ffeiliau. Tynnwch ffeil i uwchlwytho rhagor.",
|
|
111
|
+
"remove": "Tynnu",
|
|
112
|
+
"removeFileTitle": "Ydych chi'n siŵr eich bod chi eisiau dileu'r ffeil hon?",
|
|
113
|
+
"removeFileBody": "Ni allwch adfer ffeiliau a dynnwyd.",
|
|
114
|
+
"removeFileButton": "Dileu ffeil",
|
|
115
|
+
"cancel": "Canslo"
|
|
93
116
|
},
|
|
94
117
|
|
|
95
118
|
"exit": {
|
|
@@ -111,6 +134,7 @@
|
|
|
111
134
|
"body": "Os hoffech dderbyn e-bost prawf, [[link]] yr hoffech i gyflwyniadau ffurflen fynd iddo.",
|
|
112
135
|
"linkText": "nodwch y cyfeiriad e-bost (yn agor mewn tab newydd)"
|
|
113
136
|
},
|
|
137
|
+
"bannerTitle": "Pwysig",
|
|
114
138
|
"bannerForce": "Rhagolwg o ffurflen [[previewMode]] yw hon. Peidiwch â rhoi gwybodaeth bersonol.",
|
|
115
139
|
"bannerText": "Dyma ragolwg o dudalen ffurflen [[previewMode]] rydych chi'n ei golygu.",
|
|
116
140
|
"previousPages": "Mae'n dibynnu ar atebion o dudalennau cynharach yn y ffurflen. Yn y fersiwn fyw, bydd angen i ddefnyddwyr gwblhau'r cwestiynau hynny yn gyntaf."
|
|
@@ -134,7 +158,11 @@
|
|
|
134
158
|
"findAnAddressInstead": "dod o hyd i gyfeiriad yn lle hynny",
|
|
135
159
|
"noAddressFoundTitle": "Ni chanfuwyd cyfeiriad",
|
|
136
160
|
"noAddressFoundBody": "Ni allem ddod o hyd i gyfeiriad cyfatebol",
|
|
161
|
+
"addressFound_zero": "Ni chanfuwyd unrhyw gyfeiriadau ar gyfer",
|
|
137
162
|
"addressFound_one": "Canfuwyd [[count]] cyfeiriad ar gyfer",
|
|
163
|
+
"addressFound_two": "Canfuwyd dau gyfeiriad ar gyfer",
|
|
164
|
+
"addressFound_few": "Canfuwyd [[count]] chyfeiriad ar gyfer",
|
|
165
|
+
"addressFound_many": "Canfuwyd [[count]] o gyfeiriadau ar gyfer",
|
|
138
166
|
"addressFound_other": "Canfuwyd [[count]] cyfeiriad ar gyfer",
|
|
139
167
|
"validation": {
|
|
140
168
|
"invalidPostcode": "Nodwch god post dilys neu nodwch gyfeiriad â llaw",
|
|
@@ -220,7 +248,7 @@
|
|
|
220
248
|
|
|
221
249
|
"yesNoField": {
|
|
222
250
|
"yes": "Ie",
|
|
223
|
-
"no": "
|
|
251
|
+
"no": "Nage",
|
|
224
252
|
"validation": {
|
|
225
253
|
"selectYesNoRequired": "{{#label}} - dewiswch ie neu na"
|
|
226
254
|
}
|
|
@@ -236,7 +264,11 @@
|
|
|
236
264
|
},
|
|
237
265
|
|
|
238
266
|
"geospatialField": {
|
|
267
|
+
"added_zero": "Ni ychwanegwyd unrhyw leoliadau",
|
|
239
268
|
"added_one": "Ychwanegwyd [[count]] lleoliad",
|
|
269
|
+
"added_two": "Ychwanegwyd dau leoliad",
|
|
270
|
+
"added_few": "Ychwanegwyd [[count]] lleoliad",
|
|
271
|
+
"added_many": "Ychwanegwyd [[count]] o leoliadau",
|
|
240
272
|
"added_other": "Ychwanegwyd [[count]] lleoliad",
|
|
241
273
|
"validation": {
|
|
242
274
|
"descriptionRequired": "Rhowch ddisgrifiad ar gyfer lleoliad [[count]]",
|
|
@@ -245,7 +277,7 @@
|
|
|
245
277
|
},
|
|
246
278
|
|
|
247
279
|
"paymentField": {
|
|
248
|
-
"detailsRequired": "Angen
|
|
280
|
+
"detailsRequired": "Angen talu",
|
|
249
281
|
"pendingTransaction": "Mae'n bosibl y gwelwch drafodiad ar y gweill yn eich cyfrif banc ond dim ond pan fyddwch yn cyflwyno'r ffurflen y codir tâl arnoch.",
|
|
250
282
|
"addPaymentDetails": "Ychwanegu manylion talu",
|
|
251
283
|
"cannotTakePayment": "Mae problem ac ni allwn dderbyn taliad. Cysylltwch â ni (manylion yn nhroedyn y ffurflen hon) neu cadwch eich cynnydd a dychwelyd at y ffurflen yn ddiweddarach.",
|
|
@@ -261,11 +293,29 @@
|
|
|
261
293
|
},
|
|
262
294
|
|
|
263
295
|
"fileUploadField": {
|
|
296
|
+
"uploading": "Yn uwchlwytho…",
|
|
264
297
|
"uploaded": "Wedi'i uwchlwytho",
|
|
265
298
|
"uploadFailed": "Roedd problem gyda'ch ffeiliau a uwchlwythwyd. Uwchlwythwch nhw eto cyn cyflwyno'r ffurflen.",
|
|
266
299
|
"uploadedFilesHeading": "Ffeiliau a uwchlwythwyd",
|
|
300
|
+
"filesCount_zero": "Uwchlwythwyd [[count]] o ffeiliau",
|
|
267
301
|
"filesCount_one": "Uwchlwythwyd [[count]] ffeil",
|
|
302
|
+
"filesCount_two": "Uwchlwythwyd [[count]] ffeil",
|
|
303
|
+
"filesCount_few": "Uwchlwythwyd [[count]] ffeil",
|
|
304
|
+
"filesCount_many": "Uwchlwythwyd [[count]] o ffeiliau",
|
|
268
305
|
"filesCount_other": "Uwchlwythwyd [[count]] ffeil"
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
"characterCount": {
|
|
309
|
+
"_comment": "Note the use of %{count} instead of [[count]]. This is because we are passing to the govuk template, not passing to Joi",
|
|
310
|
+
"underLimit": {
|
|
311
|
+
"one": "Mae gennych %{count} nod ar ôl",
|
|
312
|
+
"other": "Mae gennych %{count} nod ar ôl"
|
|
313
|
+
},
|
|
314
|
+
"atLimit": "Mae gennych 0 nod ar ôl",
|
|
315
|
+
"overLimit": {
|
|
316
|
+
"one": "Mae gennych %{count} nod yn ormod",
|
|
317
|
+
"other": "Mae gennych %{count} nod yn ormod"
|
|
318
|
+
}
|
|
269
319
|
}
|
|
270
320
|
}
|
|
271
321
|
}
|
|
@@ -60,6 +60,8 @@
|
|
|
60
60
|
"totalAmount": "Total amount",
|
|
61
61
|
"reference": "Reference",
|
|
62
62
|
"dateOfPayment": "Date of payment",
|
|
63
|
+
"fileUpload_one": "Uploaded [[count]] file",
|
|
64
|
+
"fileUpload_other": "Uploaded [[count]] files",
|
|
63
65
|
"submissionFailed": "There was a problem and your form was not submitted. Try submitting the form again",
|
|
64
66
|
"submissionFailedContactSuffix": " or you can [[contactUsLink]] and quote your reference number to arrange a refund",
|
|
65
67
|
"contactUsLinkText": "contact us (opens in new tab)",
|
|
@@ -89,7 +91,12 @@
|
|
|
89
91
|
|
|
90
92
|
"fileUpload": {
|
|
91
93
|
"upload": "Upload file",
|
|
92
|
-
"maxFilesReached": "You have reached the maximum number of files. Please remove a file to upload more."
|
|
94
|
+
"maxFilesReached": "You have reached the maximum number of files. Please remove a file to upload more.",
|
|
95
|
+
"remove": "Remove",
|
|
96
|
+
"removeFileTitle": "Are you sure you want to remove this file?",
|
|
97
|
+
"removeFileBody": "You cannot recover removed files.",
|
|
98
|
+
"removeFileButton": "Remove file",
|
|
99
|
+
"cancel": "Cancel"
|
|
93
100
|
},
|
|
94
101
|
|
|
95
102
|
"exit": {
|
|
@@ -111,6 +118,7 @@
|
|
|
111
118
|
"body": "If you want to receive a test email, [[link]] you want form submissions to go to.",
|
|
112
119
|
"linkText": "enter the email address (opens in new tab)"
|
|
113
120
|
},
|
|
121
|
+
"bannerTitle": "Important",
|
|
114
122
|
"bannerForce": "This is a preview of a [[previewMode]] form. Do not enter personal information.",
|
|
115
123
|
"bannerText": "This is a preview of a [[previewMode]] form page you are editing.",
|
|
116
124
|
"previousPages": "It depends on answers from earlier pages in the form. In the live version, users will need to complete those questions first."
|
|
@@ -245,7 +253,7 @@
|
|
|
245
253
|
},
|
|
246
254
|
|
|
247
255
|
"paymentField": {
|
|
248
|
-
"detailsRequired": "Payment
|
|
256
|
+
"detailsRequired": "Payment required",
|
|
249
257
|
"pendingTransaction": "You may see a pending transaction in your bank account but you will only be charged when you submit the form.",
|
|
250
258
|
"addPaymentDetails": "Add payment details",
|
|
251
259
|
"cannotTakePayment": "There is a problem and we cannot take a payment. Contact us (details in the footer of this form) or save your progress and return to the form later.",
|
|
@@ -261,11 +269,25 @@
|
|
|
261
269
|
},
|
|
262
270
|
|
|
263
271
|
"fileUploadField": {
|
|
272
|
+
"uploading": "Uploading…",
|
|
264
273
|
"uploaded": "Uploaded",
|
|
265
274
|
"uploadFailed": "There was a problem with your uploaded files. Re-upload them before submitting the form again.",
|
|
266
275
|
"uploadedFilesHeading": "Uploaded files",
|
|
267
276
|
"filesCount_one": "[[count]] file uploaded",
|
|
268
277
|
"filesCount_other": "[[count]] files uploaded"
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
"characterCount": {
|
|
281
|
+
"_comment": "Note the use of %{count} instead of [[count]]. This is because we are passing to the govuk template, not passing to Joi",
|
|
282
|
+
"underLimit": {
|
|
283
|
+
"one": "You have %{count} character remaining",
|
|
284
|
+
"other": "You have %{count} characters remaining"
|
|
285
|
+
},
|
|
286
|
+
"atLimit": "You have 0 characters remaining",
|
|
287
|
+
"overLimit": {
|
|
288
|
+
"one": "You have %{count} character too many",
|
|
289
|
+
"other": "You have %{count} characters too many"
|
|
290
|
+
}
|
|
269
291
|
}
|
|
270
292
|
}
|
|
271
293
|
}
|
|
@@ -188,17 +188,19 @@ export class FileUploadPageController extends QuestionPageController {
|
|
|
188
188
|
|
|
189
189
|
const { filename } = fileToRemove.status.form.file
|
|
190
190
|
|
|
191
|
-
const
|
|
191
|
+
const translator = this.getTranslator(request)
|
|
192
|
+
const { t } = translator
|
|
192
193
|
|
|
193
194
|
return h.view(this.fileDeleteViewName, {
|
|
194
195
|
...viewModel,
|
|
195
196
|
context,
|
|
196
197
|
backLink: this.getBackLink(request, context, t),
|
|
197
|
-
pageTitle:
|
|
198
|
+
pageTitle: t('pages.fileUpload.removeFileTitle'),
|
|
198
199
|
itemTitle: filename,
|
|
199
|
-
confirmation: { text: '
|
|
200
|
-
buttonConfirm: { text: '
|
|
201
|
-
buttonCancel: { text: '
|
|
200
|
+
confirmation: { text: t('pages.fileUpload.removeFileBody') },
|
|
201
|
+
buttonConfirm: { text: t('pages.fileUpload.removeFileButton') },
|
|
202
|
+
buttonCancel: { text: t('pages.fileUpload.cancel') },
|
|
203
|
+
t
|
|
202
204
|
} satisfies ItemDeletePageViewModel)
|
|
203
205
|
}
|
|
204
206
|
}
|
|
@@ -266,6 +268,7 @@ export class FileUploadPageController extends QuestionPageController {
|
|
|
266
268
|
): FeaturedFormPageViewModel {
|
|
267
269
|
const { fileUpload } = this
|
|
268
270
|
const { state } = context
|
|
271
|
+
const { t } = translator
|
|
269
272
|
|
|
270
273
|
const upload = this.getUploadFromState(state)
|
|
271
274
|
|
|
@@ -277,6 +280,12 @@ export class FileUploadPageController extends QuestionPageController {
|
|
|
277
280
|
({ model }) => model.id === fileUpload.name
|
|
278
281
|
)
|
|
279
282
|
|
|
283
|
+
formComponent.model.upload = {
|
|
284
|
+
count: formComponent.model.upload?.count ?? 0,
|
|
285
|
+
summaryList: formComponent.model.upload?.summaryList ?? { rows: [] },
|
|
286
|
+
uploadingLabel: t('components.fileUploadField.uploading')
|
|
287
|
+
}
|
|
288
|
+
|
|
280
289
|
const index = components.indexOf(formComponent)
|
|
281
290
|
|
|
282
291
|
const proxyUrl = getProxyUrlForLocalDevelopment(upload?.uploadUrl)
|
|
@@ -290,7 +299,8 @@ export class FileUploadPageController extends QuestionPageController {
|
|
|
290
299
|
// Split out components before/after
|
|
291
300
|
componentsBefore: components.slice(0, index),
|
|
292
301
|
components: components.slice(index),
|
|
293
|
-
proxyUrl
|
|
302
|
+
proxyUrl,
|
|
303
|
+
t
|
|
294
304
|
}
|
|
295
305
|
}
|
|
296
306
|
|
|
@@ -174,9 +174,14 @@ export class QuestionPageController extends PageController {
|
|
|
174
174
|
if (!pageTitle) {
|
|
175
175
|
pageTitle = labelOrLegend.text
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
|
|
178
|
+
// The question text may have already appended 'optional' in the relevant language
|
|
179
|
+
const optionalWord = t('common.optional')
|
|
180
|
+
const optionalAlreadyAppended = pageTitle.endsWith(` ${optionalWord}`)
|
|
181
|
+
labelOrLegend.text =
|
|
182
|
+
isOptional && !optionalAlreadyAppended
|
|
183
|
+
? `${pageTitle} ${optionalWord}`
|
|
184
|
+
: pageTitle
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
// Fallback if still no pageTitle set
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% macro FileUploadField(component) %}
|
|
4
4
|
{% set upload = component.model.upload %}
|
|
5
5
|
|
|
6
|
-
<div id="uploadedFilesContainer">
|
|
6
|
+
<div id="uploadedFilesContainer" data-uploadinglabel="{{ upload.uploadingLabel }}">
|
|
7
7
|
<h2 class="govuk-heading-m">{{ t('components.fileUploadField.uploadedFilesHeading') }}</h2>
|
|
8
8
|
{% if upload.count %}
|
|
9
9
|
<p class="govuk-body" role="alert">{{ t('components.fileUploadField.filesCount', { count: upload.count }) }}</p>
|
|
@@ -3,7 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
{% macro MultilineTextField(component) %}
|
|
5
5
|
{% if component.model.isCharacterOrWordCount == true %}
|
|
6
|
-
{
|
|
6
|
+
{% set characterParams = component.model | merge({
|
|
7
|
+
charactersUnderLimitText: {
|
|
8
|
+
one: t('components.characterCount.underLimit.one'),
|
|
9
|
+
other: t('components.characterCount.underLimit.other')
|
|
10
|
+
},
|
|
11
|
+
charactersAtLimitText: t('components.characterCount.atLimit'),
|
|
12
|
+
charactersOverLimitText: {
|
|
13
|
+
one: t('components.characterCount.overLimit.one'),
|
|
14
|
+
other: t('components.characterCount.overLimit.other')
|
|
15
|
+
}
|
|
16
|
+
} ) %}
|
|
17
|
+
{{ govukCharacterCount(characterParams) }}
|
|
7
18
|
{% else %}
|
|
8
19
|
{{ govukTextarea(component.model) }}
|
|
9
20
|
{% endif %}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<p class="govuk-body">{{ t('components.paymentField.preAuthorisedBody') }}</p>
|
|
17
17
|
{% else %}
|
|
18
18
|
{# No pre-authorisation - show payment form #}
|
|
19
|
-
<h2 class="govuk-heading-m">{{
|
|
19
|
+
<h2 class="govuk-heading-m">{{ t('components.paymentField.detailsRequired') }}</h2>
|
|
20
20
|
|
|
21
21
|
<p class="govuk-body">{{ description }}</p>
|
|
22
22
|
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
</p>
|
|
9
9
|
{%- endmacro -%}
|
|
10
10
|
|
|
11
|
-
{% call govukNotificationBanner(
|
|
11
|
+
{% call govukNotificationBanner({
|
|
12
|
+
titleText: t('pages.preview.bannerTitle')
|
|
13
|
+
}) %}
|
|
12
14
|
{% set previewModeTranslated = t('common.' + previewMode) %}
|
|
13
15
|
{% if not context.isForceAccess %}
|
|
14
16
|
<p class="govuk-notification-banner__heading govuk-!-margin-bottom-0">
|