diff --git a/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearch.tsx b/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearch.tsx index 26228e8c44..2d93f3cc73 100644 --- a/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearch.tsx +++ b/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearch.tsx @@ -106,6 +106,8 @@ type Props = { shouldRefetch?: boolean; resetShouldRefetch?: () => void; applyView?: boolean; + onLineageClick?: () => void; + isLineageTab?: boolean; }; export const EmbeddedListSearch = ({ @@ -134,6 +136,8 @@ export const EmbeddedListSearch = ({ shouldRefetch, resetShouldRefetch, applyView = false, + onLineageClick, + isLineageTab = false, }: Props) => { const { shouldRefetchEmbeddedListSearch, setShouldRefetchEmbeddedListSearch } = useEntityContext(); // Adjust query based on props @@ -143,7 +147,6 @@ export const EmbeddedListSearch = ({ unionType, filters, }; - const finalFilters = (fixedFilters && mergeFilterSets(fixedFilters, baseFilters)) || generateOrFilters(unionType, filters); @@ -191,6 +194,12 @@ export const EmbeddedListSearch = ({ fetchPolicy: 'cache-first', }); + const [serverError, setServerError] = useState(undefined); + + useEffect(() => { + setServerError(error); + }, [error]); + useEffect(() => { if (shouldRefetch && resetShouldRefetch) { refetch({ @@ -282,9 +291,18 @@ export const EmbeddedListSearch = ({ }); } + const isServerOverloadError = [503, 500, 504].includes(serverError?.networkError?.response?.status); + + const onClickLessHops = () => { + setServerError(undefined); + onChangeFilters(defaultFilters); + }; + + const ErrorMessage = () => ; + return ( - {error && } + {!isLineageTab ? error && : serverError && !isServerOverloadError && } onChangeQuery(addFixedQuery(q, fixedQuery as string, emptySearchQuery as string))} placeholderText={placeholderText} @@ -303,6 +321,10 @@ export const EmbeddedListSearch = ({ /> void; entityAction?: React.FC; applyView?: boolean; + isServerOverloadError?: any; + onClickLessHops?: () => void; + onLineageClick?: () => void; + isLineageTab?: boolean; } export const EmbeddedListSearchResults = ({ @@ -104,6 +122,10 @@ export const EmbeddedListSearchResults = ({ setNumResultsPerPage, entityAction, applyView, + isServerOverloadError, + onClickLessHops, + onLineageClick, + isLineageTab = false, }: Props) => { const pageStart = searchResponse?.start || 0; const pageSize = searchResponse?.count || 0; @@ -131,7 +153,19 @@ export const EmbeddedListSearchResults = ({ } /> )} - {!loading && ( + {isLineageTab && !loading && isServerOverloadError && ( + + Data is too large. Please use + + visualize lineage + + or see less hops by clicking + + here + + + )} + {!loading && !isServerOverloadError && ( void; applyView?: boolean; + onLineageClick?: () => void; + isLineageTab?: boolean; }; export const EmbeddedListSearchSection = ({ @@ -69,6 +71,8 @@ export const EmbeddedListSearchSection = ({ shouldRefetch, resetShouldRefetch, applyView, + onLineageClick, + isLineageTab }: Props) => { const history = useHistory(); const location = useLocation(); @@ -155,6 +159,8 @@ export const EmbeddedListSearchSection = ({ shouldRefetch={shouldRefetch} resetShouldRefetch={resetShouldRefetch} applyView={applyView} + onLineageClick={onLineageClick} + isLineageTab={isLineageTab} /> ); }; diff --git a/datahub-web-react/src/app/entity/shared/tabs/Lineage/ImpactAnalysis.tsx b/datahub-web-react/src/app/entity/shared/tabs/Lineage/ImpactAnalysis.tsx index ce5a1598a0..4f1c5bb988 100644 --- a/datahub-web-react/src/app/entity/shared/tabs/Lineage/ImpactAnalysis.tsx +++ b/datahub-web-react/src/app/entity/shared/tabs/Lineage/ImpactAnalysis.tsx @@ -13,6 +13,8 @@ type Props = { skipCache?: boolean; setSkipCache?: (skipCache: boolean) => void; resetShouldRefetch?: () => void; + onLineageClick?: () => void; + isLineageTab?: boolean; }; export const ImpactAnalysis = ({ @@ -24,6 +26,8 @@ export const ImpactAnalysis = ({ skipCache, setSkipCache, resetShouldRefetch, + onLineageClick, + isLineageTab }: Props) => { const finalStartTimeMillis = startTimeMillis || undefined; const finalEndTimeMillis = endTimeMillis || undefined; @@ -49,6 +53,8 @@ export const ImpactAnalysis = ({ defaultFilters={[{ field: 'degree', values: ['1'] }]} shouldRefetch={shouldRefetch} resetShouldRefetch={resetShouldRefetch} + onLineageClick={onLineageClick} + isLineageTab={isLineageTab} /> ); }; diff --git a/datahub-web-react/src/app/entity/shared/tabs/Lineage/LineageTab.tsx b/datahub-web-react/src/app/entity/shared/tabs/Lineage/LineageTab.tsx index bbc86d4940..a5debe43d4 100644 --- a/datahub-web-react/src/app/entity/shared/tabs/Lineage/LineageTab.tsx +++ b/datahub-web-react/src/app/entity/shared/tabs/Lineage/LineageTab.tsx @@ -181,6 +181,8 @@ export const LineageTab = ({