Remove tool runner mako, show message instead

This commit is contained in:
guerler
2025-11-26 18:11:51 +03:00
parent 5d9a193d8a
commit 76341658dc
4 changed files with 18 additions and 49 deletions
@@ -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."
)
@@ -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):
+3
View File
@@ -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}
@@ -1,47 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
Galaxy
%if app.config.brand:
| ${app.config.brand}
%endif
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
<script type="text/javascript">
setTimeout( function() { top.location.href = '${h.url_for( "/" )}'; }, 1000 );
</script>
</head>
<body>
<div class="donemessagelarge">
%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
<p>
${jobs_str} been successfully added to the queue - resulting in the following ${datasets_str}:
</p>
%for _, data in out_data:
<div style="padding: 10px"><b> ${data.hid}: ${data.name | h}</b></div>
%endfor
<p> You can check the status of queued jobs and view the resulting data by refreshing the <b>History</b> 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 <a href="${h.url_for( '/' )}">Galaxy</a>.</p>
</div>
%if job_errors:
<div class="errormessagelarge">
There were errors setting up ${len(job_errors)} submitted job(s):
<ul>
%for job_error in job_errors:
<li><b>${job_error | h}</b></li>
%endfor
</ul>
</div>
%endif
</body>
</html>