diff --git a/client/src/components/Collections/ListCollectionCreatorModal.js b/client/src/components/Collections/ListCollectionCreatorModal.js index aed340c2082..79beaff0912 100644 --- a/client/src/components/Collections/ListCollectionCreatorModal.js +++ b/client/src/components/Collections/ListCollectionCreatorModal.js @@ -26,7 +26,7 @@ function listCollectionCreatorModal(elements, options) { /** Use a modal to create a list collection, then add it to the given history contents. * @returns {Promise} resolved when the collection is added to the history. */ -function createListCollection(contents, defaultHideSourceItems) { +function createListCollection(contents, defaultHideSourceItems = true) { const elements = contents.toJSON(); let copyElements; const promise = listCollectionCreatorModal(elements, { diff --git a/client/src/components/Collections/PairCollectionCreatorModal.js b/client/src/components/Collections/PairCollectionCreatorModal.js index a95e6dec65a..653a27ec98a 100644 --- a/client/src/components/Collections/PairCollectionCreatorModal.js +++ b/client/src/components/Collections/PairCollectionCreatorModal.js @@ -22,7 +22,7 @@ function pairCollectionCreatorModal(elements, options) { return promise; }); } -function createPairCollection(contents, defaultHideSourceItems) { +function createPairCollection(contents, defaultHideSourceItems = true) { var elements = contents.toJSON(); var copyElements; var promise = pairCollectionCreatorModal(elements, { diff --git a/client/src/components/Collections/RuleBasedCollectionCreatorModal.js b/client/src/components/Collections/RuleBasedCollectionCreatorModal.js index 9adcf0a99b6..46fb48e879b 100644 --- a/client/src/components/Collections/RuleBasedCollectionCreatorModal.js +++ b/client/src/components/Collections/RuleBasedCollectionCreatorModal.js @@ -42,7 +42,7 @@ function ruleBasedCollectionCreatorModal(elements, elementsType, importType, opt } ); } -function createCollectionViaRules(selection, defaultHideSourceItems) { +function createCollectionViaRules(selection, defaultHideSourceItems = true) { let elements; let elementsType; let importType; diff --git a/client/src/components/History/adapters/HistoryPanelProxy.js b/client/src/components/History/adapters/HistoryPanelProxy.js index 437201a9a62..d3eb6a733fe 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, selection, hideSourceItems, fromRulesInput = false, historyId = null) { + async buildCollection(collectionType, historyId, selection, fromRulesInput = false) { let selectionContent = null; historyId = historyId || this.model.id; if (fromRulesInput) { @@ -72,13 +72,7 @@ export class HistoryPanelProxy { selectionContent.set(obj.id, obj); }); } - const modalResult = await buildCollectionModal( - collectionType, - historyId, - selectionContent, - hideSourceItems, - fromRulesInput - ); + const modalResult = await buildCollectionModal(collectionType, historyId, selectionContent, 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 ba74feef724..adeb82dc458 100644 --- a/client/src/components/History/adapters/buildCollectionModal.js +++ b/client/src/components/History/adapters/buildCollectionModal.js @@ -15,13 +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, - history_id, - selectedContent, - hideSourceItems = true, - fromRulesInput = false -) { +export async function buildCollectionModal(collectionType, historyId, selectedContent, fromRulesInput = false) { // select legacy function let createFunc; if (collectionType == "list") { @@ -37,10 +31,10 @@ export async function buildCollectionModal( } // pull up cached content by type_ids; if (fromRulesInput) { - return await createFunc(selectedContent, hideSourceItems); + return await createFunc(selectedContent); } else { - const fakeBackboneContent = createBackboneContent(history_id, selectedContent); - return await createFunc(fakeBackboneContent, hideSourceItems); + const fakeBackboneContent = createBackboneContent(historyId, selectedContent); + return await createFunc(fakeBackboneContent); } } 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 e180147b04b..44d7ed796cf 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 @@ -110,7 +110,7 @@ var ImportCollectionModal = Backbone.View.extend({ models: collectionElements, }; const Galaxy = getGalaxyInstance(); - Galaxy.currHistoryPanel.buildCollection(this.collectionType, selection, true, historyId); + Galaxy.currHistoryPanel.buildCollection(this.collectionType, historyId, selection); }, templateCollectionSelectModal: function () { return _.template( diff --git a/client/src/components/Upload/Collection.vue b/client/src/components/Upload/Collection.vue index b7e7fa745a4..07b9f9cdf14 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, selection, true); + Galaxy.currHistoryPanel.buildCollection(this.collectionType, null, 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 a46829a4365..f7973aa1ac0 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", selection, true, true); + Galaxy.currHistoryPanel.buildCollection("rules", null, selection, true); this.$emit("dismiss"); }, },