Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow rule based operations on existing collections. #5819

Merged
merged 9 commits into from
Apr 25, 2018
12 changes: 8 additions & 4 deletions client/galaxy/scripts/components/RuleCollectionBuilder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ export default {
computed: {
exisistingDatasets() {
const elementsType = this.elementsType;
return elementsType === "datasets" || elementsType === "collection_contents";
return elementsType === "datasets" || elementsType === "collection_contents" || elementsType === "library_datasets";
},
showFileTypeSelector() {
return !this.exisistingDatasets && !this.mappingAsDict.file_type;
Expand Down Expand Up @@ -1375,9 +1375,13 @@ export default {
if (this.elementsType == "datasets" || this.elementsType == "library_datasets") {
const elements = this.creationElementsFromDatasets();
if (this.state !== "error") {
const response = this.creationFn(elements, collectionType, name, this.hideSourceItems);
response.done(this.oncreate);
response.error(this.renderFetchError);
new AjaxQueue.AjaxQueue(
_.map(elements, (elements, name) => {
return () => {
const response = this.creationFn(elements, collectionType, name, this.hideSourceItems);
return response;
};
})).done(this.oncreate).fail(this.renderFetchError);
}
} else if (this.elementsType == "collection_contents") {
this.resetSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,8 @@ var ruleBasedCollectionCreatorModal = function _ruleBasedCollectionCreatorModal(
title = _l("Build Rules for Uploading Datasets");
} else if (elementsType == "collection_contents") {
title = _l("Build Rules for Applying to Existing Collection");
} else if (elementsType == "datasets") {
title = _l("Build Rules for Creating Collection");
} else if (elementsType == "datasets" || elementsType == "library_datasets") {
title = _l("Build Rules for Creating Collection(s)");
} else {
title = _l("Build Rules for Uploading Collections");
}
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/mvc/rules/rule-definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ const MAPPING_TARGETS = {
help: _l(
"If this is set, all rows with the same collection name will be joined into a collection and it is possible to create multiple collections at once."
),
modes: ["raw", "ftp"], // TODO: allow this in datasets mode & tool builder modes
modes: ["raw", "ftp", "datasets", "library_datasets"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you deleted this whole line in #5969, is this the proper merge?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... thanks for looking so close though! Think of modes like a filter - in #5969 I made it so all the modes of the rule builder that produce collections could production multiple collections so I didn't need that any more. This PR adds the ability to apply to existing collections using a tool that only has one output - so I needed to re-list all the valid modes and exclude that one new mode ("collection_contents").

screen shot 2018-04-24 at 4 14 41 pm

importType: "collections"
},
name: {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.