feat(workflows, runs, api): parameter metadata search/filter/display across workflows and runs (#3718)

Co-authored-by: Jonathan Dobson <jon.m.dobson@gmail.com>
This commit is contained in:
Celal Zamanoglu
2025-10-16 16:04:53 +03:00
committed by GitHub
parent 427e674299
commit 5531367566
9 changed files with 700 additions and 18 deletions

View File

@@ -14,19 +14,27 @@ type Props = {
workflowPermanentId?: string;
statusFilters?: Array<Status>;
page: number;
search?: string;
} & UseQueryOptions;
function useWorkflowRunsQuery({
workflowPermanentId,
statusFilters,
page,
search,
...queryOptions
}: Props) {
const { data: globalWorkflows } = useGlobalWorkflowsQuery();
const credentialGetter = useCredentialGetter();
return useQuery<Array<WorkflowRunApiResponse>>({
queryKey: ["workflowRuns", { statusFilters }, workflowPermanentId, page],
queryKey: [
"workflowRuns",
{ statusFilters },
workflowPermanentId,
page,
search,
],
queryFn: async () => {
const client = await getClient(credentialGetter);
const params = new URLSearchParams();
@@ -42,6 +50,9 @@ function useWorkflowRunsQuery({
params.append("status", status);
});
}
if (search) {
params.append("search_key", search);
}
return client
.get(`/workflows/${workflowPermanentId}/runs`, {