-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Timeline #4936
New Timeline #4936
Conversation
TODOs/FIXMEs:
|
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper'; | ||
|
||
type EventListProps = { | ||
targetableObject: ActivityTargetableObject; | ||
title: string; | ||
events: Event[]; | ||
events: TimelineActivity[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbd if we introduce a proper sub-type concept for Activity (note/task) or if we transform activity into two objects. If we do introduce a proper subtype then TimelineActvity probably isn't the right naming.
objectNameType: 'id', | ||
}), | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need to think about the right mental model for the different types of timeline items. I kept the logic which was to build it dynamically (but moved it on the TS part / away from the JSX part) but it feels like it might become hard to read if we add more and more conditions
...rver/src/engine/api/graphql/workspace-query-runner/listeners/entity-events-to-db.listener.ts
Outdated
Show resolved
Hide resolved
...wenty-server/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.ts
Show resolved
Hide resolved
(field) => | ||
field.type === FieldMetadataType.RELATION && field.name === key, | ||
) || | ||
(objectMetadata.nameSingular === 'activity' && key === 'body') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo need to hand diff for activity.body (thought I had done it but somehow got lost)
...es/twenty-server/src/engine/integrations/event-emitter/utils/object-record-changed-values.ts
Show resolved
Hide resolved
import { ObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/object-metadata.decorator'; | ||
import { BaseObjectMetadata } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-objects/base.object-metadata'; | ||
|
||
@ObjectMetadata({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behavioral events = event coming from Segment
8eb7648
to
c46909c
Compare
packages/twenty-server/src/modules/event/standard-objects/timeline-activity.object-metadata.ts
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/activities/events/components/EventList.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/activities/events/components/EventList.tsx
Outdated
Show resolved
Hide resolved
return ( | ||
event.name === type + '.' + targetableObject.targetObjectNameSingular | ||
); | ||
if (event.name.includes('.')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isEventType could be extracted to an util and tested with unit tests
}; | ||
|
||
const { getIcon } = useIcons(); | ||
|
||
const linkedObjectMetadata = useRecoilValue( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useObjectMetadataItem
packages/twenty-front/src/modules/object-metadata/states/objectMetadataItemFamilySelector.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/event/standard-objects/timeline-activity.object-metadata.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/event/standard-objects/timeline-activity.object-metadata.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/event/standard-objects/timeline-activity.object-metadata.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/event/standard-objects/timeline-activity.object-metadata.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/modules/event/standard-objects/timeline-activity.object-metadata.ts
Outdated
Show resolved
Hide resolved
6d33847
to
a6a7700
Compare
a6a7700
to
8ea1c33
Compare
## Context We have recently added an event listener to create audit logs on objects update. However, we have only created the structure (relations on event standard objects) for Company, Person, Opportunity and custom objects. There is a larger effort in #4936 to refactor this. For now, we are disabling log auditing on all other objects ## How Add @IsNotAuditLogged() annotation on all standard objects except Company, Person, Opportunity
4340456
to
badb5e5
Compare
badb5e5
to
c06ae7f
Compare
## Context We have recently added an event listener to create audit logs on objects update. However, we have only created the structure (relations on event standard objects) for Company, Person, Opportunity and custom objects. There is a larger effort in twentyhq#4936 to refactor this. For now, we are disabling log auditing on all other objects ## How Add @IsNotAuditLogged() annotation on all standard objects except Company, Person, Opportunity
Refactored the code to introduce two different concepts: - AuditLogs (immutable, raw data) - TimelineActivities (user-friendly, transformed data) Still some work needed: - Add message, files, calendar events to timeline (~2 hours if done naively) - Refactor repository to try to abstract concept when we can (tbd, wait for Twenty ORM) - Introduce ability to display child timelines on parent timeline with filtering (~2 days) - Improve UI: add links to open note/task, improve diff display, etc (half a day) - Decide the path forward for Task vs Notes: either introduce a new field type "Record Type" and start going into that direction ; or split in two objects? - Trigger updates when a field is changed (will be solved by real-time / websockets: 2 weeks) - Integrate behavioral events (1 day for POC, 1 week for clean/documented) <img width="1248" alt="Screenshot 2024-04-12 at 09 24 49" src="https://github.com/twentyhq/twenty/assets/6399865/9428db1a-ab2b-492c-8b0b-d4d9a36e81fa">
Refactored the code to introduce two different concepts:
Still some work needed: