aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/SchemaTable.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-08-05 17:07:02 -0400
committerbobzel <zzzman@gmail.com>2020-08-05 17:07:02 -0400
commit201da4ecf5c91595dc1c7fb51e360bb75af613f8 (patch)
tree50e6e5e7e7bca513f7fbc6b6d9a69f0307f658a4 /src/client/views/collections/SchemaTable.tsx
parent4e6c4da15efe4b2ea55291eb85211178872c3f09 (diff)
restored sub tables in schema views.
Diffstat (limited to 'src/client/views/collections/SchemaTable.tsx')
-rw-r--r--src/client/views/collections/SchemaTable.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index f81a03f98..75d484cbe 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -495,11 +495,13 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
@computed
get reactTable() {
const children = this.childDocs;
+ const hasCollectionChild = children.reduce((found, doc) => found || doc.type === "collection", false);
const expandedRowsList = this._openCollections.map(col => children.findIndex(doc => doc[Id] === col).toString());
const expanded = {};
//@ts-ignore
expandedRowsList.forEach(row => expanded[row] = true);
const rerender = [...this.textWrappedRows]; // TODO: get component to rerender on text wrap change without needign to console.log :((((
+
return <ReactTable
style={{ position: "relative" }}
data={children}
@@ -514,8 +516,9 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
sorted={this.sorted}
expanded={expanded}
resized={this.resized}
- NoDataComponent={() => null}
onResizedChange={this.props.onResizedChange}
+ SubComponent={!hasCollectionChild ? undefined : row => (row.original.type !== "collection") ? (null) :
+ <div className="reactTable-sub"><SchemaTable {...this.props} Document={row.original} dataDoc={undefined} childDocs={undefined} /></div>}
/>;
}