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

rename upload status variable

This commit is contained in:
Tim Daubenschütz 2015-06-30 09:20:20 +02:00
parent 52db729a4d
commit 31e3c23302
3 changed files with 24 additions and 28 deletions

View File

@ -82,7 +82,7 @@ var ReactS3FineUploader = React.createClass({
retry: React.PropTypes.shape({
enableAuto: React.PropTypes.bool
}),
setUploadStatus: React.PropTypes.func,
setIsUploadReady: React.PropTypes.func,
isReadyForFormSubmission: React.PropTypes.func
},
@ -247,9 +247,9 @@ var ReactS3FineUploader = React.createClass({
// the form is ready for submission or not
if(this.props.isReadyForFormSubmission && this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
// if so, set uploadstatus to true
this.props.setUploadStatus(true);
this.props.setIsUploadReady(true);
} else {
this.props.setUploadStatus(false);
this.props.setIsUploadReady(false);
}
},
@ -305,9 +305,9 @@ var ReactS3FineUploader = React.createClass({
if(this.props.isReadyForFormSubmission && this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
// if so, set uploadstatus to true
this.props.setUploadStatus(true);
this.props.setIsUploadReady(true);
} else {
this.props.setUploadStatus(false);
this.props.setIsUploadReady(false);
}
},
@ -324,9 +324,9 @@ var ReactS3FineUploader = React.createClass({
if(this.props.isReadyForFormSubmission && this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
// if so, set uploadstatus to true
this.props.setUploadStatus(true);
this.props.setIsUploadReady(true);
} else {
this.props.setUploadStatus(false);
this.props.setIsUploadReady(false);
}
},

View File

@ -455,9 +455,9 @@ let EditionFurtherDetails = React.createClass({
});
},
setUploadStatus(isReady) {
setIsUploadReady(isReady) {
this.setState({
uploadStatus: isReady
isUploadReady: isReady
});
},
@ -495,7 +495,7 @@ let EditionFurtherDetails = React.createClass({
edition={this.props.edition} />
<FileUploader
submitKey={this.submitKey}
setUploadStatus={this.setUploadStatus}
setIsUploadReady={this.setIsUploadReady}
isReadyForFormSubmission={this.isReadyForFormSubmission}
edition={this.props.edition}/>
</Col>
@ -506,7 +506,7 @@ let EditionFurtherDetails = React.createClass({
let FileUploader = React.createClass({
propTypes: {
setUploadStatus: React.PropTypes.func,
setIsUploadReady: React.PropTypes.func,
submitKey: React.PropTypes.func,
isReadyForFormSubmission: React.PropTypes.func
},
@ -528,7 +528,7 @@ let FileUploader = React.createClass({
sizeLimit: '10000000'
}}
submitKey={this.props.submitKey}
setUploadStatus={this.props.setUploadStatus}
setIsUploadReady={this.props.setIsUploadReady}
isReadyForFormSubmission={this.props.isReadyForFormSubmission}
session={{
endpoint: AppConstants.serverUrl + 'api/blob/otherdatas/fineuploader_session/',

View File

@ -26,7 +26,7 @@ let RegisterPiece = React.createClass( {
getInitialState(){
return {
digitalWorkKey: null,
uploadStatus: false
isUploadReady: false
};
},
@ -51,9 +51,9 @@ let RegisterPiece = React.createClass( {
});
},
setUploadStatus(isReady) {
setIsUploadReady(isReady) {
this.setState({
uploadStatus: isReady
isUploadReady: isReady
});
},
@ -67,15 +67,6 @@ let RegisterPiece = React.createClass( {
},
render() {
let buttons = null;
if (this.state.uploadStatus){
buttons = (
<button type="submit" className="btn ascribe-btn ascribe-btn-login">
Register your artwork
</button>);
}
return (
<div className="row ascribe-row">
<div className="col-md-12">
@ -85,7 +76,12 @@ let RegisterPiece = React.createClass( {
url={apiUrls.pieces_list}
getFormData={this.getFormData}
handleSuccess={this.handleSuccess}
buttons={buttons}
buttons={<button
type="submit"
className="btn ascribe-btn ascribe-btn-login"
disabled={!this.state.isUploadReady}>
Register your artwork
</button>}
spinner={
<button className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" />
@ -95,7 +91,7 @@ let RegisterPiece = React.createClass( {
label="Files to upload">
<FileUploader
submitKey={this.submitKey}
setUploadStatus={this.setUploadStatus}
setIsUploadReady={this.setIsUploadReady}
isReadyForFormSubmission={this.isReadyForFormSubmission}/>
</Property>
<Property
@ -143,7 +139,7 @@ let RegisterPiece = React.createClass( {
let FileUploader = React.createClass({
propTypes: {
setUploadStatus: React.PropTypes.func,
setIsUploadReady: React.PropTypes.func,
submitKey: React.PropTypes.func,
isReadyForFormSubmission: React.PropTypes.func
},
@ -163,7 +159,7 @@ let FileUploader = React.createClass({
itemLimit: 100000,
sizeLimit: '25000000000'
}}
setUploadStatus={this.props.setUploadStatus}
setIsUploadReady={this.props.setIsUploadReady}
isReadyForFormSubmission={this.props.isReadyForFormSubmission}/>
);
}