-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Worked on the pop-over of matched entity #5851
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
Worked on the pop-over of matched entity #5851
Conversation
const { data } = useGetTagQuery({ variables: { urn } }); | ||
return ( | ||
<HoverEntityTooltip> | ||
<TagLink key={data?.tag?.urn}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this should actually be a link to the tag page - so if you look at TagTermGroup.tsx
you can export the TagLink
component and simply import that here! you'll need to set the link like we do in that component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed and committed!!
|
||
return ( | ||
<HoverEntityTooltip> | ||
<TermLink key={data?.glossaryTerm?.urn}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same thing here - replicate what we do in TagTermGroup.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed and committed!!
const snippet = result.matchedFields[0].value.includes('urn:li:tag') ? ( | ||
<TagSummary urn={result.matchedFields[0].value} /> | ||
) : ( | ||
<TermSummary urn={result.matchedFields[0].value} /> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's guaranteed that if this is not a tag then it is a term (in fact I don't think we surface terms here at all?)
I would say if it includes this urn:li:tag
then use the tags summary, then do another check if it contains urn:li:glossaryTerm
and use the terms summary, then if neither of those match, use <b>{result.matchedFields[0].value}</b>
as it was before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed and committed!!
Build & test is failing! |
if (result.matchedFields.length > 0) { | ||
if (result.matchedFields[0].value.includes('urn:li:tag')) { | ||
snippet = <TagSummary urn={result.matchedFields[0].value} />; | ||
} else if (result.matchedFields[0].value.includes('urn:li:term')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be urn:li:glossaryTerm
<TermLink key={data?.glossaryTerm?.urn}> | ||
<Tag closable={false} style={{ cursor: 'pointer' }}> | ||
<BookOutlined style={{ marginRight: '3%' }} /> | ||
{data?.glossaryTerm?.name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use entityRegistry.getDisplayName
here?
…-Vituity/datahub into popover-to-matches
…-Vituity/datahub into popover-to-matches
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Checklist