Use aggregate operations in the widget configuration instead of extended aggregate operations (#15248)

- Use aggregate operations in the widget configuration instead of
extended aggregate operations
- Use aggregate operation from generated graphql in the frontend
This commit is contained in:
Raphaël Bosi
2025-10-22 14:19:02 +02:00
committed by GitHub
parent 0221ef991e
commit 1c27206b41
28 changed files with 118 additions and 207 deletions
@@ -1,12 +1,10 @@
import { assertUnreachable, isDefined } from 'twenty-shared/utils';
import { type ThemeColor } from 'twenty-ui/theme';
import {
ExtendedAggregateOperations,
AggregateOperations,
AxisNameDisplay,
GraphOrderBy,
GraphType,
} from '~/generated-metadata/graphql';
import {
AxisNameDisplay,
type GridPosition,
type PageLayoutWidget,
type WidgetConfiguration,
@@ -28,7 +26,7 @@ const createDefaultGraphConfiguration = (
__typename: 'NumberChartConfiguration',
graphType: GraphType.NUMBER,
aggregateFieldMetadataId: fieldSelection.aggregateFieldMetadataId,
aggregateOperation: ExtendedAggregateOperations.COUNT,
aggregateOperation: AggregateOperations.COUNT,
displayDataLabel: true,
};
@@ -50,7 +48,7 @@ const createDefaultGraphConfiguration = (
primaryAxisGroupByFieldMetadataId:
fieldSelection.groupByFieldMetadataIdX,
aggregateFieldMetadataId: fieldSelection.aggregateFieldMetadataId,
aggregateOperation: ExtendedAggregateOperations.SUM,
aggregateOperation: AggregateOperations.SUM,
primaryAxisOrderBy: GraphOrderBy.FIELD_ASC,
axisNameDisplay: AxisNameDisplay.BOTH,
};
@@ -70,7 +68,7 @@ const createDefaultGraphConfiguration = (
primaryAxisGroupByFieldMetadataId:
fieldSelection.groupByFieldMetadataIdX,
aggregateFieldMetadataId: fieldSelection.aggregateFieldMetadataId,
aggregateOperation: ExtendedAggregateOperations.SUM,
aggregateOperation: AggregateOperations.SUM,
primaryAxisOrderBy: GraphOrderBy.FIELD_ASC,
axisNameDisplay: AxisNameDisplay.BOTH,
};