Fleet UI: Fix dot problem so UI renders responses for columns with dot notation (#19528)

This commit is contained in:
RachelElysia
2024-06-10 16:21:58 -04:00
committed by GitHub
parent 01dd0c7c4d
commit 7a4a3c4939
4 changed files with 4 additions and 3 deletions
@@ -0,0 +1 @@
* Fix queries with dot notation in the column name to show results
@@ -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;
@@ -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;
@@ -50,7 +50,7 @@ const generateColumnConfigsFromRows = <T extends Record<keyof T, unknown>>(
isSortedDesc={headerProps.column.isSortedDesc}
/>
),
accessor: colName,
accessor: (data) => data[colName],
Cell: (cellProps: CellProps<T>) => {
const val = cellProps?.cell?.value;
return !!val?.length && val.length > 300