From dd0601ab6f3405253dae62219405327b6d65827f Mon Sep 17 00:00:00 2001 From: Lucas Bordeau Date: Thu, 13 Nov 2025 14:38:56 +0100 Subject: [PATCH] Fix phone not empty filter (#15790) This PR fixes the filter on not empty phones. We can end up with phone numbers that only have a country code, but it makes no sense to consider this special edge case "not empty". If we have no phone number, then it's empty, so this PR applies this particular use case for NOT EMPTY filter on phone fields. Fixes https://github.com/twentyhq/twenty/issues/15638 --- ...omputeViewRecordGqlOperationFilter.test.ts | 28 ------------------- .../utils/getEmptyRecordGqlOperationFilter.ts | 14 ---------- 2 files changed, 42 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-filter/utils/__tests__/computeViewRecordGqlOperationFilter.test.ts b/packages/twenty-front/src/modules/object-record/record-filter/utils/__tests__/computeViewRecordGqlOperationFilter.test.ts index f7f14f0cca..90aedd2d71 100644 --- a/packages/twenty-front/src/modules/object-record/record-filter/utils/__tests__/computeViewRecordGqlOperationFilter.test.ts +++ b/packages/twenty-front/src/modules/object-record/record-filter/utils/__tests__/computeViewRecordGqlOperationFilter.test.ts @@ -740,20 +740,6 @@ describe('should work as expected for the different field types', () => { }, ], }, - { - or: [ - { - phones: { - primaryPhoneCallingCode: { is: 'NULL' }, - }, - }, - { - phones: { - primaryPhoneCallingCode: { ilike: '' }, - }, - }, - ], - }, { or: [ { @@ -787,20 +773,6 @@ describe('should work as expected for the different field types', () => { }, ], }, - { - or: [ - { - phones: { - primaryPhoneCallingCode: { is: 'NULL' }, - }, - }, - { - phones: { - primaryPhoneCallingCode: { ilike: '' }, - }, - }, - ], - }, { or: [ { diff --git a/packages/twenty-shared/src/utils/filter/utils/getEmptyRecordGqlOperationFilter.ts b/packages/twenty-shared/src/utils/filter/utils/getEmptyRecordGqlOperationFilter.ts index 1288873907..480c7f731f 100644 --- a/packages/twenty-shared/src/utils/filter/utils/getEmptyRecordGqlOperationFilter.ts +++ b/packages/twenty-shared/src/utils/filter/utils/getEmptyRecordGqlOperationFilter.ts @@ -70,20 +70,6 @@ export const getEmptyRecordGqlOperationFilter = ({ }, ], }, - { - or: [ - { - [correspondingField.name]: { - primaryPhoneCallingCode: { is: 'NULL' }, - } as PhonesFilter, - }, - { - [correspondingField.name]: { - primaryPhoneCallingCode: { ilike: '' }, - } as PhonesFilter, - }, - ], - }, { or: [ {