mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 06:42:03 +08:00
fix: page breaking when query range response is null for table panel … (#5139)
* fix: page breaking when query range response is null for table panel type * fix: page breaking when query range response is null for table panel type * fix: page breaking when query range response is null for table panel type
This commit is contained in:
parent
03838f5fcc
commit
be9c3f0697
@ -135,7 +135,7 @@ export function BillingUsageGraph(props: BillingUsageGraphProps): JSX.Element {
|
||||
},
|
||||
y: {
|
||||
...getYAxisScale({
|
||||
series: graphCompatibleData?.data.newResult.data.result,
|
||||
series: graphCompatibleData?.data?.newResult?.data?.result,
|
||||
yAxisUnit: '',
|
||||
softMax: null,
|
||||
softMin: null,
|
||||
|
@ -262,7 +262,9 @@ function ChartPreview({
|
||||
panelType={graphType}
|
||||
data={chartData}
|
||||
name={name || 'Chart Preview'}
|
||||
panelData={queryResponse.data?.payload.data.newResult.data.result || []}
|
||||
panelData={
|
||||
queryResponse.data?.payload?.data?.newResult?.data?.result || []
|
||||
}
|
||||
query={query || initialQueriesMap.metrics}
|
||||
yAxisUnit={yAxisUnit}
|
||||
/>
|
||||
|
@ -215,7 +215,7 @@ function WidgetGraphComponent({
|
||||
const {
|
||||
graphVisibilityStates: localStoredVisibilityState,
|
||||
} = getLocalStorageGraphVisibilityState({
|
||||
apiResponse: queryResponse.data.payload.data.result,
|
||||
apiResponse: queryResponse.data?.payload?.data?.result,
|
||||
name: widget.id,
|
||||
});
|
||||
setGraphVisibility(localStoredVisibilityState);
|
||||
|
@ -84,7 +84,7 @@ export const useContextLogData = ({
|
||||
|
||||
const handleSuccess = useCallback(
|
||||
(data: SuccessResponse<MetricRangePayloadProps, unknown>) => {
|
||||
const currentData = data?.payload.data.newResult.data.result || [];
|
||||
const currentData = data?.payload?.data?.newResult?.data?.result || [];
|
||||
|
||||
if (currentData.length > 0 && currentData[0].list) {
|
||||
const currentLogs: ILog[] = currentData[0].list.map((item) => ({
|
||||
|
@ -84,7 +84,7 @@ function LogsContextList({
|
||||
|
||||
const handleSuccess = useCallback(
|
||||
(data: SuccessResponse<MetricRangePayloadProps, unknown>) => {
|
||||
const currentData = data?.payload.data.newResult.data.result || [];
|
||||
const currentData = data?.payload?.data?.newResult?.data?.result || [];
|
||||
|
||||
if (currentData.length > 0 && currentData[0].list) {
|
||||
const currentLogs: ILog[] = currentData[0].list.map((item) => ({
|
||||
|
@ -409,7 +409,7 @@ function LogsExplorerViews({
|
||||
|
||||
useEffect(() => {
|
||||
const currentParams = data?.params as Omit<LogTimeRange, 'pageSize'>;
|
||||
const currentData = data?.payload.data.newResult.data.result || [];
|
||||
const currentData = data?.payload?.data?.newResult?.data?.result || [];
|
||||
if (currentData.length > 0 && currentData[0].list) {
|
||||
const currentLogs: ILog[] = currentData[0].list.map((item) => ({
|
||||
...item.data,
|
||||
@ -650,7 +650,7 @@ function LogsExplorerViews({
|
||||
|
||||
{selectedPanelType === PANEL_TYPES.TABLE && (
|
||||
<LogsExplorerTable
|
||||
data={data?.payload.data.newResult.data.result || []}
|
||||
data={data?.payload?.data?.newResult?.data?.result || []}
|
||||
isLoading={isLoading || isFetching}
|
||||
isError={isError}
|
||||
/>
|
||||
|
@ -85,7 +85,7 @@ function LogsPanelComponent({
|
||||
const [lastLog, setLastLog] = useState<ILog>();
|
||||
|
||||
const { logs } = useLogsData({
|
||||
result: queryResponse.data?.payload.data.newResult.data.result,
|
||||
result: queryResponse.data?.payload?.data?.newResult?.data?.result,
|
||||
panelType: PANEL_TYPES.LIST,
|
||||
stagedQuery: widget.query,
|
||||
});
|
||||
|
@ -56,7 +56,7 @@ function LogsTopNav(): JSX.Element {
|
||||
: [],
|
||||
listQueryPayload:
|
||||
listQuery && listQuery[1]
|
||||
? listQuery[1].payload?.data.newResult.data.result || []
|
||||
? listQuery[1].payload?.data?.newResult?.data?.result || []
|
||||
: [],
|
||||
};
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ function TopOperationMetrics(): JSX.Element {
|
||||
},
|
||||
);
|
||||
|
||||
const queryTableData = data?.payload.data.newResult.data.result || [];
|
||||
const queryTableData = data?.payload?.data?.newResult?.data?.result || [];
|
||||
|
||||
const renderColumnCell = useMemo(
|
||||
() =>
|
||||
|
@ -50,7 +50,7 @@ function WidgetGraphContainer({
|
||||
}
|
||||
if (
|
||||
selectedGraph === PANEL_TYPES.LIST &&
|
||||
queryResponse.data?.payload.data.newResult?.data?.result?.length === 0
|
||||
queryResponse.data?.payload?.data?.newResult?.data?.result?.length === 0
|
||||
) {
|
||||
return (
|
||||
<NotFoundContainer>
|
||||
|
@ -117,7 +117,7 @@ export default function LogsConnectionStatus(): JSX.Element {
|
||||
}
|
||||
}
|
||||
|
||||
const currentData = data?.payload.data.newResult.data.result || [];
|
||||
const currentData = data?.payload?.data?.newResult?.data?.result || [];
|
||||
if (currentData.length > 0 && currentData[0].list) {
|
||||
const currentLogs: ILog[] = currentData[0].list.map((item) => ({
|
||||
...item.data,
|
||||
|
@ -39,7 +39,7 @@ function PiePanelWrapper({
|
||||
});
|
||||
|
||||
const panelData =
|
||||
queryResponse.data?.payload?.data.newResult.data.result || [];
|
||||
queryResponse.data?.payload?.data?.newResult?.data?.result || [];
|
||||
|
||||
const isDarkMode = useIsDarkMode();
|
||||
|
||||
|
@ -9,7 +9,7 @@ function TablePanelWrapper({
|
||||
tableProcessedDataRef,
|
||||
}: PanelWrapperProps): JSX.Element {
|
||||
const panelData =
|
||||
queryResponse.data?.payload?.data.newResult.data.result || [];
|
||||
queryResponse.data?.payload?.data?.newResult?.data?.result || [];
|
||||
const { thresholds } = widget;
|
||||
return (
|
||||
<GridTableComponent
|
||||
|
@ -81,7 +81,7 @@ export const getServiceListFromQuery = ({
|
||||
services.push(serviceData);
|
||||
}
|
||||
if (query.data) {
|
||||
const queryArray = query.data.payload.data.newResult.data.result;
|
||||
const queryArray = query.data?.payload?.data?.newResult?.data?.result;
|
||||
const serviceData: ServicesList = {
|
||||
serviceName: topLevelOperations[index][0].toString(),
|
||||
p99: parseFloat(getSeriesValue(queryArray, 'A')),
|
||||
|
@ -169,7 +169,7 @@ function DateTimeSelection({
|
||||
: [],
|
||||
listQueryPayload:
|
||||
listQuery && listQuery[1]
|
||||
? listQuery[1].payload?.data.newResult.data.result || []
|
||||
? listQuery[1].payload?.data?.newResult?.data?.result || []
|
||||
: [],
|
||||
};
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ function ListView(): JSX.Element {
|
||||
data?.payload?.data?.newResult?.data?.result[0]?.list?.length;
|
||||
const totalCount = useMemo(() => dataLength || 0, [dataLength]);
|
||||
|
||||
const queryTableDataResult = data?.payload.data.newResult.data.result;
|
||||
const queryTableDataResult = data?.payload?.data?.newResult?.data?.result;
|
||||
const queryTableData = useMemo(() => queryTableDataResult || [], [
|
||||
queryTableDataResult,
|
||||
]);
|
||||
|
@ -45,7 +45,7 @@ function TableView(): JSX.Element {
|
||||
<Space.Compact block direction="vertical">
|
||||
<QueryTable
|
||||
query={stagedQuery || initialQueriesMap.traces}
|
||||
queryTableData={data?.payload.data.newResult.data.result || []}
|
||||
queryTableData={data?.payload?.data?.newResult?.data?.result || []}
|
||||
loading={isLoading}
|
||||
/>
|
||||
</Space.Compact>
|
||||
|
@ -54,7 +54,7 @@ function TracesTableComponent({
|
||||
const totalCount = useMemo(() => dataLength || 0, [dataLength]);
|
||||
|
||||
const queryTableDataResult =
|
||||
queryResponse.data?.payload.data.newResult.data.result;
|
||||
queryResponse.data?.payload?.data?.newResult?.data?.result;
|
||||
const queryTableData = useMemo(() => queryTableDataResult || [], [
|
||||
queryTableDataResult,
|
||||
]);
|
||||
|
@ -145,7 +145,7 @@ export const useLogsData = ({
|
||||
|
||||
useEffect(() => {
|
||||
const currentParams = data?.params as Omit<LogTimeRange, 'pageSize'>;
|
||||
const currentData = data?.payload.data.newResult.data.result || [];
|
||||
const currentData = data?.payload?.data?.newResult?.data?.result || [];
|
||||
if (currentData.length > 0 && currentData[0].list) {
|
||||
const currentLogs: ILog[] = currentData[0].list.map((item) => ({
|
||||
...item.data,
|
||||
|
Loading…
x
Reference in New Issue
Block a user