Skip to content

Commit

Permalink
fix(siblings) Combine siblings in embedded search results (datahub-pr…
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscollins3456 authored Sep 19, 2024
1 parent 7713ea5 commit 06e0deb
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { SearchFiltersSection } from '../../../../../search/SearchFiltersSection
import { EntitySearchResults, EntityActionProps } from './EntitySearchResults';
import MatchingViewsLabel from './MatchingViewsLabel';
import { ANTD_GRAY } from '../../../constants';
import { useIsShowSeparateSiblingsEnabled } from '../../../../../useAppConfig';
import { combineSiblingsInSearchResults } from '../../../../../search/utils/combineSiblingsInSearchResults';

const SearchBody = styled.div`
height: 100%;
Expand Down Expand Up @@ -129,6 +131,12 @@ export const EmbeddedListSearchResults = ({
onLineageClick,
isLineageTab = false,
}: Props) => {
const showSeparateSiblings = useIsShowSeparateSiblingsEnabled();
const combinedSiblingSearchResults = combineSiblingsInSearchResults(
showSeparateSiblings,
searchResponse?.searchResults,
);

const pageStart = searchResponse?.start || 0;
const pageSize = searchResponse?.count || 0;
const totalResults = searchResponse?.total || 0;
Expand Down Expand Up @@ -169,9 +177,9 @@ export const EmbeddedListSearchResults = ({
)}
{!loading && !isServerOverloadError && (
<EntitySearchResults
searchResults={searchResponse?.searchResults || []}
searchResults={combinedSiblingSearchResults || []}
additionalPropertiesList={
searchResponse?.searchResults?.map((searchResult) => ({
combinedSiblingSearchResults?.map((searchResult) => ({
// when we add impact analysis, we will want to pipe the path to each element to the result this
// eslint-disable-next-line @typescript-eslint/dot-notation
degree: searchResult['degree'],
Expand Down

0 comments on commit 06e0deb

Please sign in to comment.