Skip to content

Commit f6c7c54

Browse files
committed
Make invocation link clickable
1 parent d427537 commit f6c7c54

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

planemo/galaxy/activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ def wait_for_invocation_and_jobs(
786786
):
787787
polling_tracker = PollingTrackerImpl(polling_backoff)
788788
invocation_api = BioblendInvocationApi(ctx, user_gi)
789-
with WorkflowProgressDisplay(invocation_id) as workflow_progress_display:
789+
with WorkflowProgressDisplay(invocation_id, galaxy_url=user_gi.base_url) as workflow_progress_display:
790790
final_invocation_state, job_state, error_message = polling_wait_for_invocation_and_jobs(
791791
ctx,
792792
invocation_id,

planemo/galaxy/invocations/progress.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,14 @@ def __init__(
254254
self,
255255
invocation_id: str,
256256
display_configuration: Optional[DisplayConfiguration] = None,
257+
galaxy_url: Optional[str] = None,
257258
):
258259
self.subworkflow_invocation_ids_seen: Set[str] = set()
259260
self.subworkflow_invocation_ids_completed: Set[str] = set()
260261
self.subworkflow_invocation_id: Optional[str] = None
261262
self.invocation_id = invocation_id
262263
display = display_configuration or DisplayConfiguration()
264+
self.galaxy_url = galaxy_url
263265
self.display = display
264266
self.workflow_progress = WorkflowProgress(display)
265267
self.subworkflow_progress = WorkflowProgress(display)
@@ -287,14 +289,20 @@ def an_incomplete_subworkflow_id(self):
287289
def all_subworkflows_complete(self):
288290
return len(self.subworkflow_invocation_ids_seen) == len(self.subworkflow_invocation_ids_completed)
289291

292+
def get_invocation_ui_link(self):
293+
if self.galaxy_url:
294+
return f"{self.galaxy_url}/workflows/invocations/{self.invocation_id}"
295+
else:
296+
return None
297+
290298
def _panel(self):
291299
def job_states(workflow_progress):
292300
if self.display.include_job_state_breakdown:
293301
return workflow_progress._job_states_console_line()
294302
else:
295303
return None
296304

297-
title = f"[{self.display.style_header}]{self.display.label_header_prefix}<{self.invocation_id}>"
305+
title = f"[{self.display.style_header}]{self.display.label_header_prefix}<[link={self.get_invocation_ui_link()}]{self.invocation_id}[/link]>"
298306
subworkflow_title = None
299307
if self.subworkflow_invocation_id:
300308
subworkflow_title = f"[{self.display.style_subworkflow_header}]{self.display.label_subworkflow_header_prefix}<{self.subworkflow_invocation_id}>"

0 commit comments

Comments
 (0)