Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend-MECRED
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MECRED
Frontend-MECRED
Commits
f4875050
Commit
f4875050
authored
May 3, 2024
by
Richard Fernando Heise Ferreira
Browse files
Options
Downloads
Plain Diff
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
Branches containing commit
No related tags found
1 merge request
!56
Issue #82: FIX check for downloadable items before creating zipfile
Pipeline
#37114
passed
May 3, 2024
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/DownloadButton.js
+8
-2
8 additions, 2 deletions
src/app/components/DownloadButton.js
with
8 additions
and
2 deletions
src/app/components/DownloadButton.js
+
8
−
2
View file @
f4875050
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment