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

FIO-9244: fixed an issue where Radio component with Allow only available values checked does not submit #178

Conversation

KatrinKhilko
Copy link
Contributor

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-9244

Description

Changed incorrect values for Radio Component.

Breaking Changes / Backwards Compatibility

n/a

Dependencies

n/a

How has this PR been tested?

tested manually, fixed incorrect values in existing test from #152

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@@ -249,7 +249,7 @@ export const validateAvailableItems: RuleFn = async (context: ValidationContext)
? null
: error;
}
return values.find((optionValue) => optionValue === value) !== undefined ? null : error;
Copy link
Contributor

@brendanbond brendanbond Oct 22, 2024

Choose a reason for hiding this comment

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

Does this cover the case of, like, custom values? Should we be doing a deep equal here instead? I want to make sure all of our bases are covered (i.e. custom values or JSON values of any shape)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brendanbond There is a check above this line for the object value, I'm pretty sure it should cover most of the json and custom values, so this line is only triggered for primitive ones. I changed it a bit to pass both validation in case if dataSrc=values and if values is an array of primitives. So all the bases seem to be covered, but we can further discuss this if you have any other adjustments in mind.

@KatrinKhilko KatrinKhilko force-pushed the FIO-9244-Radio-component-with-Allow-only-available-values-checked-does-not-submit branch from f3525a9 to dc79aaa Compare October 23, 2024 13:15
@brendanbond brendanbond merged commit 46e413a into master Oct 23, 2024
8 checks passed
lane-formio pushed a commit that referenced this pull request Oct 23, 2024
…ow-only-available-values-checked-does-not-submit

FIO-9244: fixed an issue where Radio component with Allow only available values checked does not submit
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.

3 participants