diff --git a/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue b/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue index c0e758659e0..9ed05975cc2 100644 --- a/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue +++ b/client/src/components/History/CurrentHistory/HistoryOperations/SelectionOperations.vue @@ -314,7 +314,7 @@ export default { await this.buildNewCollection("rules"); }, async buildNewCollection(collectionType) { - const modalResult = await buildCollectionModal(collectionType, this.history.id, this.contentSelection); + const modalResult = await buildCollectionModal(collectionType, this.contentSelection, this.history.id); await createDatasetCollection(this.history, modalResult); // have to hide the source items if that was requested diff --git a/client/src/components/History/adapters/HistoryPanelProxy.js b/client/src/components/History/adapters/HistoryPanelProxy.js index d3eb6a733fe..b5946fef8f2 100644 --- a/client/src/components/History/adapters/HistoryPanelProxy.js +++ b/client/src/components/History/adapters/HistoryPanelProxy.js @@ -61,7 +61,7 @@ export class HistoryPanelProxy { this.model.id = historyId; store.dispatch("history/setCurrentHistory", historyId); } - async buildCollection(collectionType, historyId, selection, fromRulesInput = false) { + async buildCollection(collectionType, selection, historyId = null, fromRulesInput = false) { let selectionContent = null; historyId = historyId || this.model.id; if (fromRulesInput) { @@ -72,7 +72,7 @@ export class HistoryPanelProxy { selectionContent.set(obj.id, obj); }); } - const modalResult = await buildCollectionModal(collectionType, historyId, selectionContent, fromRulesInput); + const modalResult = await buildCollectionModal(collectionType, selectionContent, historyId, fromRulesInput); if (modalResult) { console.debug("Submitting collection build request.", modalResult); await createDatasetCollection({ id: historyId }, modalResult); diff --git a/client/src/components/History/adapters/buildCollectionModal.js b/client/src/components/History/adapters/buildCollectionModal.js index adeb82dc458..355204c9675 100644 --- a/client/src/components/History/adapters/buildCollectionModal.js +++ b/client/src/components/History/adapters/buildCollectionModal.js @@ -15,7 +15,7 @@ import LIST_OF_PAIRS_COLLECTION_CREATOR from "components/Collections/PairedListC import RULE_BASED_COLLECTION_CREATOR from "components/Collections/RuleBasedCollectionCreatorModal"; // stand-in for buildCollection from history-view-edit.js -export async function buildCollectionModal(collectionType, historyId, selectedContent, fromRulesInput = false) { +export async function buildCollectionModal(collectionType, selectedContent, historyId, fromRulesInput = false) { // select legacy function let createFunc; if (collectionType == "list") { diff --git a/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-collection.js b/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-collection.js index ecc305663b6..b707707acf3 100644 --- a/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-collection.js +++ b/client/src/components/Libraries/LibraryFolder/TopToolbar/import-to-history/import-collection.js @@ -104,12 +104,18 @@ var ImportCollectionModal = Backbone.View.extend({ } }, collectionImport: function (collectionElements, historyId) { - this.collectionType = this.modal.$el.find("#library-collection-type-select").val(); - const selection = { - models: collectionElements, - }; + const collectionType = this.modal.$el.find("#library-collection-type-select").val(); + let selection = null; + if (collectionType == "rules") { + selection = collectionElements; + selection.selectionType = "library_datasets"; + } else { + selection = { + models: collectionElements, + }; + } const Galaxy = getGalaxyInstance(); - Galaxy.currHistoryPanel.buildCollection(this.collectionType, historyId, selection); + Galaxy.currHistoryPanel.buildCollection(collectionType, selection, historyId); }, templateCollectionSelectModal: function () { return _.template( diff --git a/client/src/components/Upload/Collection.vue b/client/src/components/Upload/Collection.vue index 07b9f9cdf14..3b31d6fd8e0 100644 --- a/client/src/components/Upload/Collection.vue +++ b/client/src/components/Upload/Collection.vue @@ -273,7 +273,7 @@ export default { models: Object.values(models), historyId: Galaxy.currHistoryPanel.model.id, }; - Galaxy.currHistoryPanel.buildCollection(this.collectionType, null, selection); + Galaxy.currHistoryPanel.buildCollection(this.collectionType, selection); this.counterRunning = 0; this._updateStateForCounters(); this._eventReset(); diff --git a/client/src/components/Upload/RulesInput.vue b/client/src/components/Upload/RulesInput.vue index f7973aa1ac0..94cd0f189b6 100644 --- a/client/src/components/Upload/RulesInput.vue +++ b/client/src/components/Upload/RulesInput.vue @@ -200,7 +200,7 @@ export default { selection.elements = this.uris; } selection.dataType = this.dataType; - Galaxy.currHistoryPanel.buildCollection("rules", null, selection, true); + Galaxy.currHistoryPanel.buildCollection("rules", selection, null, true); this.$emit("dismiss"); }, }, diff --git a/lib/galaxy_test/selenium/test_histories_list.py b/lib/galaxy_test/selenium/test_histories_list.py index 6c384883e16..79e8eccb780 100644 --- a/lib/galaxy_test/selenium/test_histories_list.py +++ b/lib/galaxy_test/selenium/test_histories_list.py @@ -31,7 +31,7 @@ class SavedHistoriesTestCase(SharedStateSeleniumTestCase): self._login() self.navigate_to_histories_page() self.click_grid_popup_option(self.history2_name, "View") - history_name = self.wait_for_selector(".name.editable-text") + history_name = self.wait_for_selector("[data-description='name display']") self.assertEqual(history_name.text, self.history2_name) @selenium_test