Skip to content

Commit

Permalink
chore: add Reduce To for pie chart (#5629)
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanthccv authored Aug 5, 2024
1 parent 61e6316 commit 4a4c9f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
3 changes: 3 additions & 0 deletions frontend/src/container/NewWidget/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'aggregateOperator',
'aggregateAttribute',
'groupBy',
'reduceTo',
'limit',
'having',
'orderBy',
Expand All @@ -286,6 +287,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'aggregateOperator',
'aggregateAttribute',
'groupBy',
'reduceTo',
'limit',
'having',
'orderBy',
Expand All @@ -305,6 +307,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'aggregateOperator',
'aggregateAttribute',
'groupBy',
'reduceTo',
'limit',
'having',
'orderBy',
Expand Down
26 changes: 14 additions & 12 deletions frontend/src/container/QueryBuilder/components/Query/Query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)}
Expand Down

0 comments on commit 4a4c9f2

Please sign in to comment.