From 05a2fe583d4657148eb8df38627e41939bbd3a9d Mon Sep 17 00:00:00 2001 From: Tom Robinson Date: Wed, 2 Nov 2016 12:02:55 -0700 Subject: [PATCH] Use formatValue in ObjectDetail for things like dates and URLs --- .../components/QueryVisualizationObjectDetailTable.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/metabase/query_builder/components/QueryVisualizationObjectDetailTable.jsx b/frontend/src/metabase/query_builder/components/QueryVisualizationObjectDetailTable.jsx index e87367a0384a9..4b8f533442e37 100644 --- a/frontend/src/metabase/query_builder/components/QueryVisualizationObjectDetailTable.jsx +++ b/frontend/src/metabase/query_builder/components/QueryVisualizationObjectDetailTable.jsx @@ -7,6 +7,7 @@ import LoadingSpinner from 'metabase/components/LoadingSpinner.jsx'; import { foreignKeyCountsByOriginTable } from 'metabase/lib/schema_metadata'; import { TYPE, isa, isPK } from "metabase/lib/types"; import { singularize, inflect } from 'inflection'; +import { formatValue } from "metabase/lib/formatting"; import cx from "classnames"; @@ -74,8 +75,10 @@ export default class QueryVisualizationObjectDetailTable extends Component { let formattedJson = JSON.stringify(row[1], null, 2); cellValue = (
{formattedJson}
); } else { - // TODO: should we be casting all values toString()? - cellValue = (); + cellValue = formatValue(row[1], { column: row[0], jsx: true }); + if (typeof cellValue === "string") { + cellValue = (); + } } // NOTE: that the values to our function call look off, but that's because we are un-pivoting them