From 01fe61f4e5f2d7bbefb4b7720e2b5ecdcd559252 Mon Sep 17 00:00:00 2001 From: Marina Samuel Date: Mon, 8 Apr 2019 11:27:15 -0400 Subject: [PATCH] Closes #934, #935: Remove type from schema browser and don't show empty example column --- client/app/components/queries/SchemaData.jsx | 17 ++++++++++++----- .../app/components/queries/schema-browser.html | 1 - 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/client/app/components/queries/SchemaData.jsx b/client/app/components/queries/SchemaData.jsx index b17600676e..bd984df811 100644 --- a/client/app/components/queries/SchemaData.jsx +++ b/client/app/components/queries/SchemaData.jsx @@ -30,13 +30,20 @@ class SchemaData extends React.PureComponent { dataIndex: 'type', width: 400, key: 'type', - }, { - title: 'Example', - dataIndex: 'example', - width: 400, - key: 'example', }]; + const hasExample = + this.props.tableMetadata.some(columnMetadata => columnMetadata.example); + + if (hasExample) { + columns.push({ + title: 'Example', + dataIndex: 'example', + width: 400, + key: 'example', + }); + } + return (
{{column.name}} - ({{column.type}})