Skip to content

Commit

Permalink
Fix for link pop-up window/toaster after Data Library to History import
Browse files Browse the repository at this point in the history
  • Loading branch information
hujambo-dunia committed Apr 26, 2023
1 parent dab53cd commit 9260c82
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var ImportDatasetModal = Backbone.View.extend({
// set the used history as current so user will see the last one
// that he imported into in the history panel on the 'analysis' page
$.getJSON(`${getAppRoot()}history/set_as_current?id=${history_id}`);
this.chainCallImportingIntoHistory(items_to_import, history_name);
this.chainCallImportingIntoHistory(items_to_import, history_name, history_id);
},

initChainCallControlToHistory: function (options) {
Expand All @@ -147,27 +147,23 @@ var ImportDatasetModal = Backbone.View.extend({
* @param {array} history_item_set array of empty history items
* @param {str} history_name name of the history to import to
*/
chainCallImportingIntoHistory: function (history_item_set, history_name) {
chainCallImportingIntoHistory: function (history_item_set, history_name, history_id) {
const Galaxy = getGalaxyInstance();
var popped_item = history_item_set.pop();
if (typeof popped_item == "undefined") {
if (this.options.chain_call_control.failed_number === 0) {
Toast.success("Selected datasets imported into history. Click this to start analyzing it.", "", {
onclick: () => {
window.location = getAppRoot();
},
});
Toast.success(
"Selected datasets imported into history. Click this to start analyzing it.",
"",
`${getAppRoot()}histories/view?id=${history_id}`
);
} else if (this.options.chain_call_control.failed_number === this.options.chain_call_control.total_number) {
Toast.error("There was an error and no datasets were imported into history.");
} else if (this.options.chain_call_control.failed_number < this.options.chain_call_control.total_number) {
Toast.warning(
"Some of the datasets could not be imported into history. Click this to see what was imported.",
"",
{
onclick: () => {
window.location = getAppRoot();
},
}
`${getAppRoot()}histories/view?id=${history_id}`
);
}
Galaxy.modal.hide();
Expand Down

0 comments on commit 9260c82

Please sign in to comment.