console: fix json string rendering in data browser (close #4201) (#4221)

This commit is contained in:
Gabriel Sobrinho
2020-03-30 12:31:49 -03:00
committed by GitHub
parent 7a443ce3a3
commit 6056dfa560

View File

@@ -581,7 +581,11 @@ const ViewRows = ({
} else if (rowColumnValue === undefined) {
cellValue = 'NULL';
cellTitle = cellValue;
} else if (typeof rowColumnValue === 'object') {
} else if (
col.data_type === 'json' ||
col.data_type === 'jsonb' ||
rowColumnValue === 'object'
) {
cellValue = JSON.stringify(rowColumnValue, null, 4);
cellTitle = cellValue;
} else {
@@ -759,9 +763,7 @@ const ViewRows = ({
<b className={styles.padd_small_right}>Selected:</b>
{selectedRows.length}
<button
className={`${styles.add_mar_right_small} btn btn-xs btn-default ${
styles.bulkDeleteButton
}`}
className={`${styles.add_mar_right_small} btn btn-xs btn-default ${styles.bulkDeleteButton}`}
title="Delete selected rows"
onClick={handleDeleteItems}
>