Skip to content

[Lens] Index pattern selection using EuiSelectable#46350

Merged
cchaos merged 11 commits intoelastic:masterfrom
cchaos:lens-index-pattern-select
Sep 27, 2019
Merged

[Lens] Index pattern selection using EuiSelectable#46350
cchaos merged 11 commits intoelastic:masterfrom
cchaos:lens-index-pattern-select

Conversation

@cchaos
Copy link
Copy Markdown
Contributor

@cchaos cchaos commented Sep 23, 2019

Created a shared component for changing index pattern

There were two different implementations used in the fields panel and the layer panel. They both used EuiComboBox and swapped out the UI from text to the input. This wasn't ideal as I wanted the selection to occur in a popover with a straight list and search capability.

Screen Shot 2019-09-23 at 12 08 40 PM

Screen Shot 2019-09-23 at 12 09 08 PM

Checklist

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

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Sep 23, 2019

@flash1293 Because I see that you were the one who created these components, can you help me fix a few things?

  • Looks like I ran into the same EUI bug but I just closed the popover on selection of a new index pattern.
  • Tests need to be updated
  • The switcher in the layer config seems to be working, but I can't get the fields panel one to update its parent. https://d.pr/free/i/8Gpaz2

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I will open an EUI issue for this, we had the same problem with the combo box

@flash1293
Copy link
Copy Markdown
Contributor

@cchaos

Looks like I ran into the same EUI bug but I just closed the popover on selection of a new index pattern.

I think this is the best option at the moment. Can we push the issue a bit? Seems like quite a few people ran into it.

Tests need to be updated

Selectables in popovers are super awkward to test with our setup because of you can't mount them because enzyme doesn't support portals and you can't shallow render because then you won't get the rendered options. You can sort-of do both by shallow rendering the container, then use dive() to get the shallow contents of popover, then mount the shallow contents again in a separate enzyme wrapper to get the actually rendered options. I will take care of that tomorrow.

The switcher in the layer config seems to be working, but I can't get the fields panel one to update its parent. https://d.pr/free/i/8Gpaz2

I fixed that, This was caused by a now obsolete performance optimization that made it necessary to pass the open state in from the data panel. I just removed the optimization.

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@flash1293
Copy link
Copy Markdown
Contributor

@cchaos tests should work now

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@cchaos cchaos marked this pull request as ready for review September 24, 2019 18:17
@cchaos cchaos requested a review from a team September 24, 2019 18:17
@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Sep 24, 2019

Awesome, thank you @flash1293 ! I'll rebase the PR and do the browser checks. I think it's ready for review then.

@cchaos cchaos added Feature:Lens Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.5.0 v8.0.0 labels Sep 24, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-app

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@cchaos cchaos requested a review from a team as a code owner September 24, 2019 22:48
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@cchaos cchaos added the release_note:skip Skip the PR/issue when compiling release notes label Sep 25, 2019
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Sep 25, 2019

This PR's ready for a final review.

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Sep 27, 2019

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Sep 27, 2019

Random unrelated failing jest test. Gonna merge with upstream manually to see if it fixes it.

@cchaos cchaos force-pushed the lens-index-pattern-select branch from 6afd876 to 93567a1 Compare September 27, 2019 13:59
Copy link
Copy Markdown
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

LGTM

Just a thought on the css. Would it be good for us to set a max-width on the popover? To avoid this 👇
image

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Sep 27, 2019

Good catch @nickofthyme ! I will add that in

Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

LGTM, tested and works as expected 👍

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@cchaos cchaos merged commit 6494f1e into elastic:master Sep 27, 2019
@cchaos cchaos deleted the lens-index-pattern-select branch September 27, 2019 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.5.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants