Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for soft required validation in builder #188

Merged
merged 6 commits into from
Oct 16, 2024

Conversation

sergei-maertens
Copy link
Member

@sergei-maertens sergei-maertens commented Oct 14, 2024

Partially closes open-formulieren/open-forms#4546 - depends on open-formulieren/types#55

  • Refactored RichText component from content to generic builder components
  • Organized ordering of storybook stories/"folders"
  • Added support for soft required validation to file component
  • Added new component SoftRequiredErrors that will collect all errors and display them. It supports rich text formatting.

Types contain the softRequired extension and custom component to
display related errors.
@sergei-maertens sergei-maertens force-pushed the feature/4546-soft-required-validation branch from a1c1d6d to cefc973 Compare October 15, 2024 13:30
@sergei-maertens sergei-maertens marked this pull request as ready for review October 15, 2024 13:30
…or soft-required fields

Hard and soft required at the same time is not possible, so when the
'required' checkbox is enabled, the soft-required one is unchecked
(if that's relevant) and the checkbox itself is disabled.
… building blocks'

While it initially was only relevant for the content component, we will
make use of this same component in the display component for the
soft required validation errors.

The component translations wrapper around it remains component-type
specific since we can leverage the type-safety when checking validation
error keys, at the cost of a little bit of code duplication.
…o display soft required validation errors

The component is similar to the content component, but needs to be its
own type so that we can process it in the SDK and find a target to
display the form validation errors.

The layout/warning scaffolding will also be fixed, and it has no
meaning in the backend data, so a number of configuration options from
the content component are not available (such as conditional logic,
hidden/visible, display configuration, custom class).
@sergei-maertens sergei-maertens force-pushed the feature/4546-soft-required-validation branch from cefc973 to 0ed623c Compare October 15, 2024 13:56
@sergei-maertens sergei-maertens force-pushed the feature/4546-soft-required-validation branch from 0ed623c to 6311885 Compare October 15, 2024 14:10
Copy link
Contributor

@robinmolen robinmolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

@sergei-maertens sergei-maertens merged commit ac96225 into main Oct 16, 2024
13 checks passed
@sergei-maertens sergei-maertens deleted the feature/4546-soft-required-validation branch October 16, 2024 13:33
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.

Add "soft required" validation/hint to document uploads component
2 participants