Skip to content

Commit

Permalink
fix Table topForm
Browse files Browse the repository at this point in the history
  • Loading branch information
QProgS committed Feb 9, 2019
1 parent df757b7 commit ac2e19b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/scripts/be5/components/tables/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import classNames from 'classnames';
import be5 from '../../be5';
import {getModelByID, getResourceByType, getSelfUrl} from '../../utils/documentUtils';
import OperationBox from './OperationBox';
import Document from "../../containers/Document";
import {registerDocument} from '../../core/registers/documents';
import {getDocument, registerDocument} from '../../core/registers/documents';
import CategoryNavigation from "./CategoryNavigation";
import {executeFrontendActions} from "../../services/frontendActions";
import FilterUI from "./FilterUI";
Expand Down Expand Up @@ -87,7 +86,7 @@ class Table extends Component {

return (
<div className={classNames("table-component", this.getTableClass(), data.attributes.layout.classes)}>
{this.topForm(topFormJson, hideOperations)}
{this.topForm(topFormJson)}
<TitleTag className="table-component__title">
{value.data.attributes.title}
{this.getOperationParamsInfo().length > 0 ? <small>{' '}{this.getOperationParamsInfo()}</small> : null}
Expand Down Expand Up @@ -187,8 +186,9 @@ class Table extends Component {
const layout = topFormJson.data.attributes.layout;
if (layout.type === undefined) layout.type = 'inlineMiniForm';
if (layout.bsSize === undefined) layout.bsSize = 'sm';
return <Document
frontendParams={{documentName: "documentTopForm", parentDocumentName: this.props.frontendParams.documentName}}
const FormComponent = getDocument(layout.type);
return <FormComponent
frontendParams={{documentName: this.props.frontendParams.documentName}}
value={topFormJson}
/>
}
Expand Down

0 comments on commit ac2e19b

Please sign in to comment.