You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in the config.json and the plugin.json files, as well as in repeater fields, dependencies are defined as an array of rules that determine whether a field should be displayed.
As stated in the official documentation:
"dependencies: array of the rules used to specify if the field should be displayed or not."
However, the current system only allows AND conditions, meaning that each dependency rule must be met simultaneously. This makes it necessary to duplicate field definitions when we want to show a field based on multiple values of the same dependency.
Proposed Enhancement
I suggest adding support for OR conditions within dependencies, allowing a field to be displayed if at least one of the specified values matches. For example, instead of writing multiple field definitions, we could use:
This would make dependency management much more efficient, reducing redundancy and improving maintainability.
Use Case
If a field should be displayed when type is either 1, 2, or 3, the current system requires defining the field three times with separate dependency conditions. Implementing OR conditions would eliminate this redundancy.
Thank you for your time and consideration! 😊
The text was updated successfully, but these errors were encountered:
gpsblues
changed the title
[Feature Request]: Support for OR Conditions in Dependencies
[Feature Request]: Support for OR conditions in config.json Dependencies
Feb 24, 2025
Feature Description
Currently, in the
config.json
and theplugin.json
files, as well as inrepeater fields
, dependencies are defined as an array of rules that determine whether a field should be displayed.As stated in the official documentation:
"dependencies: array of the rules used to specify if the field should be displayed or not."
However, the current system only allows
AND
conditions, meaning that each dependency rule must be met simultaneously. This makes it necessary to duplicate field definitions when we want to show a field based on multiple values of the same dependency.Proposed Enhancement
I suggest adding support for OR conditions within dependencies, allowing a field to be displayed if at least one of the specified values matches. For example, instead of writing multiple field definitions, we could use:
This would make dependency management much more efficient, reducing redundancy and improving maintainability.
Use Case
If a field should be displayed when type is either 1, 2, or 3, the current system requires defining the field three times with separate dependency conditions. Implementing OR conditions would eliminate this redundancy.
Thank you for your time and consideration! 😊
The text was updated successfully, but these errors were encountered: