Fix onboarding status performance issues (#6512)

Updated the onboardingStatus computation to improve performances

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
martmull
2024-08-04 00:33:33 +02:00
committed by GitHub
parent e01d3fd0be
commit 7cd5427589
40 changed files with 757 additions and 767 deletions

View File

@ -15,10 +15,10 @@ export const companyPrefillDemoData = async (
'addressAddressCity',
'employees',
'linkedinLinkPrimaryLinkUrl',
'position',
'createdBySource',
'createdByWorkspaceMemberId',
'createdByName'
'createdByName',
'position'
])
.orIgnore()
.values(

View File

@ -1,3 +1,4 @@
import { DEMO_SEED_WORKSPACE_MEMBER_IDS } from 'src/engine/workspace-manager/demo-objects-prefill-data/workspace-member';
import { EntityManager } from 'typeorm';
import { v4 } from 'uuid';
@ -25,6 +26,9 @@ const generateOpportunities = (companies) => {
stage: getRandomStage(),
pointOfContactId: company.personId,
companyId: company.id,
createdBySource: 'MANUAL',
createdByWorkspaceMemberId: DEMO_SEED_WORKSPACE_MEMBER_IDS.NOAH,
createdByName: 'Noah A',
}));
};
@ -53,6 +57,9 @@ export const opportunityPrefillDemoData = async (
'stage',
'pointOfContactId',
'companyId',
'createdBySource',
'createdByWorkspaceMemberId',
'createdByName',
'position',
])
.orIgnore()

View File

@ -19,11 +19,11 @@ export const personPrefillDemoData = async (
jobTitle: person.jobTitle,
city: person.city,
avatarUrl: person.avatarUrl,
position: index,
companyId: companies[Math.floor(index / 2)].id,
createdBySource: person.createdBySource,
createdByWorkspaceMemberId: person.createdByWorkspaceMemberId,
createdByName: person.createdByName
createdByName: person.createdByName,
position: index
}));
await entityManager
@ -37,11 +37,11 @@ export const personPrefillDemoData = async (
'jobTitle',
'city',
'avatarUrl',
'position',
'companyId',
'createdBySource',
'createdByWorkspaceMemberId',
'createdByName',
'position',
])
.orIgnore()
.values(people)