-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
EUI input controls visualization #16210
Conversation
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.
🍾 Woohoo! This is rad. I have a few suggestions in terms of UI/UX.
Validation
Is it possible to validate the fields and display them in an error state when the user hits the "Play" button but they're not configured properly? Like this:
Prefilled inputs
By the same token, it might be nice to prefill the inputs with the default index pattern and the first available field. This way the user gets some momentum by immediately being in a working state.
Form layout
@snide @cchaos Help me out here -- it feels like we should put the "Apply changes" on the far right of the form, with the "Cancel changes" button immediately to the left of it, and the "Clear form" button on the far left side of the form.
Misc spacing issues
Can we add a small spacer beneath the title of each accordion?
Can we also add a small spacer between each accordion? And it looks like the select clips the text when "Range slider" is selected.
Up and down sorting
Can we replace the up and down carets with sortUp and sortDown icons? This will distinguish these buttons from popover buttons.
7a68d72
to
cafd5aa
Compare
@cjcenizal Thanks for the feed back. Things look much nicer with those changes
validation: There is no mechanism currently in place to tell the prefilled inputs: I am not a big fan of prefilled inputs unless there are default values that make sense more often than not. Why intentionally fill forms with incorrect information? Be preselecting a field, the default results could be really ugly if a field with very long values is selected. Also, you have an almost zero percent chance of preselecting the correct field. |
Sure thing sounds good. In terms of prefilled inputs, I'd ping @Adrian-J, @alexfrancoeur and @elastic/kibana-visualizations to see how they're thinking about handling this in the future. Definitely not something we need to do in the near term, but if we want to run with the idea of "new visualizations are created in a working, valid state" then prefilling input controls sounds like a good idea. I don't think the goal is to necessarily guess the user's intention, but more so to keep the user's momentum going. For a new user this is nice because they can play with the control immediately without having to "figure it out". At least that's the theory... we should try testing it on real users to see how they take it. 😄 |
Or confuse users with values that don't make sense for their use case. https://discuss.elastic.co/t/how-do-gauges-and-ranges-work/116797 |
@nreese I agree with @cjcenizal on this one. The current form is very confusing to me, it's fine to start with empty input fields but it would be nice to see both handles on the slider. What if you started with the entire range selected? That seems like a reasonable starting point. |
After talking with @cjcenizal, we have decided that this PR will not address any default values and should move forward just as is. |
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.
Looks fantastic! 🚒
@@ -0,0 +1,4 @@ | |||
.controlEditorPanel { | |||
z-index: 1; |
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.
Why are we setting this z-index? We're also setting it here:
<EuiPanel grow={false} className="controlEditorPanel" style={{ zIndex: 1 }}>
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.
I will remove the style block from the html - that one is extra.
The z-index in the css is needed otherwise the select menu for index pattern or field is behind the "control types" select
<EuiFlexGroup> | ||
<EuiFlexItem> | ||
<EuiFormRow | ||
id="slectControlType" |
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.
nit: "select" is misspelled
} else if (inputValue > this.props.control.max) { | ||
inputValue = this.props.control.max; | ||
} | ||
handleMinChange = (evt) => { |
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.
Did the migration to EUI cause this to need to change?
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.
I found a bug in the master. Setting the min and max is totally broken in master. I fixed it in this PR because it was hard to judge how the min/max inputs worked/looked with the existing bug
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.
Gotcha, seems to work well now, so looks good to me!
c713184
to
be20324
Compare
💚 Build Succeeded |
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.
LGTM
* update jest tests as best as possible - found some bugs that need to be addressed * use EuiAccordion to hide/show control editor * set control editor to be open on load * small changes * fix editor jest tests * update visualization components to EUI * fix jest tests and updated range control to EUI * fix bug in range control input logic * fix button layout * fix dashboard grid resize test * add space between panels, change button order, switch to sort icons * remove style attribute from component, fix spelling of id
* update jest tests as best as possible - found some bugs that need to be addressed * use EuiAccordion to hide/show control editor * set control editor to be open on load * small changes * fix editor jest tests * update visualization components to EUI * fix jest tests and updated range control to EUI * fix bug in range control input logic * fix button layout * fix dashboard grid resize test * add space between panels, change button order, switch to sort icons * remove style attribute from component, fix spelling of id
Migrate input controls visualization from KUI to EUI