POC timeline activity (#5697)

TODO: 
- remove WorkspaceIsNotAuditLogged decorators on activity/activityTarget
to log task/note creations
- handle attachments
-  fix css and remove unnecessary styled components or duplicates
This commit is contained in:
Weiko
2024-06-11 18:53:28 +02:00
committed by GitHub
parent 64b8e4ec4d
commit be96c68416
60 changed files with 2134 additions and 443 deletions

View File

@ -0,0 +1,40 @@
import styled from '@emotion/styled';
import { useOpenActivityRightDrawer } from '@/activities/hooks/useOpenActivityRightDrawer';
import {
EventRowDynamicComponentProps,
StyledItemAction,
StyledItemAuthorText,
} from '@/activities/timelineActivities/rows/components/EventRowDynamicComponent';
type EventRowActivityProps = EventRowDynamicComponentProps;
const StyledLinkedActivity = styled.span`
cursor: pointer;
text-decoration: underline;
`;
export const EventRowActivity: React.FC<EventRowActivityProps> = ({
event,
authorFullName,
}: EventRowActivityProps) => {
const [, eventAction] = event.name.split('.');
const openActivityRightDrawer = useOpenActivityRightDrawer();
if (!event.linkedRecordId) {
throw new Error('Could not find linked record id for event');
}
return (
<>
<StyledItemAuthorText>{authorFullName}</StyledItemAuthorText>
<StyledItemAction>{eventAction}</StyledItemAction>
<StyledLinkedActivity
onClick={() => openActivityRightDrawer(event.linkedRecordId)}
>
{event.linkedRecordCachedName}
</StyledLinkedActivity>
</>
);
};