mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-18 14:16:48 +00:00
fix(ui) Disable cache on Domain and Glossary Related Entities pages (#7867)
This commit is contained in:
parent
1ff6949e36
commit
b58894662e
@ -24,6 +24,7 @@ export const DomainEntitiesTab = () => {
|
|||||||
}}
|
}}
|
||||||
emptySearchQuery="*"
|
emptySearchQuery="*"
|
||||||
placeholderText="Filter domain entities..."
|
placeholderText="Filter domain entities..."
|
||||||
|
skipCache
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -46,6 +46,7 @@ export default function GlossaryRelatedEntity() {
|
|||||||
}}
|
}}
|
||||||
emptySearchQuery="*"
|
emptySearchQuery="*"
|
||||||
placeholderText="Filter entities..."
|
placeholderText="Filter entities..."
|
||||||
|
skipCache
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { ApolloError } from '@apollo/client';
|
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 { ENTITY_FILTER_NAME, UnionType } from '../../../../../search/utils/constants';
|
||||||
import { SearchCfg } from '../../../../../../conf';
|
import { SearchCfg } from '../../../../../../conf';
|
||||||
import { EmbeddedListSearchResults } from './EmbeddedListSearchResults';
|
import { EmbeddedListSearchResults } from './EmbeddedListSearchResults';
|
||||||
@ -73,6 +78,7 @@ type Props = {
|
|||||||
defaultFilters?: Array<FacetFilterInput>;
|
defaultFilters?: Array<FacetFilterInput>;
|
||||||
searchBarStyle?: any;
|
searchBarStyle?: any;
|
||||||
searchBarInputStyle?: any;
|
searchBarInputStyle?: any;
|
||||||
|
skipCache?: boolean;
|
||||||
useGetSearchResults?: (params: GetSearchResultsParams) => {
|
useGetSearchResults?: (params: GetSearchResultsParams) => {
|
||||||
data: SearchResultsInterface | undefined | null;
|
data: SearchResultsInterface | undefined | null;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
@ -100,6 +106,7 @@ export const EmbeddedListSearch = ({
|
|||||||
defaultFilters,
|
defaultFilters,
|
||||||
searchBarStyle,
|
searchBarStyle,
|
||||||
searchBarInputStyle,
|
searchBarInputStyle,
|
||||||
|
skipCache,
|
||||||
useGetSearchResults = useWrappedSearchResults,
|
useGetSearchResults = useWrappedSearchResults,
|
||||||
shouldRefetch,
|
shouldRefetch,
|
||||||
resetShouldRefetch,
|
resetShouldRefetch,
|
||||||
@ -146,13 +153,16 @@ export const EmbeddedListSearch = ({
|
|||||||
return refetchForDownload(variables).then((res) => res.data.scrollAcrossEntities);
|
return refetchForDownload(variables).then((res) => res.data.scrollAcrossEntities);
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchInput = {
|
let searchInput: SearchAcrossEntitiesInput = {
|
||||||
types: entityFilters,
|
types: entityFilters,
|
||||||
query: finalQuery,
|
query: finalQuery,
|
||||||
start: (page - 1) * numResultsPerPage,
|
start: (page - 1) * numResultsPerPage,
|
||||||
count: numResultsPerPage,
|
count: numResultsPerPage,
|
||||||
orFilters: finalFilters,
|
orFilters: finalFilters,
|
||||||
};
|
};
|
||||||
|
if (skipCache) {
|
||||||
|
searchInput = { ...searchInput, searchFlags: { skipCache: true } };
|
||||||
|
}
|
||||||
|
|
||||||
const { data, loading, error, refetch } = useGetSearchResults({
|
const { data, loading, error, refetch } = useGetSearchResults({
|
||||||
variables: {
|
variables: {
|
||||||
|
@ -31,6 +31,7 @@ type Props = {
|
|||||||
defaultFilters?: Array<FacetFilterInput>;
|
defaultFilters?: Array<FacetFilterInput>;
|
||||||
searchBarStyle?: any;
|
searchBarStyle?: any;
|
||||||
searchBarInputStyle?: any;
|
searchBarInputStyle?: any;
|
||||||
|
skipCache?: boolean;
|
||||||
useGetSearchResults?: (params: GetSearchResultsParams) => {
|
useGetSearchResults?: (params: GetSearchResultsParams) => {
|
||||||
data: SearchResultsInterface | undefined | null;
|
data: SearchResultsInterface | undefined | null;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
@ -50,6 +51,7 @@ export const EmbeddedListSearchSection = ({
|
|||||||
defaultFilters,
|
defaultFilters,
|
||||||
searchBarStyle,
|
searchBarStyle,
|
||||||
searchBarInputStyle,
|
searchBarInputStyle,
|
||||||
|
skipCache,
|
||||||
useGetSearchResults,
|
useGetSearchResults,
|
||||||
shouldRefetch,
|
shouldRefetch,
|
||||||
resetShouldRefetch,
|
resetShouldRefetch,
|
||||||
@ -133,6 +135,7 @@ export const EmbeddedListSearchSection = ({
|
|||||||
defaultFilters={defaultFilters}
|
defaultFilters={defaultFilters}
|
||||||
searchBarStyle={searchBarStyle}
|
searchBarStyle={searchBarStyle}
|
||||||
searchBarInputStyle={searchBarInputStyle}
|
searchBarInputStyle={searchBarInputStyle}
|
||||||
|
skipCache={skipCache}
|
||||||
useGetSearchResults={useGetSearchResults}
|
useGetSearchResults={useGetSearchResults}
|
||||||
shouldRefetch={shouldRefetch}
|
shouldRefetch={shouldRefetch}
|
||||||
resetShouldRefetch={resetShouldRefetch}
|
resetShouldRefetch={resetShouldRefetch}
|
||||||
|
@ -82,6 +82,7 @@ const ContentContainer = styled.div`
|
|||||||
height: auto;
|
height: auto;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const HeaderAndTabs = styled.div`
|
const HeaderAndTabs = styled.div`
|
||||||
|
@ -13,6 +13,7 @@ import { useEntityRegistry } from '../useEntityRegistry';
|
|||||||
const ContentWrapper = styled.div`
|
const ContentWrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default function GlossaryRoutes() {
|
export default function GlossaryRoutes() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user