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

feat(ui) Display consistent search results in embedded searches #8597

Conversation

chriscollins3456
Copy link
Collaborator

Makes an update so that embedded searches display the same search result card as regular search results. That means we show all the same info (usage stats, owners, all that good stuff).

Previously EntityNameList was being used in two different contexts - (1) embedded list searches (2) home page recommendation modules.
The tough thing is that in order to display the regular search card, we need the whole SearchResult object which we have from embedded list searches but not in home page recommendations. So what I did was pull out the contents of EntityNameList and create a new component that is essentially the same but instead takes in SearchResult objects instead of Entity objects and use the entity registry's renderSearch method which displays the full search result card.

Then I stripped EntityNameList of any unused functionality so it only does what is needed for it from the recommendation modules. Therefore the diff is a little misleading here.

Screenshot:
image

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Aug 8, 2023
Copy link
Contributor

@joshuaeilers joshuaeilers left a comment

Choose a reason for hiding this comment

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

Looks reasonable - tested out the different variations where it's rendered already yeah? Like the Recommendations + results.

@chriscollins3456
Copy link
Collaborator Author

Looks reasonable - tested out the different variations where it's rendered already yeah? Like the Recommendations + results.

indeed i have

@chriscollins3456 chriscollins3456 merged commit 9594f2c into datahub-project:master Aug 15, 2023
34 checks passed
/>
)}
{entityRegistry.renderSearchResult(entity.type, searchResult)}
{entityAction && <EntityAction urn={entity.urn} type={entity.type} />}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can test this using the metadata tests flow on acryl

bordered = true,
entityAction,
}: Props) => {
export const EntityNameList = ({ entities, onClick }: Props) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we still using this component anywhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants