From 7c3e26d34a63db1c9308e2c9cc35f9a2d0fe142d Mon Sep 17 00:00:00 2001 From: Alex Luckett Date: Tue, 1 Apr 2025 15:36:12 +0100 Subject: [PATCH 1/4] Add link to live demo --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aacfadc5d..74e508cd5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,9 @@ It is designed to be embedded in the frontend of a digital service and provide a ## Demo of DXT -TODO: Link to CDP exemplar +If you are within the Defra network, [see a live demo](https://forms-engine-plugin-example-ui.dev.cdp-int.defra.cloud/example-form). + +If you aren't within the Defra network, [see our example UI and run it locally](https://github.com/DEFRA/forms-engine-plugin-example-ui). ## Installation From d44313d0aebcb85a93d3243fb217fba525092c78 Mon Sep 17 00:00:00 2001 From: Alex Luckett Date: Tue, 1 Apr 2025 15:36:34 +0100 Subject: [PATCH 2/4] Add static assets and env vars --- docs/GETTING_STARTED.md | 45 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index 4df24b681..4db2b842f 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -102,11 +102,48 @@ await server.start() ## Step 3: Handling static assets -TODO +1. [Update webpack to bundle the DXT application assets (CSS, JavaScript, etc)](https://github.com/DEFRA/forms-engine-plugin-example-ui/pull/1/files#diff-1fb26bc12ac780c7ad7325730ed09fc4c2c3d757c276c3dacc44bfe20faf166f) +2. [Serve the newly bundled assets from your web server](https://github.com/DEFRA/forms-engine-plugin-example-ui/pull/1/files#diff-e5b183306056f90c7f606b526dbc0d0b7e17bccd703945703a0811b6e6bb3503) + +DXT plans to prefix to these asset paths to prevent collisions with your assets. Contact [#defra-forms-support](https://defra-digital-team.slack.com) if this is a blocker for you. ## Step 4: Environment variables -TODO +Blocks marked with `# FEATURE: ` are optional and can be omitted if the feature is not used. + +```shell +# Feedback link shown in the phase banner. Supports `mailto:` links. +FEEDBACK_LINK=http://test.com + +# Session configuration +SESSION_COOKIE_PASSWORD="a-random-value-longer-a-minimum-of-32-characters" +SESSION_TIMEOUT=604800000 + +# Redis configuration +REDIS_PASSWORD=my-password +REDIS_USERNAME=default +REDIS_HOST=localhost +REDIS_KEY_PREFIX=forms-runner + +# START FEATURE: DXT -- used if using DXT's infrastructure to store your forms and file uploads +MANAGER_URL=http://localhost:3001 +DESIGNER_URL=http://localhost:3000 +SUBMISSION_URL=http://localhost:3002 + +# S3 bucket and URL of the CDP uploader. Bucket is owned by DXT, uploader is your service's URL. +UPLOADER_BUCKET_NAME=my-bucket +UPLOADER_URL=http://localhost:7337 +# END FEATURE: DXT + +# START FEATURE: GOV.UK Notify -- used if using DXT's default GOV.UK Notify email sender +NOTIFY_TEMPLATE_ID="your-gov-notify-api-key" +NOTIFY_API_KEY="your-gov-notify-api-key" +# END FEATURE: GOV.UK Notify + +# START FEATURE: Google Analytics -- if enabled, shows a cookie banner and includes GA on the cookies/privacy policy +GOOGLE_ANALYTICS_TRACKING_ID='12345' +# END FEATURE: Google Analytics +``` ## Step 5: Creating and loading a form @@ -122,6 +159,6 @@ These files are called `Form definitions` and are built up of: The [types](https://github.com/DEFRA/forms-designer/blob/main/model/src/form/form-definition/types.ts), `joi` [schema](https://github.com/DEFRA/forms-designer/blob/main/model/src/form/form-definition/index.ts) and the [examples](test/form/definitions) folder are a good place to learn about the structure of these files. -TODO - Link to wiki for `Form metadata` +TODO - Link to documentation for `Form metadata` -TODO - Link to wiki for `Form definition` +TODO - Link to documentation for `Form definition` From c449f6b6bb7bb06611e0e8af84ecee36ea7b089a Mon Sep 17 00:00:00 2001 From: Alex Luckett Date: Wed, 9 Apr 2025 11:45:10 +0100 Subject: [PATCH 3/4] Clean up env vars --- docs/GETTING_STARTED.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index 4db2b842f..4e2c30e9d 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -112,18 +112,9 @@ DXT plans to prefix to these asset paths to prevent collisions with your assets. Blocks marked with `# FEATURE: ` are optional and can be omitted if the feature is not used. ```shell -# Feedback link shown in the phase banner. Supports `mailto:` links. +# START FEATURE: Phase banner -- supports `https://` and `mailto:` links in the feedback link FEEDBACK_LINK=http://test.com - -# Session configuration -SESSION_COOKIE_PASSWORD="a-random-value-longer-a-minimum-of-32-characters" -SESSION_TIMEOUT=604800000 - -# Redis configuration -REDIS_PASSWORD=my-password -REDIS_USERNAME=default -REDIS_HOST=localhost -REDIS_KEY_PREFIX=forms-runner +# END FEATURE: Phase banner # START FEATURE: DXT -- used if using DXT's infrastructure to store your forms and file uploads MANAGER_URL=http://localhost:3001 From 6dbabd43b50bdfae900b41f34d0f80beedf9c945 Mon Sep 17 00:00:00 2001 From: Alex Luckett Date: Wed, 9 Apr 2025 11:51:02 +0100 Subject: [PATCH 4/4] Replace TODOs with content --- docs/GETTING_STARTED.md | 6 +----- docs/PLUGIN_OPTIONS.md | 2 +- docs/features/code-based/PAGE_VIEWS.md | 5 ++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index 4e2c30e9d..a96d754e0 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -148,8 +148,4 @@ These files are called `Form definitions` and are built up of: - `conditions` - used to conditionally show and hide pages and - `lists` - data used to in selection fields like [Select](https://design-system.service.gov.uk/components/select/), [Checkboxes](https://design-system.service.gov.uk/components/checkboxes/) and [Radios](https://design-system.service.gov.uk/components/radios/) -The [types](https://github.com/DEFRA/forms-designer/blob/main/model/src/form/form-definition/types.ts), `joi` [schema](https://github.com/DEFRA/forms-designer/blob/main/model/src/form/form-definition/index.ts) and the [examples](test/form/definitions) folder are a good place to learn about the structure of these files. - -TODO - Link to documentation for `Form metadata` - -TODO - Link to documentation for `Form definition` +To understand the full set of options available to you, consult our [schema documentation](https://defra.github.io/forms-engine-plugin/schemas/). Specifically, the [form definition schema](https://defra.github.io/forms-engine-plugin/schemas/form-definition-v2-payload-schema). diff --git a/docs/PLUGIN_OPTIONS.md b/docs/PLUGIN_OPTIONS.md index f5ef14dd2..405809514 100644 --- a/docs/PLUGIN_OPTIONS.md +++ b/docs/PLUGIN_OPTIONS.md @@ -15,7 +15,7 @@ The forms plugin is configured with [registration options](https://hapi.dev/api/ ## Services -TODO +See [our services documentation](./features/code-based/CUSTOM_SERVICES.md). ## Custom controllers diff --git a/docs/features/code-based/PAGE_VIEWS.md b/docs/features/code-based/PAGE_VIEWS.md index 8d471dfca..c02b5d6c0 100644 --- a/docs/features/code-based/PAGE_VIEWS.md +++ b/docs/features/code-based/PAGE_VIEWS.md @@ -1,8 +1,7 @@ # Templates and views -## Extending the default layout - -TODO +> [!NOTE] +> DXT currently handles the page layout internally within the plugin and cannot be customised. We plan to offer this customisation as a feature, please contact us on Slack if this is urgent for you. To override the default page template, vision and nunjucks both need to be configured to search in the `forms-engine-plugin` views directory when looking for template files.