From 9b8f4fa46bfdc9ee435a9fa300a60310ede56112 Mon Sep 17 00:00:00 2001 From: Melissa Zhang Date: Thu, 13 Aug 2020 10:10:45 -0700 Subject: fixed empty string bug, small expander UI change --- src/client/views/collections/CollectionSchemaCells.tsx | 2 +- src/client/views/collections/SchemaTable.tsx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index 49d75e6de..4c0a82e83 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -254,7 +254,7 @@ export class CollectionSchemaCell extends React.Component { }; let contents: any = "incorrect type"; - if (type === undefined) contents = ; + if (type === undefined) contents = StrCast(field) === "" ? "--" : ; if (type === "number") contents = typeof field === "number" ? NumCast(field) : "--" + typeof field + "--"; if (type === "string") contents = typeof field === "string" ? (StrCast(field) === "" ? "--" : StrCast(field)) : "--" + typeof field + "--"; if (type === "boolean") contents = typeof field === "boolean" ? (BoolCast(field) ? "true" : "false") : "--" + typeof field + "--"; diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx index 8bf5a0475..d3837c49f 100644 --- a/src/client/views/collections/SchemaTable.tsx +++ b/src/client/views/collections/SchemaTable.tsx @@ -168,8 +168,9 @@ export class SchemaTable extends React.Component { width: 30, Expander: (rowInfo) => { if (rowInfo.original.type === "collection") { - if (rowInfo.isExpanded) return
this.onCloseCollection(rowInfo.original)}>
; - if (!rowInfo.isExpanded) return
this.onExpandCollection(rowInfo.original)}>
; + return rowInfo.isExpanded ? +
this.onCloseCollection(rowInfo.original)}>
: +
this.onExpandCollection(rowInfo.original)}>
; } else { return null; } -- cgit v1.2.3-70-g09d2