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

[Feature Request]: Support for OR conditions in config.json Dependencies #2053

Open
gpsblues opened this issue Feb 24, 2025 · 0 comments
Open

Comments

@gpsblues
Copy link

gpsblues commented Feb 24, 2025

Feature Description

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:

"dependencies": [
    { 
        "field": "type", 
        "value": ["1", "2", "3"] 
    }
]

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! 😊

@gpsblues 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
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

No branches or pull requests

1 participant