Skip to content
Snippets Groups Projects
Commit e1bedfaa authored by Marjolaine Bodin's avatar Marjolaine Bodin
Browse files

Merge branch '822-bug_globus_download_option' into 'main'

Resolve "Globus download is not proposed"

Closes #822

See merge request !730
parents 960e661e 9d7fef45
No related branches found
No related tags found
1 merge request!730Resolve "Globus download is not proposed"
Pipeline #227955 waiting for manual action
......@@ -51,20 +51,26 @@ export function DatasetDownloadModal({
const globusUrl = useMemo(() => {
if (!config.ui.globus.enabled) return undefined;
const location = path && path.length > 0 ? path[0] : dataset.location;
const locations =
path?.length && path?.length > 0 ? path : [dataset.location];
if (locations) {
for (const location of locations) {
if (!location) continue;
const collection = config.ui.globus.collections.find((c) =>
location.startsWith(c.root),
);
if (!collection) continue;
if (!location) return undefined;
const globusPath = location.replace(collection.origin, '');
const params = new URLSearchParams({
origin_id: collection.originId,
origin_path: globusPath,
});
const collection = config.ui.globus.collections.find((c) =>
location.startsWith(c.root),
);
if (!collection) return undefined;
const globusPath = location.replace(collection.origin, '');
const params = new URLSearchParams({
origin_id: collection.originId,
origin_path: globusPath,
});
return `${config.ui.globus.url}${params.toString()}`;
return `${config.ui.globus.url}${params.toString()}`;
}
}
return undefined;
}, [
config.ui.globus.collections,
config.ui.globus.enabled,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment