import React from 'react'; import { ButtonToolbar, Button, Modal } from 'react-bootstrap'; import Card from './card'; import Form from '../forms/form'; import { isFunction } from '../commons/utils'; import AsyncButton from './async-button'; import RemoteForm from './remote-form'; /** * The page controller of the public module */ export default class FormDialog extends React.Component { constructor(props) { super(props); this.confirmClick = this.confirmClick.bind(this); this.remoteFormLoad = this.remoteFormLoad.bind(this); const title = this.props.schema ? this.props.schema.title : undefined; this.state = { title: title, remoteFormMounted: false }; } componentWillMount() { if (!this.props.remotePath) { this.setState({ doc: this.props.doc }); } } componentDidMount() { this._mounted = true; } componentWillReceiveProps(nextProps) { // forces this component to update the