Add parsing for nested json objects in resultset (#2163)

This commit is contained in:
vera-liu 2017-02-13 17:15:41 -08:00 committed by GitHub
parent c564881867
commit 83ef8a2e12
1 changed files with 12 additions and 1 deletions

View File

@ -190,7 +190,18 @@ class ResultSet extends React.PureComponent {
{sql}
<div className="ResultSet">
<Table
data={data}
data={data.map(function (row) {
const newRow = {};
for (const k in row) {
const val = row[k];
if (typeof(val) === 'string') {
newRow[k] = val;
} else {
newRow[k] = JSON.stringify(val);
}
}
return newRow;
})}
columns={results.columns.map((col) => col.name)}
sortable
className="table table-condensed table-bordered"