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 <paul@twenty.com>
This commit is contained in:
Rohan Hazari
2025-05-05 13:55:12 +05:30
committed by GitHub
parent a570be0ad1
commit ee1fe3564a
2 changed files with 27 additions and 2 deletions

View File

@ -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 <IconTrash />;
}
if (eventAction === 'restored') {
return <IconRestore />;
}
const IconComponent = getIcon(linkedObjectMetadataItem?.icon);

View File

@ -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}
</StyledEventRowItemColumn>
<StyledEventRowItemAction>
was created by
{t`was created by`}
</StyledEventRowItemAction>
<StyledEventRowItemColumn>
{authorFullName}
@ -88,7 +89,27 @@ export const EventRowMainObject = ({
{labelIdentifierValue}
</StyledEventRowItemColumn>
<StyledEventRowItemAction>
was deleted by
{t`was deleted by`}
</StyledEventRowItemAction>
<StyledEventRowItemColumn>
{authorFullName}
</StyledEventRowItemColumn>
</StyledRow>
<StyledItemTitleDate>{createdAt}</StyledItemTitleDate>
</StyledRowContainer>
</StyledMainContainer>
);
}
case 'restored': {
return (
<StyledMainContainer>
<StyledRowContainer>
<StyledRow>
<StyledEventRowItemColumn>
{labelIdentifierValue}
</StyledEventRowItemColumn>
<StyledEventRowItemAction>
{t`was restored by`}
</StyledEventRowItemAction>
<StyledEventRowItemColumn>
{authorFullName}