diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-05-17 23:16:11 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-05-17 23:16:11 -0400 |
commit | 5220b9dc1f416a5e592fd359fb31033c63602e77 (patch) | |
tree | 650cf5070e1d90fae2edcc0ac574cab4df6d0eee /src | |
parent | c627be793938188ebcb16d2ca3db93728b609116 (diff) |
fixed sorting within Schemas
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/CollectionSchemaView.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index e2b90e26d..2b4361e50 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -66,8 +66,8 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) { renderCell = (rowProps: CellInfo) => { let props: FieldViewProps = { - Document: rowProps.value[0], - fieldKey: rowProps.value[1], + Document: rowProps.original, + fieldKey: rowProps.column.id as string, ContainingCollectionView: this.props.CollectionView, isSelected: returnFalse, select: emptyFunction, @@ -79,6 +79,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) { whenActiveChanged: emptyFunction, PanelHeight: returnZero, PanelWidth: returnZero, + addDocTab: this.props.addDocTab, }; let fieldContentView = <FieldView {...props} />; let reference = React.createRef<HTMLDivElement>(); @@ -296,6 +297,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) { parentActive={this.props.active} whenActiveChanged={this.props.whenActiveChanged} bringToFront={emptyFunction} + addDocTab={this.props.addDocTab} /> </div>)} <input className="collectionSchemaView-input" value={this.previewScript} onChange={this.onPreviewScriptChange} @@ -358,7 +360,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) { <ReactTable data={children} page={0} pageSize={children.length} showPagination={false} columns={this.columns.map(col => ({ Header: col, - accessor: (doc: Doc) => [doc, col], + accessor: (doc: Doc) => doc ? doc[col] : 0, id: col }))} column={{ ...ReactTableDefaults.column, Cell: this.renderCell, }} |