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

Fix issues with enums in json form #453

Merged
merged 1 commit into from Dec 15, 2023
Merged

Fix issues with enums in json form #453

merged 1 commit into from Dec 15, 2023

Conversation

jbeisen
Copy link
Collaborator

@jbeisen jbeisen commented Dec 14, 2023

Formik was not properly setting the values when switching between JSON shema 'oneof' variants. This adds a call to reset the field when switching variants.

This change also removes the option of leaving optional enums as null, and instead defaults it to the 'default_value' (for string enums if defined), or the first oneof variant.

For example:

image

@jbeisen jbeisen force-pushed the select-defaults branch 2 times, most recently from 8fc67b7 to 7d5f153 Compare December 14, 2023 21:16
@jbeisen jbeisen changed the title Remove null option from select widget Fix issues with enums in json form Dec 14, 2023
Copy link
Member

@mwylde mwylde left a comment

Choose a reason for hiding this comment

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

This looks good. I think you'll need to also go through all of the schemas and adjust the ordering of the options to align with the defaults. For example, in Kafka we need the non-transactional options to be default for both sources and sinks.

Formik was not properly setting the values when switching between JSON
shema 'oneof' variants. This adds a call to reset the field when
switching variants.

This change also removes the option of leaving optional enums as null,
and instead defaults it to the 'default_value' (for string enums if
defined), or the first oneof variant.
@jbeisen jbeisen merged commit 930346b into master Dec 15, 2023
8 checks passed
@jbeisen jbeisen deleted the select-defaults branch December 15, 2023 19:14
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.

None yet

2 participants