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:
@ -15,10 +15,10 @@ export const companyPrefillDemoData = async (
|
||||
'addressAddressCity',
|
||||
'employees',
|
||||
'linkedinLinkPrimaryLinkUrl',
|
||||
'position',
|
||||
'createdBySource',
|
||||
'createdByWorkspaceMemberId',
|
||||
'createdByName'
|
||||
'createdByName',
|
||||
'position'
|
||||
])
|
||||
.orIgnore()
|
||||
.values(
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user