mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-03 04:10:43 +00:00
fix(search): fix search on paginated lists (#9198)
This commit is contained in:
parent
5dd09dd62e
commit
8451c758e7
@ -92,7 +92,10 @@ export const GroupList = () => {
|
||||
fontSize: 12,
|
||||
}}
|
||||
onSearch={() => null}
|
||||
onQueryChange={(q) => setQuery(q)}
|
||||
onQueryChange={(q) => {
|
||||
setPage(1);
|
||||
setQuery(q);
|
||||
}}
|
||||
entityRegistry={entityRegistry}
|
||||
hideRecommendations
|
||||
/>
|
||||
|
||||
@ -135,7 +135,10 @@ export const UserList = () => {
|
||||
fontSize: 12,
|
||||
}}
|
||||
onSearch={() => null}
|
||||
onQueryChange={(q) => setQuery(q)}
|
||||
onQueryChange={(q) => {
|
||||
setPage(1);
|
||||
setQuery(q);
|
||||
}}
|
||||
entityRegistry={entityRegistry}
|
||||
hideRecommendations
|
||||
/>
|
||||
|
||||
@ -54,10 +54,10 @@ export const SecretsList = () => {
|
||||
input: {
|
||||
start,
|
||||
count: pageSize,
|
||||
query: query && query.length > 0 ? query : undefined,
|
||||
query: (query?.length && query) || undefined,
|
||||
},
|
||||
},
|
||||
fetchPolicy: query && query.length > 0 ? 'no-cache' : 'cache-first',
|
||||
fetchPolicy: (query?.length || 0) > 0 ? 'no-cache' : 'cache-first',
|
||||
});
|
||||
|
||||
const totalSecrets = data?.listSecrets?.total || 0;
|
||||
@ -197,7 +197,10 @@ export const SecretsList = () => {
|
||||
fontSize: 12,
|
||||
}}
|
||||
onSearch={() => null}
|
||||
onQueryChange={(q) => setQuery(q)}
|
||||
onQueryChange={(q) => {
|
||||
setPage(1);
|
||||
setQuery(q);
|
||||
}}
|
||||
entityRegistry={entityRegistry}
|
||||
hideRecommendations
|
||||
/>
|
||||
|
||||
@ -107,10 +107,10 @@ export const IngestionSourceList = () => {
|
||||
input: {
|
||||
start,
|
||||
count: pageSize,
|
||||
query,
|
||||
query: (query?.length && query) || undefined,
|
||||
},
|
||||
},
|
||||
fetchPolicy: 'cache-first',
|
||||
fetchPolicy: (query?.length || 0) > 0 ? 'no-cache' : 'cache-first',
|
||||
});
|
||||
const [createIngestionSource] = useCreateIngestionSourceMutation();
|
||||
const [updateIngestionSource] = useUpdateIngestionSourceMutation();
|
||||
@ -399,7 +399,10 @@ export const IngestionSourceList = () => {
|
||||
fontSize: 12,
|
||||
}}
|
||||
onSearch={() => null}
|
||||
onQueryChange={(q) => setQuery(q)}
|
||||
onQueryChange={(q) => {
|
||||
setPage(1);
|
||||
setQuery(q);
|
||||
}}
|
||||
entityRegistry={entityRegistry}
|
||||
hideRecommendations
|
||||
/>
|
||||
|
||||
@ -166,7 +166,6 @@ export const ManagePolicies = () => {
|
||||
data: policiesData,
|
||||
refetch: policiesRefetch,
|
||||
} = useListPoliciesQuery({
|
||||
fetchPolicy: 'no-cache',
|
||||
variables: {
|
||||
input: {
|
||||
start,
|
||||
@ -174,6 +173,7 @@ export const ManagePolicies = () => {
|
||||
query,
|
||||
},
|
||||
},
|
||||
fetchPolicy: (query?.length || 0) > 0 ? 'no-cache' : 'cache-first',
|
||||
});
|
||||
|
||||
// Any time a policy is removed, edited, or created, refetch the list.
|
||||
@ -476,7 +476,10 @@ export const ManagePolicies = () => {
|
||||
fontSize: 12,
|
||||
}}
|
||||
onSearch={() => null}
|
||||
onQueryChange={(q) => setQuery(q)}
|
||||
onQueryChange={(q) => {
|
||||
setPage(1);
|
||||
setQuery(q);
|
||||
}}
|
||||
entityRegistry={entityRegistry}
|
||||
hideRecommendations
|
||||
/>
|
||||
|
||||
@ -72,7 +72,6 @@ export const ManageRoles = () => {
|
||||
data: rolesData,
|
||||
refetch: rolesRefetch,
|
||||
} = useListRolesQuery({
|
||||
fetchPolicy: 'cache-first',
|
||||
variables: {
|
||||
input: {
|
||||
start,
|
||||
@ -80,6 +79,7 @@ export const ManageRoles = () => {
|
||||
query,
|
||||
},
|
||||
},
|
||||
fetchPolicy: (query?.length || 0) > 0 ? 'no-cache' : 'cache-first',
|
||||
});
|
||||
|
||||
const totalRoles = rolesData?.listRoles?.total || 0;
|
||||
@ -238,7 +238,10 @@ export const ManageRoles = () => {
|
||||
fontSize: 12,
|
||||
}}
|
||||
onSearch={() => null}
|
||||
onQueryChange={(q) => setQuery(q)}
|
||||
onQueryChange={(q) => {
|
||||
setPage(1);
|
||||
setQuery(q);
|
||||
}}
|
||||
entityRegistry={entityRegistry}
|
||||
/>
|
||||
{isBatchAddRolesModalVisible && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user