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

Handle booleans in filter editor #13406

Merged
merged 2 commits into from
Aug 16, 2017

Conversation

lukasolson
Copy link
Member

@lukasolson lukasolson commented Aug 9, 2017

Fixes #12745.

This PR updates the filter editor to properly handle fields of type boolean. It also removes the "is one of" and "is not one of" options from the boolean field type (because they don't make much sense).

image

@cjcenizal
Copy link
Contributor

FWIW, I think the UI will be a little easier to parse if you use a select with "true" and "false" options instead of a checkbox here. It's kind of an unusual checkbox behavior to check it and cause the label to change.

@lukasolson
Copy link
Member Author

@cjcenizal I agree. I've updated it to use a select instead.

Copy link
Contributor

@Bargs Bargs left a comment

Choose a reason for hiding this comment

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

LGTM

While I was testing this I also noticed boolean scripted fields are incorrectly showing an empty string in the filter pill. Thought I'd mention it in case you were feeling in the mood, otherwise we can create a separate ticket for it :)

screen shot 2017-08-09 at 5 36 42 pm

@lukasolson
Copy link
Member Author

I also noticed boolean scripted fields are incorrectly showing an empty string in the filter pill.

Are you sure you're not using some sort of formatter that's doing this? When I create a scripted boolean, I don't see this:

image

@weltenwort
Copy link
Member

I was able to reproduce the "empty bool value" effect that @Bargs reported by performing these steps in the same tab without reloading:

  • create a new index pattern
  • go to discover, add one of the fields as a column
  • go to index pattern settings, add a scripted bool field
  • go back to discover
  • add the new scripted field as a column

For me, all the values in that column as well as the filter descriptions were empty. There seems to be something wrong with the boolean field formatters, so it is probably not related to this PR. A page reload fixes it.

@lukasolson lukasolson merged commit c4c6ea1 into elastic:master Aug 16, 2017
lukasolson added a commit to lukasolson/kibana that referenced this pull request Aug 16, 2017
* Handle booleans in filter editor

* Use select instead of checkbox
lukasolson added a commit that referenced this pull request Aug 16, 2017
* Handle booleans in filter editor

* Use select instead of checkbox
lukasolson added a commit that referenced this pull request Aug 16, 2017
* Handle booleans in filter editor

* Use select instead of checkbox
@lukasolson lukasolson deleted the filterEditorBools branch March 27, 2018 21:09
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.

4 participants