fix: pie chart panels not rendering (#5376)

* fix: pie chart panels not rendering

* fix: restructure code
This commit is contained in:
Vikrant Gupta 2024-06-28 12:10:57 +05:30 committed by GitHub
parent fd603b8fdf
commit b34509215e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 5 deletions

View File

@ -81,7 +81,7 @@ function FullView({
globalSelectedInterval: globalSelectedTime,
variables: getDashboardVariables(selectedDashboard?.data.variables),
fillGaps: widget.fillSpans,
formatForWeb: getGraphType(widget.panelTypes) === PANEL_TYPES.TABLE,
formatForWeb: widget.panelTypes === PANEL_TYPES.TABLE,
};
}
updatedQuery.builder.queryData[0].pageSize = 10;

View File

@ -109,7 +109,7 @@ function GridCardGraph({
globalSelectedInterval,
variables: getDashboardVariables(variables),
fillGaps: widget.fillSpans,
formatForWeb: getGraphType(widget.panelTypes) === PANEL_TYPES.TABLE,
formatForWeb: widget.panelTypes === PANEL_TYPES.TABLE,
};
}
updatedQuery.builder.queryData[0].pageSize = 10;

View File

@ -12,7 +12,7 @@ import { memo, useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
import { GlobalReducer } from 'types/reducer/globalTime';
import { getGraphType } from 'utils/getGraphType';
import { getGraphType, getGraphTypeForFormat } from 'utils/getGraphType';
import { WidgetGraphProps } from '../types';
import ExplorerColumnsRenderer from './ExplorerColumnsRenderer';
@ -45,7 +45,7 @@ function LeftContainer({
query: stagedQuery || initialQueriesMap.metrics,
globalSelectedInterval,
formatForWeb:
getGraphType(selectedGraph || selectedWidget.panelTypes) ===
getGraphTypeForFormat(selectedGraph || selectedWidget.panelTypes) ===
PANEL_TYPES.TABLE,
variables: getDashboardVariables(selectedDashboard?.data.variables),
};
@ -77,7 +77,7 @@ function LeftContainer({
query: stagedQuery,
fillGaps: selectedWidget.fillSpans || false,
formatForWeb:
getGraphType(selectedGraph || selectedWidget.panelTypes) ===
getGraphTypeForFormat(selectedGraph || selectedWidget.panelTypes) ===
PANEL_TYPES.TABLE,
}));
}

View File

@ -10,3 +10,6 @@ export const getGraphType = (panelType: PANEL_TYPES): PANEL_TYPES => {
}
return panelType;
};
export const getGraphTypeForFormat = (panelType: PANEL_TYPES): PANEL_TYPES =>
panelType;