Skip to content

Add support for conditional fields#1392

Draft
Dashue wants to merge 1 commit intoXGovFormBuilder:mainfrom
ukhsa-collaboration:confitional_field_support
Draft

Add support for conditional fields#1392
Dashue wants to merge 1 commit intoXGovFormBuilder:mainfrom
ukhsa-collaboration:confitional_field_support

Conversation

@Dashue
Copy link
Copy Markdown

@Dashue Dashue commented Feb 25, 2026

Note

This template is designed to help both contributors and maintainers. It is a checklist to ensure all necessary
information is provided, and prompts contributors on any contribution guidelines they have missed.

Do not remove sections.
They are important for the review process and help maintainers ensure quality and good documentation across the
project.

Some checkboxes will not apply to every change, so feel free to leave them unchecked if they are not relevant.

Description

Context

In order to allow the multi option, like CheckboxesField input drive content on a single page.
To remove the need for duplicated pages in order to support permutations of input

Changes

Extend form schema with 'condition' property on field level
Conditionally render fields based on state (full form state, not just this page "relevant" state)

Type of change

What is the type of change you are making?

  • Chore or documentation (non-breaking change that does not add functionality)
  • ADR (Architectural Decision Record, non-breaking change that documents or proposes a decision)
  • Refactor (non-breaking change that improves code quality)
  • Bug fix (non-breaking change which fixes an issue)
  • [X ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

PR title

PR titles should be prefixed with the type of change you are making, based on the README.md#versioning.
This is so that when performing a squash merge, the PR title is automatically used as the commit message.

Have you updated the PR title to match the type of change you are making?

  • Yes
  • [X ] No, I need help or guidance

Testing

Automated tests

Have you added automated tests?

  • Yes, unit or integration tests
  • Yes, end-to-end (cypress) tests
  • No, tests are not required for this change
  • [X ] No, I need help or guidance
  • No (explain why tests are not required or can't be added at this time)

Manual tests

Have you manually tested your changes?

  • Yes
  • No, manual tests are not required or sufficiently covered by automated tests
  • [X ] Not yet, only on downstream based branch

Have you attached an example form JSON or snippet for the reviewer in this PR?

  • Yes
  • No, any existing form can be used
  • No, it is not required or not applicable
  • [X ] Not yet, will need guidance or help

Steps to test

  1. Step 1
  2. Step 2

Documentation

Have you updated the documentation?

  • Yes, I have updated ./docs for this change since additional explanation or steps to use/configure the feature is required
  • Yes, I have added or updated an ADR for this change since it is large, complex, or has significant architectural implications
  • Yes, I have added inline comments for hard-to-understand areas
  • [X ] No, I am not sure if documentation is required
  • No, documentation is not required for this change

Discussion

Warning

Large or complex changes may require discussion with the maintainers before they can be merged. If it has not yet been discussed, it may delay the review process

Have you discussed this change with the maintainers?

  • Yes, I have discussed this change with the maintainers on slack, email or via GitHub issues
  • Yes, this change is an ADR to help kick-off discussion
  • No, this change is small and does not require discussion
  • [X ] No, I am not sure if one is required

@Dashue Dashue force-pushed the confitional_field_support branch from b7a8db8 to 1d7e4d1 Compare February 25, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant