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-8807: fixed an issue where conditionals based on selectBoxes component do not work #131

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

TanyaGashtold
Copy link
Contributor

@TanyaGashtold TanyaGashtold commented Aug 13, 2024

Link to Jira Ticket

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

Description

What changed?

The select boxes component value is an object like this: {value1: false, value2: true.}. When we use simple conditionals UI for making condition based on select boxes, its value looks like this: 'value1'. Potentially 'value1' can be a stringified number or object.

When the isEqual operator is executed, we check if the comparedValue type is equal to the real value type. If not and the compared value is a string, we try to parse it. In case, when the the selectboxes value is stringified number, we get a number. That means, the previous (that was before my PR) special check for selectboxes is skipped as it has a condition that expects the comparendValue to be a string. Additionally this special check is common and can be applied not just to selectboxes but every time when the real component value is an object and the compared value is a string

This PR adds a new check, that applies the specific select boxes isEqual code only when the condition based component is selectboxes.

How has this PR been tested?

Manually + test

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

@johnformio johnformio merged commit 0002586 into master Aug 13, 2024
6 checks passed
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.

2 participants