'use strict'; import React from 'react'; import Button from 'react-bootstrap/lib/Button'; import Form from './form'; import Property from './property'; import InputContractAgreementCheckbox from './input_contract_agreement_checkbox'; import InputTextAreaToggable from './input_textarea_toggable'; import AscribeSpinner from '../ascribe_spinner'; import AclInformation from '../ascribe_buttons/acl_information'; import { getLangText } from '../../utils/lang_utils.js'; let ConsignForm = React.createClass({ propTypes: { url: React.PropTypes.string, id: React.PropTypes.object, autoFocusProperty: React.PropTypes.string, email: React.PropTypes.string, message: React.PropTypes.string, labels: React.PropTypes.object, createPublicContractAgreement: React.PropTypes.bool, handleSuccess: React.PropTypes.func }, getDefaultProps() { return { labels: {} }; }, getInitialState() { return { email: this.props.email || '' }; }, componentWillReceiveProps(nextProps) { if (this.props.email !== nextProps.email) { this.setState({ email: nextProps.email }); } }, getFormData() { return this.props.id; }, handleEmailOnChange(event) { // event.target.value is the submitted email of the consignee this.setState({ email: event && event.target && event.target.value || '' }); }, render() { const { email } = this.state; const { autoFocusProperty, createPublicContractAgreement, email: defaultEmail, handleSuccess, id, message, labels, url } = this.props; return (
); } }); export default ConsignForm;