Skip to content

Commit

Permalink
Overhaul workflow execution response, including appropriate text for …
Browse files Browse the repository at this point in the history
…new histories, and multiple executions. With links.
  • Loading branch information
dannon committed May 29, 2018
1 parent d4cb7c6 commit f3dccb7
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions client/galaxy/scripts/mvc/tool/tool-form-composite.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,22 +686,28 @@ var View = Backbone.View.extend({
/** Templates */
_templateSuccess: function(response) {
if ($.isArray(response) && response.length > 0) {
return $("<div/>")
.addClass("donemessagelarge")
.append(
$("<p/>").html(
`Successfully invoked workflow <b>${Utils.sanitize(this.model.get("name"))}</b>${
response.length > 1 ? ` <b>${response.length} times</b>` : ""
}.`
)
)
.append(
$("<p/>")
.append("<b/>")
.text(
"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."
)
);
console.debug(response);
let timesExecuted = "";
// Default destination blurb, used for a single execution, same history.
let destinationBlurb = "You can check the status of queued jobs and view the resulting data by refreshing the History pane, if this has not already happened automatically.";
if (response.length > 1){
// Executed more than one time, build blurb but skip history link.
timesExecuted = `<em> - ${response.length} times</em>`;
destinationBlurb = `This workflow will generate results in multiple histories. You can observe progress in the <a href="${Galaxy.root}/history/view_multiple">history multi-view</a>.`;
} else if (response[0].history_id && Galaxy.currHistoryPanel && Galaxy.currHistoryPanel.model.id != response[0].history_id){
// Single execution, with a destination other than the
// current history. Present a link.
destinationBlurb = `This workflow will generate results in a new history. <a href="${Galaxy.root}/history/switch_to_history?hist_id=${response[0].history_id}">Switch to that history now</a>.`;
}
return $(`
<div class="donemessagelarge">
<p>
Successfully invoked workflow <b>${Utils.sanitize(this.model.get("name"))}</b>${timesExecuted}.
</p>
<p>
${destinationBlurb}
</p>
</div>`);
} else {
return this._templateError(response, "Invalid success response. No invocations found.");
}
Expand Down

0 comments on commit f3dccb7

Please sign in to comment.