From 76341658dcc054b7560e8eebc78019cfc1a5ff41 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 3 Nov 2025 10:19:47 +0300 Subject: [PATCH] Remove tool runner mako, show message instead --- .../webapps/galaxy/controllers/async.py | 4 +- .../webapps/galaxy/controllers/tool_runner.py | 13 ++++- lib/galaxy_test/api/test_authenticate.py | 3 ++ .../webapps/galaxy/root/tool_runner.mako | 47 ------------------- 4 files changed, 18 insertions(+), 49 deletions(-) delete mode 100644 templates/webapps/galaxy/root/tool_runner.mako diff --git a/lib/galaxy/webapps/galaxy/controllers/async.py b/lib/galaxy/webapps/galaxy/controllers/async.py index 690700ca7af..07c89b89f67 100644 --- a/lib/galaxy/webapps/galaxy/controllers/async.py +++ b/lib/galaxy/webapps/galaxy/controllers/async.py @@ -230,4 +230,6 @@ class ASync(BaseUIController): trans.sa_session.commit() - return trans.fill_template("root/tool_runner.mako", out_data={}, num_jobs=1, job_errors=[]) + return trans.show_ok_message( + "A job has been successfully added to the queue. You can check the status of queued jobs in the History panel." + ) diff --git a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py index 3c8f537ae6c..fddc9e88321 100644 --- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py +++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py @@ -113,7 +113,18 @@ class ToolRunner(BaseUIController): error(galaxy.util.unicodify(e)) if len(params) > 0: trans.log_event(f"Tool params: {str(params)}", tool_id=tool_id) - return trans.fill_template("root/tool_runner.mako", **vars) + status_text = "You can check the status of queued jobs in the History panel." + job_errors = vars.get("job_errors") + num_jobs = vars.get("num_jobs") + if job_errors: + errors = "\n".join(f"- {job_error}" for job_error in job_errors) + message = f"There were errors setting up {len(job_errors)} submitted job(s):\n{errors}" + return trans.show_error_message(message) + if num_jobs > 1: + message = f"{num_jobs} jobs have been successfully added to the queue. {status_text}" + else: + message = f"A job has been successfully added to the queue. {status_text}" + return trans.show_ok_message(message) @web.expose def rerun(self, trans, id=None, job_id=None, **kwd): diff --git a/lib/galaxy_test/api/test_authenticate.py b/lib/galaxy_test/api/test_authenticate.py index 7cd375516a3..68c5f25c855 100644 --- a/lib/galaxy_test/api/test_authenticate.py +++ b/lib/galaxy_test/api/test_authenticate.py @@ -46,6 +46,9 @@ class TestAuthenticateApi(ApiTestCase): tool_runner_response.raise_for_status() # Verify that we're not returning the sessioncookie assert "galaxysession" not in tool_runner_response.cookies + # Verify text message + text = tool_runner_response.text + assert "A job has been successfully added to the queue." in text # Make sure history for original session received job current_history_json_response = get( urljoin(self.url, "history/current_history_json"), cookies={"galaxysession": galaxy_session_cookie} diff --git a/templates/webapps/galaxy/root/tool_runner.mako b/templates/webapps/galaxy/root/tool_runner.mako deleted file mode 100644 index c90a9bda53f..00000000000 --- a/templates/webapps/galaxy/root/tool_runner.mako +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Galaxy - %if app.config.brand: - | ${app.config.brand} - %endif - - - - - - -
- %if num_jobs > 1: - <% jobs_str = "%d jobs have" % num_jobs %> - %else: - <% jobs_str = "A job has" %> - %endif - %if len(out_data) == 1: - <% datasets_str = "dataset" %> - %else: - <% datasets_str = "datasets" %> - %endif -

- ${jobs_str} been successfully added to the queue - resulting in the following ${datasets_str}: -

- %for _, data in out_data: -
${data.hid}: ${data.name | h}
- %endfor -

You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered. You are now being redirected back to Galaxy.

-
- %if job_errors: -
- There were errors setting up ${len(job_errors)} submitted job(s): - -
- %endif - -