[GroupBy] Add views filters to groupBy query 2/2: handle anyFieldFilter (#14791)

Following https://github.com/twentyhq/twenty/pull/14762 

In this PR
- moved logic around any field filter formatting to twenty-shared
- added any field filter to the filters applied to groupBy when viewId
is defined
- added integration test
This commit is contained in:
Marie
2025-09-30 18:13:40 +02:00
committed by GitHub
parent 3927b36406
commit f33396e425
46 changed files with 805 additions and 549 deletions
@@ -4,11 +4,13 @@ import { currentRecordFilterGroupsComponentState } from '@/object-record/record-
import { useFilterValueDependencies } from '@/object-record/record-filter/hooks/useFilterValueDependencies';
import { anyFieldFilterValueComponentState } from '@/object-record/record-filter/states/anyFieldFilterValueComponentState';
import { currentRecordFiltersComponentState } from '@/object-record/record-filter/states/currentRecordFiltersComponentState';
import { turnAnyFieldFilterIntoRecordGqlFilter } from '@/object-record/record-filter/utils/turnAnyFieldFilterIntoRecordGqlFilter';
import { AggregateOperations } from '@/object-record/record-table/constants/AggregateOperations';
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
import { useGetViewGroupsFilters } from '@/views/hooks/useGetViewGroupsFilters';
import { computeRecordGqlOperationFilter } from 'twenty-shared/utils';
import {
computeRecordGqlOperationFilter,
turnAnyFieldFilterIntoRecordGqlFilter,
} from 'twenty-shared/utils';
export const useGetRecordIndexTotalCount = () => {
const { objectMetadataItem } = useContextStoreObjectMetadataItemOrThrow();
@@ -38,7 +40,7 @@ export const useGetRecordIndexTotalCount = () => {
const { recordGqlOperationFilter: anyFieldFilter } =
turnAnyFieldFilterIntoRecordGqlFilter({
objectMetadataItem,
fields: objectMetadataItem.fields,
filterValue: anyFieldFilterValue,
});