mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix file_source uploads
This broke in https://github.com/galaxyproject/galaxy/pull/11276, which moved all URL style uploads to fetch_data, but didn't build the right payload for ftp / file_source uploads.
This commit is contained in:
@@ -11,6 +11,7 @@ import LazyLimited from "mvc/lazy/lazy-limited";
|
||||
import { findExtension } from "./utils";
|
||||
import { filesDialog } from "utils/data";
|
||||
import { getAppRoot } from "onload";
|
||||
import axios from "axios";
|
||||
|
||||
const localize = _l;
|
||||
|
||||
@@ -85,20 +86,19 @@ export default {
|
||||
}
|
||||
});
|
||||
if (list.length > 0) {
|
||||
$.uploadpost({
|
||||
data: this.app.toData(list),
|
||||
url: this.app.uploadPath,
|
||||
success: (message) => {
|
||||
const data = this.app.toFetchData(list, this.history_id);
|
||||
axios
|
||||
.post("api/tools/fetch", data)
|
||||
.then((message) => {
|
||||
list.forEach((model) => {
|
||||
this._eventSuccess(model.id, message);
|
||||
});
|
||||
},
|
||||
error: (message) => {
|
||||
})
|
||||
.catch((message) => {
|
||||
list.forEach((model) => {
|
||||
self._eventError(model.id, message);
|
||||
this._eventError(model.id, message);
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
renderNewModel: function (model) {
|
||||
|
||||
@@ -294,19 +294,23 @@ export default {
|
||||
|
||||
// Composite does not use the fetch API, so we can just
|
||||
// index into the first element of items
|
||||
const urls = items[0].get("url_paste").split("\n");
|
||||
for (var index in urls) {
|
||||
var url = urls[index].trim();
|
||||
if (url != "") {
|
||||
var element = {
|
||||
url: urls[index].trim(),
|
||||
src: "url",
|
||||
dbkey: items[0].get("genome", "?"),
|
||||
ext: items[0].get("extension", "auto"),
|
||||
};
|
||||
data.targets[0].elements.push(element);
|
||||
}
|
||||
const item = items[0];
|
||||
let urls;
|
||||
if (item.get("file_mode") == "ftp") {
|
||||
urls = [item.get("file_path")];
|
||||
} else {
|
||||
urls = item.get("url_paste").split("\n");
|
||||
}
|
||||
urls.forEach((url) => {
|
||||
if (url != "") {
|
||||
data.targets[0].elements.push({
|
||||
url: url.trim(),
|
||||
src: "url",
|
||||
dbkey: item.get("genome", "?"),
|
||||
ext: item.get("extension", "auto"),
|
||||
});
|
||||
}
|
||||
});
|
||||
return data;
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user