From 50421863d4b3b57e824761f692c5864f8e389c51 Mon Sep 17 00:00:00 2001 From: Weiko Date: Fri, 3 May 2024 14:52:20 +0200 Subject: [PATCH] Fix filter transform with logic operators (#5269) Various fixes - Remote objects are read-only for now, we already hide and block most of the write actions but the button that allows you to add a new record in an empty collection was still visible. - CreatedAt is not mandatory on remote objects (at least for now) so it was breaking the show page, it now checks if createdAt exists and is not null before trying to display the human readable format `Added x days ago` - The filters are overwritten in query-runner-args.factory.ts to handle NUMBER field type, this was only working with filters like ``` { "id": { "in": [ 1 ] } ``` but not with more depth such as ``` "and": [ {}, { "id": { "in": [ 1 ] } } ] ``` - Fixes CREATE FOREIGN TABLE raw query which was missing ",". --- .../components/RecordTableWithWrappers.tsx | 42 ++++++++------ .../components/ShowPageSummaryCard.tsx | 6 +- .../factories/query-runner-args.factory.ts | 58 ++++++++++++------- .../workspace-migration-runner.service.ts | 8 +-- 4 files changed, 68 insertions(+), 46 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableWithWrappers.tsx b/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableWithWrappers.tsx index 3431933e4f..fd62043add 100644 --- a/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableWithWrappers.tsx +++ b/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableWithWrappers.tsx @@ -81,6 +81,8 @@ export const RecordTableWithWrappers = ({ const objectLabel = foundObjectMetadataItem?.labelSingular; + const isRemote = foundObjectMetadataItem?.isRemote ?? false; + return ( @@ -113,25 +115,27 @@ export const RecordTableWithWrappers = ({ recordTableId={recordTableId} tableBodyRef={tableBodyRef} /> - {!isRecordTableInitialLoading && numberOfTableRows === 0 && ( - - - - - Add your first {objectLabel} - - - Use our API or add your first {objectLabel} manually - - -