1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

rename fineuploader's submitKey method to submitFile

This commit is contained in:
Tim Daubenschütz 2015-09-14 14:46:03 +02:00
parent f78dbf9e1a
commit 73c2a7c544
6 changed files with 17 additions and 17 deletions

View File

@ -38,9 +38,9 @@ let FurtherDetails = React.createClass({
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
}, },
submitKey(key){ submitFile(file){
this.setState({ this.setState({
otherDataKey: key otherDataKey: file.key
}); });
}, },
@ -78,7 +78,7 @@ let FurtherDetails = React.createClass({
extraData={this.props.extraData} /> extraData={this.props.extraData} />
<Form> <Form>
<FurtherDetailsFileuploader <FurtherDetailsFileuploader
submitKey={this.submitKey} submitFile={this.submitFile}
setIsUploadReady={this.setIsUploadReady} setIsUploadReady={this.setIsUploadReady}
isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile} isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile}
editable={this.props.editable} editable={this.props.editable}

View File

@ -17,7 +17,7 @@ let FurtherDetailsFileuploader = React.createClass({
pieceId: React.PropTypes.number, pieceId: React.PropTypes.number,
otherData: React.PropTypes.arrayOf(React.PropTypes.object), otherData: React.PropTypes.arrayOf(React.PropTypes.object),
setIsUploadReady: React.PropTypes.func, setIsUploadReady: React.PropTypes.func,
submitKey: React.PropTypes.func, submitFile: React.PropTypes.func,
isReadyForFormSubmission: React.PropTypes.func, isReadyForFormSubmission: React.PropTypes.func,
editable: React.PropTypes.bool, editable: React.PropTypes.bool,
multiple: React.PropTypes.bool multiple: React.PropTypes.bool
@ -59,7 +59,7 @@ let FurtherDetailsFileuploader = React.createClass({
itemLimit: 100000, itemLimit: 100000,
sizeLimit: '50000000' sizeLimit: '50000000'
}} }}
submitKey={this.props.submitKey} submitFile={this.props.submitFile}
setIsUploadReady={this.props.setIsUploadReady} setIsUploadReady={this.props.setIsUploadReady}
isReadyForFormSubmission={this.props.isReadyForFormSubmission} isReadyForFormSubmission={this.props.isReadyForFormSubmission}
session={{ session={{

View File

@ -78,7 +78,7 @@ let CreateContractForm = React.createClass({
}} }}
areAssetsDownloadable={true} areAssetsDownloadable={true}
areAssetsEditable={true} areAssetsEditable={true}
submitKey={this.submitKey} submitFile={this.submitFile}
setIsUploadReady={this.setIsUploadReady} setIsUploadReady={this.setIsUploadReady}
isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile} /> isReadyForFormSubmission={formSubmissionValidation.atLeastOneUploadedFile} />
</Property> </Property>

View File

@ -43,9 +43,9 @@ let InputFileUploader = React.createClass({
}; };
}, },
submitKey(key){ submitFile(file){
this.setState({ this.setState({
value: key value: file.key
}); });
}, },
@ -69,7 +69,7 @@ let InputFileUploader = React.createClass({
keyRoutine={this.props.keyRoutine} keyRoutine={this.props.keyRoutine}
createBlobRoutine={this.props.createBlobRoutine} createBlobRoutine={this.props.createBlobRoutine}
validation={this.props.validation} validation={this.props.validation}
submitKey={this.submitKey} submitFile={this.submitFile}
setIsUploadReady={this.props.setIsUploadReady} setIsUploadReady={this.props.setIsUploadReady}
isReadyForFormSubmission={this.props.isReadyForFormSubmission} isReadyForFormSubmission={this.props.isReadyForFormSubmission}
areAssetsDownloadable={false} areAssetsDownloadable={false}

View File

@ -36,7 +36,7 @@ var ReactS3FineUploader = React.createClass({
React.PropTypes.number React.PropTypes.number
]) ])
}), }),
submitKey: React.PropTypes.func, submitFile: React.PropTypes.func,
autoUpload: React.PropTypes.bool, autoUpload: React.PropTypes.bool,
debug: React.PropTypes.bool, debug: React.PropTypes.bool,
objectProperties: React.PropTypes.shape({ objectProperties: React.PropTypes.shape({
@ -393,12 +393,12 @@ var ReactS3FineUploader = React.createClass({
// Only after the blob has been created server-side, we can make the form submittable. // Only after the blob has been created server-side, we can make the form submittable.
this.createBlob(files[id]) this.createBlob(files[id])
.then(() => { .then(() => {
// since the form validation props isReadyForFormSubmission, setIsUploadReady and submitKey // since the form validation props isReadyForFormSubmission, setIsUploadReady and submitFile
// are optional, we'll only trigger them when they're actually defined // are optional, we'll only trigger them when they're actually defined
if(this.props.submitKey) { if(this.props.submitFile) {
this.props.submitKey(files[id].key); this.props.submitFile(files[id]);
} else { } else {
console.warn('You didn\'t define submitKey in as a prop in react-s3-fine-uploader'); console.warn('You didn\'t define submitFile in as a prop in react-s3-fine-uploader');
} }
// for explanation, check comment of if statement above // for explanation, check comment of if statement above
@ -458,7 +458,7 @@ var ReactS3FineUploader = React.createClass({
let notification = new GlobalNotificationModel(getLangText('File upload canceled'), 'success', 5000); let notification = new GlobalNotificationModel(getLangText('File upload canceled'), 'success', 5000);
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
// since the form validation props isReadyForFormSubmission, setIsUploadReady and submitKey // since the form validation props isReadyForFormSubmission, setIsUploadReady and submitFile
// are optional, we'll only trigger them when they're actually defined // are optional, we'll only trigger them when they're actually defined
if(this.props.isReadyForFormSubmission && this.props.setIsUploadReady) { if(this.props.isReadyForFormSubmission && this.props.setIsUploadReady) {
if(this.props.isReadyForFormSubmission(this.state.filesToUpload)) { if(this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
@ -524,7 +524,7 @@ var ReactS3FineUploader = React.createClass({
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
} }
// since the form validation props isReadyForFormSubmission, setIsUploadReady and submitKey // since the form validation props isReadyForFormSubmission, setIsUploadReady and submitFile
// are optional, we'll only trigger them when they're actually defined // are optional, we'll only trigger them when they're actually defined
if(this.props.isReadyForFormSubmission && this.props.setIsUploadReady) { if(this.props.isReadyForFormSubmission && this.props.setIsUploadReady) {
// also, lets check if after the completion of this upload, // also, lets check if after the completion of this upload,

View File

@ -112,7 +112,7 @@ let CylandAdditionalDataForm = React.createClass({
</Property> </Property>
<FurtherDetailsFileuploader <FurtherDetailsFileuploader
uploadStarted={this.uploadStarted} uploadStarted={this.uploadStarted}
submitKey={this.submitKey} submitFile={this.submitFile}
setIsUploadReady={this.setIsUploadReady} setIsUploadReady={this.setIsUploadReady}
isReadyForFormSubmission={formSubmissionValidation.fileOptional} isReadyForFormSubmission={formSubmissionValidation.fileOptional}
editable={!this.props.disabled} editable={!this.props.disabled}