Skip to content

Commit

Permalink
Ensure that we can upload and display bloompub files properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Sep 17, 2024
1 parent de70311 commit 69be8e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions contentcuration/contentcuration/frontend/shared/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export const constantStrings = createTranslator('ConstantStrings', {
mp3: 'MP3 audio',
pdf: 'PDF document',
epub: 'EPub document',
bloompub: 'BloomPub document',
jpg: 'JPG image',
jpeg: 'JPEG image',
png: 'PNG image',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ref="fileUpload"
style="display: none;"
type="file"
:accept="acceptedMimetypes"
:accept="acceptedFileTypes"
:multiple="allowMultiple"
data-test="upload-dialog"
@change="handleFiles($event.target.files)"
Expand Down Expand Up @@ -129,8 +129,12 @@
: !fp.supplementary && (!this.displayOnly || fp.display)
);
},
acceptedMimetypes() {
return flatMap(this.acceptedFiles, f => f.associated_mimetypes).join(',');
acceptedFileTypes() {
return uniq(
flatMap(this.acceptedFiles, f => f.associated_mimetypes).concat(
this.acceptedExtensions.map(ext => `.${ext}`)
)
).join(',');
},
acceptedExtensions() {
return uniq(flatMap(this.acceptedFiles, f => f.allowed_formats));
Expand Down

0 comments on commit 69be8e5

Please sign in to comment.