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

[Vis: Default editor] EUIficate filters control #35464

Merged
merged 11 commits into from
May 10, 2019

Conversation

sulemanof
Copy link
Contributor

@sulemanof sulemanof commented Apr 23, 2019

Summary

Part of #30922.
EUIfication of filters control for Filters aggregation parameter.

The previous UI:

filters_old

The current implementation:

filters_new

UI changes:

  • used EUI icons;
  • added a plus icon into Add Filter button;
  • remove filter button disabled if it is the only filter

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@sulemanof sulemanof requested a review from cchaos April 23, 2019 13:33
@sulemanof
Copy link
Contributor Author

@cchaos could you please take a look at the current design of the filters component and provide your feedback 😊

@sulemanof sulemanof requested a review from maryia-lapata April 23, 2019 13:35
@elasticmachine
Copy link
Contributor

💔 Build Failed

@cchaos
Copy link
Contributor

cchaos commented Apr 23, 2019

I've been trying to think of ways to improve this UI and the only thing I can come up with would require a bit more work. It would be really nice if these filters could re-use the popover that exists in the global filter bar and then display similarly like so:


Otherwise I don't think there's much we can do to enhance this UI. Thoughts on the possibility of accomplishing the above?

@maryia-lapata
Copy link
Contributor

maryia-lapata commented Apr 24, 2019

Thoughts on the possibility of accomplishing the above?

@cchaos looking briefly, we can reuse the popover. That FilterEditor provides ample opportunity (field and operator selector, value, range) and I'm not sure whether we need them for the visualization editor, also it seems for me as a kind of duplication of the global filter bar.
Also we need to investigate how to pass all configuration from FilterEditor to visualization API, how to proper convert it. Probably @timroes has wider vision about the possibility of that.

@maryia-lapata maryia-lapata requested a review from timroes April 24, 2019 14:53
@cchaos
Copy link
Contributor

cchaos commented Apr 24, 2019

Maybe if not the actual popover from the global filters, but a similar pattern? So instead of writing out the filters inline in the sidebar, you open a popover with a text editor (similar to the one in "Edit as Query DSL") and then use the filter pill format to display and remove them?

@timroes
Copy link
Contributor

timroes commented Apr 29, 2019

@cchaos we should for now leave that as simple text boxes, since a filter is something completely different than a query (which you ironically put into the filter aggregation :D). Changing the filter aggregation to use the filter editor (and thus also need to use the filter to query DSL builder (and not a simple lucene query anymore) is a significant rewrite, which goes beyond this PR. Also one filter in the filter aggregation (since being a Lucene string) usually contains multiple filter queries, so basically each filter in a filter aggregation would not be represented by one filter pill/editor but by one filter bar itself. (And also we would need a new filter bar, which supports AND and OR for filters beforehand :D)

But please feel free to create a separate issue for this, since @Bargs will anyway be looking into supporting KQL for the filter aggregation. Maybe during that, we come closer with the infrastructure to also use a more UI wise approach with the filter editor.

@cchaos
Copy link
Contributor

cchaos commented Apr 29, 2019

If nothing can be done to improve the UI at this point, then from a straight angular to React (EUI) conversion, this is fine.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@Bargs
Copy link
Contributor

Bargs commented May 1, 2019

I'd love to see this get merged as soon as possible. As we speak I'm in the middle of converting these inputs into query bars that support both lucene and KQL as well as autocomplete. Having the editor in React will solve one of the issues I'm currently facing. So the sooner this gets merged the sooner I can continue to progress on that work.

I did a review of the code and functionality and everything LGTM!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@sulemanof sulemanof marked this pull request as ready for review May 6, 2019 10:54
@timroes timroes mentioned this pull request May 6, 2019
29 tasks
@sulemanof sulemanof requested a review from Bargs May 6, 2019 10:57
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

@Bargs
Copy link
Contributor

Bargs commented May 9, 2019

@sulemanof is this good to merge?

@Bargs
Copy link
Contributor

Bargs commented May 10, 2019

Since this is blocking me I'm going to go ahead and merge it considering the tests have passed and it's been reviewed.

@Bargs Bargs merged commit f5f9b5e into elastic:master May 10, 2019
@sulemanof
Copy link
Contributor Author

Hi @Bargs ! Sorry for late reply, I was on vacation.
I hope everything is good in this PR and it was ready for merge.
We also have to backport it to 7.x branch

sulemanof added a commit to sulemanof/kibana that referenced this pull request May 14, 2019
EUIfication of filters control for Filters aggregation parameter.
@sulemanof sulemanof added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Vis Editor Visualization editor issues release_note:skip Skip the PR/issue when compiling release notes v7.2.0 v8.0.0 labels May 14, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

sulemanof added a commit that referenced this pull request May 14, 2019
EUIfication of filters control for Filters aggregation parameter.
@lizozom
Copy link
Contributor

lizozom commented May 20, 2019

@sulemanof @Bargs
The propFilter dependency used in vis_type_agg_filter, needs to be removed.
App Arch team is about to delete the filters directory, and that's the only thing remaining in it.
Maybe it can be simplified for your use case and hosted in this file?
In the worst case, please copy it into your code.

@sulemanof
Copy link
Contributor Author

The propFilter dependency used in vis_type_agg_filter, needs to be removed.

If we need to remove the propFilter we have to create a separate PR for that stuff because it has not any relation to the Filter Aggregation (which the existing pr consists of)

@timroes what should we do with that?

@timroes
Copy link
Contributor

timroes commented May 22, 2019

@sulemanof Yes, I agree with Liza here. Let's move that code into the vis_type_agg_filter directly. Also let's shorten it for what we need, so we can basically remove the wrapping function and just use the inner function on the property name directly (will also be a bit more typesafe).

@sulemanof @maryia-lapata could either of you open a PR for that?

@maryia-lapata
Copy link
Contributor

@timroes sure, I'll do it.

@maryia-lapata
Copy link
Contributor

@timroes propFilter is used in two places, so I just moved it to ui/agg_types/filter #36875

cc/ @lizozom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:Vis Editor Visualization editor issues release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants