mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
better error handling for fineuploader
This commit is contained in:
parent
6bf28dbfa4
commit
bfb052f8c0
@ -96,7 +96,8 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
setIsUploadReady: React.PropTypes.func,
|
setIsUploadReady: React.PropTypes.func,
|
||||||
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
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
@ -141,7 +142,8 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
},
|
},
|
||||||
multiple: false
|
multiple: false,
|
||||||
|
defaultErrorMessage: 'Unexpected error. Please contact us if this happens repeatedly.'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -188,16 +190,12 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
multiple: this.props.multiple,
|
multiple: this.props.multiple,
|
||||||
retry: this.props.retry,
|
retry: this.props.retry,
|
||||||
callbacks: {
|
callbacks: {
|
||||||
onSubmit: this.onSubmit,
|
|
||||||
onComplete: this.onComplete,
|
onComplete: this.onComplete,
|
||||||
onCancel: this.onCancel,
|
onCancel: this.onCancel,
|
||||||
onDelete: this.onDelete,
|
|
||||||
onProgress: this.onProgress,
|
onProgress: this.onProgress,
|
||||||
onRetry: this.onRetry,
|
|
||||||
onAutoRetry: this.onAutoRetry,
|
|
||||||
onManualRetry: this.onManualRetry,
|
|
||||||
onDeleteComplete: this.onDeleteComplete,
|
onDeleteComplete: this.onDeleteComplete,
|
||||||
onSessionRequestComplete: this.onSessionRequestComplete
|
onSessionRequestComplete: this.onSessionRequestComplete,
|
||||||
|
onError: this.onError
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -226,7 +224,6 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
resolve(res.key);
|
resolve(res.key);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(err);
|
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -234,10 +231,6 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
|
|
||||||
/* FineUploader specific callback function handlers */
|
/* FineUploader specific callback function handlers */
|
||||||
|
|
||||||
onSubmit() {
|
|
||||||
console.log('submit');
|
|
||||||
},
|
|
||||||
|
|
||||||
onComplete(id) {
|
onComplete(id) {
|
||||||
let files = this.state.filesToUpload;
|
let files = this.state.filesToUpload;
|
||||||
files[id].status = 'upload successful';
|
files[id].status = 'upload successful';
|
||||||
@ -309,20 +302,9 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
return defer;
|
return defer;
|
||||||
},
|
},
|
||||||
|
|
||||||
onRetry() {
|
onError() {
|
||||||
console.log('retry');
|
let notification = new GlobalNotificationModel(this.props.defaultErrorMessage, 'danger', 5000);
|
||||||
},
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
|
|
||||||
onAutoRetry() {
|
|
||||||
console.log('autoretry');
|
|
||||||
},
|
|
||||||
|
|
||||||
onManualRetry() {
|
|
||||||
console.log('manualretry');
|
|
||||||
},
|
|
||||||
|
|
||||||
onDelete() {
|
|
||||||
console.log('delete');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onCancel(id) {
|
onCancel(id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user