Add support for grouping conditions with and/or operators
In our project we would benefit from extra conditions for our Story's controls, to better match our more complex polymorphic component parameters.
Please check the new tests for example usage.
cc @tmeasday @shilman
Cc @kylegach
Nice work, @DiogoDoreto!
The API is as straightforward as I can imagine it being. I recommend that we only document one level of nesting, though, even if it's implemented recursively as it is here.
That said...
to better match our more complex polymorphic component parameters
I wonder if there's something better we could offer for this use case, that wouldn't require manually authoring a bunch of complex conditions. Whatever that is, it could likely be implemented as an auto-generation of this feature. So this PR is still valuable.
Thanks, @kylegach!
Regarding your last point, what we really thought about initially was to have the options of a control to be dynamic and based on the values of other controls. Since this was a major change from the current requirement of being statically defined we tried to avoid it. The current solution is to multiply the number of controls with pre-calculated options and predefined rules for visibility — where multiple conditions come in handy. And yes, we are autogenerating those :)
This would be great. Is anyone looking at this PR and going to see about merging it in?