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:
@ -1,4 +1,5 @@
|
||||
import { AGGREGATE_OPERATIONS } from '@/object-record/record-table/constants/AggregateOperations';
|
||||
import { ExtendedAggregateOperations } from '@/object-record/record-table/types/ExtendedAggregateOperations';
|
||||
import { convertExtendedAggregateOperationToAggregateOperation } from '@/object-record/utils/convertExtendedAggregateOperationToAggregateOperation';
|
||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||
import { useUpdateView } from '@/views/hooks/useUpdateView';
|
||||
import { currentViewIdComponentState } from '@/views/states/currentViewIdComponentState';
|
||||
@ -13,13 +14,18 @@ export const useUpdateViewAggregate = () => {
|
||||
kanbanAggregateOperation,
|
||||
}: {
|
||||
kanbanAggregateOperationFieldMetadataId: string | null;
|
||||
kanbanAggregateOperation: AGGREGATE_OPERATIONS | null;
|
||||
}) =>
|
||||
kanbanAggregateOperation: ExtendedAggregateOperations | null;
|
||||
}) => {
|
||||
const convertedKanbanAggregateOperation =
|
||||
convertExtendedAggregateOperationToAggregateOperation(
|
||||
kanbanAggregateOperation,
|
||||
);
|
||||
updateView({
|
||||
id: currentViewId,
|
||||
kanbanAggregateOperationFieldMetadataId,
|
||||
kanbanAggregateOperation,
|
||||
}),
|
||||
kanbanAggregateOperation: convertedKanbanAggregateOperation,
|
||||
});
|
||||
},
|
||||
[currentViewId, updateView],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user