FIO-10099: fix an issue where conditionally hidden layout components that are children of containers can wreak havoc#250
Closed
brendanbond wants to merge 2 commits intomasterfrom
Closed
FIO-10099: fix an issue where conditionally hidden layout components that are children of containers can wreak havoc#250brendanbond wants to merge 2 commits intomasterfrom
brendanbond wants to merge 2 commits intomasterfrom
Conversation
… conditionally hidden scope; add tests
Contributor
Author
|
Closing this in favor of #243 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-10099
Description
If you have a layout component as a child to a container, and that layout component contains a conditional, at some point we will ask for its path, expecting something like
container.panel. Instead, because layout components don't really have a data path (instead they have absolute paths), we will getcontainer, flagging the entire container as conditionally hidden and potentially clearing the whole thing (assumingclearOnHideis enabled). This hotfix solution addresses this by checking the component's model type - if it isnone, we will use the absolute path for the component when evaluating its conditional. This PR also ensures that paths are passed to the async version ofeachComponentDataunder certain conditions.I do think this reveals a weakness in our treatment of conditionals - we use the "scope" object here and there to check to see if a component somewhere else has been flagged as conditionally hidden. This is brittle, and we already have an alternative mechanism by which to do so: when we determine that a component is conditionally hidden, we use its ephemeral
scopeproperty (not to be confused with thescopeprocess results object) to label it as such. A longer term solution here would be to use that property exclusively and to no longer rely on the scope for checks of this nature.Breaking Changes / Backwards Compatibility
n/a
Dependencies
n/a
How has this PR been tested?
Automated test
Checklist: