Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hsz committed Feb 5, 2019
1 parent c98a102 commit b2ebe92
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/containers/CollectionsPage/DraggableFieldsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { Button, Divider, Icon, Popconfirm } from 'antd';
import { DraggableTable, FieldTypeIcon } from 'components';
import FieldModal from 'containers/CollectionsPage/FieldModal';
import { withTranslate } from 'helpers';
import { List } from 'immutable';
import { get } from 'lodash';
import { fieldArrayFieldsPropTypes } from 'redux-form/immutable';
import { Component, PropTypes, React, styled } from 'utils/create';
import { Component, compose, PropTypes, React, styled } from 'utils/create';

const FieldName = styled.strong`
display: block;
Expand Down Expand Up @@ -41,7 +42,7 @@ class DraggableFieldsTable extends Component {
render() {
const { _, fields } = this.props;
const { current, showModal } = this.state;
const dataSource = fields.map((name, index) => ({ name, field: fields.get(index) })).toArray();
const dataSource = List(fields.map((name, index) => ({ name, field: fields.get(index) })));

return (
<div>
Expand Down Expand Up @@ -103,7 +104,7 @@ class DraggableFieldsTable extends Component {
),
},
]}
dataSource={dataSource}
dataSource={dataSource.toArray()}
pagination={false}
rowKey={({ name }) => name}
showHeader={false}
Expand All @@ -119,4 +120,4 @@ DraggableFieldsTable.propTypes = {
fields: PropTypes.shape(fieldArrayFieldsPropTypes).isRequired,
};

export default withTranslate(DraggableFieldsTable);
export default compose(withTranslate)(DraggableFieldsTable);
1 change: 1 addition & 0 deletions src/containers/CollectionsPage/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ CollectionsPageEdit.contextTypes = {

const mapStateToProps = (state, { match: { params } }) => {
const item = getCollection(state, params.id);

return {
id: params.id,
item,
Expand Down

0 comments on commit b2ebe92

Please sign in to comment.