Cleaned FieldDefinition props and removed recoil calls (#14220)
This PR removes some unused props from FieldDefinition type and put some recoil calls higher up in the hierarchy. This PR fixes a regression on Chip introduced by https://github.com/twentyhq/twenty/pull/11498, where we don't want "Untitled" to be displayed in compact mode. # FieldDefinition refactor Removed `isLabelIdentifierCompact` and `labelIdentifierLink` which can be derived directly in the chip component or computed in the record table context. Removed `disableTooltip` and `infoTooltipContent` because they were not used. Introduced `fieldMetadataItemId`, as optional for now, to have the ability to progressively refactor the different things that could be derived from this and `recordId`. # Performance improvements There's not a great deal to be gained for now on those modifications, which specifically concern the identifier column.
This commit is contained in:
@@ -133,6 +133,8 @@ const InternalTableContextProviders = ({
|
||||
}),
|
||||
);
|
||||
|
||||
const triggerEvent = 'CLICK';
|
||||
|
||||
return (
|
||||
<RecordIndexContextProvider
|
||||
value={{
|
||||
@@ -160,6 +162,8 @@ const InternalTableContextProviders = ({
|
||||
objectMetadataId: objectMetadataItem.id,
|
||||
}),
|
||||
visibleRecordFields,
|
||||
onRecordIdentifierClick: () => {},
|
||||
triggerEvent,
|
||||
}}
|
||||
>
|
||||
<RecordTableBodyContextProvider
|
||||
|
||||
@@ -129,6 +129,7 @@ export const getFieldDecorator =
|
||||
>
|
||||
<FieldContext.Provider
|
||||
value={{
|
||||
fieldMetadataItemId: fieldMetadataItem.id,
|
||||
recordId: record.id,
|
||||
isLabelIdentifier,
|
||||
fieldDefinition: formatFieldMetadataItemAsColumnDefinition({
|
||||
|
||||
Reference in New Issue
Block a user