mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
register form separate
spinner => spans
This commit is contained in:
parent
b4f1d3d6cc
commit
1f73811950
@ -30,9 +30,9 @@ let AccordionListItemCreateEditions = React.createClass({
|
|||||||
getFormData={this.getFormData}
|
getFormData={this.getFormData}
|
||||||
handleSuccess={this.props.handleSuccess}
|
handleSuccess={this.props.handleSuccess}
|
||||||
spinner={
|
spinner={
|
||||||
<button className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
|
<span 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" />
|
||||||
</button>
|
</span>
|
||||||
}>
|
}>
|
||||||
<Property
|
<Property
|
||||||
name='num_editions'
|
name='num_editions'
|
||||||
|
@ -24,6 +24,8 @@ let LoginForm = React.createClass({
|
|||||||
redirectOnLoginSuccess: React.PropTypes.bool
|
redirectOnLoginSuccess: React.PropTypes.bool
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mixins: [Router.Navigation],
|
||||||
|
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
return {
|
return {
|
||||||
redirectOnLoggedIn: true,
|
redirectOnLoggedIn: true,
|
||||||
@ -31,8 +33,6 @@ let LoginForm = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
mixins: [Router.Navigation],
|
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return UserStore.getState();
|
return UserStore.getState();
|
||||||
},
|
},
|
||||||
@ -90,9 +90,9 @@ let LoginForm = React.createClass({
|
|||||||
{getLangText('Enter')} ascribe
|
{getLangText('Enter')} ascribe
|
||||||
</button>}
|
</button>}
|
||||||
spinner={
|
spinner={
|
||||||
<button className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
|
<span 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" />
|
||||||
</button>
|
</span>
|
||||||
}>
|
}>
|
||||||
<Property
|
<Property
|
||||||
name='email'
|
name='email'
|
||||||
|
165
js/components/ascribe_forms/form_register_piece.js
Normal file
165
js/components/ascribe_forms/form_register_piece.js
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import AppConstants from '../../constants/application_constants';
|
||||||
|
|
||||||
|
import Form from './form';
|
||||||
|
import Property from './property';
|
||||||
|
import FormPropertyHeader from './form_property_header';
|
||||||
|
|
||||||
|
import apiUrls from '../../constants/api_urls';
|
||||||
|
|
||||||
|
import ReactS3FineUploader from '../ascribe_uploader/react_s3_fine_uploader';
|
||||||
|
|
||||||
|
import { getCookie } from '../../utils/fetch_api_utils';
|
||||||
|
import { getLangText } from '../../utils/lang_utils';
|
||||||
|
|
||||||
|
|
||||||
|
let RegisterPieceForm = React.createClass({
|
||||||
|
getInitialState(){
|
||||||
|
return {
|
||||||
|
digitalWorkKey: null,
|
||||||
|
isUploadReady: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
getFormData(){
|
||||||
|
return {
|
||||||
|
digital_work_key: this.state.digitalWorkKey
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
submitKey(key){
|
||||||
|
this.setState({
|
||||||
|
digitalWorkKey: key
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
setIsUploadReady(isReady) {
|
||||||
|
this.setState({
|
||||||
|
isUploadReady: isReady
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
isReadyForFormSubmission(files) {
|
||||||
|
files = files.filter((file) => file.status !== 'deleted' && file.status !== 'canceled');
|
||||||
|
if (files.length > 0 && files[0].status === 'upload successful') {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<Form
|
||||||
|
className="ascribe-form-bordered"
|
||||||
|
ref='form'
|
||||||
|
url={apiUrls.pieces_list}
|
||||||
|
getFormData={this.getFormData}
|
||||||
|
handleSuccess={this.props.handleSuccess}
|
||||||
|
buttons={<button
|
||||||
|
type="submit"
|
||||||
|
className="btn ascribe-btn ascribe-btn-login"
|
||||||
|
disabled={!this.state.isUploadReady}>
|
||||||
|
{getLangText('Register work')}
|
||||||
|
</button>}
|
||||||
|
spinner={
|
||||||
|
<span 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" />
|
||||||
|
</span>
|
||||||
|
}>
|
||||||
|
<FormPropertyHeader>
|
||||||
|
<h3>{getLangText('Register your work')}</h3>
|
||||||
|
</FormPropertyHeader>
|
||||||
|
<Property
|
||||||
|
ignoreFocus={true}>
|
||||||
|
<FileUploader
|
||||||
|
submitKey={this.submitKey}
|
||||||
|
setIsUploadReady={this.setIsUploadReady}
|
||||||
|
isReadyForFormSubmission={this.isReadyForFormSubmission}
|
||||||
|
editable={this.props.isFineUploaderEditable}/>
|
||||||
|
</Property>
|
||||||
|
<Property
|
||||||
|
name='artist_name'
|
||||||
|
label={getLangText('Artist Name')}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="(e.g. Andy Warhol)"
|
||||||
|
required/>
|
||||||
|
</Property>
|
||||||
|
<Property
|
||||||
|
name='title'
|
||||||
|
label={getLangText('Title')}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
placeholder="(e.g. 32 Campbell's Soup Cans)"
|
||||||
|
required/>
|
||||||
|
</Property>
|
||||||
|
<Property
|
||||||
|
name='date_created'
|
||||||
|
label={getLangText('Year Created')}>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
placeholder="(e.g. 1962)"
|
||||||
|
min={0}
|
||||||
|
required/>
|
||||||
|
</Property>
|
||||||
|
{this.props.children}
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let FileUploader = React.createClass({
|
||||||
|
propTypes: {
|
||||||
|
setIsUploadReady: React.PropTypes.func,
|
||||||
|
submitKey: React.PropTypes.func,
|
||||||
|
isReadyForFormSubmission: React.PropTypes.func,
|
||||||
|
onClick: React.PropTypes.func,
|
||||||
|
// editable is used to lock react fine uploader in case
|
||||||
|
// a user is actually not logged in already to prevent him from droping files
|
||||||
|
// before login in
|
||||||
|
editable: React.PropTypes.bool
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<ReactS3FineUploader
|
||||||
|
onClick={this.props.onClick}
|
||||||
|
keyRoutine={{
|
||||||
|
url: AppConstants.serverUrl + 's3/key/',
|
||||||
|
fileClass: 'digitalwork'
|
||||||
|
}}
|
||||||
|
createBlobRoutine={{
|
||||||
|
url: apiUrls.blob_digitalworks
|
||||||
|
}}
|
||||||
|
submitKey={this.props.submitKey}
|
||||||
|
validation={{
|
||||||
|
itemLimit: 100000,
|
||||||
|
sizeLimit: '25000000000'
|
||||||
|
}}
|
||||||
|
setIsUploadReady={this.props.setIsUploadReady}
|
||||||
|
isReadyForFormSubmission={this.props.isReadyForFormSubmission}
|
||||||
|
areAssetsDownloadable={false}
|
||||||
|
areAssetsEditable={this.props.editable}
|
||||||
|
signature={{
|
||||||
|
endpoint: AppConstants.serverUrl + 's3/signature/',
|
||||||
|
customHeaders: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
deleteFile={{
|
||||||
|
enabled: true,
|
||||||
|
method: 'DELETE',
|
||||||
|
endpoint: AppConstants.serverUrl + 's3/delete',
|
||||||
|
customHeaders: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
}}/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default RegisterPieceForm;
|
@ -75,9 +75,9 @@ let SignupForm = React.createClass({
|
|||||||
{getLangText('Sign up to ascribe')}
|
{getLangText('Sign up to ascribe')}
|
||||||
</button>}
|
</button>}
|
||||||
spinner={
|
spinner={
|
||||||
<button className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
|
<span 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" />
|
||||||
</button>
|
</span>
|
||||||
}>
|
}>
|
||||||
<FormPropertyHeader>
|
<FormPropertyHeader>
|
||||||
<h3>{getLangText('Welcome to ascribe')}</h3>
|
<h3>{getLangText('Welcome to ascribe')}</h3>
|
||||||
|
@ -68,9 +68,9 @@ let CoaVerifyForm = React.createClass({
|
|||||||
{getLangText('Verify your Certificate of Authenticity')}
|
{getLangText('Verify your Certificate of Authenticity')}
|
||||||
</button>}
|
</button>}
|
||||||
spinner={
|
spinner={
|
||||||
<button className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
|
<span 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" />
|
||||||
</button>
|
</span>
|
||||||
}>
|
}>
|
||||||
<Property
|
<Property
|
||||||
name='message'
|
name='message'
|
||||||
|
@ -12,12 +12,16 @@ let Link = Router.Link;
|
|||||||
|
|
||||||
let LoginContainer = React.createClass({
|
let LoginContainer = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
message: React.PropTypes.string
|
message: React.PropTypes.string,
|
||||||
|
redirectOnLoggedIn: React.PropTypes.bool,
|
||||||
|
redirectOnLoginSuccess: React.PropTypes.bool
|
||||||
},
|
},
|
||||||
|
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
return {
|
return {
|
||||||
message: getLangText('Enter') + ' ascribe'
|
message: getLangText('Enter') + ' ascribe',
|
||||||
|
redirectOnLoggedIn: true,
|
||||||
|
redirectOnLoginSuccess: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -26,6 +30,8 @@ let LoginContainer = React.createClass({
|
|||||||
<div className="ascribe-login-wrapper">
|
<div className="ascribe-login-wrapper">
|
||||||
<br/>
|
<br/>
|
||||||
<LoginForm
|
<LoginForm
|
||||||
|
redirectOnLoggedIn={this.props.redirectOnLoggedIn}
|
||||||
|
redirectOnLoginSuccess={this.props.redirectOnLoginSuccess}
|
||||||
message={this.props.message} />
|
message={this.props.message} />
|
||||||
<div className="ascribe-login-text">
|
<div className="ascribe-login-text">
|
||||||
{getLangText('Not an ascribe user')}? <Link to="signup">{getLangText('Sign up')}...</Link><br/>
|
{getLangText('Not an ascribe user')}? <Link to="signup">{getLangText('Sign up')}...</Link><br/>
|
||||||
|
@ -82,9 +82,9 @@ let PasswordRequestResetForm = React.createClass({
|
|||||||
{getLangText('Reset your password')}
|
{getLangText('Reset your password')}
|
||||||
</button>}
|
</button>}
|
||||||
spinner={
|
spinner={
|
||||||
<button className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
|
<span 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" />
|
||||||
</button>
|
</span>
|
||||||
}>
|
}>
|
||||||
<Property
|
<Property
|
||||||
name='email'
|
name='email'
|
||||||
@ -129,9 +129,9 @@ let PasswordResetForm = React.createClass({
|
|||||||
{getLangText('Reset your password')}
|
{getLangText('Reset your password')}
|
||||||
</button>}
|
</button>}
|
||||||
spinner={
|
spinner={
|
||||||
<button className="btn ascribe-btn ascribe-btn-login ascribe-btn-login-spinner">
|
<span 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" />
|
||||||
</button>
|
</span>
|
||||||
}>
|
}>
|
||||||
<Property
|
<Property
|
||||||
name='password'
|
name='password'
|
||||||
|
@ -2,14 +2,10 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import DatePicker from 'react-datepicker/dist/react-datepicker';
|
|
||||||
|
|
||||||
import Router from 'react-router';
|
import Router from 'react-router';
|
||||||
import Col from 'react-bootstrap/lib/Col';
|
import Col from 'react-bootstrap/lib/Col';
|
||||||
import Row from 'react-bootstrap/lib/Row';
|
import Row from 'react-bootstrap/lib/Row';
|
||||||
|
|
||||||
import AppConstants from '../constants/application_constants';
|
|
||||||
|
|
||||||
import LicenseActions from '../actions/license_actions';
|
import LicenseActions from '../actions/license_actions';
|
||||||
import LicenseStore from '../stores/license_store';
|
import LicenseStore from '../stores/license_store';
|
||||||
|
|
||||||
@ -21,17 +17,14 @@ import UserStore from '../stores/user_store';
|
|||||||
import GlobalNotificationModel from '../models/global_notification_model';
|
import GlobalNotificationModel from '../models/global_notification_model';
|
||||||
import GlobalNotificationActions from '../actions/global_notification_actions';
|
import GlobalNotificationActions from '../actions/global_notification_actions';
|
||||||
|
|
||||||
import Form from './ascribe_forms/form';
|
|
||||||
import Property from './ascribe_forms/property';
|
import Property from './ascribe_forms/property';
|
||||||
import PropertyCollapsible from './ascribe_forms/property_collapsible';
|
import PropertyCollapsible from './ascribe_forms/property_collapsible';
|
||||||
import FormPropertyHeader from './ascribe_forms/form_property_header';
|
import RegisterPieceForm from './ascribe_forms/form_register_piece';
|
||||||
|
//import FormPropertyHeader from './ascribe_forms/form_property_header';
|
||||||
|
|
||||||
import LoginContainer from './login_container';
|
import LoginContainer from './login_container';
|
||||||
import SlidesContainer from './ascribe_slides_container/slides_container';
|
import SlidesContainer from './ascribe_slides_container/slides_container';
|
||||||
|
|
||||||
import apiUrls from '../constants/api_urls';
|
|
||||||
|
|
||||||
import ReactS3FineUploader from './ascribe_uploader/react_s3_fine_uploader';
|
|
||||||
|
|
||||||
import { mergeOptions } from '../utils/general_utils';
|
import { mergeOptions } from '../utils/general_utils';
|
||||||
import { getCookie } from '../utils/fetch_api_utils';
|
import { getCookie } from '../utils/fetch_api_utils';
|
||||||
@ -46,8 +39,6 @@ let RegisterPiece = React.createClass( {
|
|||||||
UserStore.getState(),
|
UserStore.getState(),
|
||||||
PieceListStore.getState(),
|
PieceListStore.getState(),
|
||||||
{
|
{
|
||||||
digitalWorkKey: null,
|
|
||||||
uploadStatus: false,
|
|
||||||
selectedLicense: 0,
|
selectedLicense: 0,
|
||||||
isFineUploaderEditable: false
|
isFineUploaderEditable: false
|
||||||
});
|
});
|
||||||
@ -97,32 +88,6 @@ let RegisterPiece = React.createClass( {
|
|||||||
this.transitionTo('piece', {pieceId: response.piece.id});
|
this.transitionTo('piece', {pieceId: response.piece.id});
|
||||||
},
|
},
|
||||||
|
|
||||||
getFormData(){
|
|
||||||
return {
|
|
||||||
digital_work_key: this.state.digitalWorkKey
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
submitKey(key){
|
|
||||||
this.setState({
|
|
||||||
digitalWorkKey: key
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
setIsUploadReady(isReady) {
|
|
||||||
this.setState({
|
|
||||||
isUploadReady: isReady
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
isReadyForFormSubmission(files) {
|
|
||||||
files = files.filter((file) => file.status !== 'deleted' && file.status !== 'canceled');
|
|
||||||
if (files.length > 0 && files[0].status === 'upload successful') {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLicenseChange(event){
|
onLicenseChange(event){
|
||||||
//console.log(this.state.licenses[event.target.selectedIndex].url);
|
//console.log(this.state.licenses[event.target.selectedIndex].url);
|
||||||
this.setState({selectedLicense: event.target.selectedIndex});
|
this.setState({selectedLicense: event.target.selectedIndex});
|
||||||
@ -170,59 +135,9 @@ let RegisterPiece = React.createClass( {
|
|||||||
onFocus={this.changeSlide}>
|
onFocus={this.changeSlide}>
|
||||||
<Row className="no-margin">
|
<Row className="no-margin">
|
||||||
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
|
||||||
<Form
|
<RegisterPieceForm
|
||||||
className="ascribe-form-bordered"
|
isFineUploaderEditable={this.state.isFineUploaderEditable}
|
||||||
ref='form'
|
handleSuccess={this.handleSuccess}>
|
||||||
url={apiUrls.pieces_list}
|
|
||||||
getFormData={this.getFormData}
|
|
||||||
handleSuccess={this.handleSuccess}
|
|
||||||
buttons={<button
|
|
||||||
type="submit"
|
|
||||||
className="btn ascribe-btn ascribe-btn-login"
|
|
||||||
disabled={!this.state.isUploadReady}>
|
|
||||||
{getLangText('Register work')}
|
|
||||||
</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" />
|
|
||||||
</button>
|
|
||||||
}>
|
|
||||||
<FormPropertyHeader>
|
|
||||||
<h3>{getLangText('Register your work')}</h3>
|
|
||||||
</FormPropertyHeader>
|
|
||||||
<Property
|
|
||||||
ignoreFocus={true}>
|
|
||||||
<FileUploader
|
|
||||||
submitKey={this.submitKey}
|
|
||||||
setIsUploadReady={this.setIsUploadReady}
|
|
||||||
isReadyForFormSubmission={this.isReadyForFormSubmission}
|
|
||||||
editable={this.state.isFineUploaderEditable}/>
|
|
||||||
</Property>
|
|
||||||
<Property
|
|
||||||
name='artist_name'
|
|
||||||
label={getLangText('Artist Name')}>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="(e.g. Andy Warhol)"
|
|
||||||
required/>
|
|
||||||
</Property>
|
|
||||||
<Property
|
|
||||||
name='title'
|
|
||||||
label={getLangText('Title')}>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="(e.g. 32 Campbell's Soup Cans)"
|
|
||||||
required/>
|
|
||||||
</Property>
|
|
||||||
<Property
|
|
||||||
name='date_created'
|
|
||||||
label={getLangText('Year Created')}>
|
|
||||||
<input
|
|
||||||
type="number"
|
|
||||||
placeholder="(e.g. 1962)"
|
|
||||||
min={0}
|
|
||||||
required/>
|
|
||||||
</Property>
|
|
||||||
<PropertyCollapsible
|
<PropertyCollapsible
|
||||||
checkboxLabel={getLangText('Specify editions')}>
|
checkboxLabel={getLangText('Specify editions')}>
|
||||||
<span>{getLangText('Editions')}</span>
|
<span>{getLangText('Editions')}</span>
|
||||||
@ -232,7 +147,7 @@ let RegisterPiece = React.createClass( {
|
|||||||
min={0}/>
|
min={0}/>
|
||||||
</PropertyCollapsible>
|
</PropertyCollapsible>
|
||||||
{this.getLicenses()}
|
{this.getLicenses()}
|
||||||
</Form>
|
</RegisterPieceForm>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
@ -248,54 +163,4 @@ let RegisterPiece = React.createClass( {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
let FileUploader = React.createClass({
|
|
||||||
propTypes: {
|
|
||||||
setIsUploadReady: React.PropTypes.func,
|
|
||||||
submitKey: React.PropTypes.func,
|
|
||||||
isReadyForFormSubmission: React.PropTypes.func,
|
|
||||||
onClick: React.PropTypes.func,
|
|
||||||
// editable is used to lock react fine uploader in case
|
|
||||||
// a user is actually not logged in already to prevent him from droping files
|
|
||||||
// before login in
|
|
||||||
editable: React.PropTypes.bool
|
|
||||||
},
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<ReactS3FineUploader
|
|
||||||
onClick={this.props.onClick}
|
|
||||||
keyRoutine={{
|
|
||||||
url: AppConstants.serverUrl + 's3/key/',
|
|
||||||
fileClass: 'digitalwork'
|
|
||||||
}}
|
|
||||||
createBlobRoutine={{
|
|
||||||
url: apiUrls.blob_digitalworks
|
|
||||||
}}
|
|
||||||
submitKey={this.props.submitKey}
|
|
||||||
validation={{
|
|
||||||
itemLimit: 100000,
|
|
||||||
sizeLimit: '25000000000'
|
|
||||||
}}
|
|
||||||
setIsUploadReady={this.props.setIsUploadReady}
|
|
||||||
isReadyForFormSubmission={this.props.isReadyForFormSubmission}
|
|
||||||
areAssetsDownloadable={false}
|
|
||||||
areAssetsEditable={this.props.editable}
|
|
||||||
signature={{
|
|
||||||
endpoint: AppConstants.serverUrl + 's3/signature/',
|
|
||||||
customHeaders: {
|
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
deleteFile={{
|
|
||||||
enabled: true,
|
|
||||||
method: 'DELETE',
|
|
||||||
endpoint: AppConstants.serverUrl + 's3/delete',
|
|
||||||
customHeaders: {
|
|
||||||
'X-CSRFToken': getCookie('csrftoken')
|
|
||||||
}
|
|
||||||
}}/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default RegisterPiece;
|
export default RegisterPiece;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user