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

EUI input controls visualization #16210

Merged
merged 12 commits into from
Jan 30, 2018
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jan 22, 2018

Migrate input controls visualization from KUI to EUI

screen shot 2018-01-22 at 1 00 09 pm

screen shot 2018-01-22 at 12 59 53 pm

@nreese nreese added the Feature:Input Control Input controls visualization label Jan 22, 2018
@nreese nreese requested review from cjcenizal and kobelb January 23, 2018 01:07
Copy link
Contributor

@cjcenizal cjcenizal left a 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:

image

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.

image

Misc spacing issues

Can we add a small spacer beneath the title of each accordion?

image

Can we also add a small spacer between each accordion? And it looks like the select clips the text when "Range slider" is selected.

image

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.

image

@nreese
Copy link
Contributor Author

nreese commented Jan 25, 2018

@cjcenizal Thanks for the feed back. Things look much nicer with those changes

  • validation
  • prefilled inputs
  • form layout
  • missing spaces
  • select clips the text when "Range slider" is selected
  • sort up/down icons

validation: There is no mechanism currently in place to tell the visualize editor that there are errors in the form and play can not be pressed. This will need to be figured out and could be complicated. I think this should be done in a separate PR to avoid doing too many things at once.

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.
Pre-selecting the default index does make sense. I will wait for PR #16235 to get merged. That PR contains a new method in indexPatterns for easily getting the default index that I could use here.

@cjcenizal
Copy link
Contributor

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. 😄

@nreese
Copy link
Contributor Author

nreese commented Jan 25, 2018

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

@chrisronline chrisronline mentioned this pull request Jan 25, 2018
47 tasks
@Adrian-J
Copy link

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

@nreese
Copy link
Contributor Author

nreese commented Jan 26, 2018

After talking with @cjcenizal, we have decided that this PR will not address any default values and should move forward just as is.

Copy link
Contributor

@cjcenizal cjcenizal left a 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;
Copy link
Contributor

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 }}>

Copy link
Contributor Author

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"
Copy link
Contributor

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) => {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@kobelb kobelb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nreese nreese merged commit 270455d into elastic:master Jan 30, 2018
nreese added a commit to nreese/kibana that referenced this pull request Jan 30, 2018
* 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
nreese added a commit that referenced this pull request Jan 30, 2018
* 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
@nreese nreese deleted the euiInputControls branch February 13, 2018 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Input Control Input controls visualization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants