mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-09-21 15:33:16 +08:00
fix: list panel not querying selected columns (#5452)
Added log and traces columns to query for list panels Closes #5064 Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com>
This commit is contained in:
parent
43e73e06fe
commit
77eba9a558
@ -14,6 +14,7 @@ import { memo, useEffect, useRef, useState } from 'react';
|
|||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { UpdateTimeInterval } from 'store/actions';
|
import { UpdateTimeInterval } from 'store/actions';
|
||||||
import { AppState } from 'store/reducers';
|
import { AppState } from 'store/reducers';
|
||||||
|
import { DataSource } from 'types/common/queryBuilder';
|
||||||
import { GlobalReducer } from 'types/reducer/globalTime';
|
import { GlobalReducer } from 'types/reducer/globalTime';
|
||||||
import { getGraphType } from 'utils/getGraphType';
|
import { getGraphType } from 'utils/getGraphType';
|
||||||
import { getSortedSeriesData } from 'utils/getSortedSeriesData';
|
import { getSortedSeriesData } from 'utils/getSortedSeriesData';
|
||||||
@ -113,6 +114,7 @@ function GridCardGraph({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
updatedQuery.builder.queryData[0].pageSize = 10;
|
updatedQuery.builder.queryData[0].pageSize = 10;
|
||||||
|
const initialDataSource = updatedQuery.builder.queryData[0].dataSource;
|
||||||
return {
|
return {
|
||||||
query: updatedQuery,
|
query: updatedQuery,
|
||||||
graphType: PANEL_TYPES.LIST,
|
graphType: PANEL_TYPES.LIST,
|
||||||
@ -123,6 +125,10 @@ function GridCardGraph({
|
|||||||
offset: 0,
|
offset: 0,
|
||||||
limit: updatedQuery.builder.queryData[0].limit || 0,
|
limit: updatedQuery.builder.queryData[0].limit || 0,
|
||||||
},
|
},
|
||||||
|
selectColumns:
|
||||||
|
initialDataSource === DataSource.LOGS
|
||||||
|
? widget.selectedLogFields
|
||||||
|
: widget.selectedTracesFields,
|
||||||
},
|
},
|
||||||
fillGaps: widget.fillSpans,
|
fillGaps: widget.fillSpans,
|
||||||
};
|
};
|
||||||
|
@ -559,6 +559,29 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [onSaveDashboard]);
|
}, [onSaveDashboard]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (selectedGraph === PANEL_TYPES.LIST) {
|
||||||
|
const initialDataSource = currentQuery.builder.queryData[0].dataSource;
|
||||||
|
if (initialDataSource === DataSource.LOGS) {
|
||||||
|
setRequestData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
tableParams: {
|
||||||
|
...prev.tableParams,
|
||||||
|
selectColumns: selectedLogFields,
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
} else if (initialDataSource === DataSource.TRACES) {
|
||||||
|
setRequestData((prev) => ({
|
||||||
|
...prev,
|
||||||
|
tableParams: {
|
||||||
|
...prev.tableParams,
|
||||||
|
selectColumns: selectedTracesFields,
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [selectedLogFields, selectedTracesFields, currentQuery, selectedGraph]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<div className="edit-header">
|
<div className="edit-header">
|
||||||
|
@ -43,6 +43,7 @@ function TracesTableComponent({
|
|||||||
setRequestData((prev) => ({
|
setRequestData((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
tableParams: {
|
tableParams: {
|
||||||
|
...prev.tableParams,
|
||||||
pagination,
|
pagination,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user