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:
@@ -89,7 +89,6 @@ describe('mapViewFieldsToColumnDefinitions', () => {
|
||||
fieldMetadataId: '1',
|
||||
label: 'label 1',
|
||||
metadata: { fieldName: 'fieldName 1' },
|
||||
infoTooltipContent: 'infoTooltipContent 1',
|
||||
iconName: 'iconName 1',
|
||||
type: FieldMetadataType.TEXT,
|
||||
position: 1,
|
||||
@@ -109,7 +108,6 @@ describe('mapViewFieldsToColumnDefinitions', () => {
|
||||
fieldMetadataId: '2',
|
||||
label: 'label 2',
|
||||
metadata: { fieldName: 'fieldName 2' },
|
||||
infoTooltipContent: 'infoTooltipContent 2',
|
||||
iconName: 'iconName 2',
|
||||
type: FieldMetadataType.TEXT,
|
||||
position: 2,
|
||||
@@ -129,7 +127,6 @@ describe('mapViewFieldsToColumnDefinitions', () => {
|
||||
fieldMetadataId: '3',
|
||||
label: 'label 3',
|
||||
metadata: { fieldName: 'fieldName 3' },
|
||||
infoTooltipContent: 'infoTooltipContent 3',
|
||||
iconName: 'iconName 3',
|
||||
type: FieldMetadataType.TEXT,
|
||||
position: 3,
|
||||
@@ -146,7 +143,6 @@ describe('mapViewFieldsToColumnDefinitions', () => {
|
||||
label: 'label 1',
|
||||
position: 1,
|
||||
metadata: { fieldName: 'fieldName 1' },
|
||||
infoTooltipContent: 'infoTooltipContent 1',
|
||||
iconName: 'iconName 1',
|
||||
type: FieldMetadataType.TEXT,
|
||||
size: 1,
|
||||
@@ -156,7 +152,6 @@ describe('mapViewFieldsToColumnDefinitions', () => {
|
||||
label: 'label 3',
|
||||
position: 3,
|
||||
metadata: { fieldName: 'fieldName 3' },
|
||||
infoTooltipContent: 'infoTooltipContent 3',
|
||||
iconName: 'iconName 3',
|
||||
type: FieldMetadataType.TEXT,
|
||||
size: 3,
|
||||
@@ -168,7 +163,6 @@ describe('mapViewFieldsToColumnDefinitions', () => {
|
||||
fieldMetadataId: '1',
|
||||
label: 'label 1',
|
||||
metadata: { fieldName: 'fieldName 1' },
|
||||
infoTooltipContent: 'infoTooltipContent 1',
|
||||
iconName: 'iconName 1',
|
||||
type: FieldMetadataType.TEXT,
|
||||
size: 1,
|
||||
@@ -180,7 +174,6 @@ describe('mapViewFieldsToColumnDefinitions', () => {
|
||||
fieldMetadataId: '3',
|
||||
label: 'label 3',
|
||||
metadata: { fieldName: 'fieldName 3' },
|
||||
infoTooltipContent: 'infoTooltipContent 3',
|
||||
iconName: 'iconName 3',
|
||||
type: FieldMetadataType.TEXT,
|
||||
size: 3,
|
||||
|
||||
@@ -39,7 +39,6 @@ export const mapViewFieldsToColumnDefinitions = ({
|
||||
fieldMetadataId: viewField.fieldMetadataId,
|
||||
label: correspondingColumnDefinition.label,
|
||||
metadata: correspondingColumnDefinition.metadata,
|
||||
infoTooltipContent: correspondingColumnDefinition.infoTooltipContent,
|
||||
iconName: correspondingColumnDefinition.iconName,
|
||||
type: correspondingColumnDefinition.type,
|
||||
position: isLabelIdentifier ? 0 : viewField.position,
|
||||
|
||||
Reference in New Issue
Block a user