Allow upload if all non-optional files are selected

Fixes https://github.com/galaxyproject/galaxy/issues/5326
This commit is contained in:
mvdbeek
2019-05-02 14:13:31 +02:00
parent 1994c3598f
commit a52f3f30d8
3 changed files with 6 additions and 2 deletions
@@ -50,7 +50,8 @@ export default Backbone.View.extend({
_.each(details.composite_files, item => {
self.collection.add({
id: self.collection.size(),
file_desc: item.description || item.name
file_desc: item.description || item.name,
optional: item.optional,
});
});
}
@@ -100,7 +101,7 @@ export default Backbone.View.extend({
this.select_genome.enable();
this.select_extension.enable();
}
if (this.collection.where({ status: "ready" }).length == this.collection.length && this.collection.length > 0) {
if (this.collection.where({ status: "ready" }).length + this.collection.where({ optional: true }).length == this.collection.length && this.collection.length > 0) {
this.btnStart.enable();
this.btnStart.$el.addClass("btn-primary");
} else {
@@ -4,6 +4,7 @@ var Model = Backbone.Model.extend({
genome: "?",
url_paste: "",
status: "init",
optional: false,
info: null,
file_name: "",
file_mode: "",
@@ -172,6 +172,8 @@ export default Backbone.View.extend({
file: it.get("file_data")
});
}
} else if (it.get("optional")) {
continue;
} else {
data.error_message = "Upload content incomplete.";
it.set("status", "error");