Skip to content
Snippets Groups Projects
Commit f4875050 authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira
Browse files

Merge branch 'issue-82/zip' into 'develop'

Issue #82: FIX check for downloadable items before creating zipfile

See merge request !56
parents 93f3bbe8 099479f9
Branches
No related tags found
1 merge request!56Issue #82: FIX check for downloadable items before creating zipfile
Pipeline #37114 passed
......@@ -6,6 +6,7 @@ export default function DownloadButton({id, objects}) {
const handleDowloadCollection = (e) => {
e.preventDefault();
var zip = false
alert("Caso esta coleção contenha links externos, eles serão abertos em novas abas.\
Talvez seja preciso permitir a abertura de várias abas nas opções do seu navegador!")
......@@ -15,12 +16,17 @@ export default function DownloadButton({id, objects}) {
if (object.collectionable.link !== null) {
let url = `https://api.portalmec.c3sl.ufpr.br/v1/learning_objects/${object.collectionable.id}/download`
window.open(url, '_blank');
} else {
// This means we have objects that are not links, so we should download them with a zipfile
zip = true
}
})
if (zip) {
// Downloadable objects will get zipped and sent for download
window.location = `https://api.portalmec.c3sl.ufpr.br/zipper/${id}`;
}
}
return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment