@defra/forms-engine-plugin 0.1.10 → 0.1.12
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/file-upload.min.js +1 -1
- package/.public/javascripts/file-upload.min.js.map +1 -1
- package/.public/stylesheets/application.min.css +1 -1
- package/.public/stylesheets/application.min.css.map +1 -1
- package/.server/client/javascripts/file-upload.js +45 -4
- package/.server/client/javascripts/file-upload.js.map +1 -1
- package/.server/client/stylesheets/application.scss +10 -0
- package/.server/config/index.js +3 -14
- package/.server/config/index.js.map +1 -1
- package/.server/server/constants.js +2 -0
- package/.server/server/constants.js.map +1 -1
- package/.server/server/devserver/dxt-devtool-baselayout.html +71 -0
- package/.server/server/forms/register-as-a-unicorn-breeder.json +393 -0
- package/.server/server/forms/register-as-a-unicorn-breeder.yaml +251 -0
- package/.server/server/index.js +12 -17
- package/.server/server/index.js.map +1 -1
- package/.server/server/plugins/engine/components/AutocompleteField.js +2 -0
- package/.server/server/plugins/engine/components/AutocompleteField.js.map +1 -1
- package/.server/server/plugins/engine/components/CheckboxesField.js +3 -4
- package/.server/server/plugins/engine/components/CheckboxesField.js.map +1 -1
- package/.server/server/plugins/engine/components/ComponentCollection.js +37 -16
- package/.server/server/plugins/engine/components/ComponentCollection.js.map +1 -1
- package/.server/server/plugins/engine/components/DatePartsField.js +36 -2
- package/.server/server/plugins/engine/components/DatePartsField.js.map +1 -1
- package/.server/server/plugins/engine/components/EmailAddressField.js +19 -3
- package/.server/server/plugins/engine/components/EmailAddressField.js.map +1 -1
- package/.server/server/plugins/engine/components/FileUploadField.js +44 -4
- package/.server/server/plugins/engine/components/FileUploadField.js.map +1 -1
- package/.server/server/plugins/engine/components/FormComponent.js +14 -2
- package/.server/server/plugins/engine/components/FormComponent.js.map +1 -1
- package/.server/server/plugins/engine/components/ListFormComponent.js +16 -3
- package/.server/server/plugins/engine/components/ListFormComponent.js.map +1 -1
- package/.server/server/plugins/engine/components/Markdown.js +24 -0
- package/.server/server/plugins/engine/components/Markdown.js.map +1 -0
- package/.server/server/plugins/engine/components/MonthYearField.js +30 -2
- package/.server/server/plugins/engine/components/MonthYearField.js.map +1 -1
- package/.server/server/plugins/engine/components/MultilineTextField.js +32 -3
- package/.server/server/plugins/engine/components/MultilineTextField.js.map +1 -1
- package/.server/server/plugins/engine/components/NumberField.js +28 -3
- package/.server/server/plugins/engine/components/NumberField.js.map +1 -1
- package/.server/server/plugins/engine/components/SelectionControlField.js +14 -0
- package/.server/server/plugins/engine/components/SelectionControlField.js.map +1 -1
- package/.server/server/plugins/engine/components/TelephoneNumberField.js +19 -3
- package/.server/server/plugins/engine/components/TelephoneNumberField.js.map +1 -1
- package/.server/server/plugins/engine/components/TextField.js +22 -3
- package/.server/server/plugins/engine/components/TextField.js.map +1 -1
- package/.server/server/plugins/engine/components/UkAddressField.js +29 -0
- package/.server/server/plugins/engine/components/UkAddressField.js.map +1 -1
- package/.server/server/plugins/engine/components/YesNoField.js +18 -0
- package/.server/server/plugins/engine/components/YesNoField.js.map +1 -1
- package/.server/server/plugins/engine/components/helpers.js +16 -0
- package/.server/server/plugins/engine/components/helpers.js.map +1 -1
- package/.server/server/plugins/engine/components/index.js +1 -0
- package/.server/server/plugins/engine/components/index.js.map +1 -1
- package/.server/server/plugins/engine/configureEnginePlugin.js +19 -3
- package/.server/server/plugins/engine/configureEnginePlugin.js.map +1 -1
- package/.server/server/plugins/engine/helpers.js +38 -18
- package/.server/server/plugins/engine/helpers.js.map +1 -1
- package/.server/server/plugins/engine/models/FormModel.js +60 -2
- package/.server/server/plugins/engine/models/FormModel.js.map +1 -1
- package/.server/server/plugins/engine/models/SummaryViewModel.js +3 -2
- package/.server/server/plugins/engine/models/SummaryViewModel.js.map +1 -1
- package/.server/server/plugins/engine/outputFormatters/human/v1.js +1 -1
- package/.server/server/plugins/engine/outputFormatters/human/v1.js.map +1 -1
- package/.server/server/plugins/engine/pageControllers/PageController.js +13 -5
- package/.server/server/plugins/engine/pageControllers/PageController.js.map +1 -1
- package/.server/server/plugins/engine/pageControllers/QuestionPageController.js +2 -2
- package/.server/server/plugins/engine/pageControllers/QuestionPageController.js.map +1 -1
- package/.server/server/plugins/engine/pageControllers/SummaryPageController.js +19 -5
- package/.server/server/plugins/engine/pageControllers/SummaryPageController.js.map +1 -1
- package/.server/server/plugins/engine/pageControllers/validationOptions.js +6 -11
- package/.server/server/plugins/engine/pageControllers/validationOptions.js.map +1 -1
- package/.server/server/plugins/engine/plugin.js +32 -20
- package/.server/server/plugins/engine/plugin.js.map +1 -1
- package/.server/server/plugins/engine/services/formsService.js +15 -29
- package/.server/server/plugins/engine/services/formsService.js.map +1 -1
- package/.server/server/plugins/engine/services/localFormsService.js +52 -0
- package/.server/server/plugins/engine/services/localFormsService.js.map +1 -0
- package/.server/server/plugins/engine/services/notifyService.js +1 -4
- package/.server/server/plugins/engine/services/notifyService.js.map +1 -1
- package/.server/server/plugins/engine/services/uploadService.js +5 -3
- package/.server/server/plugins/engine/services/uploadService.js.map +1 -1
- package/.server/server/plugins/engine/types.js.map +1 -1
- package/.server/server/plugins/engine/views/components/html.html +1 -1
- package/.server/server/plugins/engine/views/components/markdown.html +5 -0
- package/.server/server/plugins/engine/views/confirmation.html +1 -1
- package/.server/server/plugins/engine/views/file-upload.html +1 -1
- package/.server/server/plugins/engine/views/index.html +1 -1
- package/.server/server/plugins/engine/views/item-delete.html +1 -1
- package/.server/server/plugins/engine/views/repeat-list-summary.html +1 -1
- package/.server/server/plugins/engine/views/summary.html +8 -2
- package/.server/server/plugins/errorPages.js +4 -26
- package/.server/server/plugins/errorPages.js.map +1 -1
- package/.server/server/plugins/nunjucks/context.js +43 -33
- package/.server/server/plugins/nunjucks/context.js.map +1 -1
- package/.server/server/plugins/nunjucks/context.test.js +23 -28
- package/.server/server/plugins/nunjucks/context.test.js.map +1 -1
- package/.server/server/plugins/nunjucks/enviroment.test.js +6 -3
- package/.server/server/plugins/nunjucks/enviroment.test.js.map +1 -1
- package/.server/server/plugins/nunjucks/types.js +3 -4
- package/.server/server/plugins/nunjucks/types.js.map +1 -1
- package/.server/server/routes/index.js +0 -1
- package/.server/server/routes/index.js.map +1 -1
- package/.server/server/utils/type-utils.js +8 -0
- package/.server/server/utils/type-utils.js.map +1 -0
- package/.server/typings/hapi/index.d.js.map +1 -1
- package/.server/typings/joi/index.d.js.map +1 -1
- package/package.json +4 -3
- package/src/client/javascripts/file-upload.js +60 -4
- package/src/client/stylesheets/application.scss +10 -0
- package/src/config/index.ts +4 -17
- package/src/server/constants.js +2 -0
- package/src/server/devserver/dxt-devtool-baselayout.html +71 -0
- package/src/server/forms/register-as-a-unicorn-breeder.json +393 -0
- package/src/server/forms/register-as-a-unicorn-breeder.yaml +251 -0
- package/src/server/index.test.ts +38 -66
- package/src/server/index.ts +15 -17
- package/src/server/plugins/engine/components/AutocompleteField.test.ts +71 -3
- package/src/server/plugins/engine/components/AutocompleteField.ts +6 -2
- package/src/server/plugins/engine/components/CheckboxesField.test.ts +40 -8
- package/src/server/plugins/engine/components/CheckboxesField.ts +7 -3
- package/src/server/plugins/engine/components/ComponentCollection.ts +45 -18
- package/src/server/plugins/engine/components/DatePartsField.test.ts +13 -4
- package/src/server/plugins/engine/components/DatePartsField.ts +29 -8
- package/src/server/plugins/engine/components/EmailAddressField.test.ts +51 -1
- package/src/server/plugins/engine/components/EmailAddressField.ts +17 -2
- package/src/server/plugins/engine/components/FileUploadField.test.ts +53 -0
- package/src/server/plugins/engine/components/FileUploadField.ts +52 -3
- package/src/server/plugins/engine/components/FormComponent.ts +24 -2
- package/src/server/plugins/engine/components/ListFormComponent.ts +16 -2
- package/src/server/plugins/engine/components/Markdown.test.ts +48 -0
- package/src/server/plugins/engine/components/Markdown.ts +29 -0
- package/src/server/plugins/engine/components/MonthYearField.test.ts +35 -0
- package/src/server/plugins/engine/components/MonthYearField.ts +34 -9
- package/src/server/plugins/engine/components/MultilineTextField.test.ts +83 -5
- package/src/server/plugins/engine/components/MultilineTextField.ts +37 -2
- package/src/server/plugins/engine/components/NumberField.test.ts +24 -2
- package/src/server/plugins/engine/components/NumberField.ts +23 -3
- package/src/server/plugins/engine/components/RadiosField.test.ts +10 -1
- package/src/server/plugins/engine/components/SelectField.test.ts +2 -1
- package/src/server/plugins/engine/components/SelectionControlField.ts +14 -0
- package/src/server/plugins/engine/components/TelephoneNumberField.test.ts +30 -2
- package/src/server/plugins/engine/components/TelephoneNumberField.ts +17 -2
- package/src/server/plugins/engine/components/TextField.test.ts +33 -1
- package/src/server/plugins/engine/components/TextField.ts +17 -2
- package/src/server/plugins/engine/components/UkAddressField.test.ts +46 -3
- package/src/server/plugins/engine/components/UkAddressField.ts +28 -0
- package/src/server/plugins/engine/components/YesNoField.test.ts +9 -1
- package/src/server/plugins/engine/components/YesNoField.ts +24 -0
- package/src/server/plugins/engine/components/helpers.test.ts +24 -0
- package/src/server/plugins/engine/components/helpers.ts +39 -0
- package/src/server/plugins/engine/components/index.ts +1 -0
- package/src/server/plugins/engine/configureEnginePlugin.ts +32 -4
- package/src/server/plugins/engine/helpers.test.ts +71 -20
- package/src/server/plugins/engine/helpers.ts +46 -19
- package/src/server/plugins/engine/models/FormModel.test.ts +91 -1
- package/src/server/plugins/engine/models/FormModel.ts +86 -3
- package/src/server/plugins/engine/models/SummaryViewModel.test.ts +46 -7
- package/src/server/plugins/engine/models/SummaryViewModel.ts +7 -3
- package/src/server/plugins/engine/outputFormatters/human/v1.test.ts +1 -2
- package/src/server/plugins/engine/outputFormatters/human/v1.ts +1 -1
- package/src/server/plugins/engine/pageControllers/FileUploadPageController.test.ts +1 -0
- package/src/server/plugins/engine/pageControllers/PageController.test.ts +9 -6
- package/src/server/plugins/engine/pageControllers/PageController.ts +15 -5
- package/src/server/plugins/engine/pageControllers/QuestionPageController.ts +2 -2
- package/src/server/plugins/engine/pageControllers/SummaryPageController.ts +21 -6
- package/src/server/plugins/engine/pageControllers/validationOptions.ts +31 -17
- package/src/server/plugins/engine/plugin.ts +52 -22
- package/src/server/plugins/engine/services/formsService.js +17 -35
- package/src/server/plugins/engine/services/localFormsService.js +49 -0
- package/src/server/plugins/engine/services/notifyService.ts +1 -2
- package/src/server/plugins/engine/services/uploadService.js +10 -6
- package/src/server/plugins/engine/types.ts +10 -1
- package/src/server/plugins/engine/views/components/html.html +1 -1
- package/src/server/plugins/engine/views/components/markdown.html +5 -0
- package/src/server/plugins/engine/views/confirmation.html +1 -1
- package/src/server/plugins/engine/views/file-upload.html +1 -1
- package/src/server/plugins/engine/views/index.html +1 -1
- package/src/server/plugins/engine/views/item-delete.html +1 -1
- package/src/server/plugins/engine/views/repeat-list-summary.html +1 -1
- package/src/server/plugins/engine/views/summary.html +8 -2
- package/src/server/plugins/errorPages.ts +4 -26
- package/src/server/plugins/nunjucks/context.js +44 -34
- package/src/server/plugins/nunjucks/context.test.js +24 -27
- package/src/server/plugins/nunjucks/enviroment.test.js +9 -3
- package/src/server/plugins/nunjucks/types.js +3 -4
- package/src/server/routes/index.ts +0 -1
- package/src/server/utils/type-utils.ts +15 -0
- package/src/typings/hapi/index.d.ts +3 -9
- package/src/typings/joi/index.d.ts +8 -0
- package/.server/common/cookies.js +0 -55
- package/.server/common/cookies.js.map +0 -1
- package/.server/common/cookies.test.js +0 -15
- package/.server/common/cookies.test.js.map +0 -1
- package/.server/common/types.js +0 -6
- package/.server/common/types.js.map +0 -1
- package/.server/server/forms/README.md +0 -10
- package/.server/server/forms/report-a-terrorist.json +0 -270
- package/.server/server/forms/runner-components-test.json +0 -365
- package/.server/server/forms/test.json +0 -581
- package/.server/server/forms/test.yaml +0 -363
- package/.server/server/plugins/blankie.js +0 -29
- package/.server/server/plugins/blankie.js.map +0 -1
- package/.server/server/plugins/engine/services/formsService.test.js +0 -71
- package/.server/server/plugins/engine/services/formsService.test.js.map +0 -1
- package/.server/server/plugins/engine/views/layout.html +0 -199
- package/.server/server/plugins/router.js +0 -169
- package/.server/server/plugins/router.js.map +0 -1
- package/.server/server/routes/health.js +0 -15
- package/.server/server/routes/health.js.map +0 -1
- package/.server/server/routes/health.test.js +0 -32
- package/.server/server/routes/health.test.js.map +0 -1
- package/.server/server/utils/file-form-service.test.js +0 -52
- package/.server/server/utils/file-form-service.test.js.map +0 -1
- package/.server/server/views/404.html +0 -16
- package/.server/server/views/500.html +0 -19
- package/.server/server/views/help/accessibility-statement.html +0 -58
- package/.server/server/views/help/cookie-preferences.html +0 -57
- package/.server/server/views/help/cookies.html +0 -71
- package/.server/server/views/help/get-support.html +0 -37
- package/.server/server/views/help/privacy-notice.html +0 -68
- package/.server/server/views/help/terms-and-conditions.html +0 -83
- package/src/common/cookies.js +0 -58
- package/src/common/cookies.test.js +0 -23
- package/src/common/types.js +0 -5
- package/src/server/forms/README.md +0 -10
- package/src/server/forms/report-a-terrorist.json +0 -270
- package/src/server/forms/runner-components-test.json +0 -365
- package/src/server/forms/test.json +0 -581
- package/src/server/forms/test.yaml +0 -363
- package/src/server/plugins/blankie.test.ts +0 -73
- package/src/server/plugins/blankie.ts +0 -48
- package/src/server/plugins/engine/services/formsService.test.js +0 -90
- package/src/server/plugins/engine/views/layout.html +0 -199
- package/src/server/plugins/router.ts +0 -201
- package/src/server/routes/health.js +0 -13
- package/src/server/routes/health.test.js +0 -35
- package/src/server/routes/index.test.ts +0 -125
- package/src/server/utils/file-form-service.test.js +0 -79
- package/src/server/views/404.html +0 -16
- package/src/server/views/500.html +0 -19
- package/src/server/views/help/accessibility-statement.html +0 -58
- package/src/server/views/help/cookie-preferences.html +0 -57
- package/src/server/views/help/cookies.html +0 -71
- package/src/server/views/help/get-support.html +0 -37
- package/src/server/views/help/privacy-notice.html +0 -68
- package/src/server/views/help/terms-and-conditions.html +0 -83
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { slugSchema } from '@defra/forms-model';
|
|
2
|
-
import Boom from '@hapi/boom';
|
|
3
|
-
import humanizeDuration from 'humanize-duration';
|
|
4
|
-
import Joi from 'joi';
|
|
5
|
-
import { defaultConsent, parseCookieConsent, serialiseCookieConsent } from "../../common/cookies.js";
|
|
6
|
-
import { config } from "../../config/index.js";
|
|
7
|
-
import { isPathRelative } from "./engine/helpers.js";
|
|
8
|
-
import { getFormMetadata } from "./engine/services/formsService.js";
|
|
9
|
-
import { healthRoute, publicRoutes } from "../routes/index.js";
|
|
10
|
-
import { crumbSchema } from "../schemas/index.js";
|
|
11
|
-
const routes = [...publicRoutes, healthRoute];
|
|
12
|
-
export default {
|
|
13
|
-
plugin: {
|
|
14
|
-
name: 'router',
|
|
15
|
-
register: server => {
|
|
16
|
-
server.route(routes);
|
|
17
|
-
|
|
18
|
-
// Shared help routes params schema & options
|
|
19
|
-
const params = Joi.object().keys({
|
|
20
|
-
slug: slugSchema
|
|
21
|
-
}).required();
|
|
22
|
-
const options = {
|
|
23
|
-
validate: {
|
|
24
|
-
params
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
server.route({
|
|
28
|
-
method: 'get',
|
|
29
|
-
path: '/help/get-support/{slug}',
|
|
30
|
-
async handler(request, h) {
|
|
31
|
-
const {
|
|
32
|
-
slug
|
|
33
|
-
} = request.params;
|
|
34
|
-
const form = await getFormMetadata(slug);
|
|
35
|
-
return h.view('help/get-support', {
|
|
36
|
-
form
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
options
|
|
40
|
-
});
|
|
41
|
-
server.route({
|
|
42
|
-
method: 'get',
|
|
43
|
-
path: '/help/privacy/{slug}',
|
|
44
|
-
async handler(request, h) {
|
|
45
|
-
const {
|
|
46
|
-
slug
|
|
47
|
-
} = request.params;
|
|
48
|
-
const form = await getFormMetadata(slug);
|
|
49
|
-
return h.view('help/privacy-notice', {
|
|
50
|
-
form
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
options
|
|
54
|
-
});
|
|
55
|
-
server.route({
|
|
56
|
-
method: 'get',
|
|
57
|
-
path: '/help/cookies/{slug}',
|
|
58
|
-
handler(_request, h) {
|
|
59
|
-
const sessionTimeout = config.get('sessionTimeout');
|
|
60
|
-
const sessionDurationPretty = humanizeDuration(sessionTimeout);
|
|
61
|
-
return h.view('help/cookies', {
|
|
62
|
-
googleAnalyticsContainerId: config.get('googleAnalyticsTrackingId').replace(/^G-/, ''),
|
|
63
|
-
sessionDurationPretty
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
options
|
|
67
|
-
});
|
|
68
|
-
server.route({
|
|
69
|
-
method: 'post',
|
|
70
|
-
path: '/help/cookie-preferences/{slug}',
|
|
71
|
-
handler(request, h) {
|
|
72
|
-
const {
|
|
73
|
-
params,
|
|
74
|
-
payload,
|
|
75
|
-
query
|
|
76
|
-
} = request;
|
|
77
|
-
const {
|
|
78
|
-
slug
|
|
79
|
-
} = params;
|
|
80
|
-
let {
|
|
81
|
-
returnUrl
|
|
82
|
-
} = query;
|
|
83
|
-
if (returnUrl && !isPathRelative(returnUrl)) {
|
|
84
|
-
throw Boom.badRequest('Return URL must be relative');
|
|
85
|
-
}
|
|
86
|
-
const analyticsDecision = (payload['cookies[analytics]'] ?? '').toLowerCase();
|
|
87
|
-
const dismissedDecision = (payload['cookies[dismissed]'] ?? '').toLowerCase();
|
|
88
|
-
|
|
89
|
-
// move the parser into our JS code so we can delegate to the frontend in a future iteration
|
|
90
|
-
let cookieConsent;
|
|
91
|
-
if (typeof request.state.cookieConsent === 'string') {
|
|
92
|
-
cookieConsent = parseCookieConsent(request.state.cookieConsent);
|
|
93
|
-
} else {
|
|
94
|
-
cookieConsent = defaultConsent;
|
|
95
|
-
}
|
|
96
|
-
if (analyticsDecision) {
|
|
97
|
-
cookieConsent.analytics = analyticsDecision === 'yes';
|
|
98
|
-
cookieConsent.dismissed = false;
|
|
99
|
-
}
|
|
100
|
-
if (dismissedDecision) {
|
|
101
|
-
cookieConsent.dismissed = dismissedDecision === 'yes';
|
|
102
|
-
}
|
|
103
|
-
if (!returnUrl) {
|
|
104
|
-
cookieConsent.dismissed = true; // this page already has a confirmation message, don't show another
|
|
105
|
-
returnUrl = `/help/cookie-preferences/${slug}`;
|
|
106
|
-
}
|
|
107
|
-
const serialisedCookieConsent = serialiseCookieConsent(cookieConsent);
|
|
108
|
-
h.state('cookieConsent', serialisedCookieConsent);
|
|
109
|
-
return h.redirect(returnUrl);
|
|
110
|
-
},
|
|
111
|
-
options: {
|
|
112
|
-
validate: {
|
|
113
|
-
params,
|
|
114
|
-
payload: Joi.object({
|
|
115
|
-
crumb: crumbSchema,
|
|
116
|
-
'cookies[analytics]': Joi.string().valid('yes', 'no').optional(),
|
|
117
|
-
'cookies[dismissed]': Joi.string().valid('yes', 'no').optional()
|
|
118
|
-
}),
|
|
119
|
-
query: Joi.object({
|
|
120
|
-
returnUrl: Joi.string().optional()
|
|
121
|
-
})
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
server.route({
|
|
126
|
-
method: 'get',
|
|
127
|
-
path: '/',
|
|
128
|
-
handler() {
|
|
129
|
-
throw Boom.notFound();
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
server.route({
|
|
133
|
-
method: 'get',
|
|
134
|
-
path: '/help/cookie-preferences/{slug}',
|
|
135
|
-
handler(request, h) {
|
|
136
|
-
const {
|
|
137
|
-
params
|
|
138
|
-
} = request;
|
|
139
|
-
const {
|
|
140
|
-
slug
|
|
141
|
-
} = params;
|
|
142
|
-
let cookieConsentDismissed = false;
|
|
143
|
-
if (typeof request.state.cookieConsent === 'string') {
|
|
144
|
-
const cookieConsent = parseCookieConsent(request.state.cookieConsent);
|
|
145
|
-
cookieConsentDismissed = cookieConsent.dismissed;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// if the user has come back to this page after updating their preferences
|
|
149
|
-
// override the 'dismissed' behaviour to show a success notification instead of
|
|
150
|
-
// the cookie banner
|
|
151
|
-
const showConsentSuccess = cookieConsentDismissed && request.info.referrer.endsWith(`/help/cookie-preferences/${slug}`);
|
|
152
|
-
return h.view('help/cookie-preferences', {
|
|
153
|
-
cookieConsentUpdated: showConsentSuccess
|
|
154
|
-
});
|
|
155
|
-
},
|
|
156
|
-
options
|
|
157
|
-
});
|
|
158
|
-
server.route({
|
|
159
|
-
method: 'get',
|
|
160
|
-
path: '/help/accessibility-statement/{slug}',
|
|
161
|
-
handler(_request, h) {
|
|
162
|
-
return h.view('help/accessibility-statement');
|
|
163
|
-
},
|
|
164
|
-
options
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
//# sourceMappingURL=router.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","names":["slugSchema","Boom","humanizeDuration","Joi","defaultConsent","parseCookieConsent","serialiseCookieConsent","config","isPathRelative","getFormMetadata","healthRoute","publicRoutes","crumbSchema","routes","plugin","name","register","server","route","params","object","keys","slug","required","options","validate","method","path","handler","request","h","form","view","_request","sessionTimeout","get","sessionDurationPretty","googleAnalyticsContainerId","replace","payload","query","returnUrl","badRequest","analyticsDecision","toLowerCase","dismissedDecision","cookieConsent","state","analytics","dismissed","serialisedCookieConsent","redirect","crumb","string","valid","optional","notFound","cookieConsentDismissed","showConsentSuccess","info","referrer","endsWith","cookieConsentUpdated"],"sources":["../../../src/server/plugins/router.ts"],"sourcesContent":["import { slugSchema } from '@defra/forms-model'\nimport Boom from '@hapi/boom'\nimport { type ServerRegisterPluginObject } from '@hapi/hapi'\nimport humanizeDuration from 'humanize-duration'\nimport Joi from 'joi'\n\nimport {\n defaultConsent,\n parseCookieConsent,\n serialiseCookieConsent\n} from '~/src/common/cookies.js'\nimport { type CookieConsent } from '~/src/common/types.js'\nimport { config } from '~/src/config/index.js'\nimport { isPathRelative } from '~/src/server/plugins/engine/helpers.js'\nimport { getFormMetadata } from '~/src/server/plugins/engine/services/formsService.js'\nimport { healthRoute, publicRoutes } from '~/src/server/routes/index.js'\nimport { crumbSchema } from '~/src/server/schemas/index.js'\n\nconst routes = [...publicRoutes, healthRoute]\n\nexport default {\n plugin: {\n name: 'router',\n register: (server) => {\n server.route(routes)\n\n // Shared help routes params schema & options\n const params = Joi.object()\n .keys({\n slug: slugSchema\n })\n .required()\n\n const options = {\n validate: {\n params\n }\n }\n\n server.route<{ Params: { slug: string } }>({\n method: 'get',\n path: '/help/get-support/{slug}',\n async handler(request, h) {\n const { slug } = request.params\n const form = await getFormMetadata(slug)\n\n return h.view('help/get-support', { form })\n },\n options\n })\n\n server.route<{ Params: { slug: string } }>({\n method: 'get',\n path: '/help/privacy/{slug}',\n async handler(request, h) {\n const { slug } = request.params\n const form = await getFormMetadata(slug)\n\n return h.view('help/privacy-notice', { form })\n },\n options\n })\n\n server.route<{ Params: { slug: string } }>({\n method: 'get',\n path: '/help/cookies/{slug}',\n handler(_request, h) {\n const sessionTimeout = config.get('sessionTimeout')\n\n const sessionDurationPretty = humanizeDuration(sessionTimeout)\n\n return h.view('help/cookies', {\n googleAnalyticsContainerId: config\n .get('googleAnalyticsTrackingId')\n .replace(/^G-/, ''),\n sessionDurationPretty\n })\n },\n options\n })\n\n server.route<{\n Params: { slug: string }\n Payload: {\n crumb?: string\n 'cookies[analytics]'?: string\n 'cookies[dismissed]'?: string\n }\n Query: { returnUrl?: string }\n }>({\n method: 'post',\n path: '/help/cookie-preferences/{slug}',\n handler(request, h) {\n const { params, payload, query } = request\n const { slug } = params\n let { returnUrl } = query\n\n if (returnUrl && !isPathRelative(returnUrl)) {\n throw Boom.badRequest('Return URL must be relative')\n }\n\n const analyticsDecision = (\n payload['cookies[analytics]'] ?? ''\n ).toLowerCase()\n\n const dismissedDecision = (\n payload['cookies[dismissed]'] ?? ''\n ).toLowerCase()\n\n // move the parser into our JS code so we can delegate to the frontend in a future iteration\n let cookieConsent: CookieConsent\n\n if (typeof request.state.cookieConsent === 'string') {\n cookieConsent = parseCookieConsent(request.state.cookieConsent)\n } else {\n cookieConsent = defaultConsent\n }\n\n if (analyticsDecision) {\n cookieConsent.analytics = analyticsDecision === 'yes'\n cookieConsent.dismissed = false\n }\n\n if (dismissedDecision) {\n cookieConsent.dismissed = dismissedDecision === 'yes'\n }\n\n if (!returnUrl) {\n cookieConsent.dismissed = true // this page already has a confirmation message, don't show another\n returnUrl = `/help/cookie-preferences/${slug}`\n }\n\n const serialisedCookieConsent = serialiseCookieConsent(cookieConsent)\n h.state('cookieConsent', serialisedCookieConsent)\n\n return h.redirect(returnUrl)\n },\n options: {\n validate: {\n params,\n payload: Joi.object({\n crumb: crumbSchema,\n 'cookies[analytics]': Joi.string().valid('yes', 'no').optional(),\n 'cookies[dismissed]': Joi.string().valid('yes', 'no').optional()\n }),\n query: Joi.object({\n returnUrl: Joi.string().optional()\n })\n }\n }\n })\n\n server.route({\n method: 'get',\n path: '/',\n handler() {\n throw Boom.notFound()\n }\n })\n\n server.route<{ Params: { slug: string } }>({\n method: 'get',\n path: '/help/cookie-preferences/{slug}',\n handler(request, h) {\n const { params } = request\n const { slug } = params\n let cookieConsentDismissed = false\n\n if (typeof request.state.cookieConsent === 'string') {\n const cookieConsent = parseCookieConsent(\n request.state.cookieConsent\n )\n\n cookieConsentDismissed = cookieConsent.dismissed\n }\n\n // if the user has come back to this page after updating their preferences\n // override the 'dismissed' behaviour to show a success notification instead of\n // the cookie banner\n const showConsentSuccess =\n cookieConsentDismissed &&\n request.info.referrer.endsWith(`/help/cookie-preferences/${slug}`)\n\n return h.view('help/cookie-preferences', {\n cookieConsentUpdated: showConsentSuccess\n })\n },\n options\n })\n\n server.route<{ Params: { slug: string } }>({\n method: 'get',\n path: '/help/accessibility-statement/{slug}',\n handler(_request, h) {\n return h.view('help/accessibility-statement')\n },\n options\n })\n }\n }\n} satisfies ServerRegisterPluginObject<void>\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,OAAOC,IAAI,MAAM,YAAY;AAE7B,OAAOC,gBAAgB,MAAM,mBAAmB;AAChD,OAAOC,GAAG,MAAM,KAAK;AAErB,SACEC,cAAc,EACdC,kBAAkB,EAClBC,sBAAsB;AAGxB,SAASC,MAAM;AACf,SAASC,cAAc;AAC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UACR,MAAM3B,IAAI,CAACuD,QAAQ,CAAC,CAAC;QACvB;MACF,CAAC,CAAC;MAEFvC,MAAM,CAACC,KAAK,CAA+B;QACzCQ,MAAM,EAAE,KAAK;QACbC,IAAI,EAAE,iCAAiC;QACvCC,OAAOA,CAACC,OAAO,EAAEC,CAAC,EAAE;UAClB,MAAM;YAAEX;UAAO,CAAC,GAAGU,OAAO;UAC1B,MAAM;YAAEP;UAAK,CAAC,GAAGH,MAAM;UACvB,IAAIsC,sBAAsB,GAAG,KAAK;UAElC,IAAI,OAAO5B,OAAO,CAACkB,KAAK,CAACD,aAAa,KAAK,QAAQ,EAAE;YACnD,MAAMA,aAAa,GAAGzC,kBAAkB,CACtCwB,OAAO,CAACkB,KAAK,CAACD,aAChB,CAAC;YAEDW,sBAAsB,GAAGX,aAAa,CAACG,SAAS;UAClD;;UAEA;UACA;UACA;UACA,MAAMS,kBAAkB,GACtBD,sBAAsB,IACtB5B,OAAO,CAAC8B,IAAI,CAACC,QAAQ,CAACC,QAAQ,CAAC,4BAA4BvC,IAAI,EAAE,CAAC;UAEpE,OAAOQ,CAAC,CAACE,IAAI,CAAC,yBAAyB,EAAE;YACvC8B,oBAAoB,EAAEJ;UACxB,CAAC,CAAC;QACJ,CAAC;QACDlC;MACF,CAAC,CAAC;MAEFP,MAAM,CAACC,KAAK,CAA+B;QACzCQ,MAAM,EAAE,KAAK;QACbC,IAAI,EAAE,sCAAsC;QAC5CC,OAAOA,CAACK,QAAQ,EAAEH,CAAC,EAAE;UACnB,OAAOA,CAAC,CAACE,IAAI,CAAC,8BAA8B,CAAC;QAC/C,CAAC;QACDR;MACF,CAAC,CAAC;IACJ;EACF;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { StatusCodes } from 'http-status-codes';
|
|
2
|
-
export default (/** @type {ServerRoute} */{
|
|
3
|
-
method: 'GET',
|
|
4
|
-
path: '/health',
|
|
5
|
-
handler(_, h) {
|
|
6
|
-
return h.response({
|
|
7
|
-
message: 'success'
|
|
8
|
-
}).code(StatusCodes.OK);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @import { ServerRoute } from '@hapi/hapi'
|
|
14
|
-
*/
|
|
15
|
-
//# sourceMappingURL=health.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health.js","names":["StatusCodes","method","path","handler","_","h","response","message","code","OK"],"sources":["../../../src/server/routes/health.js"],"sourcesContent":["import { StatusCodes } from 'http-status-codes'\n\nexport default /** @type {ServerRoute} */ ({\n method: 'GET',\n path: '/health',\n handler(_, h) {\n return h.response({ message: 'success' }).code(StatusCodes.OK)\n }\n})\n\n/**\n * @import { ServerRoute } from '@hapi/hapi'\n */\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAmB;AAE/C,gBAAe,0BAA4B;EACzCC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE,SAAS;EACfC,OAAOA,CAACC,CAAC,EAAEC,CAAC,EAAE;IACZ,OAAOA,CAAC,CAACC,QAAQ,CAAC;MAAEC,OAAO,EAAE;IAAU,CAAC,CAAC,CAACC,IAAI,CAACR,WAAW,CAACS,EAAE,CAAC;EAChE;AACF,CAAC;;AAED;AACA;AACA","ignoreList":[]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { createServer } from "../index.js";
|
|
2
|
-
describe('Health check route', () => {
|
|
3
|
-
const startServer = async () => {
|
|
4
|
-
const server = await createServer();
|
|
5
|
-
await server.initialize();
|
|
6
|
-
return server;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/** @type {Server} */
|
|
10
|
-
let server;
|
|
11
|
-
afterEach(async () => {
|
|
12
|
-
await server.stop();
|
|
13
|
-
});
|
|
14
|
-
test('/health route response is correct', async () => {
|
|
15
|
-
server = await startServer();
|
|
16
|
-
const options = {
|
|
17
|
-
method: 'GET',
|
|
18
|
-
url: '/health'
|
|
19
|
-
};
|
|
20
|
-
const {
|
|
21
|
-
result
|
|
22
|
-
} = await server.inject(options);
|
|
23
|
-
expect(result).toMatchObject({
|
|
24
|
-
message: 'success'
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @import { Server } from '@hapi/hapi'
|
|
31
|
-
*/
|
|
32
|
-
//# sourceMappingURL=health.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health.test.js","names":["createServer","describe","startServer","server","initialize","afterEach","stop","test","options","method","url","result","inject","expect","toMatchObject","message"],"sources":["../../../src/server/routes/health.test.js"],"sourcesContent":["import { createServer } from '~/src/server/index.js'\n\ndescribe('Health check route', () => {\n const startServer = async () => {\n const server = await createServer()\n await server.initialize()\n return server\n }\n\n /** @type {Server} */\n let server\n\n afterEach(async () => {\n await server.stop()\n })\n\n test('/health route response is correct', async () => {\n server = await startServer()\n\n const options = {\n method: 'GET',\n url: '/health'\n }\n\n const { result } = await server.inject(options)\n\n expect(result).toMatchObject({\n message: 'success'\n })\n })\n})\n\n/**\n * @import { Server } from '@hapi/hapi'\n */\n"],"mappings":"AAAA,SAASA,YAAY;AAErBC,QAAQ,CAAC,oBAAoB,EAAE,MAAM;EACnC,MAAMC,WAAW,GAAG,MAAAA,CAAA,KAAY;IAC9B,MAAMC,MAAM,GAAG,MAAMH,YAAY,CAAC,CAAC;IACnC,MAAMG,MAAM,CAACC,UAAU,CAAC,CAAC;IACzB,OAAOD,MAAM;EACf,CAAC;;EAED;EACA,IAAIA,MAAM;EAEVE,SAAS,CAAC,YAAY;IACpB,MAAMF,MAAM,CAACG,IAAI,CAAC,CAAC;EACrB,CAAC,CAAC;EAEFC,IAAI,CAAC,mCAAmC,EAAE,YAAY;IACpDJ,MAAM,GAAG,MAAMD,WAAW,CAAC,CAAC;IAE5B,MAAMM,OAAO,GAAG;MACdC,MAAM,EAAE,KAAK;MACbC,GAAG,EAAE;IACP,CAAC;IAED,MAAM;MAAEC;IAAO,CAAC,GAAG,MAAMR,MAAM,CAACS,MAAM,CAACJ,OAAO,CAAC;IAE/CK,MAAM,CAACF,MAAM,CAAC,CAACG,aAAa,CAAC;MAC3BC,OAAO,EAAE;IACX,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC;;AAEF;AACA;AACA","ignoreList":[]}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { FormStatus } from "../routes/types.js";
|
|
2
|
-
import { FileFormService } from "./file-form-service.js";
|
|
3
|
-
|
|
4
|
-
// Create the metadata which is shared for all forms
|
|
5
|
-
const now = new Date();
|
|
6
|
-
const user = {
|
|
7
|
-
id: 'user',
|
|
8
|
-
displayName: 'Username'
|
|
9
|
-
};
|
|
10
|
-
const author = {
|
|
11
|
-
createdAt: now,
|
|
12
|
-
createdBy: user,
|
|
13
|
-
updatedAt: now,
|
|
14
|
-
updatedBy: user
|
|
15
|
-
};
|
|
16
|
-
const metadata = {
|
|
17
|
-
id: '95e92559-968d-44ae-8666-2b1ad3dffd31',
|
|
18
|
-
slug: 'example-form',
|
|
19
|
-
title: 'Example form',
|
|
20
|
-
organisation: 'Defra',
|
|
21
|
-
teamName: 'Team name',
|
|
22
|
-
teamEmail: 'team@defra.gov.uk',
|
|
23
|
-
submissionGuidance: "Thanks for your submission, we'll be in touch",
|
|
24
|
-
notificationEmail: 'email@domain.com',
|
|
25
|
-
...author,
|
|
26
|
-
live: author
|
|
27
|
-
};
|
|
28
|
-
describe('File Form Service', () => {
|
|
29
|
-
it('should load JSON files from disk', async () => {
|
|
30
|
-
const loader = new FileFormService();
|
|
31
|
-
const definition = await loader.addForm('src/server/forms/test.json', metadata);
|
|
32
|
-
const formsService = loader.toFormsService();
|
|
33
|
-
expect(await formsService.getFormMetadata(metadata.slug)).toBe(metadata);
|
|
34
|
-
expect(await formsService.getFormDefinition(metadata.id, FormStatus.Draft)).toBe(definition);
|
|
35
|
-
expect(() => loader.getFormMetadata('invalid-slug')).toThrow("Form metadata 'invalid-slug' not found");
|
|
36
|
-
expect(() => loader.getFormDefinition('invalid-id')).toThrow("Form definition 'invalid-id' not found");
|
|
37
|
-
});
|
|
38
|
-
it('should load YAML files from disk', async () => {
|
|
39
|
-
const loader = new FileFormService();
|
|
40
|
-
const definition = await loader.addForm('src/server/forms/test.yaml', metadata);
|
|
41
|
-
const formsService = loader.toFormsService();
|
|
42
|
-
expect(await formsService.getFormMetadata(metadata.slug)).toBe(metadata);
|
|
43
|
-
expect(await formsService.getFormDefinition(metadata.id, FormStatus.Draft)).toBe(definition);
|
|
44
|
-
expect(() => loader.getFormMetadata('invalid-slug')).toThrow("Form metadata 'invalid-slug' not found");
|
|
45
|
-
expect(() => loader.getFormDefinition('invalid-id')).toThrow("Form definition 'invalid-id' not found");
|
|
46
|
-
});
|
|
47
|
-
it("should throw if the file isn't JSON or YAML", async () => {
|
|
48
|
-
const loader = new FileFormService();
|
|
49
|
-
await expect(loader.addForm('src/server/forms/test.txt', metadata)).rejects.toThrow("Invalid file extension '.txt'");
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=file-form-service.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-form-service.test.js","names":["FormStatus","FileFormService","now","Date","user","id","displayName","author","createdAt","createdBy","updatedAt","updatedBy","metadata","slug","title","organisation","teamName","teamEmail","submissionGuidance","notificationEmail","live","describe","it","loader","definition","addForm","formsService","toFormsService","expect","getFormMetadata","toBe","getFormDefinition","Draft","toThrow","rejects"],"sources":["../../../src/server/utils/file-form-service.test.js"],"sourcesContent":["import { FormStatus } from '~/src/server/routes/types.js'\nimport { FileFormService } from '~/src/server/utils/file-form-service.js'\n\n// Create the metadata which is shared for all forms\nconst now = new Date()\nconst user = { id: 'user', displayName: 'Username' }\nconst author = {\n createdAt: now,\n createdBy: user,\n updatedAt: now,\n updatedBy: user\n}\n\nconst metadata = {\n id: '95e92559-968d-44ae-8666-2b1ad3dffd31',\n slug: 'example-form',\n title: 'Example form',\n organisation: 'Defra',\n teamName: 'Team name',\n teamEmail: 'team@defra.gov.uk',\n submissionGuidance: \"Thanks for your submission, we'll be in touch\",\n notificationEmail: 'email@domain.com',\n ...author,\n live: author\n}\n\ndescribe('File Form Service', () => {\n it('should load JSON files from disk', async () => {\n const loader = new FileFormService()\n\n const definition = await loader.addForm(\n 'src/server/forms/test.json',\n metadata\n )\n\n const formsService = loader.toFormsService()\n expect(await formsService.getFormMetadata(metadata.slug)).toBe(metadata)\n expect(\n await formsService.getFormDefinition(metadata.id, FormStatus.Draft)\n ).toBe(definition)\n\n expect(() => loader.getFormMetadata('invalid-slug')).toThrow(\n \"Form metadata 'invalid-slug' not found\"\n )\n expect(() => loader.getFormDefinition('invalid-id')).toThrow(\n \"Form definition 'invalid-id' not found\"\n )\n })\n\n it('should load YAML files from disk', async () => {\n const loader = new FileFormService()\n\n const definition = await loader.addForm(\n 'src/server/forms/test.yaml',\n metadata\n )\n\n const formsService = loader.toFormsService()\n expect(await formsService.getFormMetadata(metadata.slug)).toBe(metadata)\n expect(\n await formsService.getFormDefinition(metadata.id, FormStatus.Draft)\n ).toBe(definition)\n\n expect(() => loader.getFormMetadata('invalid-slug')).toThrow(\n \"Form metadata 'invalid-slug' not found\"\n )\n expect(() => loader.getFormDefinition('invalid-id')).toThrow(\n \"Form definition 'invalid-id' not found\"\n )\n })\n\n it(\"should throw if the file isn't JSON or YAML\", async () => {\n const loader = new FileFormService()\n\n await expect(\n loader.addForm('src/server/forms/test.txt', metadata)\n ).rejects.toThrow(\"Invalid file extension '.txt'\")\n })\n})\n"],"mappings":"AAAA,SAASA,UAAU;AACnB,SAASC,eAAe;;AAExB;AACA,MAAMC,GAAG,GAAG,IAAIC,IAAI,CAAC,CAAC;AACtB,MAAMC,IAAI,GAAG;EAAEC,EAAE,EAAE,MAAM;EAAEC,WAAW,EAAE;AAAW,CAAC;AACpD,MAAMC,MAAM,GAAG;EACbC,SAAS,EAA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pC,MAAMuB,UAAU,GAAG,MAAMD,MAAM,CAACE,OAAO,CACrC,4BAA4B,EAC5Bb,QACF,CAAC;IAED,MAAMc,YAAY,GAAGH,MAAM,CAACI,cAAc,CAAC,CAAC;IAC5CC,MAAM,CAAC,MAAMF,YAAY,CAACG,eAAe,CAACjB,QAAQ,CAACC,IAAI,CAAC,CAAC,CAACiB,IAAI,CAAClB,QAAQ,CAAC;IACxEgB,MAAM,CACJ,MAAMF,YAAY,CAACK,iBAAiB,CAACnB,QAAQ,CAACP,EAAE,EAAEL,UAAU,CAACgC,KAAK,CACpE,CAAC,CAACF,IAAI,CAACN,UAAU,CAAC;IAElBI,MAAM,CAAC,MAAML,MAAM,CAACM,eAAe,CAAC,cAAc,CAAC,CAAC,CAACI,OAAO,CAC1D,wCACF,CAAC;IACDL,MAAM,CAAC,MAAML,MAAM,CAACQ,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAACE,OAAO,CAC1D,wCACF,CAAC;EACH,CAAC,CAAC;EAEFX,EAAE,CAAC,6CAA6C,EAAE,YAAY;IAC5D,MAAMC,MAAM,GAAG,IAAItB,eAAe,CAAC,CAAC;IAEpC,MAAM2B,MAAM,CACVL,MAAM,CAACE,OAAO,CAAC,2BAA2B,EAAEb,QAAQ,CACtD,CAAC,CAACsB,OAAO,CAACD,OAAO,CAAC,+BAA+B,CAAC;EACpD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{% extends 'layout.html' %}
|
|
2
|
-
|
|
3
|
-
{% block content %}
|
|
4
|
-
<div class="govuk-width-container">
|
|
5
|
-
<div class="govuk-main-wrapper">
|
|
6
|
-
<div class="govuk-grid-row">
|
|
7
|
-
<div class="govuk-grid-column-two-thirds">
|
|
8
|
-
<h1 class="govuk-heading-l">Page not found</h1>
|
|
9
|
-
<p class="govuk-body">If you typed the web address, check it is correct.</p>
|
|
10
|
-
<p class="govuk-body">If you pasted the web address, check you copied the entire address.</p>
|
|
11
|
-
<p class="govuk-body">If the web address is correct or you selected a link or button, <a href="https://www.gov.uk/guidance/contact-defra" class="govuk-link">contact the Defra Helpline</a> if you need to speak to someone about your form.</p>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
{% endblock %}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{% extends 'layout.html' %}
|
|
2
|
-
|
|
3
|
-
{% block content %}
|
|
4
|
-
<div class="govuk-width-container">
|
|
5
|
-
<div class="govuk-main-wrapper">
|
|
6
|
-
<div class="govuk-grid-row">
|
|
7
|
-
<div class="govuk-grid-column-two-thirds">
|
|
8
|
-
<h1 class="govuk-heading-l">Sorry, there is a problem with the service</h1>
|
|
9
|
-
<p class="govuk-body">You can:</p>
|
|
10
|
-
<ul class="govuk-list govuk-list--bullet">
|
|
11
|
-
<li>try your browser back button as your data may be saved</li>
|
|
12
|
-
<li><a class="govuk-link" href="https://www.gov.uk/guidance/contact-defra">contact the Defra Helpline</a> if you
|
|
13
|
-
have any questions</li>
|
|
14
|
-
</ul>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
{% endblock %}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{% extends 'layout.html' %}
|
|
2
|
-
|
|
3
|
-
{% set pageTitle = "Accessibility statement" %}
|
|
4
|
-
|
|
5
|
-
{% block content %}
|
|
6
|
-
<div class="govuk-grid-row">
|
|
7
|
-
<div class="govuk-grid-column-two-thirds">
|
|
8
|
-
<h1 class="govuk-heading-l">Accessibility statement for this form</h1>
|
|
9
|
-
<p class="govuk-body">This accessibility statement applies to online forms with a URL that starts with
|
|
10
|
-
https://submit-forms-to-defra.service.gov.uk.</p>
|
|
11
|
-
|
|
12
|
-
<h2 class="govuk-heading-m">Technical information about this website’s accessibility</h2>
|
|
13
|
-
<p class="govuk-body">Defra is committed to making its forms accessible, in accordance with the Public Sector Bodies
|
|
14
|
-
(Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.</p>
|
|
15
|
-
|
|
16
|
-
<h2 class="govuk-heading-m">Compliance status</h2>
|
|
17
|
-
<p class="govuk-body">Forms created by Defra are fully compliant with the Web Content Accessibility Guidelines
|
|
18
|
-
(WCAG) version 2.2 AA standard.</p>
|
|
19
|
-
|
|
20
|
-
<h2 class="govuk-heading-m">How accessible this website is</h2>
|
|
21
|
-
<p class="govuk-body">This section lists accessibility issues with content found in Defra forms.</p>
|
|
22
|
-
|
|
23
|
-
<h3 class="govuk-heading-s">Non-compliance with the accessibility regulations</h3>
|
|
24
|
-
<p class="govuk-body">Defra forms do not have accessibility issues that fail the WCAG 2.2 accessibility regulations.</p>
|
|
25
|
-
|
|
26
|
-
<h3 class="govuk-heading-s">Content that’s not within the scope of the accessibility regulations</h3>
|
|
27
|
-
<p class="govuk-body">The accessibility issues listed in this section do not fail the accessibility regulations. We
|
|
28
|
-
plan to fix them as soon as possible.</p>
|
|
29
|
-
<ul class="govuk-list govuk-list--number">
|
|
30
|
-
<li>Forms do not default to a dark or light theme based on the ‘prefers-color-scheme’.</li>
|
|
31
|
-
<li>The email field allows for the entry of values that are not formatted as an email address.</li>
|
|
32
|
-
<li>The summary screen for each form does not display the question asked. Instead, it displays a summarised version of
|
|
33
|
-
the question.</li>
|
|
34
|
-
<li>Some optional questions are not marked as optional.</li>
|
|
35
|
-
<li>Section titles in some forms are formatted as H2 level headings. These headings are shown before page titles
|
|
36
|
-
which are formatted as H1 level headings (skipped heading hierarchy).</li>
|
|
37
|
-
</ul>
|
|
38
|
-
|
|
39
|
-
<h2 class="govuk-heading-m">Preparation of this accessibility statement</h2>
|
|
40
|
-
<p class="govuk-body">This statement was prepared on 24 June 2024. It was last reviewed on 26 June 2024.</p>
|
|
41
|
-
<p class="govuk-body">The Defra Accessibility team tested 2 online forms against the WCAG 2.2 AA standard on 17 June
|
|
42
|
-
2024. The tests were done using automated testing tools.</p>
|
|
43
|
-
<p class="govuk-body">We will commission a full accessibility audit of forms created by Defra before April 2025.</p>
|
|
44
|
-
|
|
45
|
-
<h2 class="govuk-heading-m">Feedback and contact information</h2>
|
|
46
|
-
<p class="govuk-body">If you find any problems not listed on this page or think we’re not meeting accessibility
|
|
47
|
-
requirements, email the Defra Forms team on <a class="govuk-link"
|
|
48
|
-
href="mailto:defraforms@defra.gov.uk">defraforms@defra.gov.uk</a>.</p>
|
|
49
|
-
|
|
50
|
-
<h2 class="govuk-heading-m">Enforcement procedure</h2>
|
|
51
|
-
<p class="govuk-body">The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector
|
|
52
|
-
Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility
|
|
53
|
-
regulations’). If you’re not happy with how we respond to your complaint, contact the <a class="govuk-link"
|
|
54
|
-
href="https://www.equalityadvisoryservice.com/" rel="external">Equality Advisory and Support Service (EASS)</a>.
|
|
55
|
-
</p>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
{% endblock %}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
{% extends "layout.html" %}
|
|
2
|
-
|
|
3
|
-
{% from "govuk/components/radios/macro.njk" import govukRadios %}
|
|
4
|
-
{% from "govuk/components/button/macro.njk" import govukButton %}
|
|
5
|
-
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner -%}
|
|
6
|
-
|
|
7
|
-
{% set pageTitle = "Cookies" %}
|
|
8
|
-
|
|
9
|
-
{% block content %}
|
|
10
|
-
<div class="govuk-grid-row">
|
|
11
|
-
<div class="govuk-grid-column-two-thirds">
|
|
12
|
-
{% if cookieConsentUpdated %}
|
|
13
|
-
{% set notificationHtml %}
|
|
14
|
-
<p class="govuk-notification-banner__heading">
|
|
15
|
-
You’ve set your cookie preferences.
|
|
16
|
-
</p>
|
|
17
|
-
{% endset %}
|
|
18
|
-
|
|
19
|
-
{{ govukNotificationBanner({
|
|
20
|
-
type: "success",
|
|
21
|
-
html: notificationHtml
|
|
22
|
-
}) }}
|
|
23
|
-
{% endif %}
|
|
24
|
-
|
|
25
|
-
<h2 class="govuk-heading-l">Change your cookie settings</h2>
|
|
26
|
-
|
|
27
|
-
<form method="post" novalidate>
|
|
28
|
-
<input type="hidden" name="crumb" value="{{ crumb }}">
|
|
29
|
-
|
|
30
|
-
{{ govukRadios({
|
|
31
|
-
name: "cookies[analytics]",
|
|
32
|
-
fieldset: {
|
|
33
|
-
legend: {
|
|
34
|
-
text: "Do you want to accept analytics cookies?",
|
|
35
|
-
classes: "govuk-fieldset__legend--s"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
items: [
|
|
39
|
-
{
|
|
40
|
-
value: "yes",
|
|
41
|
-
text: "Yes"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
value: "no",
|
|
45
|
-
text: "No"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
value: "yes" if cookieConsent.analytics === true else "no"
|
|
49
|
-
}) }}
|
|
50
|
-
|
|
51
|
-
{{ govukButton({
|
|
52
|
-
text: "Save cookie settings"
|
|
53
|
-
}) }}
|
|
54
|
-
</form>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
{% endblock %}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
{% extends 'layout.html' %}
|
|
2
|
-
|
|
3
|
-
{% from "govuk/components/table/macro.njk" import govukTable %}
|
|
4
|
-
|
|
5
|
-
{% set pageTitle = "Cookies" %}
|
|
6
|
-
|
|
7
|
-
{% block content %}
|
|
8
|
-
<div class="govuk-grid-row">
|
|
9
|
-
<div class="govuk-grid-column-two-thirds">
|
|
10
|
-
<h1 class="govuk-heading-l">Cookies</h1>
|
|
11
|
-
<p class="govuk-body">Cookies are small files saved on your phone, tablet or computer when you visit a website.</p>
|
|
12
|
-
<p class="govuk-body">We use essential cookies to make this form work.</p>
|
|
13
|
-
|
|
14
|
-
<h2 class="govuk-heading-m">Essential cookies</h2>
|
|
15
|
-
<p class="govuk-body">Essential cookies keep your information secure. We do not need to ask your permission to use them.</p>
|
|
16
|
-
{{ govukTable({
|
|
17
|
-
firstCellIsHeader: true,
|
|
18
|
-
caption: "Essential cookies we use",
|
|
19
|
-
head: [
|
|
20
|
-
{ text: "Name" },
|
|
21
|
-
{ text: "Purpose" },
|
|
22
|
-
{ text: "Expires" }
|
|
23
|
-
],
|
|
24
|
-
rows: [
|
|
25
|
-
[
|
|
26
|
-
{ text: "cookieConsent" },
|
|
27
|
-
{ text: "Remembers your cookie preferences" },
|
|
28
|
-
{ text: "1 year" }
|
|
29
|
-
],
|
|
30
|
-
[
|
|
31
|
-
{ text: "session" },
|
|
32
|
-
{ text: "Remembers the information you enter" },
|
|
33
|
-
{ text: "When you close the browser, or after " + sessionDurationPretty }
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
{ text: "crumb" },
|
|
37
|
-
{ text: "Ensures forms can only be submitted from this website" },
|
|
38
|
-
{ text: "When you close the browser" }
|
|
39
|
-
]
|
|
40
|
-
]
|
|
41
|
-
}) }}
|
|
42
|
-
|
|
43
|
-
<h2 class="govuk-heading-m">Analytics cookies</h2>
|
|
44
|
-
<p class="govuk-body">We use Google Analytics software to understand how people use our forms. We do this to help make sure the site is meeting the needs of its users and to help us make improvements.</p>
|
|
45
|
-
{{ govukTable({
|
|
46
|
-
firstCellIsHeader: true,
|
|
47
|
-
caption: "Analytics cookies we use",
|
|
48
|
-
head: [
|
|
49
|
-
{ text: "Name" },
|
|
50
|
-
{ text: "Purpose" },
|
|
51
|
-
{ text: "Expires" }
|
|
52
|
-
],
|
|
53
|
-
rows: [
|
|
54
|
-
[
|
|
55
|
-
{ text: "_ga" },
|
|
56
|
-
{ text: "Used by Google Analytics to help us count how many people visit our forms by tracking if you’ve visited before" },
|
|
57
|
-
{ text: "2 years" }
|
|
58
|
-
],
|
|
59
|
-
[
|
|
60
|
-
{ text: "_ga_" + googleAnalyticsContainerId },
|
|
61
|
-
{ text: "Used by Google Analytics to find and track an individual session with your device" },
|
|
62
|
-
{ text: "2 years" }
|
|
63
|
-
]
|
|
64
|
-
]
|
|
65
|
-
}) }}
|
|
66
|
-
|
|
67
|
-
<h2 class="govuk-heading-m">Change your settings</h2>
|
|
68
|
-
<p class="govuk-body">You can <a class="govuk-link" href="/help/cookie-preferences/{{ slug }}">change which cookies you’re happy for us to use</a>.</p>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
{% endblock %}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{% extends "layout.html" %}
|
|
2
|
-
|
|
3
|
-
{% set pageTitle = "Get help with your form" %}
|
|
4
|
-
|
|
5
|
-
{% block content %}
|
|
6
|
-
{% if form.contact %}
|
|
7
|
-
<div class="govuk-width-container">
|
|
8
|
-
<div class="govuk-grid-row">
|
|
9
|
-
<div class="govuk-grid-column-two-thirds">
|
|
10
|
-
<h1 class="govuk-heading-l">{{ pageTitle }}</h1>
|
|
11
|
-
{% if form.contact.phone %}
|
|
12
|
-
<h2 class="govuk-heading-m">Telephone</h2>
|
|
13
|
-
<div class="app-prose-scope">
|
|
14
|
-
{{ form.contact.phone | markdown | safe }}
|
|
15
|
-
</div>
|
|
16
|
-
<p class="govuk-body"><a href="https://www.gov.uk/call-charges" class="govuk-link govuk-link--no-visited-state">Find out about call charges</a></p>
|
|
17
|
-
{% endif %}
|
|
18
|
-
|
|
19
|
-
{% if form.contact.email %}
|
|
20
|
-
<h2 class="govuk-heading-m">Email</h2>
|
|
21
|
-
<ul class="govuk-list">
|
|
22
|
-
<li><a class="govuk-link govuk-link--no-visited-state" href="mailto:{{ form.contact.email.address }}">{{ form.contact.email.address }}</a></li>
|
|
23
|
-
<li>{{ form.contact.email.responseTime }}</li>
|
|
24
|
-
</ul>
|
|
25
|
-
{% endif %}
|
|
26
|
-
|
|
27
|
-
{% if form.contact.online %}
|
|
28
|
-
<h2 class="govuk-heading-m">Online contact form</h2>
|
|
29
|
-
<ul class="govuk-list">
|
|
30
|
-
<li><a class="govuk-link govuk-link--no-visited-state" href="{{ form.contact.online.url }}">{{ form.contact.online.text }}</a></li>
|
|
31
|
-
</ul>
|
|
32
|
-
{% endif %}
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
{% endif %}
|
|
37
|
-
{% endblock %}
|