Aggregate follow-up (#9547)
In this PR - fix [some UI regressions](https://discord.com/channels/1130383047699738754/1327189577575956514/1327189577575956514) introduced by work on view groups - address some follow-ups: 1. [Menu should keep selected when the menu is open](https://discord.com/channels/1130383047699738754/1326607851824877639/1326607851824877639) 2. [Cropping](https://discord.com/channels/1130383047699738754/1326610578869063800/1326610578869063800) 3. [Put earliest date / latest date in a separate "Date" submenu](https://discord.com/channels/1130383047699738754/1326856023985618966/1326856023985618966) - Refactor around date aggregate operations
This commit is contained in:
@ -5,13 +5,13 @@ import { RecordGqlFieldsAggregate } from '@/object-record/graphql/types/RecordGq
|
||||
import { RecordGqlOperationFilter } from '@/object-record/graphql/types/RecordGqlOperationFilter';
|
||||
import { RecordGqlOperationFindManyResult } from '@/object-record/graphql/types/RecordGqlOperationFindManyResult';
|
||||
import { useAggregateRecordsQuery } from '@/object-record/hooks/useAggregateRecordsQuery';
|
||||
import { AGGREGATE_OPERATIONS } from '@/object-record/record-table/constants/AggregateOperations';
|
||||
import { ExtendedAggregateOperations } from '@/object-record/record-table/types/ExtendedAggregateOperations';
|
||||
import isEmpty from 'lodash.isempty';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
|
||||
export type AggregateRecordsData = {
|
||||
[fieldName: string]: {
|
||||
[operation in AGGREGATE_OPERATIONS]?: string | number | undefined;
|
||||
[operation in ExtendedAggregateOperations]?: string | number | undefined;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { RecordGqlFields } from '@/object-record/graphql/types/RecordGqlFields';
|
||||
import { RecordGqlFieldsAggregate } from '@/object-record/graphql/types/RecordGqlFieldsAggregate';
|
||||
import { AGGREGATE_OPERATIONS } from '@/object-record/record-table/constants/AggregateOperations';
|
||||
import { ExtendedAggregateOperations } from '@/object-record/record-table/types/ExtendedAggregateOperations';
|
||||
import { generateAggregateQuery } from '@/object-record/utils/generateAggregateQuery';
|
||||
import { getAvailableAggregationsFromObjectFields } from '@/object-record/utils/getAvailableAggregationsFromObjectFields';
|
||||
import { useMemo } from 'react';
|
||||
@ -10,7 +10,7 @@ import { isDefined } from 'twenty-ui';
|
||||
export type GqlFieldToFieldMap = {
|
||||
[gqlField: string]: [
|
||||
fieldName: string,
|
||||
aggregateOperation: AGGREGATE_OPERATIONS,
|
||||
aggregateOperation: ExtendedAggregateOperations,
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user