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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 3 deletions

View file

@ -0,0 +1 @@
* Fix queries with dot notation in the column name to show results

View file

@ -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;

View file

@ -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;

View file

@ -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