diff --git a/changes/19528-dot-notation-bug-on-queries b/changes/19528-dot-notation-bug-on-queries new file mode 100644 index 0000000000..2475c7d866 --- /dev/null +++ b/changes/19528-dot-notation-bug-on-queries @@ -0,0 +1 @@ +* Fix queries with dot notation in the column name to show results \ No newline at end of file diff --git a/frontend/pages/hosts/details/HostQueryReport/HQRTable/HQRTableConfig.tsx b/frontend/pages/hosts/details/HostQueryReport/HQRTable/HQRTableConfig.tsx index d5252ec5df..4939263100 100644 --- a/frontend/pages/hosts/details/HostQueryReport/HQRTable/HQRTableConfig.tsx +++ b/frontend/pages/hosts/details/HostQueryReport/HQRTable/HQRTableConfig.tsx @@ -31,7 +31,7 @@ const generateColumnConfigs = (rows: IWebSocketData[]): IHQRTTableColumn[] => isSortedDesc={headerProps.column.isSortedDesc} /> ), - accessor: colName, + accessor: (data) => data[colName], Cell: (cellProps: ITableStringCellProps) => { if (typeof cellProps?.cell?.value !== "string") return null; diff --git a/frontend/pages/queries/details/components/QueryReport/QueryReportTableConfig.tsx b/frontend/pages/queries/details/components/QueryReport/QueryReportTableConfig.tsx index b46383ecf6..0294dffe5c 100644 --- a/frontend/pages/queries/details/components/QueryReport/QueryReportTableConfig.tsx +++ b/frontend/pages/queries/details/components/QueryReport/QueryReportTableConfig.tsx @@ -65,7 +65,7 @@ const generateReportColumnConfigsFromResults = ( isSortedDesc={headerProps.column.isSortedDesc} /> ), - accessor: key, + accessor: (data) => data[key], Cell: (cellProps: ITableCellProps) => { if (typeof cellProps.cell.value !== "string") return null; diff --git a/frontend/pages/queries/edit/components/QueryResults/QueryResultsTableConfig.tsx b/frontend/pages/queries/edit/components/QueryResults/QueryResultsTableConfig.tsx index fd29edceb4..3f45c702d6 100644 --- a/frontend/pages/queries/edit/components/QueryResults/QueryResultsTableConfig.tsx +++ b/frontend/pages/queries/edit/components/QueryResults/QueryResultsTableConfig.tsx @@ -50,7 +50,7 @@ const generateColumnConfigsFromRows = >( isSortedDesc={headerProps.column.isSortedDesc} /> ), - accessor: colName, + accessor: (data) => data[colName], Cell: (cellProps: CellProps) => { const val = cellProps?.cell?.value; return !!val?.length && val.length > 300