New Timeline (#4936)

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">
This commit is contained in:
Félix Malfait
2024-04-19 17:52:57 +02:00
committed by GitHub
parent 9c8cb52952
commit d145684966
56 changed files with 1314 additions and 368 deletions

View File

@ -27,7 +27,7 @@ export class ParticipantPersonListener {
async handleCreatedEvent(
payload: ObjectRecordCreateEvent<PersonObjectMetadata>,
) {
if (payload.details.after.email === null) {
if (payload.properties.after.email === null) {
return;
}
@ -35,7 +35,7 @@ export class ParticipantPersonListener {
MatchParticipantJob.name,
{
workspaceId: payload.workspaceId,
email: payload.details.after.email,
email: payload.properties.after.email,
personId: payload.recordId,
},
);
@ -47,15 +47,15 @@ export class ParticipantPersonListener {
) {
if (
objectRecordUpdateEventChangedProperties(
payload.details.before,
payload.details.after,
payload.properties.before,
payload.properties.after,
).includes('email')
) {
await this.messageQueueService.add<UnmatchParticipantJobData>(
UnmatchParticipantJob.name,
{
workspaceId: payload.workspaceId,
email: payload.details.before.email,
email: payload.properties.before.email,
personId: payload.recordId,
},
);
@ -64,7 +64,7 @@ export class ParticipantPersonListener {
MatchParticipantJob.name,
{
workspaceId: payload.workspaceId,
email: payload.details.after.email,
email: payload.properties.after.email,
personId: payload.recordId,
},
);

View File

@ -27,7 +27,7 @@ export class ParticipantWorkspaceMemberListener {
async handleCreatedEvent(
payload: ObjectRecordCreateEvent<WorkspaceMemberObjectMetadata>,
) {
if (payload.details.after.userEmail === null) {
if (payload.properties.after.userEmail === null) {
return;
}
@ -35,8 +35,8 @@ export class ParticipantWorkspaceMemberListener {
MatchParticipantJob.name,
{
workspaceId: payload.workspaceId,
email: payload.details.after.userEmail,
workspaceMemberId: payload.details.after.id,
email: payload.properties.after.userEmail,
workspaceMemberId: payload.properties.after.id,
},
);
}
@ -47,15 +47,15 @@ export class ParticipantWorkspaceMemberListener {
) {
if (
objectRecordUpdateEventChangedProperties(
payload.details.before,
payload.details.after,
payload.properties.before,
payload.properties.after,
).includes('userEmail')
) {
await this.messageQueueService.add<UnmatchParticipantJobData>(
UnmatchParticipantJob.name,
{
workspaceId: payload.workspaceId,
email: payload.details.before.userEmail,
email: payload.properties.before.userEmail,
personId: payload.recordId,
},
);
@ -64,7 +64,7 @@ export class ParticipantWorkspaceMemberListener {
MatchParticipantJob.name,
{
workspaceId: payload.workspaceId,
email: payload.details.after.userEmail,
email: payload.properties.after.userEmail,
workspaceMemberId: payload.recordId,
},
);