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

Input Control visualization #13314

Merged
merged 59 commits into from
Sep 20, 2017
Merged

Input Control visualization #13314

merged 59 commits into from
Sep 20, 2017

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Aug 3, 2017

Adds visualization type for creating input panels for dashboards.

  • Range slider input. Slider min and max obtained via a min/max aggregation call when panel is first rendered.
  • Options list input. Options are loaded via a terms aggregation call when panel is first rendered.

screen shot 2017-08-31 at 11 48 53 am

Replaces experimental PRs #11873 and #12126

@nreese
Copy link
Contributor Author

nreese commented Aug 31, 2017

jenkins, test this

@nreese
Copy link
Contributor Author

nreese commented Sep 1, 2017

jenkins, test this

Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

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

Sending out first round of comments.

}

handleToggleControlVisibility() {
this.setState({
Copy link
Contributor

Choose a reason for hiding this comment

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

}

return (
<div className="sidebar-item">
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about breaking this component down into something like EditorSummaryBar and EditorDetails? Might help pare this back a little bit, and neither of those components would need any state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure this gets you anything. With the above requested changes, control_editor is very straightforward.

render() {
let editor;
if (this.state.isEditorVisible) {
editor = (
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about either making this a function outside render, or a separate component? e.g. getEditorContents() and then below could do

 { this.state.isEditorVisible && getEditorContents() }

super(props);

this.state = {
isEditorVisible: true
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about isEditorCollapsed?

<input
className="kuiTextInput"
type="text"
value={this.props.controlParams.label}
Copy link
Contributor

Choose a reason for hiding this comment

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

These should all have spaces inside the parens (and elsewhere in the file)

 value={ this.props.controlParams.label }

Copy link

Choose a reason for hiding this comment

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

Are you sure about that? From working in x-pack-kibana I know that from 6.1 onward there is an eslint rule enforcing no spaces inside of {}.
https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/.eslintrc.js#L89-L100

Copy link
Contributor

Choose a reason for hiding this comment

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

Whoa you are right (https://github.com/elastic/x-pack-kibana/pull/2371 and #13323 did all the conversions), sorry for the misdirection @nreese and thanks for pointing that out @archanid. Looks like we switched it over to match the AirBnb style guide. I guess the react style guide should be updated because all of the examples in there use the old style of spaces inside.

Copy link
Contributor

Choose a reason for hiding this comment

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

I filed #13846 to keep track.

constructor(props) {
super(props);

this.loadOptions = this.loadOptions.bind(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

import React, { Component } from 'react';
import Select from 'react-select';

export class IndexPatternSelect extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

TSVB has a similar Index pattern field, except that it's not a drop down and can accept any index pattern on the fly. Unless there is a specific reason for the differences, I think we should try to do the same - either let them enter in any custom index pattern here, or adjust TSVB to be a drop down like this. @simianhacker or @snide -- any thoughts on this?

I was going to suggest this go into the uiFramework but because of the K7 stuff in progress, it might not be worth it right now. Just when K7 gets here, we'll want to migrate over to use those control components.

Copy link
Member

Choose a reason for hiding this comment

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

TSVB will probably always be adhoc because there are a lot of users with dashboards that depend on the current behavior; I don't want to take that away from them.

import React, { Component } from 'react';
import Select from 'react-select';

export class IndexPatternSelect extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

import React, { Component } from 'react';
import Select from 'react-select';

export class FieldSelect extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

This component looks like it could be generalized for the uiFramework as well - e.g. FilterableSelect.

@snide - what's your take on components like this. Would you prefer they get moved into the uiFramework ala k6, or should we hold off for now due to incoming k7?

import { IndexPatternSelect } from './index_pattern_select';
import { FieldSelect } from './field_select';

export class ListControlEditor extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

Make stateless function. I thought we had eslint checks for this recently put it place, but maybe it's only turned on in the uiFramework... CJ would know but I don't want to tag him on paternity leave.

Few other files/components I see that should be in the functional stateless variety.

@stacey-gammon
Copy link
Contributor

One more thing - can you add jest tests for all the react components?

timroes
timroes previously requested changes Sep 6, 2017
Label
</label>
<div className="kuiSideBarFormRow__control kuiFieldGroupSection--wide">
<input
Copy link
Contributor

Choose a reason for hiding this comment

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

Please label this input with the above label (see accessibility style guide) using htmlFor in React.

{this.props.controlTitle}
</span>
<div className="vis-editor-agg-header-controls kuiButtonGroup kuiButtonGroup--united">
<button
Copy link
Contributor

Choose a reason for hiding this comment

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

This button is missing an aria-label, that describes it (since it doesn't have any textual content).

>
<i aria-hidden="true" className="fa fa-chevron-down" />
</button>
<button
Copy link
Contributor

Choose a reason for hiding this comment

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

This button is missing an aria-label, that describes it (since it doesn't have any textual content).

Field
</label>
<div className="kuiSideBarFormRow__control kuiFieldGroupSection--wide">
<Select
Copy link
Contributor

Choose a reason for hiding this comment

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

Please label this Select (you can set an id with inputProps={{ id: 'yourId' }}) with the above label.

Index Pattern
</label>
<div className="kuiSideBarFormRow__control kuiFieldGroupSection--wide">
<Select.Async
Copy link
Contributor

Choose a reason for hiding this comment

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

Please label this Select (see other comment).

Size
</label>
<div className="kuiSideBarFormRow__control kuiFieldGroupSection--wide">
<input
Copy link
Contributor

Choose a reason for hiding this comment

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

Please label this input with the above label (see other comment).

Step Size
</label>
<div className="kuiSideBarFormRow__control kuiFieldGroupSection--wide">
<input
Copy link
Contributor

Choose a reason for hiding this comment

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

Please label this input with the above label (see other comment).


<div className="kuiSideBarFormRow">
<div className="kuiSideBarFormRow__control kuiFieldGroupSection--wide">
<select
Copy link
Contributor

Choose a reason for hiding this comment

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

Please provide a label (e.g. via aria-label) for this select.

<FormRow
label={this.props.control.label}
>
<Select
Copy link
Contributor

Choose a reason for hiding this comment

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

Please label this Select (see other comment).

label={this.props.control.label}
>
<div className="inputRangeContainer">
<InputRange
Copy link
Contributor

Choose a reason for hiding this comment

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

Please label this element, using aria-labelledby on the InputRange and set this to the id of the label in FormRow (I guess that needs some modifications.

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.

I have general hesitations to us adding another method of selecting/specifying an index-pattern with this visualization. We have the "traditional" method, and the TSVB free-form method, the Timelion method, and now this.

I'm wondering if this is intertwined with us defining a bunch of different input controls for a dashboard as a single visualization. I'd be interested to see how these are used/re-used because there's potential for each input control being it's own visualizations allowing us to utilize the existing Visualize workflow of selecting an index-pattern/etc. while allowing more re-use opportunities.

I'm in no way an authority on this design decision, but would be interested to hear others thoughts.

import InputRange from 'react-input-range';
import { FormRow } from './form_row';

export class RangeControl extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not finding the way the RangeControl works to be very intuitive. When it's first displayed and not being used for filtering, the start/end "dots" are on top of each other:

screen shot 2017-09-05 at 8 22 19 am

even though it's effective showing all values within the min-max and the following feels more natural:

screen shot 2017-09-05 at 8 26 15 am

Additionally, once the range slider has been moved from the starting position, it can't be put back there and stops at the first "step":

min-step-slider

It's also impossible to move the Range slider to the max-value unless it's a multiple of the step:

max-value-slider

The min-max labels are also occasionally cut-off for large values:

screen shot 2017-09-05 at 8 33 30 am

this.loadOptions = this.loadOptions.bind(this);
}

loadOptions(input, callback) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the IndexPatternSelect itself is loading the index-patterns, every-time that we add a new "input control" we're making another network request to retrieve the list of index patterns. Can we at least cache this for reuse so it only happens once?

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 was thinking of changing this to limit the index-pattern search to 100 results. Then I would configure Select.Async to fire the search every time a character is added to the filter. This is how the dashboard add 'Visualzation' and 'Saved Search' function. What do you think?

}

async loadFields(indexPatternId) {
if (!indexPatternId || indexPatternId.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

loadFields is called by the constructor and whenever the indexPattern changes, potentially leading to a race condition if there's any type of inconsistent network latency.

@@ -0,0 +1,9 @@
export default function (kibana) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this should be split into two tabs, with only the "Update kibana filters on each change" being on the "Options" tab and everything else being on the first tab. Personally, I find "Update kibana filters on each change" being enabled by default to be a much more pleasant UX and wonder if this should be the default.

screen shot 2017-09-07 at 4 04 13 pm

Copy link
Contributor Author

@nreese nreese Sep 8, 2017

Choose a reason for hiding this comment

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

Great idea. I have split the editor into two tabs; Controls and Options

The idea behind disabling "Update kibana filters on each change" by default is that only submitting all of the filters at a single instant puts the least amount of stress on the cluster. The default is designed for the usecase where the Panel contains many controls. Users can fiddle with several filters and then apply them all at once - so the dashboard only has to update 1 time instead of each time a control is modified.

@@ -0,0 +1,592 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders InputControlVisEditor 1`] = `
Copy link
Contributor

Choose a reason for hiding this comment

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

The way we're doing these snapshots feel like they're going to break all the time. They're testing the implementation details of all nested components, including the Kui framework, so anytime these change we'll have to update the snapshot. Have we considered using enzyme to do shallow rendering for the snapshot tests?

@@ -0,0 +1,413 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
Copy link
Contributor

Choose a reason for hiding this comment

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

Same concerns as above.

renderControls() {
return this.props.controls.map((control, index) => {
let controlComponent = null;
switch (control.type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a default for this switch that throws an Error? This could lead to some hard to understand bugs.

if (status.params) {
this.initControls();
}
return new Promise(() => {});
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 returning a Promise that never resolves? This is making the render-counter attribute always stay at 0, which will cause issues with Reporting.

initControls() {
this.controls = [];

controlFactory(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking that if we change the controlFactory to deal with a single control, then we could switch from using a callback below for each individual control and use a Promise which seems more natural.

This would also allow us to use a Promise.all for each of the controlFactory to use with the render method.

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 did it this way so that a single _msearch would be used to init all controls in a panel. The weirdness comes from the fact that fetch.these uses the defer promise pattern

@@ -112,6 +112,10 @@ dashboard-grid {
i.remove {
cursor: pointer;
}

.gs-w {
z-index: auto;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is something else setting this to something besides auto? auto should be the default z-index for elements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gridster sets this to 1 for each grid. This caused problems with overflow of the list select and needed to be set to auto

@nreese nreese mentioned this pull request Sep 8, 2017
5 tasks
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

@timroes
Copy link
Contributor

timroes commented Sep 11, 2017

Unfortunately I think we still need some refactoring with the ids. Ids in HTML need to be unique on the whole page, meaning you cannot assign a static id in a component (like the editor components) that might get rendered multiple times.

You can use the htmlIdGenerator service from the ui_framework, to generate ids. I just merged this onto master (and 6.x) so you would need to rebase on master again.

I explained how to use this service, in the accessibility styleguide.

@nreese
Copy link
Contributor Author

nreese commented Sep 11, 2017

@stacey-gammon I have added all of the requested jest tests and should have addressed all of your comments if you want to take another look.

@timroes I have fixed all of the html elements with id collisions.

this.state = {
isEditorCollapsed: true
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

When just setting the initial state, the constructor isn't needed:

export class ControlEditor extends Component {

  state = {
    isEditorCollapsed: true
  }

import { FieldSelect } from './field_select';

function filterField(field) {
return ['number'].includes(field.type);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be simplified to

return field.type === 'number'

@stacey-gammon
Copy link
Contributor

When I tried to create my first input control, the default tab is Options, not Controls. Is that intentional? I think it's a little confusing because all I see is a check box then and not much else to show me how to start setting it up.
screen shot 2017-09-12 at 9 10 05 am

How difficult would it be to adjust the indexPattern drop down from allowing any dynamic index pattern, like TSVB? I like the control here better in that it auto completes with your current patterns, but it might be nice to allow free form, if desired - as long as there isn't a technical reason not to. Then that will match what TSVB does.
screen shot 2017-09-12 at 9 11 49 am

@stacey-gammon
Copy link
Contributor

I think I notice a bug with the index pattern drop down.

  • Enter in a character that doesn't match any index pattern, e.g. '*'

screen shot 2017-09-12 at 9 11 49 am

- Click outside of the control which will clear the contents:

screen shot 2017-09-12 at 9 17 18 am

- Press the drop down icon to see the possible index patterns, and nothing shows up.

screen shot 2017-09-12 at 9 14 38 am

If you go back and add in another character, then explicitly delete it (not just clicking away), it will clear the value, and the next time you click the drop down icon, you'll see the expected patterns:
screen shot 2017-09-12 at 9 18 38 am

@stacey-gammon
Copy link
Contributor

From a design standpoint, I think there should be padding above these controls:
screen shot 2017-09-12 at 9 20 20 am

@nreese
Copy link
Contributor Author

nreese commented Sep 15, 2017

@stacey-gammon @snide @kobelb What do you think about @JacobBrandt's idea of ditching react-input-range and just using 2 native range inputs? The latest commit changes the range control to provide a very rough implementation showing how @JacobBrandt's request would function. Is this better, worse, or just different? Is this worth pursuing further? I can polish this up if this seems like a better control mechanism.

screen shot 2017-09-15 at 8 39 05 am

@kobelb
Copy link
Contributor

kobelb commented Sep 15, 2017

@nreese to be completely honest, I don't find it to be intuitive at all...

@JacobBrandt
Copy link
Contributor

JacobBrandt commented Sep 15, 2017

@nreese Now that I see it I can see what @kobelb is saying. Maybe try putting the two input fields side by side in the middle.

<-------*----> 7105 to 8771 <---*-------->

Another option is to keep react-input-range and put the input fields at the beginning or end of the slider

<------*-------------------*--> 7105 to 8711

You'll still run into issues where the dots are on top of each other but with the input fields you'll at least be able to see the values you can't read on the slider.

@snide
Copy link
Contributor

snide commented Sep 15, 2017

image

@JacobBrandt
Copy link
Contributor

@snide Yea that's better if we're going to keep the one slider approach.

@stacey-gammon
Copy link
Contributor

I like the single slider better too. ++ to @snide's suggestion.

@nreese
Copy link
Contributor Author

nreese commented Sep 18, 2017

@stacey-gammon Thanks for all the great feedback. Below are responses. I tried to summarize here instead of answering each individually. Would you mind taking another look at the PR?

  • Options tab opened by default: Great point, I have changed so that the Controls tab is now the default tab when the editor is opened.
  • Adjust the indexPattern drop down from allowing any dynamic index pattern: This is not possible. The control must target a single index pattern.
  • Bug with the index pattern drop down where enter a character that doesn't match any index pattern, click outside of the control, and finally press the drop down icon to see the possible index patterns, and nothing shows up: This is a bug with react-select and will need to be fixed upstream. I will create a PR for react-select and get this fixed.
  • Padding above the control buttons: Padding has been added
  • The difference between Clear and Cancel isn't very clear: Changed buttons to Apply Changes, Cancel Changes, and Clear Form. Modified how Clear Form works so that instead of clearing kibana filters, it just clears the form and Apply Changes still has to be clicked to clear the kibana filters.
  • delay when pressing Clear: There is no more delay when Clear Form is clicked.
  • Unable to select certain options in list control drop down: Good find - there was a bug where numeric values or string values containing a comma were un-selectable. That has been resolved.
  • input controls can also extend the borders of the dashboard panels: Unresolved and tracked by issue Panel overflows #13982

@nreese
Copy link
Contributor Author

nreese commented Sep 18, 2017

@JacobBrandt I have updated the range control to include inputs for setting the value more precisely. Try it out and see if this makes sense

@stacey-gammon
Copy link
Contributor

Awesome, the new buttons and labels are way more intuitive. One little UX oddity, but does not need to be addressed in this PR:

slider

@JacobBrandt
Copy link
Contributor

@nreese Yep. This makes sense and will work well, thanks!

@nreese
Copy link
Contributor Author

nreese commented Sep 19, 2017

@timroes Everything should be good to go. Can you take another look?

@timroes timroes dismissed their stale review September 19, 2017 14:51

Fixed the a11y issues

@nreese nreese merged commit 30cc42f into elastic:master Sep 20, 2017
nreese added a commit to nreese/kibana that referenced this pull request Sep 20, 2017
* react editor example

* ensure props are not updated

* use new stageEditorParams method to stage parameter changes

* make component stateless

* use terms_vis_editor component

* get add button to work

* update vis controller to display terms input controls

* update componenent when query bar updates

* add functional test

* lay ground work for different control types in single visulization

* make editors for range and text controls

* text control

* implement type ahead suggestor for text control

* add range slider

* some CSS work

* add submit button, move control init functionallity under control_factory

* add custom options for control types

* provide buttons to move controls up and down

* Make ControlEditor component and clean up styling of editor

* styling work

* multi select for terms dropdown control

* add option to disable filter staging, only enable submit button when filters are staged

* clean up range styling

* rename top level vis folder

* cleanup

* move control type select out of each control editor

* dark theme styling

* use ui/public/filter_manager/lib/phrases.js to build phrases filter, add tests to range filter manager

* use savedObjectsClient to get index patterns

* remove text control and add id to controls for react tracking

* ensure fields get updated when index pattern changes

* update PropTypes for react 15.6.1

* update to latest react-select to avoid isMounted deprecation warnings

* fix input controls functional test

* rename termsControl to listControl to be more generic

* add function test for clear button, refactor directory structure

* functional tests for updateFiltersOnChange is true

* fix react-select clipping problem in dashboard

* try clicking option instead of pressing enter to set react-select value in functional tests

* react-select css

* clean up control_editor component, make ListControlEditor component be function

* add jest test for vis_editor component and accessibility

* add decimal places option to range slider

* add jest test for InputControlVis component

* add default to switch blocks, split editor into seperate tabs, use shallow in snapshot tests

* fix race condition in field_select, update index_pattern_select to fetch indexPatterns on each filter

* clean up control initialization

* use htmlIdGenerator to avoid html element id conflicts

* update functional test to support new editor tabs

* finish jest tests for sub componenets

* mark vis as experimental, refactor buttons for better usability

* fix bug in list control where unable to select options containing numbers and options containing commas. Truncate display of long list options

* fix chart types functional test

* fix jest tests, add margin to action buttons

* remove binds from render functions

* experement with native input range sliders

* Revert "experement with native input range sliders"

This reverts commit aed599e.

* Use Promise.resolve in tests and replace _createRequest with searchSource.fetch

* add inputs to range control
nreese added a commit that referenced this pull request Sep 20, 2017
* react editor example

* ensure props are not updated

* use new stageEditorParams method to stage parameter changes

* make component stateless

* use terms_vis_editor component

* get add button to work

* update vis controller to display terms input controls

* update componenent when query bar updates

* add functional test

* lay ground work for different control types in single visulization

* make editors for range and text controls

* text control

* implement type ahead suggestor for text control

* add range slider

* some CSS work

* add submit button, move control init functionallity under control_factory

* add custom options for control types

* provide buttons to move controls up and down

* Make ControlEditor component and clean up styling of editor

* styling work

* multi select for terms dropdown control

* add option to disable filter staging, only enable submit button when filters are staged

* clean up range styling

* rename top level vis folder

* cleanup

* move control type select out of each control editor

* dark theme styling

* use ui/public/filter_manager/lib/phrases.js to build phrases filter, add tests to range filter manager

* use savedObjectsClient to get index patterns

* remove text control and add id to controls for react tracking

* ensure fields get updated when index pattern changes

* update PropTypes for react 15.6.1

* update to latest react-select to avoid isMounted deprecation warnings

* fix input controls functional test

* rename termsControl to listControl to be more generic

* add function test for clear button, refactor directory structure

* functional tests for updateFiltersOnChange is true

* fix react-select clipping problem in dashboard

* try clicking option instead of pressing enter to set react-select value in functional tests

* react-select css

* clean up control_editor component, make ListControlEditor component be function

* add jest test for vis_editor component and accessibility

* add decimal places option to range slider

* add jest test for InputControlVis component

* add default to switch blocks, split editor into seperate tabs, use shallow in snapshot tests

* fix race condition in field_select, update index_pattern_select to fetch indexPatterns on each filter

* clean up control initialization

* use htmlIdGenerator to avoid html element id conflicts

* update functional test to support new editor tabs

* finish jest tests for sub componenets

* mark vis as experimental, refactor buttons for better usability

* fix bug in list control where unable to select options containing numbers and options containing commas. Truncate display of long list options

* fix chart types functional test

* fix jest tests, add margin to action buttons

* remove binds from render functions

* experement with native input range sliders

* Revert "experement with native input range sliders"

This reverts commit aed599e.

* Use Promise.resolve in tests and replace _createRequest with searchSource.fetch

* add inputs to range control
@nreese
Copy link
Contributor Author

nreese commented Sep 20, 2017

backported to 6.x #14074

@jccq
Copy link

jccq commented Oct 7, 2017

my2c., making this work on top of a saved search instead (or additionally to ) an index pattern could also be useful (Future version?)

@nreese
Copy link
Contributor Author

nreese commented Oct 7, 2017

@jccq interesting idea, added to feature request meta issue #13911

chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Nov 20, 2017
* react editor example

* ensure props are not updated

* use new stageEditorParams method to stage parameter changes

* make component stateless

* use terms_vis_editor component

* get add button to work

* update vis controller to display terms input controls

* update componenent when query bar updates

* add functional test

* lay ground work for different control types in single visulization

* make editors for range and text controls

* text control

* implement type ahead suggestor for text control

* add range slider

* some CSS work

* add submit button, move control init functionallity under control_factory

* add custom options for control types

* provide buttons to move controls up and down

* Make ControlEditor component and clean up styling of editor

* styling work

* multi select for terms dropdown control

* add option to disable filter staging, only enable submit button when filters are staged

* clean up range styling

* rename top level vis folder

* cleanup

* move control type select out of each control editor

* dark theme styling

* use ui/public/filter_manager/lib/phrases.js to build phrases filter, add tests to range filter manager

* use savedObjectsClient to get index patterns

* remove text control and add id to controls for react tracking

* ensure fields get updated when index pattern changes

* update PropTypes for react 15.6.1

* update to latest react-select to avoid isMounted deprecation warnings

* fix input controls functional test

* rename termsControl to listControl to be more generic

* add function test for clear button, refactor directory structure

* functional tests for updateFiltersOnChange is true

* fix react-select clipping problem in dashboard

* try clicking option instead of pressing enter to set react-select value in functional tests

* react-select css

* clean up control_editor component, make ListControlEditor component be function

* add jest test for vis_editor component and accessibility

* add decimal places option to range slider

* add jest test for InputControlVis component

* add default to switch blocks, split editor into seperate tabs, use shallow in snapshot tests

* fix race condition in field_select, update index_pattern_select to fetch indexPatterns on each filter

* clean up control initialization

* use htmlIdGenerator to avoid html element id conflicts

* update functional test to support new editor tabs

* finish jest tests for sub componenets

* mark vis as experimental, refactor buttons for better usability

* fix bug in list control where unable to select options containing numbers and options containing commas. Truncate display of long list options

* fix chart types functional test

* fix jest tests, add margin to action buttons

* remove binds from render functions

* experement with native input range sliders

* Revert "experement with native input range sliders"

This reverts commit aed599e.

* Use Promise.resolve in tests and replace _createRequest with searchSource.fetch

* add inputs to range control
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Dec 1, 2017
* react editor example

* ensure props are not updated

* use new stageEditorParams method to stage parameter changes

* make component stateless

* use terms_vis_editor component

* get add button to work

* update vis controller to display terms input controls

* update componenent when query bar updates

* add functional test

* lay ground work for different control types in single visulization

* make editors for range and text controls

* text control

* implement type ahead suggestor for text control

* add range slider

* some CSS work

* add submit button, move control init functionallity under control_factory

* add custom options for control types

* provide buttons to move controls up and down

* Make ControlEditor component and clean up styling of editor

* styling work

* multi select for terms dropdown control

* add option to disable filter staging, only enable submit button when filters are staged

* clean up range styling

* rename top level vis folder

* cleanup

* move control type select out of each control editor

* dark theme styling

* use ui/public/filter_manager/lib/phrases.js to build phrases filter, add tests to range filter manager

* use savedObjectsClient to get index patterns

* remove text control and add id to controls for react tracking

* ensure fields get updated when index pattern changes

* update PropTypes for react 15.6.1

* update to latest react-select to avoid isMounted deprecation warnings

* fix input controls functional test

* rename termsControl to listControl to be more generic

* add function test for clear button, refactor directory structure

* functional tests for updateFiltersOnChange is true

* fix react-select clipping problem in dashboard

* try clicking option instead of pressing enter to set react-select value in functional tests

* react-select css

* clean up control_editor component, make ListControlEditor component be function

* add jest test for vis_editor component and accessibility

* add decimal places option to range slider

* add jest test for InputControlVis component

* add default to switch blocks, split editor into seperate tabs, use shallow in snapshot tests

* fix race condition in field_select, update index_pattern_select to fetch indexPatterns on each filter

* clean up control initialization

* use htmlIdGenerator to avoid html element id conflicts

* update functional test to support new editor tabs

* finish jest tests for sub componenets

* mark vis as experimental, refactor buttons for better usability

* fix bug in list control where unable to select options containing numbers and options containing commas. Truncate display of long list options

* fix chart types functional test

* fix jest tests, add margin to action buttons

* remove binds from render functions

* experement with native input range sliders

* Revert "experement with native input range sliders"

This reverts commit aed599e.

* Use Promise.resolve in tests and replace _createRequest with searchSource.fetch

* add inputs to range control
@rashidkpc rashidkpc mentioned this pull request Dec 4, 2017
5 tasks
@nreese nreese deleted the inputPanel branch February 13, 2018 19:33
@stbka
Copy link

stbka commented Apr 27, 2018

There should be an option to enable drop down fields depending on each other.

When you choose a value in the first field there should only be those values showed up in the second that are existing in the index in combination with the first value. And vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.