Closed Bonapara closed 1 month ago
Modify EventRowMainObjectUpdated.tsx
to handle empty field values:
const diffEntries = Object.entries(diff).map(([key, value]) => {
if (value.after === '') {
value.after = 'Empty';
}
return [key, value];
});
Update EventFieldDiffContainer.tsx
to ensure 'Empty' is displayed:
const EventFieldDiffContainer = ({
mainObjectMetadataItem,
diffKey,
diffValue,
eventId,
fieldMetadataItemMap,
}: EventFieldDiffContainerProps) => {
const fieldMetadataItem = fieldMetadataItemMap[diffKey];
if (!fieldMetadataItem) {
throw new Error(
`Cannot find field metadata item for field name ${diffKey} on object ${mainObjectMetadataItem.nameSingular}`,
);
}
const diffArtificialRecordStoreId = eventId + '--' + fieldMetadataItem.id;
return (
<EventFieldDiff
key={diffArtificialRecordStoreId}
diffRecord={diffValue === '' ? 'Empty' : diffValue}
fieldMetadataItem={fieldMetadataItem}
mainObjectMetadataItem={mainObjectMetadataItem}
diffArtificialRecordStoreId={diffArtificialRecordStoreId}
/>
);
};
/packages/twenty-front/src/modules/activities/timelineActivities/rows/main-object/components/EventRowMainObjectUpdated.tsx /packages/twenty-front/src/modules/activities/timelineActivities/rows/main-object/components/EventFieldDiffContainer.tsx
Current behavior
When deleting the value of a field, the timeline log looks buggy as there is no value next to the arrow
Desired Behavior
We should display "Empty" and not an empty string