FIO-8807: fixed an issue where conditionals based on selectBoxes component do not work #131
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: