diff --git a/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/component.jsx index c9ffda0d5770d8da27343f4aeba370fe2f10aa03..c5d251cad3142a9dbe1bdf6c9e63a0f84979914a 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/component.jsx @@ -146,6 +146,18 @@ const intlMessages = defineMessages({ id: 'app.presentationUploder.conversion.pdfHasBigPage', description: 'warns the user that the conversion failed because of the pdf page siz that exceeds the allowed limit', }, + OFFICE_DOC_CONVERSION_INVALID: { + id: 'app.presentationUploder.conversion.officeDocConversionInvalid', + description: '', + }, + OFFICE_DOC_CONVERSION_FAILED: { + id: 'app.presentationUploder.conversion.officeDocConversionFailed', + description: 'warns the user that the conversion failed because of wrong office file', + }, + UNSUPPORTED_DOCUMENT: { + id: 'app.presentationUploder.conversion.unsupportedDocument', + description: 'warns the user that the file extension is not supported', + }, isDownloadable: { id: 'app.presentationUploder.isDownloadableLabel', description: 'presentation is available for downloading by all viewers', @@ -287,10 +299,10 @@ class PresentationUploader extends Component { handleFiledrop(files, files2) { const { fileValidMimeTypes, intl } = this.props; const { toUploadCount } = this.state; - const validMimes = fileValidMimeTypes.map(fileValid => fileValid.mime); - const validExtentions = fileValidMimeTypes.map(fileValid => fileValid.extension); + const validMimes = fileValidMimeTypes.map((fileValid) => fileValid.mime); + const validExtentions = fileValidMimeTypes.map((fileValid) => fileValid.extension); const [accepted, rejected] = _.partition(files - .concat(files2), f => ( + .concat(files2), (f) => ( validMimes.includes(f.type) || validExtentions.includes(`.${f.name.split('.').pop()}`) )); @@ -616,7 +628,7 @@ class PresentationUploader extends Component { </tr> </thead> <tbody> - {presentationsSorted.map(item => this.renderPresentationItem(item))} + {presentationsSorted.map((item) => this.renderPresentationItem(item))} </tbody> </table> </div> diff --git a/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/service.js b/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/service.js index fa46226be1f3214b4ce583ad596c322254ef8ada..07bca5745a81bf5e17ddc4265a0df3ed33d07580 100644 --- a/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/service.js +++ b/bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/service.js @@ -88,7 +88,7 @@ const observePresentationConversion = ( added: (doc) => { if (doc.name !== filename) return; - if (doc.conversion.status === 'FILE_TOO_LARGE') { + if (doc.conversion.status === 'FILE_TOO_LARGE' || doc.conversion.status === 'UNSUPPORTED_DOCUMENT') { onConversion(doc.conversion); c.stop(); clearTimeout(conversionTimeout); diff --git a/bigbluebutton-html5/public/locales/en.json b/bigbluebutton-html5/public/locales/en.json index d2221d011a9579001ef41f64305ac47351b14fd4..9f40392f86528fc3ff519d081cad929e001e2623 100755 --- a/bigbluebutton-html5/public/locales/en.json +++ b/bigbluebutton-html5/public/locales/en.json @@ -207,6 +207,7 @@ "app.presentationUploder.conversion.pdfHasBigPage": "We could not convert the PDF file, please try optimizing it. Max page size {0}", "app.presentationUploder.conversion.timeout": "Ops, the conversion took too long", "app.presentationUploder.conversion.pageCountFailed": "Failed to determine the number of pages.", + "app.presentationUploder.conversion.unsupportedDocument": "File extension not supported", "app.presentationUploder.isDownloadableLabel": "Presentation download is not allowed - click to allow presentation to be downloaded", "app.presentationUploder.isNotDownloadableLabel": "Presentation download is allowed - click to disallow presentation to be downloaded", "app.presentationUploder.removePresentationLabel": "Remove presentation",