mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
made react fine uploader error message more generic
This commit is contained in:
parent
0cc48a73e4
commit
71fcdff874
@ -95,7 +95,15 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
isReadyForFormSubmission: React.PropTypes.func,
|
isReadyForFormSubmission: React.PropTypes.func,
|
||||||
areAssetsDownloadable: React.PropTypes.bool,
|
areAssetsDownloadable: React.PropTypes.bool,
|
||||||
areAssetsEditable: React.PropTypes.bool,
|
areAssetsEditable: React.PropTypes.bool,
|
||||||
defaultErrorMessage: React.PropTypes.string
|
defaultErrorMessage: React.PropTypes.string,
|
||||||
|
|
||||||
|
// We encountered some cases where people had difficulties to upload their
|
||||||
|
// works to ascribe due to a slow internet connection.
|
||||||
|
// One solution we found in the process of tackling this problem was to hash
|
||||||
|
// the file in the browser using md5 and then uploading the resulting text document instead
|
||||||
|
// of the actual file.
|
||||||
|
// This boolean essentially enables that behavior
|
||||||
|
localHashing: React.PropTypes.bool
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
@ -323,7 +331,7 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
onValidate(data) {
|
onValidate(data) {
|
||||||
if(data.size > this.props.validation.sizeLimit) {
|
if(data.size > this.props.validation.sizeLimit) {
|
||||||
this.state.uploader.cancelAll();
|
this.state.uploader.cancelAll();
|
||||||
let notification = new GlobalNotificationModel('Your file is bigger than 10MB', 'danger', 5000);
|
let notification = new GlobalNotificationModel('Your file is bigger than ' + this.props.validation.sizeLimit / 1000000 + 'MB', 'danger', 5000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -481,6 +489,8 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// routine for adding all the files submitted to fineuploader
|
||||||
this.state.uploader.addFiles(files);
|
this.state.uploader.addFiles(files);
|
||||||
let oldFiles = this.state.filesToUpload;
|
let oldFiles = this.state.filesToUpload;
|
||||||
let oldAndNewFiles = this.state.uploader.getUploads();
|
let oldAndNewFiles = this.state.uploader.getUploads();
|
||||||
|
Loading…
Reference in New Issue
Block a user