2015-07-08 22:54:07 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import Row from 'react-bootstrap/lib/Row';
|
|
|
|
import Col from 'react-bootstrap/lib/Col';
|
|
|
|
|
|
|
|
import Form from './../ascribe_forms/form';
|
|
|
|
|
|
|
|
import PieceExtraDataForm from './../ascribe_forms/form_piece_extradata';
|
|
|
|
|
|
|
|
|
|
|
|
import GlobalNotificationModel from '../../models/global_notification_model';
|
|
|
|
import GlobalNotificationActions from '../../actions/global_notification_actions';
|
|
|
|
|
2015-08-12 13:34:41 +02:00
|
|
|
import FurtherDetailsFileuploader from './further_details_fileuploader';
|
2015-07-08 22:54:07 +02:00
|
|
|
|
2015-08-18 13:15:22 +02:00
|
|
|
import { isReadyForFormSubmission } from '../ascribe_uploader/react_s3_fine_uploader_utils';
|
|
|
|
|
2015-07-08 22:54:07 +02:00
|
|
|
let FurtherDetails = React.createClass({
|
|
|
|
propTypes: {
|
2015-07-09 14:37:33 +02:00
|
|
|
editable: React.PropTypes.bool,
|
2015-07-10 14:15:22 +02:00
|
|
|
pieceId: React.PropTypes.number,
|
2015-07-09 14:37:33 +02:00
|
|
|
extraData: React.PropTypes.object,
|
2015-08-17 20:52:36 +02:00
|
|
|
otherData: React.PropTypes.arrayOf(React.PropTypes.object),
|
2015-07-08 22:54:07 +02:00
|
|
|
handleSuccess: React.PropTypes.func
|
|
|
|
},
|
|
|
|
|
|
|
|
getInitialState() {
|
|
|
|
return {
|
|
|
|
loading: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
showNotification(){
|
|
|
|
this.props.handleSuccess();
|
|
|
|
let notification = new GlobalNotificationModel('Details updated', 'success');
|
|
|
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
|
|
|
},
|
|
|
|
|
|
|
|
submitKey(key){
|
|
|
|
this.setState({
|
|
|
|
otherDataKey: key
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
setIsUploadReady(isReady) {
|
|
|
|
this.setState({
|
|
|
|
isUploadReady: isReady
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
2015-07-09 14:37:33 +02:00
|
|
|
//return (<span />);
|
|
|
|
return (
|
|
|
|
<Row>
|
|
|
|
<Col md={12} className="ascribe-edition-personal-note">
|
|
|
|
<PieceExtraDataForm
|
|
|
|
name='artist_contact_info'
|
|
|
|
title='Artist Contact Info'
|
|
|
|
handleSuccess={this.showNotification}
|
|
|
|
editable={this.props.editable}
|
|
|
|
pieceId={this.props.pieceId}
|
|
|
|
extraData={this.props.extraData}
|
|
|
|
/>
|
|
|
|
<PieceExtraDataForm
|
|
|
|
name='display_instructions'
|
|
|
|
title='Display Instructions'
|
|
|
|
handleSuccess={this.showNotification}
|
|
|
|
editable={this.props.editable}
|
|
|
|
pieceId={this.props.pieceId}
|
|
|
|
extraData={this.props.extraData} />
|
|
|
|
<PieceExtraDataForm
|
|
|
|
name='technology_details'
|
|
|
|
title='Technology Details'
|
|
|
|
handleSuccess={this.showNotification}
|
|
|
|
editable={this.props.editable}
|
|
|
|
pieceId={this.props.pieceId}
|
|
|
|
extraData={this.props.extraData} />
|
2015-08-12 13:34:41 +02:00
|
|
|
<Form>
|
|
|
|
<FurtherDetailsFileuploader
|
|
|
|
submitKey={this.submitKey}
|
|
|
|
setIsUploadReady={this.setIsUploadReady}
|
2015-08-18 13:15:22 +02:00
|
|
|
isReadyForFormSubmission={isReadyForFormSubmission}
|
2015-08-12 13:34:41 +02:00
|
|
|
editable={this.props.editable}
|
|
|
|
pieceId={this.props.pieceId}
|
2015-08-17 20:52:36 +02:00
|
|
|
otherData={this.props.otherData}
|
|
|
|
multiple={true}/>
|
2015-08-12 13:34:41 +02:00
|
|
|
</Form>
|
2015-07-09 14:37:33 +02:00
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
);
|
2015-07-08 22:54:07 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default FurtherDetails;
|