mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 16:25:54 +08:00
fix: fixed list panel getting no-data in full view and edit panel (#7320)
* fix: fixed list panel getting no-data in full view and edit panel * fix: added cloneDeep for updatedQuery --------- Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
This commit is contained in:
parent
7a225e0a4f
commit
4779300dea
@ -95,6 +95,7 @@ function FullView({
|
|||||||
graphType: PANEL_TYPES.LIST,
|
graphType: PANEL_TYPES.LIST,
|
||||||
selectedTime: widget?.timePreferance || 'GLOBAL_TIME',
|
selectedTime: widget?.timePreferance || 'GLOBAL_TIME',
|
||||||
globalSelectedInterval: globalSelectedTime,
|
globalSelectedInterval: globalSelectedTime,
|
||||||
|
variables: getDashboardVariables(selectedDashboard?.data.variables),
|
||||||
tableParams: {
|
tableParams: {
|
||||||
pagination: {
|
pagination: {
|
||||||
offset: 0,
|
offset: 0,
|
||||||
|
@ -24,7 +24,7 @@ import { useSafeNavigate } from 'hooks/useSafeNavigate';
|
|||||||
import useUrlQuery from 'hooks/useUrlQuery';
|
import useUrlQuery from 'hooks/useUrlQuery';
|
||||||
import { getDashboardVariables } from 'lib/dashbaordVariables/getDashboardVariables';
|
import { getDashboardVariables } from 'lib/dashbaordVariables/getDashboardVariables';
|
||||||
import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';
|
import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';
|
||||||
import { defaultTo, isEmpty, isUndefined } from 'lodash-es';
|
import { cloneDeep, defaultTo, isEmpty, isUndefined } from 'lodash-es';
|
||||||
import { Check, X } from 'lucide-react';
|
import { Check, X } from 'lucide-react';
|
||||||
import { DashboardWidgetPageParams } from 'pages/DashboardWidget';
|
import { DashboardWidgetPageParams } from 'pages/DashboardWidget';
|
||||||
import { useAppContext } from 'providers/App/App';
|
import { useAppContext } from 'providers/App/App';
|
||||||
@ -315,7 +315,25 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
|
|||||||
// request data should be handled by the parent and the child components should consume the same
|
// request data should be handled by the parent and the child components should consume the same
|
||||||
// this has been moved here from the left container
|
// this has been moved here from the left container
|
||||||
const [requestData, setRequestData] = useState<GetQueryResultsProps>(() => {
|
const [requestData, setRequestData] = useState<GetQueryResultsProps>(() => {
|
||||||
if (selectedWidget && selectedGraph !== PANEL_TYPES.LIST) {
|
const updatedQuery = cloneDeep(stagedQuery || initialQueriesMap.metrics);
|
||||||
|
updatedQuery.builder.queryData[0].pageSize = 10;
|
||||||
|
|
||||||
|
if (selectedWidget) {
|
||||||
|
if (selectedGraph === PANEL_TYPES.LIST) {
|
||||||
|
return {
|
||||||
|
query: updatedQuery,
|
||||||
|
graphType: PANEL_TYPES.LIST,
|
||||||
|
selectedTime: selectedTime.enum || 'GLOBAL_TIME',
|
||||||
|
globalSelectedInterval,
|
||||||
|
variables: getDashboardVariables(selectedDashboard?.data.variables),
|
||||||
|
tableParams: {
|
||||||
|
pagination: {
|
||||||
|
offset: 0,
|
||||||
|
limit: updatedQuery.builder.queryData[0].limit || 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
selectedTime: selectedWidget?.timePreferance,
|
selectedTime: selectedWidget?.timePreferance,
|
||||||
graphType: getGraphType(selectedGraph || selectedWidget.panelTypes),
|
graphType: getGraphType(selectedGraph || selectedWidget.panelTypes),
|
||||||
@ -327,8 +345,6 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
|
|||||||
variables: getDashboardVariables(selectedDashboard?.data.variables),
|
variables: getDashboardVariables(selectedDashboard?.data.variables),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const updatedQuery = { ...(stagedQuery || initialQueriesMap.metrics) };
|
|
||||||
updatedQuery.builder.queryData[0].pageSize = 10;
|
|
||||||
|
|
||||||
// If stagedQuery exists, don't re-run the query (e.g. when clicking on Add to Dashboard from logs and traces explorer)
|
// If stagedQuery exists, don't re-run the query (e.g. when clicking on Add to Dashboard from logs and traces explorer)
|
||||||
if (!stagedQuery) {
|
if (!stagedQuery) {
|
||||||
@ -336,15 +352,10 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
query: updatedQuery,
|
query: updatedQuery,
|
||||||
graphType: PANEL_TYPES.LIST,
|
graphType: selectedGraph,
|
||||||
selectedTime: selectedTime.enum || 'GLOBAL_TIME',
|
selectedTime: selectedTime.enum || 'GLOBAL_TIME',
|
||||||
globalSelectedInterval,
|
globalSelectedInterval,
|
||||||
tableParams: {
|
variables: getDashboardVariables(selectedDashboard?.data.variables),
|
||||||
pagination: {
|
|
||||||
offset: 0,
|
|
||||||
limit: updatedQuery.builder.queryData[0].limit || 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user