'use strict'; import React from 'react'; import AppConstants from '../constants/application_constants'; import fineUploader from 'fineUploader'; import Router from 'react-router'; import GlobalNotificationModel from '../models/global_notification_model'; import GlobalNotificationActions from '../actions/global_notification_actions'; import Form from './ascribe_forms/form'; import Property from './ascribe_forms/property'; import apiUrls from '../constants/api_urls'; import ReactS3FineUploader from './ascribe_uploader/react_s3_fine_uploader'; import DatePicker from 'react-datepicker/dist/react-datepicker'; let RegisterPiece = React.createClass( { mixins: [Router.Navigation], getInitialState(){ return {digital_work_key: null}; }, handleSuccess(){ let notification = new GlobalNotificationModel('Login successsful', 'success', 10000); GlobalNotificationActions.appendGlobalNotification(notification); this.transitionTo('pieces'); }, getFormData(){ let data = {}; for (let ref in this.refs.form.refs){ data[this.refs.form.refs[ref].props.name] = this.refs.form.refs[ref].state.value; } data.digital_work_key = this.state.digital_work_key; return data; }, handleChange(){ this.setState({digital_work_key: this.refs.uploader.refs.fineuploader.state.filesToUpload[0].key}); }, render() { let buttons = null; if (this.refs.uploader && this.refs.uploader.refs.fineuploader.state.filesToUpload[0].status === 'upload successful'){ buttons = ( ); } return (