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:
parent
52db729a4d
commit
31e3c23302
@ -82,7 +82,7 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
retry: React.PropTypes.shape({
|
retry: React.PropTypes.shape({
|
||||||
enableAuto: React.PropTypes.bool
|
enableAuto: React.PropTypes.bool
|
||||||
}),
|
}),
|
||||||
setUploadStatus: React.PropTypes.func,
|
setIsUploadReady: React.PropTypes.func,
|
||||||
isReadyForFormSubmission: React.PropTypes.func
|
isReadyForFormSubmission: React.PropTypes.func
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -247,9 +247,9 @@ var ReactS3FineUploader = React.createClass({
|
|||||||
// the form is ready for submission or not
|
// the form is ready for submission or not
|
||||||
if(this.props.isReadyForFormSubmission && this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
|
if(this.props.isReadyForFormSubmission && this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
|
||||||
// if so, set uploadstatus to true
|
// if so, set uploadstatus to true
|
||||||
this.props.setUploadStatus(true);
|
this.props.setIsUploadReady(true);
|
||||||
} else {
|
} 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(this.props.isReadyForFormSubmission && this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
|
||||||
// if so, set uploadstatus to true
|
// if so, set uploadstatus to true
|
||||||
this.props.setUploadStatus(true);
|
this.props.setIsUploadReady(true);
|
||||||
} else {
|
} 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(this.props.isReadyForFormSubmission && this.props.isReadyForFormSubmission(this.state.filesToUpload)) {
|
||||||
// if so, set uploadstatus to true
|
// if so, set uploadstatus to true
|
||||||
this.props.setUploadStatus(true);
|
this.props.setIsUploadReady(true);
|
||||||
} else {
|
} else {
|
||||||
this.props.setUploadStatus(false);
|
this.props.setIsUploadReady(false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -455,9 +455,9 @@ let EditionFurtherDetails = React.createClass({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setUploadStatus(isReady) {
|
setIsUploadReady(isReady) {
|
||||||
this.setState({
|
this.setState({
|
||||||
uploadStatus: isReady
|
isUploadReady: isReady
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -495,7 +495,7 @@ let EditionFurtherDetails = React.createClass({
|
|||||||
edition={this.props.edition} />
|
edition={this.props.edition} />
|
||||||
<FileUploader
|
<FileUploader
|
||||||
submitKey={this.submitKey}
|
submitKey={this.submitKey}
|
||||||
setUploadStatus={this.setUploadStatus}
|
setIsUploadReady={this.setIsUploadReady}
|
||||||
isReadyForFormSubmission={this.isReadyForFormSubmission}
|
isReadyForFormSubmission={this.isReadyForFormSubmission}
|
||||||
edition={this.props.edition}/>
|
edition={this.props.edition}/>
|
||||||
</Col>
|
</Col>
|
||||||
@ -506,7 +506,7 @@ let EditionFurtherDetails = React.createClass({
|
|||||||
|
|
||||||
let FileUploader = React.createClass({
|
let FileUploader = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
setUploadStatus: React.PropTypes.func,
|
setIsUploadReady: React.PropTypes.func,
|
||||||
submitKey: React.PropTypes.func,
|
submitKey: React.PropTypes.func,
|
||||||
isReadyForFormSubmission: React.PropTypes.func
|
isReadyForFormSubmission: React.PropTypes.func
|
||||||
},
|
},
|
||||||
@ -528,7 +528,7 @@ let FileUploader = React.createClass({
|
|||||||
sizeLimit: '10000000'
|
sizeLimit: '10000000'
|
||||||
}}
|
}}
|
||||||
submitKey={this.props.submitKey}
|
submitKey={this.props.submitKey}
|
||||||
setUploadStatus={this.props.setUploadStatus}
|
setIsUploadReady={this.props.setIsUploadReady}
|
||||||
isReadyForFormSubmission={this.props.isReadyForFormSubmission}
|
isReadyForFormSubmission={this.props.isReadyForFormSubmission}
|
||||||
session={{
|
session={{
|
||||||
endpoint: AppConstants.serverUrl + 'api/blob/otherdatas/fineuploader_session/',
|
endpoint: AppConstants.serverUrl + 'api/blob/otherdatas/fineuploader_session/',
|
||||||
|
@ -26,7 +26,7 @@ let RegisterPiece = React.createClass( {
|
|||||||
getInitialState(){
|
getInitialState(){
|
||||||
return {
|
return {
|
||||||
digitalWorkKey: null,
|
digitalWorkKey: null,
|
||||||
uploadStatus: false
|
isUploadReady: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -51,9 +51,9 @@ let RegisterPiece = React.createClass( {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setUploadStatus(isReady) {
|
setIsUploadReady(isReady) {
|
||||||
this.setState({
|
this.setState({
|
||||||
uploadStatus: isReady
|
isUploadReady: isReady
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -67,15 +67,6 @@ let RegisterPiece = React.createClass( {
|
|||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let buttons = null;
|
|
||||||
|
|
||||||
if (this.state.uploadStatus){
|
|
||||||
buttons = (
|
|
||||||
<button type="submit" className="btn ascribe-btn ascribe-btn-login">
|
|
||||||
Register your artwork
|
|
||||||
</button>);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="row ascribe-row">
|
<div className="row ascribe-row">
|
||||||
<div className="col-md-12">
|
<div className="col-md-12">
|
||||||
@ -85,7 +76,12 @@ let RegisterPiece = React.createClass( {
|
|||||||
url={apiUrls.pieces_list}
|
url={apiUrls.pieces_list}
|
||||||
getFormData={this.getFormData}
|
getFormData={this.getFormData}
|
||||||
handleSuccess={this.handleSuccess}
|
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={
|
spinner={
|
||||||
<button className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-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" />
|
<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">
|
label="Files to upload">
|
||||||
<FileUploader
|
<FileUploader
|
||||||
submitKey={this.submitKey}
|
submitKey={this.submitKey}
|
||||||
setUploadStatus={this.setUploadStatus}
|
setIsUploadReady={this.setIsUploadReady}
|
||||||
isReadyForFormSubmission={this.isReadyForFormSubmission}/>
|
isReadyForFormSubmission={this.isReadyForFormSubmission}/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property
|
<Property
|
||||||
@ -143,7 +139,7 @@ let RegisterPiece = React.createClass( {
|
|||||||
|
|
||||||
let FileUploader = React.createClass({
|
let FileUploader = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
setUploadStatus: React.PropTypes.func,
|
setIsUploadReady: React.PropTypes.func,
|
||||||
submitKey: React.PropTypes.func,
|
submitKey: React.PropTypes.func,
|
||||||
isReadyForFormSubmission: React.PropTypes.func
|
isReadyForFormSubmission: React.PropTypes.func
|
||||||
},
|
},
|
||||||
@ -163,7 +159,7 @@ let FileUploader = React.createClass({
|
|||||||
itemLimit: 100000,
|
itemLimit: 100000,
|
||||||
sizeLimit: '25000000000'
|
sizeLimit: '25000000000'
|
||||||
}}
|
}}
|
||||||
setUploadStatus={this.props.setUploadStatus}
|
setIsUploadReady={this.props.setIsUploadReady}
|
||||||
isReadyForFormSubmission={this.props.isReadyForFormSubmission}/>
|
isReadyForFormSubmission={this.props.isReadyForFormSubmission}/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user