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

[EuiSelectable] export SiteWideRenderOptions and wire-up isPreFiltered #4305

Merged
merged 3 commits into from
Nov 25, 2020

Conversation

myasonik
Copy link
Contributor

@myasonik myasonik commented Nov 24, 2020

Summary

Fixes #4277

This PR does two things:

  1. Export euiSelectableTemplateSitewideRenderOptions so that consumers can customize the renderOption around it while still using the same option component
    • This enables Kibana to customize the searchValue that gets passed in to control highlighting
  2. Allow isPreFiltered to be passed into the component and pass it along to the sorting function. (The sorting function already supported this flag but there was no way to use it.)
    • This avoids some sorting work in EUI, which allows Kibana to roll in advanced searching using some basic queries.

Checklist

Also tested changes in Kibana confirming everything works.

  • Props have proper autodocs
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • A changelog entry exists and is marked appropriately
  • [ ] Check against all themes for compatibility in both light and dark modes
  • [ ] Checked in mobile
  • [ ] Checked in Chrome, Safari, Edge, and Firefox
  • [ ] Added documentation
  • [ ] Checked Code Sandbox works for the any docs examples
  • [ ] Checked for accessibility including keyboard-only and screenreader modes

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4305/

@myasonik myasonik marked this pull request as ready for review November 24, 2020 23:20
@myasonik myasonik changed the title selectable changes [EuiSelectable] export SiteWideRenderOptions and wire-up isPreFiltered Nov 24, 2020
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4305/

Copy link
Contributor

@miukimiu miukimiu left a comment

Choose a reason for hiding this comment

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

Looked at the code and LGTM!

But @chandlerprall or @thompsongl are probably more indicated to do the review.

@@ -288,6 +288,7 @@ export {
EuiSelectableMessage,
EuiSelectableSearch,
EuiSelectableTemplateSitewide,
euiSelectableTemplateSitewideRenderOptions,
Copy link
Contributor

Choose a reason for hiding this comment

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

@cchaos I noticed that you named this euiSelectableTemplateSitewideRenderOptions starting with a lower e. Was this on purpose? Is it because is not a type?

Copy link
Contributor

Choose a reason for hiding this comment

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

It isn't a type and not a "proper" React component that can be used in JSX, but is a function which happens to return a React element. Because it's only a function, it begins with lowercase.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it! 👍

@thompsongl thompsongl self-requested a review November 25, 2020 16:14
Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Changes LGTM; tested isPreFiltered functionality locally

@thompsongl thompsongl removed their request for review November 25, 2020 16:40
@chandlerprall
Copy link
Contributor

Merging this as @myasonik is out today.

@chandlerprall chandlerprall merged commit ae6b5f4 into elastic:master Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EuiSelectableTemplateSitewide] should allow for customizing the searchValue
4 participants