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

Switching From Operator with Cardinality 2 to Operator with Cardinality 1 Does Not Properly Change Tree #1118

Open
ethan-ccm opened this issue Sep 18, 2024 · 0 comments · Fixed by #1136
Labels

Comments

@ethan-ccm
Copy link

Describe the bug
When changing from (for example) the between operator and the less operator for numbers, the tree is not properly changed to reflect the new operator. Both values from the between will still be in place, and the valueSrc and valueType arrays will both have two elements. This seems to be okay for most cases, but for the format string export it will stop generating the query in this situation

To Reproduce
Select a number or date field and the between operator. Switch from the between operator to an operator with cardinality of 1 such as less than.

Expected behavior
The tree should change to reflect that the new operator has only one input and only one value source.

Screenshots
With between selected:
image
After switching from between to less than:
image

Additional context
The reason we are using the query string format at all is because there is no built-in support for custom query exports so it is being used to generate custom queries of a non-supported format. Adding this as a feature would be very helpful.

rhit-gaulldj added a commit to rhit-gaulldj/react-awesome-query-builder that referenced this issue Nov 10, 2024
@ukrbublik ukrbublik added the bug label Nov 12, 2024
rhit-gaulldj added a commit to rhit-gaulldj/react-awesome-query-builder that referenced this issue Nov 12, 2024
- Addresses ukrbublik#1118
- Re-pulls newValue/newValueSrc/newValueType from previous state when new operator cardinality is less than current operator cardinality
rhit-gaulldj added a commit to rhit-gaulldj/react-awesome-query-builder that referenced this issue Nov 12, 2024
- Addresses ukrbublik#1118
- Re-reads values from previous state if new cardinality is less than current cardinality
ukrbublik pushed a commit that referenced this issue Nov 12, 2024
- Addresses #1118
- Re-reads values from previous state if new cardinality is less than current cardinality
@ukrbublik ukrbublik linked a pull request Nov 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants