diff --git a/client/src/components/Libraries/LibraryFolder/TopToolbar/add-datasets.js b/client/src/components/Libraries/LibraryFolder/TopToolbar/add-datasets.js index 5733e40d4957..42e5db51eb4b 100644 --- a/client/src/components/Libraries/LibraryFolder/TopToolbar/add-datasets.js +++ b/client/src/components/Libraries/LibraryFolder/TopToolbar/add-datasets.js @@ -32,9 +32,6 @@ var AddDatasets = Backbone.View.extend({ */ showImportModal: function (options) { switch (options.source) { - case "history": - this.addFilesFromHistoryModal(); - break; case "importdir": this.importFilesFromGalaxyFolderModal({ source: "importdir", @@ -176,46 +173,6 @@ var AddDatasets = Backbone.View.extend({ value: "auto", }); }, - addFilesFromHistoryModal: function () { - const Galaxy = getGalaxyInstance(); - this.histories = new mod_library_model.GalaxyHistories(); - this.histories - .fetch() - .done(() => { - this.modal = Galaxy.modal; - var template_modal = this.templateAddFilesFromHistory(); - this.modal.show({ - closing_events: true, - title: _l("Adding datasets from your history"), - body: template_modal({ - histories: this.histories.models, - }), - buttons: { - Add: () => { - this.addAllDatasetsFromHistory(); - }, - Close: () => { - Galaxy.modal.hide(); - }, - }, - closing_callback: () => { - // TODO update table without fetching new content from the server - // Galaxy.libraries.library_router.navigate(`folders/${this.id}`, { trigger: true }); - }, - }); - this.fetchAndDisplayHistoryContents(this.histories.models[0].id); - $("#dataset_add_bulk").change((event) => { - this.fetchAndDisplayHistoryContents(event.target.value); - }); - }) - .fail((model, response) => { - if (typeof response.responseJSON !== "undefined") { - Toast.error(response.responseJSON.err_msg); - } else { - Toast.error("An error occurred."); - } - }); - }, /** * Create modal for importing from given directory * on Galaxy. Bind jQuery events. @@ -546,49 +503,6 @@ var AddDatasets = Backbone.View.extend({ this.chainCallImportingFolders(options); }); }, - - fetchAndDisplayHistoryContents: function (history_id) { - var history_contents = new mod_library_model.HistoryContents({ - id: history_id, - }); - history_contents.fetch({ - success: (history_contents) => { - var history_contents_template = this.templateHistoryContents(); - - if (history_contents.length > 0) { - this.histories.get(history_id).set({ contents: history_contents }); - this.modal.$el.find(".library_selected_history_content").html( - history_contents_template({ - history_contents: history_contents.models.reverse(), - }) - ); - this.modal.$el.find(".history-import-select-all").bind("click", () => { - $(".library_selected_history_content [type=checkbox]").prop("checked", true); - }); - this.modal.$el.find(".history-import-unselect-all").bind("click", () => { - $(".library_selected_history_content [type=checkbox]").prop("checked", false); - }); - - this.modal.$el.find(".history-import-toggle-all").bind("click", (e) => { - this.selectAll(e); - }); - - this.modal.$el.find(".dataset_row").bind("click", (e) => { - this.selectClickedRow(e); - }); - } else { - this.modal.$el.find(".library_selected_history_content").html(`
Selected history is empty.
`); - } - }, - error: (model, response) => { - if (typeof response.responseJSON !== "undefined") { - Toast.error(response.responseJSON.err_msg); - } else { - Toast.error("An error occurred."); - } - }, - }); - }, templateAddingDatasetsProgressBar: function () { return _.template( `- - | -- | Name | -
---|---|---|
- | <%= _.escape(history_item.get("hid")) %> | -- <%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> - (Dataset Collection) - | -
- | <%= _.escape(history_item.get("hid")) %> | -- <%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> - (Dataset Collection of type <%= _.escape(collection_type) %> not supported.) - | -
- | <%= _.escape(history_item.get("hid")) %> | -- <%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> - | -