@defra/forms-engine-plugin 0.1.10 → 0.1.11
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/stylesheets/application.min.css +1 -1
- package/.public/stylesheets/application.min.css.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/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 +11 -16
- package/.server/server/index.js.map +1 -1
- package/.server/server/plugins/engine/configureEnginePlugin.js +16 -2
- package/.server/server/plugins/engine/configureEnginePlugin.js.map +1 -1
- package/.server/server/plugins/engine/plugin.js +27 -16
- 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/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 +1 -1
- package/.server/server/plugins/errorPages.js +4 -26
- package/.server/server/plugins/errorPages.js.map +1 -1
- package/.server/server/plugins/nunjucks/context.js +37 -28
- 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/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/typings/hapi/index.d.js.map +1 -1
- package/package.json +2 -1
- package/src/client/stylesheets/application.scss +10 -0
- package/src/config/index.ts +4 -17
- 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 +4 -37
- package/src/server/index.ts +13 -16
- package/src/server/plugins/engine/configureEnginePlugin.ts +19 -1
- package/src/server/plugins/engine/plugin.ts +43 -17
- 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/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 +1 -1
- package/src/server/plugins/errorPages.ts +4 -26
- package/src/server/plugins/nunjucks/context.js +41 -31
- package/src/server/plugins/nunjucks/context.test.js +24 -27
- package/src/server/plugins/nunjucks/types.js +3 -4
- package/src/server/routes/index.ts +0 -1
- package/src/typings/hapi/index.d.ts +3 -9
- 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
|
@@ -12,3 +12,13 @@
|
|
|
12
12
|
.autocomplete__option {
|
|
13
13
|
@include govuk-typography-common;
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
// An example of some user-supplied styling
|
|
17
|
+
// Not great practice but it illustrates the point
|
|
18
|
+
.govuk-header {
|
|
19
|
+
background: #008531;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.govuk-header__container {
|
|
23
|
+
border-bottom: 10px solid #003d16;
|
|
24
|
+
}
|
package/.server/config/index.js
CHANGED
|
@@ -158,11 +158,6 @@ export const config = convict({
|
|
|
158
158
|
/**
|
|
159
159
|
* API integrations
|
|
160
160
|
*/
|
|
161
|
-
managerUrl: {
|
|
162
|
-
format: String,
|
|
163
|
-
default: 'http://localhost:3001',
|
|
164
|
-
env: 'MANAGER_URL'
|
|
165
|
-
},
|
|
166
161
|
designerUrl: {
|
|
167
162
|
format: String,
|
|
168
163
|
default: 'http://localhost:3000',
|
|
@@ -222,17 +217,11 @@ export const config = convict({
|
|
|
222
217
|
default: 'staging',
|
|
223
218
|
env: 'STAGING_PREFIX'
|
|
224
219
|
},
|
|
225
|
-
|
|
226
|
-
doc: '
|
|
227
|
-
format: String,
|
|
228
|
-
default: '',
|
|
229
|
-
env: 'SERVICE_BANNER_TEXT'
|
|
230
|
-
},
|
|
231
|
-
googleAnalyticsTrackingId: {
|
|
232
|
-
doc: 'Google analytics tracking ID to be used when a user has opted in to additional cookies',
|
|
220
|
+
submissionEmailAddress: {
|
|
221
|
+
doc: 'Email address to send the form to (local devtool only)',
|
|
233
222
|
format: String,
|
|
234
223
|
default: '',
|
|
235
|
-
env: '
|
|
224
|
+
env: 'SUBMISSION_EMAIL_ADDRESS'
|
|
236
225
|
}
|
|
237
226
|
});
|
|
238
227
|
config.validate({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["resolve","convict","isProduction","process","env","NODE_ENV","isDev","isTest","oneMinute","oneHour","config","appDir","format","String","default","import","meta","dirname","publicDir","port","doc","cdpEnvironment","enforceCsrf","Boolean","isDevelopment","serviceName","serviceVersion","nullable","feedbackLink","phaseTag","sessionTimeout","Number","confirmationSessionTimeout","sessionCookiePassword","sensitive","redis","host","username","password","keyPrefix","tracing","header","notifyTemplateId","notifyAPIKey","managerUrl","designerUrl","submissionUrl","uploaderUrl","uploaderBucketName","log","enabled","level","redact","Array","safelist","stagingPrefix","serviceBannerText","googleAnalyticsTrackingId","validate","allowed"],"sources":["../../src/config/index.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport convict, { type SchemaObj } from 'convict'\nimport { type LevelWithSilent } from 'pino'\n\nimport 'dotenv/config'\n\nconst isProduction = process.env.NODE_ENV === 'production'\nconst isDev = process.env.NODE_ENV !== 'production'\nconst isTest = process.env.NODE_ENV === 'test'\n\nconst oneMinute = 1000 * 60\nconst oneHour = oneMinute * 60\n\nexport const config = convict({\n appDir: {\n format: String,\n default: resolve(import.meta.dirname, '../server')\n },\n publicDir: {\n format: String,\n default: isTest\n ? resolve(import.meta.dirname, '../../test/fixtures')\n : resolve(import.meta.dirname, '../../.public')\n },\n\n /**\n * Server\n */\n port: {\n format: 'port',\n default: 3009,\n env: 'PORT'\n },\n env: {\n doc: 'The application environment.',\n format: ['production', 'development', 'test'],\n default: 'development',\n env: 'NODE_ENV'\n },\n cdpEnvironment: {\n doc: 'The CDP environment the app is currently in, with the addition of \"local\"',\n format: [\n 'local',\n 'infra-dev',\n 'management',\n 'dev',\n 'test',\n 'perf-test',\n 'ext-test',\n 'prod'\n ],\n default: 'local',\n env: 'ENVIRONMENT'\n },\n enforceCsrf: {\n format: Boolean,\n default: isProduction,\n env: 'ENFORCE_CSRF'\n },\n\n /**\n * Helper flags\n */\n isProduction: {\n doc: 'If this application running in the production environment',\n format: Boolean,\n default: isProduction\n },\n isDevelopment: {\n doc: 'If this application running in the development environment',\n format: Boolean,\n default: isDev\n },\n isTest: {\n doc: 'If this application running in the test environment',\n format: Boolean,\n default: isTest\n },\n\n /**\n * Service\n */\n serviceName: {\n doc: 'Applications Service Name',\n format: String,\n default: 'Submit a form to Defra'\n },\n serviceVersion: {\n doc: 'The service version, this variable is injected into your docker container in CDP environments',\n format: String,\n nullable: true,\n default: '',\n env: 'SERVICE_VERSION'\n } as SchemaObj<string>,\n feedbackLink: {\n doc: 'Used in your phase banner. Can be a URL or more commonly mailto mailto:feedback@department.gov.uk',\n format: String,\n default: '',\n env: 'FEEDBACK_LINK'\n } as SchemaObj<string>,\n phaseTag: {\n format: String,\n default: 'beta', // Accepts \"alpha\" |\"beta\" | \"\"\n env: 'PHASE_TAG'\n },\n\n /**\n * Session storage\n * Redis integration is optional, but recommended for production environments.\n */\n sessionTimeout: {\n format: Number,\n default: oneHour * 24, // 1 day\n env: 'SESSION_TIMEOUT'\n },\n confirmationSessionTimeout: {\n format: Number,\n default: oneMinute * 20,\n env: 'CONFIRMATION_SESSION_TIMEOUT'\n },\n sessionCookiePassword: {\n format: String,\n default: '',\n sensitive: true,\n env: 'SESSION_COOKIE_PASSWORD'\n } as SchemaObj<string>,\n redis: {\n host: {\n doc: 'Redis cache host',\n format: String,\n default: '',\n env: 'REDIS_HOST'\n } as SchemaObj<string>,\n username: {\n doc: 'Redis cache username',\n format: String,\n default: '',\n env: 'REDIS_USERNAME'\n } as SchemaObj<string>,\n password: {\n doc: 'Redis cache password',\n format: '*',\n default: '',\n sensitive: true,\n env: 'REDIS_PASSWORD'\n } as SchemaObj<string>,\n keyPrefix: {\n doc: 'Redis cache key prefix name used to isolate the cached results across multiple clients',\n format: String,\n default: '',\n env: 'REDIS_KEY_PREFIX'\n } as SchemaObj<string>\n },\n tracing: {\n header: {\n doc: 'Tracing header name',\n format: String,\n default: 'x-cdp-request-id',\n env: 'TRACING_HEADER'\n } as SchemaObj<string>\n },\n\n /**\n * Email outputs\n * Email outputs will use notify to send an email to a single inbox.\n */\n notifyTemplateId: {\n format: String,\n default: '',\n env: 'NOTIFY_TEMPLATE_ID'\n } as SchemaObj<string>,\n notifyAPIKey: {\n format: String,\n default: '',\n env: 'NOTIFY_API_KEY'\n } as SchemaObj<string>,\n\n /**\n * API integrations\n */\n managerUrl: {\n format: String,\n default: 'http://localhost:3001',\n env: 'MANAGER_URL'\n } as SchemaObj<string>,\n\n designerUrl: {\n format: String,\n default: 'http://localhost:3000',\n env: 'DESIGNER_URL'\n } as SchemaObj<string>,\n\n submissionUrl: {\n format: String,\n default: 'http://localhost:3002',\n env: 'SUBMISSION_URL'\n } as SchemaObj<string>,\n\n uploaderUrl: {\n format: String,\n default: 'http://localhost:7337',\n env: 'UPLOADER_URL'\n } as SchemaObj<string>,\n\n uploaderBucketName: {\n format: String,\n default: 'files',\n env: 'UPLOADER_BUCKET_NAME'\n },\n\n /**\n * Logging\n */\n log: {\n enabled: {\n doc: 'Is logging enabled',\n format: Boolean,\n default: !isTest,\n env: 'LOG_ENABLED'\n },\n level: {\n doc: 'Logging level',\n format: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],\n default: 'info',\n env: 'LOG_LEVEL'\n } as SchemaObj<LevelWithSilent>,\n format: {\n doc: 'Format to output logs in.',\n format: ['ecs', 'pino-pretty'],\n default: isProduction ? 'ecs' : 'pino-pretty',\n env: 'LOG_FORMAT'\n } as SchemaObj<'ecs' | 'pino-pretty'>,\n redact: {\n doc: 'Log paths to redact',\n format: Array,\n default: isProduction\n ? ['req.headers.authorization', 'req.headers.cookie', 'res.headers']\n : ['req', 'res', 'responseTime']\n }\n },\n\n safelist: {\n format: Array,\n default: ['61bca17e-fe74-40e0-9c15-a901ad120eca.mock.pstmn.io'],\n env: 'SAFELIST'\n },\n\n stagingPrefix: {\n doc: 'Prefix for staging files in S3',\n format: String,\n default: 'staging',\n env: 'STAGING_PREFIX'\n },\n\n serviceBannerText: {\n doc: 'Service banner text used to show a maintenance message on all pages when set',\n format: String,\n default: '',\n env: 'SERVICE_BANNER_TEXT'\n },\n\n googleAnalyticsTrackingId: {\n doc: 'Google analytics tracking ID to be used when a user has opted in to additional cookies',\n format: String,\n default: '',\n env: 'GOOGLE_ANALYTICS_TRACKING_ID'\n }\n})\n\nconfig.validate({ allowed: 'strict' })\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,WA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AC;EAEDmD,aAAa,EAAE;IACbnC,GAAG,EAAE,gCAAgC;IACrCR,MAAM,EAAEC,MAAM;IACdC,OAAO,EAAE,SAAS;IAClBV,GAAG,EAAE;EACP,CAAC;EAEDoD,iBAAiB,EAAE;IACjBpC,GAAG,EAAE,8EAA8E;IACnFR,MAAM,EAAEC,MAAM;IACdC,OAAO,EAAE,EAAE;IACXV,GAAG,EAAE;EACP,CAAC;EAEDqD,yBAAyB,EAAE;IACzBrC,GAAG,EAAE,wFAAwF;IAC7FR,MAAM,EAAEC,MAAM;IACdC,OAAO,EAAE,EAAE;IACXV,GAAG,EAAE;EACP;AACF,CAAC,CAAC;AAEFM,MAAM,CAACgD,QAAQ,CAAC;EAAEC,OAAO,EAAE;AAAS,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["resolve","convict","isProduction","process","env","NODE_ENV","isDev","isTest","oneMinute","oneHour","config","appDir","format","String","default","import","meta","dirname","publicDir","port","doc","cdpEnvironment","enforceCsrf","Boolean","isDevelopment","serviceName","serviceVersion","nullable","feedbackLink","phaseTag","sessionTimeout","Number","confirmationSessionTimeout","sessionCookiePassword","sensitive","redis","host","username","password","keyPrefix","tracing","header","notifyTemplateId","notifyAPIKey","designerUrl","submissionUrl","uploaderUrl","uploaderBucketName","log","enabled","level","redact","Array","safelist","stagingPrefix","submissionEmailAddress","validate","allowed"],"sources":["../../src/config/index.ts"],"sourcesContent":["import { resolve } from 'node:path'\n\nimport convict, { type SchemaObj } from 'convict'\nimport { type LevelWithSilent } from 'pino'\n\nimport 'dotenv/config'\n\nconst isProduction = process.env.NODE_ENV === 'production'\nconst isDev = process.env.NODE_ENV !== 'production'\nconst isTest = process.env.NODE_ENV === 'test'\n\nconst oneMinute = 1000 * 60\nconst oneHour = oneMinute * 60\n\nexport const config = convict({\n appDir: {\n format: String,\n default: resolve(import.meta.dirname, '../server')\n },\n publicDir: {\n format: String,\n default: isTest\n ? resolve(import.meta.dirname, '../../test/fixtures')\n : resolve(import.meta.dirname, '../../.public')\n },\n\n /**\n * Server\n */\n port: {\n format: 'port',\n default: 3009,\n env: 'PORT'\n },\n env: {\n doc: 'The application environment.',\n format: ['production', 'development', 'test'],\n default: 'development',\n env: 'NODE_ENV'\n },\n cdpEnvironment: {\n doc: 'The CDP environment the app is currently in, with the addition of \"local\"',\n format: [\n 'local',\n 'infra-dev',\n 'management',\n 'dev',\n 'test',\n 'perf-test',\n 'ext-test',\n 'prod'\n ],\n default: 'local',\n env: 'ENVIRONMENT'\n },\n enforceCsrf: {\n format: Boolean,\n default: isProduction,\n env: 'ENFORCE_CSRF'\n },\n\n /**\n * Helper flags\n */\n isProduction: {\n doc: 'If this application running in the production environment',\n format: Boolean,\n default: isProduction\n },\n isDevelopment: {\n doc: 'If this application running in the development environment',\n format: Boolean,\n default: isDev\n },\n isTest: {\n doc: 'If this application running in the test environment',\n format: Boolean,\n default: isTest\n },\n\n /**\n * Service\n */\n serviceName: {\n doc: 'Applications Service Name',\n format: String,\n default: 'Submit a form to Defra'\n },\n serviceVersion: {\n doc: 'The service version, this variable is injected into your docker container in CDP environments',\n format: String,\n nullable: true,\n default: '',\n env: 'SERVICE_VERSION'\n } as SchemaObj<string>,\n feedbackLink: {\n doc: 'Used in your phase banner. Can be a URL or more commonly mailto mailto:feedback@department.gov.uk',\n format: String,\n default: '',\n env: 'FEEDBACK_LINK'\n } as SchemaObj<string>,\n phaseTag: {\n format: String,\n default: 'beta', // Accepts \"alpha\" |\"beta\" | \"\"\n env: 'PHASE_TAG'\n },\n\n /**\n * Session storage\n * Redis integration is optional, but recommended for production environments.\n */\n sessionTimeout: {\n format: Number,\n default: oneHour * 24, // 1 day\n env: 'SESSION_TIMEOUT'\n },\n confirmationSessionTimeout: {\n format: Number,\n default: oneMinute * 20,\n env: 'CONFIRMATION_SESSION_TIMEOUT'\n },\n sessionCookiePassword: {\n format: String,\n default: '',\n sensitive: true,\n env: 'SESSION_COOKIE_PASSWORD'\n } as SchemaObj<string>,\n redis: {\n host: {\n doc: 'Redis cache host',\n format: String,\n default: '',\n env: 'REDIS_HOST'\n } as SchemaObj<string>,\n username: {\n doc: 'Redis cache username',\n format: String,\n default: '',\n env: 'REDIS_USERNAME'\n } as SchemaObj<string>,\n password: {\n doc: 'Redis cache password',\n format: '*',\n default: '',\n sensitive: true,\n env: 'REDIS_PASSWORD'\n } as SchemaObj<string>,\n keyPrefix: {\n doc: 'Redis cache key prefix name used to isolate the cached results across multiple clients',\n format: String,\n default: '',\n env: 'REDIS_KEY_PREFIX'\n } as SchemaObj<string>\n },\n tracing: {\n header: {\n doc: 'Tracing header name',\n format: String,\n default: 'x-cdp-request-id',\n env: 'TRACING_HEADER'\n } as SchemaObj<string>\n },\n\n /**\n * Email outputs\n * Email outputs will use notify to send an email to a single inbox.\n */\n notifyTemplateId: {\n format: String,\n default: '',\n env: 'NOTIFY_TEMPLATE_ID'\n } as SchemaObj<string>,\n notifyAPIKey: {\n format: String,\n default: '',\n env: 'NOTIFY_API_KEY'\n } as SchemaObj<string>,\n\n /**\n * API integrations\n */\n designerUrl: {\n format: String,\n default: 'http://localhost:3000',\n env: 'DESIGNER_URL'\n } as SchemaObj<string>,\n\n submissionUrl: {\n format: String,\n default: 'http://localhost:3002',\n env: 'SUBMISSION_URL'\n } as SchemaObj<string>,\n\n uploaderUrl: {\n format: String,\n default: 'http://localhost:7337',\n env: 'UPLOADER_URL'\n } as SchemaObj<string>,\n\n uploaderBucketName: {\n format: String,\n default: 'files',\n env: 'UPLOADER_BUCKET_NAME'\n },\n\n /**\n * Logging\n */\n log: {\n enabled: {\n doc: 'Is logging enabled',\n format: Boolean,\n default: !isTest,\n env: 'LOG_ENABLED'\n },\n level: {\n doc: 'Logging level',\n format: ['fatal', 'error', 'warn', 'info', 'debug', 'trace', 'silent'],\n default: 'info',\n env: 'LOG_LEVEL'\n } as SchemaObj<LevelWithSilent>,\n format: {\n doc: 'Format to output logs in.',\n format: ['ecs', 'pino-pretty'],\n default: isProduction ? 'ecs' : 'pino-pretty',\n env: 'LOG_FORMAT'\n } as SchemaObj<'ecs' | 'pino-pretty'>,\n redact: {\n doc: 'Log paths to redact',\n format: Array,\n default: isProduction\n ? ['req.headers.authorization', 'req.headers.cookie', 'res.headers']\n : ['req', 'res', 'responseTime']\n }\n },\n\n safelist: {\n format: Array,\n default: ['61bca17e-fe74-40e0-9c15-a901ad120eca.mock.pstmn.io'],\n env: 'SAFELIST'\n },\n\n stagingPrefix: {\n doc: 'Prefix for staging files in S3',\n format: String,\n default: 'staging',\n env: 'STAGING_PREFIX'\n },\n\n submissionEmailAddress: {\n doc: 'Email address to send the form to (local devtool only)',\n format: String,\n default: '',\n env: 'SUBMISSION_EMAIL_ADDRESS'\n } as SchemaObj<string>\n})\n\nconfig.validate({ allowed: 'strict' })\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,WAAW;AAEnC,OAAOC,OAAO,MAA0B,SAAS;AAGjD,OAAO,eAAe;AAEtB,MAAMC,YAAY,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY;AAC1D,MAAMC,KAAK,GAAGH,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY;AACnD,MAAME,MAAM,GAAGJ,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM;AAE9C,MAAMG,SAAS,GAAG,IAAI,GAAG,EAAE;AAC3B,MAAMC,OAAO,GAAGD,SAAS,GAAG,EAAE;AAE9B,OAAO,MAAME,MAAM,GAAGT,OAAO,CAAC;EAC5BU,MAAM,EAAE;IACNC,MAAM,EAAEC,MAAM;IACdC,OAAO,EAAEd,OAAO,CAACe,MAAM,CAACC,IAAI,CAACC,OAAO,EAAE,WAAW;EACnD,CAAC;EACDC,SAAS,EAAE;IACTN,MAAM,EAAEC,MAAM;IACdC,OAAO,EAAEP,MAAM,GACXP,OAAO,CAACe,MAAM,CAACC,IAAI,CAACC,OAAO,EAAE,qBAAqB,CAAC,GACnDjB,OAAO,CAACe,MAAM,CAAC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,CAAC;MAC9BE,OAAO,EAAEZ,YAAY,GAAG,KAAK,GAAG,aAAa;MAC7CE,GAAG,EAAE;IACP,CAAqC;IACrC+C,MAAM,EAAE;MACN/B,GAAG,EAAE,qBAAqB;MAC1BR,MAAM,EAAEwC,KAAK;MACbtC,OAAO,EAAEZ,YAAY,GACjB,CAAC,2BAA2B,EAAE,oBAAoB,EAAE,aAAa,CAAC,GAClE,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc;IACnC;EACF,CAAC;EAEDmD,QAAQ,EAAE;IACRzC,MAAM,EAAEwC,KAAK;IACbtC,OAAO,EAAE,CAAC,oDAAoD,CAAC;IAC/DV,GAAG,EAAE;EACP,CAAC;EAEDkD,aAAa,EAAE;IACblC,GAAG,EAAE,gCAAgC;IACrCR,MAAM,EAAEC,MAAM;IACdC,OAAO,EAAE,SAAS;IAClBV,GAAG,EAAE;EACP,CAAC;EAEDmD,sBAAsB,EAAE;IACtBnC,GAAG,EAAE,wDAAwD;IAC7DR,MAAM,EAAEC,MAAM;IACdC,OAAO,EAAE,EAAE;IACXV,GAAG,EAAE;EACP;AACF,CAAC,CAAC;AAEFM,MAAM,CAAC8C,QAAQ,CAAC;EAAEC,OAAO,EAAE;AAAS,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{% extends "govuk/template.njk" %}
|
|
2
|
+
|
|
3
|
+
{% from "govuk/components/back-link/macro.njk" import govukBackLink -%}
|
|
4
|
+
{% from "govuk/components/footer/macro.njk" import govukFooter -%}
|
|
5
|
+
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner -%}
|
|
6
|
+
{% from "govuk/components/skip-link/macro.njk" import govukSkipLink -%}
|
|
7
|
+
{% from "govuk/macros/attributes.njk" import govukAttributes -%}
|
|
8
|
+
{% from "components/service-banner/macro.njk" import appServiceBanner -%}
|
|
9
|
+
{% from "components/tag-env/macro.njk" import appTagEnv -%}
|
|
10
|
+
{% from "govuk/components/cookie-banner/macro.njk" import govukCookieBanner -%}
|
|
11
|
+
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner -%}
|
|
12
|
+
|
|
13
|
+
{% set productName %}
|
|
14
|
+
{{ appTagEnv({ env: "devtool" }) }}
|
|
15
|
+
{% endset %}
|
|
16
|
+
|
|
17
|
+
{% block head %}
|
|
18
|
+
<link rel="preload" as="font" href="{{ assetPath }}/fonts/bold-b542beb274-v2.woff2" type="font/woff2" crossorigin="anonymous">
|
|
19
|
+
<link rel="preload" as="font" href="{{ assetPath }}/fonts/light-94a07e06a1-v2.woff2" type="font/woff2" crossorigin="anonymous">
|
|
20
|
+
<link rel="stylesheet" href="{{ getDxtAssetPath("stylesheets/application.scss") }}">
|
|
21
|
+
{% endblock %}
|
|
22
|
+
|
|
23
|
+
{% block pageTitle -%}
|
|
24
|
+
{{ "Error: " if errors | length }}{{ pageTitle | evaluate }} - {{ name if name else config.serviceName }} - GOV.UK
|
|
25
|
+
{%- endblock %}
|
|
26
|
+
|
|
27
|
+
{% block skipLink %}
|
|
28
|
+
{{ govukSkipLink({
|
|
29
|
+
href: '#main-content',
|
|
30
|
+
text: 'Skip to main content'
|
|
31
|
+
}) }}
|
|
32
|
+
{% endblock %}
|
|
33
|
+
|
|
34
|
+
{% block header %}
|
|
35
|
+
{{ govukHeader({
|
|
36
|
+
homepageUrl: currentPath if context.isForceAccess else "https://defra.github.io/forms-engine-plugin/",
|
|
37
|
+
containerClasses: "govuk-width-container",
|
|
38
|
+
productName: productName | safe | trim,
|
|
39
|
+
serviceName: "Digital Express Toolkit",
|
|
40
|
+
serviceUrl: currentPath if context.isForceAccess else serviceUrl
|
|
41
|
+
}) }}
|
|
42
|
+
{% endblock %}
|
|
43
|
+
|
|
44
|
+
{% block beforeContent %}
|
|
45
|
+
{% if backLink %}
|
|
46
|
+
{{ govukBackLink(backLink) }}
|
|
47
|
+
{% endif %}
|
|
48
|
+
{% endblock %}
|
|
49
|
+
|
|
50
|
+
{% block content %}
|
|
51
|
+
<h1 class="govuk-heading-l">Default page template</h1>
|
|
52
|
+
{% endblock %}
|
|
53
|
+
|
|
54
|
+
{% block bodyEnd %}
|
|
55
|
+
<script type="module" nonce="{{ cspNonce }}" src="{{ getDxtAssetPath("application.js") }}"></script>
|
|
56
|
+
{% endblock %}
|
|
57
|
+
|
|
58
|
+
{% block footer %}
|
|
59
|
+
{% set meta = {
|
|
60
|
+
items: [
|
|
61
|
+
{
|
|
62
|
+
href: 'https://defra.github.io/forms-engine-plugin/',
|
|
63
|
+
text: 'DXT documentation'
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
} if slug %}
|
|
67
|
+
|
|
68
|
+
{% if not context.isForceAccess %}
|
|
69
|
+
{{ govukFooter({ meta: meta }) }}
|
|
70
|
+
{% endif %}
|
|
71
|
+
{% endblock %}
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Register as a unicorn breeder",
|
|
3
|
+
"pages": [
|
|
4
|
+
{
|
|
5
|
+
"path": "/whats-your-name",
|
|
6
|
+
"title": "What's your name?",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"type": "TextField",
|
|
10
|
+
"name": "textField",
|
|
11
|
+
"title": "Name",
|
|
12
|
+
"hint": "This is a single line text box. We use it to ask for information that's likely to be 1 sentence",
|
|
13
|
+
"options": {
|
|
14
|
+
"required": true
|
|
15
|
+
},
|
|
16
|
+
"schema": {}
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"next": [
|
|
20
|
+
{
|
|
21
|
+
"path": "/whats-your-email-address"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"section": "section"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"title": "Summary",
|
|
28
|
+
"path": "/summary",
|
|
29
|
+
"controller": "./pages/summary.js",
|
|
30
|
+
"components": [],
|
|
31
|
+
"next": []
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "/whats-your-email-address",
|
|
35
|
+
"title": "What's your email address?",
|
|
36
|
+
"components": [
|
|
37
|
+
{
|
|
38
|
+
"name": "MaTzaT",
|
|
39
|
+
"options": {
|
|
40
|
+
"required": true
|
|
41
|
+
},
|
|
42
|
+
"type": "EmailAddressField",
|
|
43
|
+
"title": "Email adress",
|
|
44
|
+
"schema": {},
|
|
45
|
+
"hint": "This is an email address. An email address must contain an at sign @"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"next": [
|
|
49
|
+
{
|
|
50
|
+
"path": "/whats-your-phone-number"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"section": "section"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"path": "/whats-your-phone-number",
|
|
57
|
+
"title": "What's your phone number?",
|
|
58
|
+
"components": [
|
|
59
|
+
{
|
|
60
|
+
"name": "BdKgCe",
|
|
61
|
+
"options": {
|
|
62
|
+
"required": true
|
|
63
|
+
},
|
|
64
|
+
"type": "TelephoneNumberField",
|
|
65
|
+
"title": "Phone number",
|
|
66
|
+
"schema": {},
|
|
67
|
+
"hint": "This is a telephone number. This field can only contain numbers and the + symbol"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"next": [
|
|
71
|
+
{
|
|
72
|
+
"path": "/whats-your-address"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"section": "section"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"path": "/whats-your-address",
|
|
79
|
+
"title": "What's your address?",
|
|
80
|
+
"components": [
|
|
81
|
+
{
|
|
82
|
+
"name": "wZLWPy",
|
|
83
|
+
"options": {
|
|
84
|
+
"required": true
|
|
85
|
+
},
|
|
86
|
+
"type": "UkAddressField",
|
|
87
|
+
"title": "Address",
|
|
88
|
+
"schema": {},
|
|
89
|
+
"hint": "This is a UK address. Users must enter address line 1, town and a postcode"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"next": [
|
|
93
|
+
{
|
|
94
|
+
"path": "/do-you-want-your-unicorn-breeder-certificate-sent-to-this-address"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"section": "section"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"path": "/do-you-want-your-unicorn-breeder-certificate-sent-to-this-address",
|
|
101
|
+
"title": "Do you want your unicorn breeder certificate sent to this address?",
|
|
102
|
+
"components": [
|
|
103
|
+
{
|
|
104
|
+
"name": "dBfuID",
|
|
105
|
+
"options": {},
|
|
106
|
+
"type": "YesNoField",
|
|
107
|
+
"title": "Send certificate to same address",
|
|
108
|
+
"schema": {},
|
|
109
|
+
"hint": "This is a yes or no question. We can branch to different questions based on the answer",
|
|
110
|
+
"values": {
|
|
111
|
+
"type": "listRef"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"next": [
|
|
116
|
+
{
|
|
117
|
+
"path": "/what-address-do-you-want-the-certificate-sent-to",
|
|
118
|
+
"condition": "oyGPwP"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"path": "/when-does-your-unicorn-insurance-policy-start",
|
|
122
|
+
"condition": ""
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"section": "section"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"path": "/what-address-do-you-want-the-certificate-sent-to",
|
|
129
|
+
"title": "What address do you want the certificate sent to?",
|
|
130
|
+
"components": [
|
|
131
|
+
{
|
|
132
|
+
"name": "AegFro",
|
|
133
|
+
"options": {},
|
|
134
|
+
"type": "UkAddressField",
|
|
135
|
+
"title": "Address to send certificate",
|
|
136
|
+
"schema": {},
|
|
137
|
+
"hint": "This is a simple branch to an extra question - it's shown to users who select 'no' when asked if this is the address where the certificate should be sent"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"next": [
|
|
141
|
+
{
|
|
142
|
+
"path": "/when-does-your-unicorn-insurance-policy-start"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"section": "section"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"title": "When does your unicorn insurance policy start?",
|
|
149
|
+
"path": "/when-does-your-unicorn-insurance-policy-start",
|
|
150
|
+
"section": "Regnsa",
|
|
151
|
+
"next": [
|
|
152
|
+
{
|
|
153
|
+
"path": "/upload-your-insurance-certificate"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"components": [
|
|
157
|
+
{
|
|
158
|
+
"name": "mjAccr",
|
|
159
|
+
"options": {},
|
|
160
|
+
"type": "DatePartsField",
|
|
161
|
+
"title": "Unicorn insurance policy start date",
|
|
162
|
+
"schema": {},
|
|
163
|
+
"hint": "This is a date. We can add custom validation to the field based on your requirements. For example, the date entered must be before or after a certain date"
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"title": "How many unicorns do you expect to breed each year?",
|
|
169
|
+
"path": "/how-many-unicorns-do-you-expect-to-breed-each-year",
|
|
170
|
+
"section": "susaYr",
|
|
171
|
+
"next": [
|
|
172
|
+
{
|
|
173
|
+
"path": "/what-type-of-unicorns-will-you-breed"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"components": [
|
|
177
|
+
{
|
|
178
|
+
"name": "aitzzV",
|
|
179
|
+
"options": {},
|
|
180
|
+
"type": "RadiosField",
|
|
181
|
+
"list": "IeFOkf",
|
|
182
|
+
"title": "Number of unicorns",
|
|
183
|
+
"schema": {},
|
|
184
|
+
"hint": "This is a radio button. Users can only select one option from the list",
|
|
185
|
+
"values": {
|
|
186
|
+
"type": "listRef"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"title": "What type of unicorns will you breed?",
|
|
193
|
+
"path": "/what-type-of-unicorns-will-you-breed",
|
|
194
|
+
"section": "susaYr",
|
|
195
|
+
"next": [
|
|
196
|
+
{
|
|
197
|
+
"path": "/where-will-you-keep-the-unicorns"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"components": [
|
|
201
|
+
{
|
|
202
|
+
"name": "DyfjJC",
|
|
203
|
+
"options": {},
|
|
204
|
+
"type": "CheckboxesField",
|
|
205
|
+
"list": "fXiZrL",
|
|
206
|
+
"title": "Type of unicorn",
|
|
207
|
+
"schema": {},
|
|
208
|
+
"hint": "This is a check box. Users can select more than one option",
|
|
209
|
+
"values": {
|
|
210
|
+
"type": "listRef"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"title": "Where will you keep the unicorns?",
|
|
217
|
+
"path": "/where-will-you-keep-the-unicorns",
|
|
218
|
+
"section": "susaYr",
|
|
219
|
+
"next": [
|
|
220
|
+
{
|
|
221
|
+
"path": "/how-many-members-of-staff-will-look-after-the-unicorns"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"components": [
|
|
225
|
+
{
|
|
226
|
+
"name": "bClCvo",
|
|
227
|
+
"options": {},
|
|
228
|
+
"schema": {},
|
|
229
|
+
"type": "MultilineTextField",
|
|
230
|
+
"title": "Where you keep the unicorn",
|
|
231
|
+
"hint": "This is a multi-line text box. We use it when you expect the response to be more than 1 sentence long"
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"title": "How many members of staff will look after the unicorns?",
|
|
237
|
+
"path": "/how-many-members-of-staff-will-look-after-the-unicorns",
|
|
238
|
+
"section": "susaYr",
|
|
239
|
+
"next": [
|
|
240
|
+
{
|
|
241
|
+
"path": "/summary"
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
"components": [
|
|
245
|
+
{
|
|
246
|
+
"name": "zhJMaM",
|
|
247
|
+
"options": {
|
|
248
|
+
"classes": "govuk-!-width-one-quarter"
|
|
249
|
+
},
|
|
250
|
+
"type": "NumberField",
|
|
251
|
+
"title": "Number of staff",
|
|
252
|
+
"schema": {},
|
|
253
|
+
"hint": "This is a number field. The answer must be a number. We can use custom validation to set decimal places, minimum and maximum values"
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"title": "Upload your insurance certificate",
|
|
259
|
+
"path": "/upload-your-insurance-certificate",
|
|
260
|
+
"controller": "FileUploadPageController",
|
|
261
|
+
"section": "Regnsa",
|
|
262
|
+
"next": [
|
|
263
|
+
{
|
|
264
|
+
"path": "/how-many-unicorns-do-you-expect-to-breed-each-year"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"components": [
|
|
268
|
+
{
|
|
269
|
+
"name": "dLzALM",
|
|
270
|
+
"title": "Documents",
|
|
271
|
+
"type": "FileUploadField",
|
|
272
|
+
"hint": "We can specify the format and number of uploaded files",
|
|
273
|
+
"options": {
|
|
274
|
+
"required": false
|
|
275
|
+
},
|
|
276
|
+
"schema": {
|
|
277
|
+
"min": 1,
|
|
278
|
+
"max": 3
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"conditions": [
|
|
285
|
+
{
|
|
286
|
+
"displayName": "Address is different",
|
|
287
|
+
"name": "IrVmYz",
|
|
288
|
+
"value": {
|
|
289
|
+
"name": "Address is different",
|
|
290
|
+
"conditions": [
|
|
291
|
+
{
|
|
292
|
+
"field": {
|
|
293
|
+
"name": "dBfuID",
|
|
294
|
+
"type": "YesNoField",
|
|
295
|
+
"display": "Contact details: Send certificate to same address"
|
|
296
|
+
},
|
|
297
|
+
"operator": "is",
|
|
298
|
+
"value": {
|
|
299
|
+
"type": "Value",
|
|
300
|
+
"value": "false",
|
|
301
|
+
"display": "false"
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"displayName": "Address is not the same",
|
|
309
|
+
"name": "oyGPwP",
|
|
310
|
+
"value": {
|
|
311
|
+
"name": "Address is not the same",
|
|
312
|
+
"conditions": [
|
|
313
|
+
{
|
|
314
|
+
"field": {
|
|
315
|
+
"name": "dBfuID",
|
|
316
|
+
"type": "YesNoField",
|
|
317
|
+
"display": "Contact details: Send certificate to same address"
|
|
318
|
+
},
|
|
319
|
+
"operator": "is",
|
|
320
|
+
"value": {
|
|
321
|
+
"type": "Value",
|
|
322
|
+
"value": "false",
|
|
323
|
+
"display": "No"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"sections": [
|
|
331
|
+
{
|
|
332
|
+
"name": "section",
|
|
333
|
+
"title": "Contact details",
|
|
334
|
+
"hideTitle": false
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"title": "Unicorn details",
|
|
338
|
+
"name": "susaYr",
|
|
339
|
+
"hideTitle": false
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"title": "Insurance details",
|
|
343
|
+
"name": "Regnsa",
|
|
344
|
+
"hideTitle": false
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"lists": [
|
|
348
|
+
{
|
|
349
|
+
"title": "number of unicorns",
|
|
350
|
+
"name": "IeFOkf",
|
|
351
|
+
"type": "string",
|
|
352
|
+
"items": [
|
|
353
|
+
{
|
|
354
|
+
"text": "1 to 5",
|
|
355
|
+
"value": "1 to 5"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"text": "6 to 10",
|
|
359
|
+
"value": "6 to 10"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"text": "11 or more",
|
|
363
|
+
"value": "11 or more"
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"title": "Type of unicorn",
|
|
369
|
+
"name": "fXiZrL",
|
|
370
|
+
"type": "string",
|
|
371
|
+
"items": [
|
|
372
|
+
{
|
|
373
|
+
"text": "Flying",
|
|
374
|
+
"value": "Flying"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"text": "Fire breathing",
|
|
378
|
+
"value": "Fire breathing"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"text": "Aquatic",
|
|
382
|
+
"value": "Aquatic"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"text": "Rainbow",
|
|
386
|
+
"value": "Rainbow"
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
}
|
|
390
|
+
],
|
|
391
|
+
"outputEmail": "defraforms@defra.gov.uk",
|
|
392
|
+
"startPage": "/whats-your-name"
|
|
393
|
+
}
|