2929 invocation_job_source_iter ,
3030 summarize_metrics ,
3131)
32- from galaxy .managers .workflows import WorkflowsManager
32+ from galaxy .managers .workflows import (
33+ InvocationFilters ,
34+ WorkflowsManager ,
35+ )
3336from galaxy .model import (
3437 HistoryDatasetAssociation ,
3538 HistoryDatasetCollectionAssociation ,
3639 WorkflowInvocation ,
3740 WorkflowInvocationStep ,
3841 WorkflowRequestInputParameter ,
3942)
43+ from galaxy .schema import FilterQueryParams
4044from galaxy .schema .fields import DecodedDatabaseIdField
4145from galaxy .schema .invocation import (
4246 CreateInvocationFromStore ,
@@ -89,15 +93,21 @@ def __init__(
8993 security : IdEncodingHelper ,
9094 histories_manager : HistoryManager ,
9195 workflows_manager : WorkflowsManager ,
96+ filters : InvocationFilters ,
9297 short_term_storage_allocator : ShortTermStorageAllocator ,
9398 ):
9499 super ().__init__ (security = security )
95100 self ._histories_manager = histories_manager
96101 self ._workflows_manager = workflows_manager
102+ self .filters = filters
97103 self .short_term_storage_allocator = short_term_storage_allocator
98104
99105 def index (
100- self , trans , invocation_payload : InvocationIndexPayload , serialization_params : InvocationSerializationParams
106+ self ,
107+ trans ,
108+ invocation_payload : InvocationIndexPayload ,
109+ serialization_params : InvocationSerializationParams ,
110+ filter_query_params : FilterQueryParams ,
101111 ) -> Tuple [List [WorkflowInvocationResponse ], int ]:
102112 workflow_id = invocation_payload .workflow_id
103113 if invocation_payload .instance :
@@ -121,6 +131,10 @@ def index(
121131 # Get all invocations if user is admin (and user_id is None).
122132 # xref https://github.com/galaxyproject/galaxy/pull/13862#discussion_r865732297
123133 user_id = invocation_payload .user_id
134+
135+ filter_params = self .filters .build_filter_params (filter_query_params )
136+ filters = self .filters .parse_filters (filter_params )
137+
124138 invocations , total_matches = self ._workflows_manager .build_invocations_query (
125139 trans ,
126140 stored_workflow_id = invocation_payload .workflow_id ,
@@ -134,6 +148,7 @@ def index(
134148 sort_desc = invocation_payload .sort_desc ,
135149 include_nested_invocations = invocation_payload .include_nested_invocations ,
136150 check_ownership = False ,
151+ filters = filters ,
137152 )
138153 invocation_dict = self .serialize_workflow_invocations (invocations , serialization_params )
139154 return invocation_dict , total_matches
0 commit comments