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

[EuiSelectableSitewideTemplate][Fix] Do not show noMatchesMessage if one is provided by consumer #7758

Closed
wants to merge 8 commits into from

Conversation

rshen91
Copy link
Contributor

@rshen91 rshen91 commented May 14, 2024

Summary

Hello team! I'm working on fixing elastic/kibana#151199 and I think this PR addresses the strange behavior.

Please provide me any guidance on the fix and getting it up to library standards. Thank you!

I'm including a video of the strange double no results errors displayed with a slow network:

Screen.Recording.2024-05-14.at.12.56.11.PM.mov
  • Add unit test Add cypress test
  • Update storybook to provide example

@rshen91 rshen91 added the kibana label May 14, 2024
@rshen91 rshen91 marked this pull request as ready for review May 15, 2024 21:14
@rshen91 rshen91 requested a review from a team as a code owner May 15, 2024 21:14
@rshen91 rshen91 changed the title [Fix] Do not show noMatchesMessage if one is provided by consumer [EuiSelectableSitewideTemplate][Fix] Do not show noMatchesMessage if one is provided by consumer May 15, 2024
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@cee-chen
Copy link
Member

@rshen91 To be totally honest with you, I don't see how this PR would fix the issue shown in the screencap. The messages aren't the same at all (EUI's default empty message is No results available, the one in the screenshot is No results found, so they're not the same message).

I'm pretty sure what's happening on a slow network is that the SVG image is just taking extra time to load in.

@@ -243,7 +245,7 @@ export const EuiSelectableTemplateSitewide: FunctionComponent<
}}
loadingMessage={loadingMessage}
emptyMessage={emptyMessage}
noMatchesMessage={emptyMessage}
noMatchesMessage={noMatchesMessage ?? emptyMessage}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cee-chen I think this is the part that's causing the issue in elastic/kibana#151199 since selectable_template_sitewide isn't registering the noMatchesMessage intially? Lmk what you think, I definitely concede I could be misunderstanding.

Copy link
Member

@cee-chen cee-chen May 17, 2024

Choose a reason for hiding this comment

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

It is registering it via ...rest. Anything that comes in from that spread overrides the preceding props, which in production includes noMatchesMessage.

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

Successfully merging this pull request may close these issues.

None yet

4 participants