chore: add Reduce To for pie chart (#5629)

This commit is contained in:
Srikanth Chekuri 2024-08-05 20:53:52 +05:30 committed by GitHub
parent 61e6316736
commit 4a4c9f26a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 12 deletions

View File

@ -268,6 +268,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'aggregateOperator',
'aggregateAttribute',
'groupBy',
'reduceTo',
'limit',
'having',
'orderBy',
@ -286,6 +287,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'aggregateOperator',
'aggregateAttribute',
'groupBy',
'reduceTo',
'limit',
'having',
'orderBy',
@ -305,6 +307,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'aggregateOperator',
'aggregateAttribute',
'groupBy',
'reduceTo',
'limit',
'having',
'orderBy',

View File

@ -544,19 +544,21 @@ export const Query = memo(function Query({
)}
</Col>
{isVersionV4 && isMetricsDataSource && panelType === PANEL_TYPES.TABLE && (
<Col flex="1 1 12.5rem">
<Row>
<Col span={6}>
<FilterLabel label="Reduce to" />
</Col>
{isVersionV4 &&
isMetricsDataSource &&
(panelType === PANEL_TYPES.TABLE || panelType === PANEL_TYPES.PIE) && (
<Col flex="1 1 12.5rem">
<Row>
<Col span={6}>
<FilterLabel label="Reduce to" />
</Col>
<Col span={18}>
<ReduceToFilter query={query} onChange={handleChangeReduceTo} />
</Col>
</Row>
</Col>
)}
<Col span={18}>
<ReduceToFilter query={query} onChange={handleChangeReduceTo} />
</Col>
</Row>
</Col>
)}
</Row>
</Col>
)}