From b58894662ee0cfdcbbdf3669819077d815e17d89 Mon Sep 17 00:00:00 2001 From: Chris Collins Date: Thu, 20 Apr 2023 14:03:25 -0400 Subject: [PATCH] fix(ui) Disable cache on Domain and Glossary Related Entities pages (#7867) --- .../src/app/entity/domain/DomainEntitiesTab.tsx | 1 + .../glossaryTerm/profile/GlossaryRelatedEntity.tsx | 1 + .../styled/search/EmbeddedListSearch.tsx | 14 ++++++++++++-- .../styled/search/EmbeddedListSearchSection.tsx | 3 +++ .../shared/containers/profile/EntityProfile.tsx | 1 + .../src/app/glossary/GlossaryRoutes.tsx | 1 + 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/datahub-web-react/src/app/entity/domain/DomainEntitiesTab.tsx b/datahub-web-react/src/app/entity/domain/DomainEntitiesTab.tsx index ff8bec2744..3e0a4700a9 100644 --- a/datahub-web-react/src/app/entity/domain/DomainEntitiesTab.tsx +++ b/datahub-web-react/src/app/entity/domain/DomainEntitiesTab.tsx @@ -24,6 +24,7 @@ export const DomainEntitiesTab = () => { }} emptySearchQuery="*" placeholderText="Filter domain entities..." + skipCache /> ); }; diff --git a/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedEntity.tsx b/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedEntity.tsx index da921adb38..b154b75f05 100644 --- a/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedEntity.tsx +++ b/datahub-web-react/src/app/entity/glossaryTerm/profile/GlossaryRelatedEntity.tsx @@ -46,6 +46,7 @@ export default function GlossaryRelatedEntity() { }} emptySearchQuery="*" placeholderText="Filter entities..." + skipCache /> ); } 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 169940bdbe..ed8c4a2070 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 @@ -1,7 +1,12 @@ import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; import { ApolloError } from '@apollo/client'; -import { EntityType, FacetFilterInput, FacetMetadata } from '../../../../../../types.generated'; +import { + EntityType, + FacetFilterInput, + FacetMetadata, + SearchAcrossEntitiesInput, +} from '../../../../../../types.generated'; import { ENTITY_FILTER_NAME, UnionType } from '../../../../../search/utils/constants'; import { SearchCfg } from '../../../../../../conf'; import { EmbeddedListSearchResults } from './EmbeddedListSearchResults'; @@ -73,6 +78,7 @@ type Props = { defaultFilters?: Array; searchBarStyle?: any; searchBarInputStyle?: any; + skipCache?: boolean; useGetSearchResults?: (params: GetSearchResultsParams) => { data: SearchResultsInterface | undefined | null; loading: boolean; @@ -100,6 +106,7 @@ export const EmbeddedListSearch = ({ defaultFilters, searchBarStyle, searchBarInputStyle, + skipCache, useGetSearchResults = useWrappedSearchResults, shouldRefetch, resetShouldRefetch, @@ -146,13 +153,16 @@ export const EmbeddedListSearch = ({ return refetchForDownload(variables).then((res) => res.data.scrollAcrossEntities); }; - const searchInput = { + let searchInput: SearchAcrossEntitiesInput = { types: entityFilters, query: finalQuery, start: (page - 1) * numResultsPerPage, count: numResultsPerPage, orFilters: finalFilters, }; + if (skipCache) { + searchInput = { ...searchInput, searchFlags: { skipCache: true } }; + } const { data, loading, error, refetch } = useGetSearchResults({ variables: { diff --git a/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearchSection.tsx b/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearchSection.tsx index 4e1661cb15..202900279d 100644 --- a/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearchSection.tsx +++ b/datahub-web-react/src/app/entity/shared/components/styled/search/EmbeddedListSearchSection.tsx @@ -31,6 +31,7 @@ type Props = { defaultFilters?: Array; searchBarStyle?: any; searchBarInputStyle?: any; + skipCache?: boolean; useGetSearchResults?: (params: GetSearchResultsParams) => { data: SearchResultsInterface | undefined | null; loading: boolean; @@ -50,6 +51,7 @@ export const EmbeddedListSearchSection = ({ defaultFilters, searchBarStyle, searchBarInputStyle, + skipCache, useGetSearchResults, shouldRefetch, resetShouldRefetch, @@ -133,6 +135,7 @@ export const EmbeddedListSearchSection = ({ defaultFilters={defaultFilters} searchBarStyle={searchBarStyle} searchBarInputStyle={searchBarInputStyle} + skipCache={skipCache} useGetSearchResults={useGetSearchResults} shouldRefetch={shouldRefetch} resetShouldRefetch={resetShouldRefetch} diff --git a/datahub-web-react/src/app/entity/shared/containers/profile/EntityProfile.tsx b/datahub-web-react/src/app/entity/shared/containers/profile/EntityProfile.tsx index 3c3bdb018f..29ba3b2a9b 100644 --- a/datahub-web-react/src/app/entity/shared/containers/profile/EntityProfile.tsx +++ b/datahub-web-react/src/app/entity/shared/containers/profile/EntityProfile.tsx @@ -82,6 +82,7 @@ const ContentContainer = styled.div` height: auto; min-height: 100%; flex: 1; + min-width: 0; `; const HeaderAndTabs = styled.div` diff --git a/datahub-web-react/src/app/glossary/GlossaryRoutes.tsx b/datahub-web-react/src/app/glossary/GlossaryRoutes.tsx index ac34c1f43c..abba77d1a3 100644 --- a/datahub-web-react/src/app/glossary/GlossaryRoutes.tsx +++ b/datahub-web-react/src/app/glossary/GlossaryRoutes.tsx @@ -13,6 +13,7 @@ import { useEntityRegistry } from '../useEntityRegistry'; const ContentWrapper = styled.div` display: flex; flex: 1; + overflow: hidden; `; export default function GlossaryRoutes() {