fix(ui) Disable cache on Domain and Glossary Related Entities pages (#7867)

This commit is contained in:
Chris Collins 2023-04-20 14:03:25 -04:00 committed by GitHub
parent 1ff6949e36
commit b58894662e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 2 deletions

View File

@ -24,6 +24,7 @@ export const DomainEntitiesTab = () => {
}}
emptySearchQuery="*"
placeholderText="Filter domain entities..."
skipCache
/>
);
};

View File

@ -46,6 +46,7 @@ export default function GlossaryRelatedEntity() {
}}
emptySearchQuery="*"
placeholderText="Filter entities..."
skipCache
/>
);
}

View File

@ -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<FacetFilterInput>;
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: {

View File

@ -31,6 +31,7 @@ type Props = {
defaultFilters?: Array<FacetFilterInput>;
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}

View File

@ -82,6 +82,7 @@ const ContentContainer = styled.div`
height: auto;
min-height: 100%;
flex: 1;
min-width: 0;
`;
const HeaderAndTabs = styled.div`

View File

@ -13,6 +13,7 @@ import { useEntityRegistry } from '../useEntityRegistry';
const ContentWrapper = styled.div`
display: flex;
flex: 1;
overflow: hidden;
`;
export default function GlossaryRoutes() {