diff --git a/src/QueryBuilder/ResultViewer/ResultViewer.test.js b/src/QueryBuilder/ResultViewer/ResultViewer.test.js index 8448c4ed..80c2074c 100644 --- a/src/QueryBuilder/ResultViewer/ResultViewer.test.js +++ b/src/QueryBuilder/ResultViewer/ResultViewer.test.js @@ -26,6 +26,7 @@ const renderResultViewer = (props) => ( onSetDefaultColumns={setColumns} height={300} refreshInProgress={false} + forcedVisibleValues={['username']} {...props} /> diff --git a/src/QueryBuilder/ResultViewer/helpers.js b/src/QueryBuilder/ResultViewer/helpers.js index 9be4fcf9..66d4a101 100644 --- a/src/QueryBuilder/ResultViewer/helpers.js +++ b/src/QueryBuilder/ResultViewer/helpers.js @@ -19,9 +19,8 @@ export const getTableMetadata = (entityType, forcedVisibleValues) => { return acc; }, {}); - const defaultVisibleColumns = defaultColumns?.filter(col => !!forcedVisibleValues - .find(value => value === col.value) || col.selected) - .map(col => col.value) || []; + const defaultVisibleColumns = defaultColumns?.filter(col => !!forcedVisibleValues?.find(value => value === col.value) + || col.selected).map(col => col.value) || []; const formatter = defaultColumns.reduce((formatted, column) => { const { value, dataType, properties } = column;