From ee1fe3564a99ce87b2647683ba5f9625cbbdb403 Mon Sep 17 00:00:00 2001 From: Rohan Hazari Date: Mon, 5 May 2025 13:55:12 +0530 Subject: [PATCH] fix: Restoring record results in blank line in TimelineActivity (#11679) (#11856) Fixes issue #11679 There were no case of restored so it was defaulting to null thus showing the blank line Handled case for restored so it doesn't default to null Image shows record restored by the user and restored by other user ![Screenshot 2025-05-03 011257](https://github.com/user-attachments/assets/8b848992-4250-4266-9a3e-1ca89e1a06b8) --------- Co-authored-by: prastoin --- .../components/EventIconDynamicComponent.tsx | 4 +++ .../components/EventRowMainObject.tsx | 25 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventIconDynamicComponent.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventIconDynamicComponent.tsx index 69ca9ec6a..7e4afb038 100644 --- a/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventIconDynamicComponent.tsx +++ b/packages/twenty-front/src/modules/activities/timeline-activities/rows/components/EventIconDynamicComponent.tsx @@ -3,6 +3,7 @@ import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem'; import { IconCirclePlus, IconEditCircle, + IconRestore, IconTrash, useIcons, } from 'twenty-ui/display'; @@ -26,6 +27,9 @@ export const EventIconDynamicComponent = ({ if (eventAction === 'deleted') { return ; } + if (eventAction === 'restored') { + return ; + } const IconComponent = getIcon(linkedObjectMetadataItem?.icon); diff --git a/packages/twenty-front/src/modules/activities/timeline-activities/rows/main-object/components/EventRowMainObject.tsx b/packages/twenty-front/src/modules/activities/timeline-activities/rows/main-object/components/EventRowMainObject.tsx index 88b6c4881..101278047 100644 --- a/packages/twenty-front/src/modules/activities/timeline-activities/rows/main-object/components/EventRowMainObject.tsx +++ b/packages/twenty-front/src/modules/activities/timeline-activities/rows/main-object/components/EventRowMainObject.tsx @@ -5,6 +5,7 @@ import { } from '@/activities/timeline-activities/rows/components/EventRowDynamicComponent'; import { EventRowMainObjectUpdated } from '@/activities/timeline-activities/rows/main-object/components/EventRowMainObjectUpdated'; import styled from '@emotion/styled'; +import { t } from '@lingui/core/macro'; import { MOBILE_VIEWPORT } from 'twenty-ui/theme'; type EventRowMainObjectProps = EventRowDynamicComponentProps; @@ -57,7 +58,7 @@ export const EventRowMainObject = ({ {labelIdentifierValue} - was created by + {t`was created by`} {authorFullName} @@ -88,7 +89,27 @@ export const EventRowMainObject = ({ {labelIdentifierValue} - was deleted by + {t`was deleted by`} + + + {authorFullName} + + + {createdAt} + + + ); + } + case 'restored': { + return ( + + + + + {labelIdentifierValue} + + + {t`was restored by`} {authorFullName}