Parameter search & inline display for Past Runs and Run History pages (#3985)

This commit is contained in:
Celal Zamanoglu
2025-11-14 01:33:39 +03:00
committed by GitHub
parent f1e118ab2b
commit a95837783a
10 changed files with 797 additions and 257 deletions

View File

@@ -13,12 +13,18 @@ type Props = {
page?: number;
pageSize?: number;
statusFilters?: Array<Status>;
search?: string;
} & UseQueryOptions;
function useRunsQuery({ page = 1, pageSize = 10, statusFilters }: Props) {
function useRunsQuery({
page = 1,
pageSize = 10,
statusFilters,
search,
}: Props) {
const credentialGetter = useCredentialGetter();
return useQuery<Array<Task | WorkflowRunApiResponse>>({
queryKey: ["runs", { statusFilters }, page, pageSize],
queryKey: ["runs", { statusFilters }, page, pageSize, search],
queryFn: async () => {
const client = await getClient(credentialGetter);
const params = new URLSearchParams();
@@ -29,6 +35,9 @@ function useRunsQuery({ page = 1, pageSize = 10, statusFilters }: Props) {
params.append("status", status);
});
}
if (search) {
params.append("search_key", search);
}
return client.get("/runs", { params }).then((res) => res.data);
},
});