Skip to content

Commit

Permalink
Fix TableWidget not displaying quadbin field for a table with spatial…
Browse files Browse the repository at this point in the history
… index (#799)
  • Loading branch information
VictorVelarde authored Nov 15, 2023
1 parent 9038b4e commit 3ef0ecb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Not released

- Fix TableWidget not displaying quadbin field for a table with spatial index [#799](https://github.com/CartoDB/carto-react/pull/799)

## 2.2

### 2.2.14 (2023-10-25)
Expand Down
5 changes: 4 additions & 1 deletion packages/react-ui/src/widgets/TableWidgetUI/TableWidgetUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,12 @@ function TableBodyComponent({ columns, rows, onRowClick }) {
onClick={() => onRowClick && onRowClick(row)}
>
{columns.map(({ field, headerName, align, component }) => {
const cellValue = Object.entries(row).find(([key]) => {
let cellValue = Object.entries(row).find(([key]) => {
return key.toUpperCase() === field.toUpperCase();
})?.[1];
if (typeof cellValue === 'bigint') {
cellValue = cellValue.toString(); // otherwise TableCell will fail for displaying it
}
return (
(headerName || field) && (
<TableCellStyled
Expand Down

0 comments on commit 3ef0ecb

Please sign in to comment.