diff --git a/src/QueryBuilder/ResultViewer/DynamicTable/DynamicTable.js b/src/QueryBuilder/ResultViewer/DynamicTable/DynamicTable.js index 2ec1a53a..3b78bb14 100644 --- a/src/QueryBuilder/ResultViewer/DynamicTable/DynamicTable.js +++ b/src/QueryBuilder/ResultViewer/DynamicTable/DynamicTable.js @@ -1,9 +1,21 @@ import React, { useMemo } from 'react'; +import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import css from './DynamicTable.css'; const columnStyle = { width: '180px', minWidth: '180px' }; +function getCellValue(row, property) { + // typeof check to ensure we don't consider null/undefined as a boolean + if (property.dataType.dataType === 'booleanType' && typeof row[property.property] === 'boolean') { + return row[property.property] + ? + : ; + } + + return row[property.property]; +} + export const DynamicTable = ({ properties, values }) => { const tableBodyRows = useMemo(() => JSON.parse(values ?? '[]'), [values]); @@ -27,7 +39,7 @@ export const DynamicTable = ({ properties, values }) => { {properties?.map((cell) => ( - {row[cell.property]} + {getCellValue(row, cell)} ))}