-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
[4.x] Improve UX of Field Conditions Builder for Select & Toggle fields #9379
Merged
Conversation
This file contains 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
The toggle casts its values to booleans but the conditions system only works with strings. This change makes sure whatever is saved is a string.
duncanmcclean
changed the title
[4.x] Improve field conditions UX: show dropdown for select/button group/radio options & toggle for toggle fields
[4.x] Improve field conditions UX for Select & Toggle fields
Jan 23, 2024
duncanmcclean
changed the title
[4.x] Improve field conditions UX for Select & Toggle fields
[4.x] Improve UX of Field Conditions Builder for Select & Toggle fields
Jan 23, 2024
jasonvarga
requested changes
Jan 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. So close though.
When you are targeting a toggle, you can't select false.
CleanShot.2024-01-30.at.16.47.43.mp4
@jasonvarga Whoops, should be fixed now! |
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.
This pull request makes some small improvements to the UX of the Field Conditions Builder.
This PR also does a little bit of refactoring around how the conditions builder works. Essentially moving the logic of "building" each condition into a new
Condition
component so the computed data/methods can be more easily scoped to a single condition.Select / Button Group / Radios / Checkboxes fields
Previously, when you were configuring a condition for a Select field (or similar), you had to know the key of the option you wanted to use in your condition.
If you didn't know that key, you'd have to cancel out of that field's settings, find that select field, find the option you're looking for, copy its key, cancel out of it's field settings, go back and find the field with the new condition and paste in the key there.
This PR improves that by actually giving you the available options in a dropdown to pick from:
The dropdown will only show when using the
equals
/not
/===
/!==
operators.Toggle fields
This one is a much smaller quality-of-life improvement. When you're building a condition for a Toggle field, you'll now see an actual toggle to represent true/false without needing to type
true
/false
yourself.