diff --git a/js/components/ascribe_detail/further_details.js b/js/components/ascribe_detail/further_details.js index 8167a690..84684592 100644 --- a/js/components/ascribe_detail/further_details.js +++ b/js/components/ascribe_detail/further_details.js @@ -125,7 +125,7 @@ let FileUploader = React.createClass({ return (
+ label="Additional files (max. 10MB)">

Drag a file here

or

- + ); } diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 9d60e3ba..1414b853 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -197,7 +197,8 @@ var ReactS3FineUploader = React.createClass({ onProgress: this.onProgress, onDeleteComplete: this.onDeleteComplete, onSessionRequestComplete: this.onSessionRequestComplete, - onError: this.onError + onError: this.onError, + onValidate: this.onValidate } }; }, @@ -235,6 +236,7 @@ var ReactS3FineUploader = React.createClass({ createBlob(file) { let defer = new fineUploader.Promise(); + window.fetch(this.props.createBlobRoutine.url, { method: 'post', headers: { @@ -312,6 +314,14 @@ var ReactS3FineUploader = React.createClass({ GlobalNotificationActions.appendGlobalNotification(notification); }, + onValidate(data) { + if(data.size > this.props.validation.sizeLimit) { + this.state.uploader.cancelAll(); + let notification = new GlobalNotificationModel('Your file is bigger than 10MB', 'danger', 5000); + GlobalNotificationActions.appendGlobalNotification(notification); + } + }, + onCancel(id) { this.removeFileWithIdFromFilesToUpload(id); diff --git a/js/components/register_piece.js b/js/components/register_piece.js index e5f36c8e..f0bd441a 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -142,7 +142,7 @@ let RegisterPiece = React.createClass( { }, getSpecifyEditions() { - if (this.state.whitelabel.acl_editions) { + if(this.state.whitelabel.acl_editions || Object.keys(this.state.whitelabel).length === 0) { return (