Refactored all FieldDisplay types for performance optimization (#5768)

This PR is the second part of
https://github.com/twentyhq/twenty/pull/5693.

It optimizes all remaining field types.

The observed improvements are :
- x2 loading time improvement on table rows
- more consistent render time

Here's a summary of measured improvements, what's given here is the
average of hundreds of renders with a React Profiler component. (in our
Storybook performance stories)

| Component | Before (µs) | After (µs) |
| ----- | ------------- | --- |
| TextFieldDisplay | 127 | 83 |
| EmailFieldDisplay | 117 | 83 |
| NumberFieldDisplay | 97 | 56 |
| DateFieldDisplay | 240 | 52 |
| CurrencyFieldDisplay | 236 | 110 |
| FullNameFieldDisplay | 131 | 85 |
| AddressFieldDisplay | 118 | 81 |
| BooleanFieldDisplay | 130 | 100 |
| JSONFieldDisplay | 248 | 49 |
| LinksFieldDisplay | 1180 | 140 |
| LinkFieldDisplay | 140 | 78 |
| MultiSelectFieldDisplay | 770 | 130 |
| SelectFieldDisplay | 230 | 87 |
This commit is contained in:
Lucas Bordeau
2024-06-12 18:36:25 +02:00
committed by GitHub
parent 007e0e8b0e
commit 03b3c8a67a
101 changed files with 17167 additions and 15795 deletions

View File

@ -2,7 +2,6 @@ import { useEffect } from 'react';
import { Decorator } from '@storybook/react';
import { useRecoilCallback } from 'recoil';
import { Company } from '@/companies/types/Company';
import { formatFieldMetadataItemAsColumnDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsColumnDefinition';
import { isLabelIdentifierField } from '@/object-metadata/utils/isLabelIdentifierField';
import { FieldContext } from '@/object-record/record-field/contexts/FieldContext';
@ -12,18 +11,17 @@ import {
} from '@/object-record/record-store/contexts/RecordFieldValueSelectorContext';
import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
import { Person } from '@/people/types/Person';
import { mockedCompaniesDataV2 } from '~/testing/mock-data/companiesV2';
import { getCompaniesMock } from '~/testing/mock-data/companies';
import { generatedMockObjectMetadataItems } from '~/testing/mock-data/objectMetadataItems';
import { mockPeopleDataV2 } from '~/testing/mock-data/peopleV2';
import { getPeopleMock } from '~/testing/mock-data/people';
import { isDefined } from '~/utils/isDefined';
const RecordMockSetterEffect = ({
companies,
people,
}: {
companies: Company[];
people: Person[];
companies: ObjectRecord[];
people: ObjectRecord[];
}) => {
const setRecordValue = useSetRecordValue();
@ -56,21 +54,25 @@ export const getFieldDecorator =
fieldValue?: any,
): Decorator =>
(Story) => {
const companiesMock = getCompaniesMock();
const companies =
objectNameSingular === 'company' && isDefined(fieldValue)
? [
{ ...mockedCompaniesDataV2[0], [fieldName]: fieldValue },
...mockedCompaniesDataV2.slice(1),
{ ...companiesMock[0], [fieldName]: fieldValue },
...companiesMock.slice(1),
]
: mockedCompaniesDataV2;
: companiesMock;
const peopleMock = getPeopleMock();
const people =
objectNameSingular === 'person' && isDefined(fieldValue)
? [
{ ...mockPeopleDataV2[0], [fieldName]: fieldValue },
...mockPeopleDataV2.slice(1),
{ ...peopleMock[0], [fieldName]: fieldValue },
...peopleMock.slice(1),
]
: mockPeopleDataV2;
: peopleMock;
const record = objectNameSingular === 'company' ? companies[0] : people[0];

View File

@ -8,20 +8,24 @@ import { GET_CURRENT_USER } from '@/users/graphql/queries/getCurrentUser';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
import { mockedActivities } from '~/testing/mock-data/activities';
import {
mockedCompaniesData,
mockedDuplicateCompanyData,
getCompaniesMock,
getCompanyDuplicateMock,
} from '~/testing/mock-data/companies';
import { mockedClientConfig } from '~/testing/mock-data/config';
import { mockedObjectMetadataItemsQueryResult } from '~/testing/mock-data/metadata';
import { getPeopleMock } from '~/testing/mock-data/people';
import { mockedRemoteTables } from '~/testing/mock-data/remote-tables';
import { mockedUsersData } from '~/testing/mock-data/users';
import { mockedViewsData } from '~/testing/mock-data/views';
import { mockWorkspaceMembers } from '~/testing/mock-data/workspace-members';
import { mockedPeopleData } from './mock-data/people';
import { mockedRemoteServers } from './mock-data/remote-servers';
import { mockedViewFieldsData } from './mock-data/view-fields';
const peopleMock = getPeopleMock();
const companiesMock = getCompaniesMock();
const duplicateCompanyMock = getCompanyDuplicateMock();
export const metadataGraphql = graphql.link(
`${REACT_APP_SERVER_BASE_URL}/metadata`,
);
@ -108,8 +112,8 @@ export const graphqlMocks = {
}),
graphql.query('FindManyCompanies', ({ variables }) => {
const mockedData = variables.limit
? mockedCompaniesData.slice(0, variables.limit)
: mockedCompaniesData;
? companiesMock.slice(0, variables.limit)
: companiesMock;
return HttpResponse.json({
data: {
@ -157,7 +161,7 @@ export const graphqlMocks = {
edges: [
{
node: {
...mockedDuplicateCompanyData,
...duplicateCompanyMock,
favorites: {
edges: [],
__typename: 'FavoriteConnection',
@ -197,7 +201,7 @@ export const graphqlMocks = {
return HttpResponse.json({
data: {
people: {
edges: mockedPeopleData.map((person) => ({
edges: peopleMock.map((person) => ({
node: person,
cursor: null,
})),

View File

@ -1,210 +1,393 @@
import { Company } from '@/companies/types/Company';
import { Favorite } from '@/favorites/types/Favorite';
import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import { mockedUsersData } from './users';
type MockedCompany = Omit<Company, 'deletedAt'> & {
accountOwner: WorkspaceMember | null;
Favorite: Pick<Favorite, 'id'> | null;
export const getCompaniesMock = () => {
return companiesQueryResult.companies.edges.map((edge) => edge.node);
};
export const mockedCompaniesData: Array<MockedCompany> = [
{
export const getCompanyDuplicateMock = () => {
return {
...companiesQueryResult.companies.edges[0].node,
id: '8b40856a-2ec9-4c03-8bc0-c032c89e1824',
};
};
export const getEmptyCompanyMock = () => {
return {
id: '9231e6ee-4cc2-4c7b-8c55-dff16f4d968a',
name: '',
domainName: '',
address: '',
accountOwner: null,
createdAt: null,
updatedAt: null,
employees: null,
idealCustomerProfile: null,
linkedinLink: null,
xLink: null,
_activityCount: null,
__typename: 'Company',
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
domainName: 'airbnb.com',
name: 'Airbnb',
createdAt: '2023-04-26T10:08:54.724515+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
address: '17 rue de clignancourt',
employees: 12,
linkedinLink: {
url: 'https://www.linkedin.com/company/airbnb/',
label: 'https://www.linkedin.com/company/airbnb/',
};
};
export const companiesQueryResult = {
companies: {
__typename: 'CompanyConnection',
totalCount: 13,
pageInfo: {
__typename: 'PageInfo',
hasNextPage: false,
startCursor:
'WzEsICIyMDIwMjAyMC0zZWMzLTRmZTMtODk5Ny1iNzZhYTBiZmE0MDgiXQ==',
endCursor: 'WzEzLCAiMjAyMDIwMjAtMTQ1NS00YzU3LWFmYWYtZGQ1ZGMwODYzNjFkIl0=',
},
xLink: {
url: 'https://twitter.com/airbnb',
label: 'https://twitter.com/airbnb',
},
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
idealCustomerProfile: true,
Favorite: null,
accountOwnerId: mockedUsersData[0].id,
accountOwner: {
__typename: 'WorkspaceMember',
name: {
firstName: 'Charles',
lastName: 'Test',
edges: [
{
__typename: 'CompanyEdge',
cursor: 'WzEsICIyMDIwMjAyMC0zZWMzLTRmZTMtODk5Ny1iNzZhYTBiZmE0MDgiXQ==',
node: {
__typename: 'Company',
id: '20202020-3ec3-4fe3-8997-b76aa0bfa408',
employees: 100,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Linkedin',
accountOwner: null,
domainName: 'linkedin.com',
address: '',
position: 1,
idealCustomerProfile: true,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
previousEmployees: {
__typename: 'Person',
id: '20202020-2d40-4e49-8df4-9c6a049191de',
email: 'louis.duss@google.com',
position: 14,
testJson: null,
testRating: null,
companyId: '20202020-c21e-4ec2-873b-de4264d89025',
avatarUrl: '',
updatedAt: '2024-06-05T09:36:42.400Z',
testMultiSelect: null,
testBoolean: true,
testSelect: 'OPTION_1',
testDateOnly: null,
bestCompanyId: null,
testUuid: null,
phone: '+33788901234',
createdAt: '2024-06-05T09:00:20.412Z',
city: 'Seattle',
testPhone: '',
jobTitle: 'CTO',
testCurrency: {
__typename: 'Currency',
amountMicros: null,
currencyCode: 'USD',
},
xLink: {
__typename: 'Link',
label: '',
url: 'twitter.com',
},
testLinks: {
__typename: 'Links',
primaryLinkUrl: '',
primaryLinkLabel: '',
secondaryLinks: null,
},
name: {
__typename: 'FullName',
firstName: 'Louis',
lastName: 'Duss',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: 'linkedin.com',
},
testAddress: {
__typename: 'Address',
addressStreet1: '',
addressStreet2: '',
addressCity: '',
addressState: '',
addressCountry: '',
addressPostcode: '',
addressLat: null,
addressLng: null,
},
testLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
},
avatarUrl: null,
id: mockedUsersData[0].id,
locale: 'en',
colorScheme: 'Light',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
createdAt: '2023-04-26T10:23:42.33625+00:00',
userId: mockedUsersData[0].id,
userEmail: 'charles@test.com',
},
{
__typename: 'CompanyEdge',
cursor: 'WzIsICIyMDIwMjAyMC01ZDgxLTQ2ZDYtYmY4My1mN2ZkMzNlYTYxMDIiXQ==',
node: {
__typename: 'Company',
id: '20202020-5d81-46d6-bf83-f7fd33ea6102',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Facebook',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'facebook.com',
address: '',
previousEmployees: null,
position: 2,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzMsICIyMDIwMjAyMC0wNzEzLTQwYTUtODIxNi04MjgwMjQwMWQzM2UiXQ==',
node: {
__typename: 'Company',
id: '20202020-0713-40a5-8216-82802401d33e',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Qonto',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'qonto.com',
address: '',
previousEmployees: null,
position: 3,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzQsICIyMDIwMjAyMC1lZDg5LTQxM2EtYjMxYS05NjI5ODZlNjdiYjQiXQ==',
node: {
__typename: 'Company',
id: '20202020-ed89-413a-b31a-962986e67bb4',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Microsoft',
idealCustomerProfile: true,
accountOwner: null,
domainName: 'microsoft.com',
address: '',
previousEmployees: null,
position: 4,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzUsICIyMDIwMjAyMC0xNzFlLTRiY2MtOWNmNy00MzQ0OGQ2ZmIyNzgiXQ==',
node: {
__typename: 'Company',
id: '20202020-171e-4bcc-9cf7-43448d6fb278',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Airbnb',
idealCustomerProfile: true,
accountOwner: null,
domainName: 'airbnb.com',
address: '',
previousEmployees: null,
position: 5,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzYsICIyMDIwMjAyMC1jMjFlLTRlYzItODczYi1kZTQyNjRkODkwMjUiXQ==',
node: {
__typename: 'Company',
id: '20202020-c21e-4ec2-873b-de4264d89025',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Google',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'google.com',
address: '',
previousEmployees: null,
position: 6,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzcsICIyMDIwMjAyMC03MDdlLTQ0ZGMtYTFkMi0zMDAzMGJmMWE5NDQiXQ==',
node: {
__typename: 'Company',
id: '20202020-707e-44dc-a1d2-30030bf1a944',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Netflix',
idealCustomerProfile: true,
accountOwner: null,
domainName: 'netflix.com',
address: '',
previousEmployees: null,
position: 7,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzgsICIyMDIwMjAyMC0zZjc0LTQ5MmQtYTEwMS0yYTcwZjUwYTE2NDUiXQ==',
node: {
__typename: 'Company',
id: '20202020-3f74-492d-a101-2a70f50a1645',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Libeo',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'libeo.io',
address: '',
previousEmployees: null,
position: 8,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzksICIyMDIwMjAyMC1jZmJmLTQxNTYtYTc5MC1lMzk4NTRkY2Q0ZWIiXQ==',
node: {
__typename: 'Company',
id: '20202020-cfbf-4156-a790-e39854dcd4eb',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Claap',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'claap.io',
address: '',
previousEmployees: null,
position: 9,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzEwLCAiMjAyMDIwMjAtZjg2Yi00MTlmLWI3OTQtMDIzMTlhYmU4NjM3Il0=',
node: {
__typename: 'Company',
id: '20202020-f86b-419f-b794-02319abe8637',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Hasura',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'hasura.io',
address: '',
previousEmployees: null,
position: 10,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzExLCAiMjAyMDIwMjAtNTUxOC00NTUzLTk0MzMtNDJkOGViODI4MzRiIl0=',
node: {
__typename: 'Company',
id: '20202020-5518-4553-9433-42d8eb82834b',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Wework',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'wework.com',
address: '',
previousEmployees: null,
position: 11,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzEyLCAiMjAyMDIwMjAtZjc5ZS00MGRkLWJkMDYtYzM2ZTZhYmI0Njc4Il0=',
node: {
__typename: 'Company',
id: '20202020-f79e-40dd-bd06-c36e6abb4678',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Samsung',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'samsung.com',
address: '',
previousEmployees: null,
position: 12,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
{
__typename: 'CompanyEdge',
cursor: 'WzEzLCAiMjAyMDIwMjAtMTQ1NS00YzU3LWFmYWYtZGQ1ZGMwODYzNjFkIl0=',
node: {
__typename: 'Company',
id: '20202020-1455-4c57-afaf-dd5dc086361d',
employees: null,
createdAt: '2024-06-05T09:00:20.412Z',
name: 'Algolia',
idealCustomerProfile: false,
accountOwner: null,
domainName: 'algolia.com',
address: '',
previousEmployees: null,
position: 13,
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
},
],
},
{
__typename: 'Company',
id: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
domainName: 'aircall.io',
name: 'Aircall',
createdAt: '2023-04-26T10:12:42.33625+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
address: '',
employees: 1,
accountOwnerId: null,
linkedinLink: {
url: 'https://www.linkedin.com/company/aircall/',
label: 'https://www.linkedin.com/company/aircall/',
},
xLink: {
url: 'https://twitter.com/aircall',
label: 'https://twitter.com/aircall',
},
annualRecurringRevenue: { amountMicros: 500000, currencyCode: 'USD' },
idealCustomerProfile: false,
accountOwner: null,
Favorite: null,
},
{
__typename: 'Company',
id: 'a674fa6c-1455-4c57-afaf-dd5dc086361d',
domainName: 'algolia.com',
name: 'Algolia',
createdAt: '2023-04-26T10:10:32.530184+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
address: '',
employees: 1,
linkedinLink: {
url: 'https://www.linkedin.com/company/algolia/',
label: 'https://www.linkedin.com/company/algolia/',
},
xLink: {
url: 'https://twitter.com/algolia',
label: 'https://twitter.com/algolia',
},
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
idealCustomerProfile: true,
accountOwner: null,
Favorite: null,
accountOwnerId: null,
},
{
__typename: 'Company',
id: 'b1cfd51b-a831-455f-ba07-4e30671e1dc3',
domainName: 'apple.com',
name: 'Apple',
createdAt: '2023-03-21T06:30:25.39474+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
address: '',
employees: 10,
linkedinLink: {
url: 'https://www.linkedin.com/company/apple/',
label: 'https://www.linkedin.com/company/apple/',
},
xLink: {
url: 'https://twitter.com/apple',
label: 'https://twitter.com/apple',
},
annualRecurringRevenue: { amountMicros: 1000000, currencyCode: 'USD' },
idealCustomerProfile: false,
accountOwner: null,
Favorite: null,
accountOwnerId: null,
},
{
__typename: 'Company',
id: '5c21e19e-e049-4393-8c09-3e3f8fb09ecb',
domainName: 'qonto.com',
name: 'Qonto',
createdAt: '2023-04-26T10:13:29.712485+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
address: '10 rue de la Paix',
employees: 1,
linkedinLink: {
url: 'https://www.linkedin.com/company/qonto/',
label: 'https://www.linkedin.com/company/qonto/',
},
xLink: {
url: 'https://twitter.com/qonto',
label: 'https://twitter.com/qonto',
},
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
idealCustomerProfile: false,
accountOwner: null,
Favorite: null,
accountOwnerId: null,
},
{
__typename: 'Company',
id: '9d162de6-cfbf-4156-a790-e39854dcd4eb',
domainName: 'facebook.com',
name: 'Facebook',
createdAt: '2023-04-26T10:09:25.656555+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
address: '',
employees: 1,
linkedinLink: {
url: 'https://www.linkedin.com/company/facebook/',
label: 'https://www.linkedin.com/company/facebook/',
},
xLink: {
url: 'https://twitter.com/facebook',
label: 'https://twitter.com/facebook',
},
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
idealCustomerProfile: true,
accountOwner: null,
Favorite: null,
accountOwnerId: null,
},
{
__typename: 'Company',
id: '9d162de6-cfbf-4156-a790-e39854dcd4ef',
domainName: 'sequoia.com',
name: 'Sequoia',
createdAt: '2023-04-26T10:09:25.656555+00:00',
updatedAt: '2023-04-26T10:23:42.33625+00:00',
address: '',
employees: 1,
linkedinLink: {
url: 'https://www.linkedin.com/company/sequoia/',
label: 'https://www.linkedin.com/company/sequoia/',
},
xLink: {
url: 'https://twitter.com/sequoia',
label: 'https://twitter.com/sequoia',
},
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
idealCustomerProfile: true,
accountOwner: null,
Favorite: null,
accountOwnerId: null,
},
];
export const mockedDuplicateCompanyData: MockedCompany = {
...mockedCompaniesData[0],
id: '8b40856a-2ec9-4c03-8bc0-c032c89e1824',
};
export const mockedEmptyCompanyData = {
id: '9231e6ee-4cc2-4c7b-8c55-dff16f4d968a',
name: '',
domainName: '',
address: '',
accountOwner: null,
annualRecurringRevenue: null,
createdAt: null,
updatedAt: null,
employees: null,
idealCustomerProfile: null,
linkedinLink: null,
xLink: null,
_activityCount: null,
__typename: 'Company',
};

View File

@ -1,493 +0,0 @@
import { Company } from '@/companies/types/Company';
import { Favorite } from '@/favorites/types/Favorite';
import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
import { mockedCompaniesData } from '~/testing/mock-data/companies';
type MockedCompanyV2 = Omit<Company, 'deletedAt'> & {
accountOwner: WorkspaceMember | null;
Favorite?: Pick<Favorite, 'id'> | null;
};
export const mockedCompaniesDataV2: Array<MockedCompanyV2> = [
{
__typename: 'Company',
domainName: 'paris.com',
name: 'Test',
employees: null,
address: 'Paris France',
createdAt: '2024-05-27T11:23:05.954Z',
id: 'd55c240e-e4e0-4248-b56d-8004d1218a9c',
position: 6.109375,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 1000000000,
currencyCode: 'USD',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: 'paris.com',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-1553-45c6-a028-5a9064cce07f',
colorScheme: 'Light',
updatedAt: '2024-05-01T13:16:29.046Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-7169-42cf-bc47-1cfef15264b8',
userEmail: 'phil.schiler@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Phil',
lastName: 'Shiler',
},
},
},
{
__typename: 'Company',
domainName: 'google.com',
name: 'Google',
employees: 10202,
address: 'Paris France',
createdAt: '2024-05-21T13:16:29.000Z',
id: '20202020-c21e-4ec2-873b-de4264d89025',
position: 7.5,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 1001000000,
currencyCode: 'USD',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-0687-4c41-b707-ed1bfca972a7',
colorScheme: 'Light',
updatedAt: '2024-05-30T09:00:31.127Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
userEmail: 'tim@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Tim',
lastName: 'Apple',
},
},
},
{
__typename: 'Company',
domainName: 'hasura.io',
name: 'Hasura',
employees: 102938102938,
address: '',
createdAt: '2024-05-16T13:16:29.000Z',
id: '20202020-f86b-419f-b794-02319abe8637',
position: 10,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-77d5-4cb6-b60a-f4a835a85d61',
colorScheme: 'Light',
updatedAt: '2024-05-01T13:16:29.046Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-3957-4908-9c36-2929a23f8357',
userEmail: 'jony.ive@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Jony',
lastName: 'Ive',
},
},
},
{
__typename: 'Company',
domainName: 'netflix.com',
name: 'Netflix',
employees: null,
address: '',
createdAt: '2024-05-15T13:16:29.000Z',
id: '20202020-707e-44dc-a1d2-30030bf1a944',
position: 7,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 2000000000,
currencyCode: 'USD',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-1553-45c6-a028-5a9064cce07f',
colorScheme: 'Light',
updatedAt: '2024-05-01T13:16:29.046Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-7169-42cf-bc47-1cfef15264b8',
userEmail: 'phil.schiler@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Phil',
lastName: 'Shiler',
},
},
},
{
__typename: 'Company',
domainName: 'claap.io',
name: 'Claap',
employees: 2131920,
address: 'asdasd',
createdAt: '2024-05-10T13:16:29.000Z',
id: '20202020-cfbf-4156-a790-e39854dcd4eb',
position: 9,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: 'asmdlkasd',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-0687-4c41-b707-ed1bfca972a7',
colorScheme: 'Light',
updatedAt: '2024-05-30T09:00:31.127Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
userEmail: 'tim@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Tim',
lastName: 'Apple',
},
},
},
{
__typename: 'Company',
domainName: 'libeo.io',
name: 'Libeo',
employees: 1239819238,
address: '',
createdAt: '2024-05-09T13:16:29.000Z',
id: '20202020-3f74-492d-a101-2a70f50a1645',
position: 8,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-1553-45c6-a028-5a9064cce07f',
colorScheme: 'Light',
updatedAt: '2024-05-01T13:16:29.046Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-7169-42cf-bc47-1cfef15264b8',
userEmail: 'phil.schiler@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Phil',
lastName: 'Shiler',
},
},
},
{
__typename: 'Company',
domainName: 'qonto.com',
name: 'Qonto',
employees: 123123123,
address: '',
createdAt: '2024-05-08T13:16:29.000Z',
id: '20202020-0713-40a5-8216-82802401d33e',
position: 9.5,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-1553-45c6-a028-5a9064cce07f',
colorScheme: 'Light',
updatedAt: '2024-05-01T13:16:29.046Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-7169-42cf-bc47-1cfef15264b8',
userEmail: 'phil.schiler@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Phil',
lastName: 'Shiler',
},
},
},
{
__typename: 'Company',
domainName: 'wework.com',
name: 'Wework',
employees: 123123123,
address: '',
createdAt: '2024-05-08T13:16:29.000Z',
id: '20202020-5518-4553-9433-42d8eb82834b',
position: 11,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-0687-4c41-b707-ed1bfca972a7',
colorScheme: 'Light',
updatedAt: '2024-05-30T09:00:31.127Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
userEmail: 'tim@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Tim',
lastName: 'Apple',
},
},
},
{
__typename: 'Company',
domainName: 'linkedin.com',
name: 'Linkedin',
employees: 10102,
accountOwner: null,
address: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-3ec3-4fe3-8997-b76aa0bfa408',
position: 1,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: 'adasd',
url: 'adasd',
},
},
{
__typename: 'Company',
domainName: 'airbnb.com',
name: 'Airbnb',
employees: 123333,
accountOwner: null,
address: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-171e-4bcc-9cf7-43448d6fb278',
position: 5,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
},
{
__typename: 'Company',
domainName: 'samsung.com',
name: 'Samsung',
employees: 10000,
address: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-f79e-40dd-bd06-c36e6abb4678',
position: 12,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-1553-45c6-a028-5a9064cce07f',
colorScheme: 'Light',
updatedAt: '2024-05-01T13:16:29.046Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-7169-42cf-bc47-1cfef15264b8',
userEmail: 'phil.schiler@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Phil',
lastName: 'Shiler',
},
},
},
{
__typename: 'Company',
domainName: 'algolia.com',
name: 'Algolia',
employees: 10000,
address: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-1455-4c57-afaf-dd5dc086361d',
position: 13,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-77d5-4cb6-b60a-f4a835a85d61',
colorScheme: 'Light',
updatedAt: '2024-05-01T13:16:29.046Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-3957-4908-9c36-2929a23f8357',
userEmail: 'jony.ive@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Jony',
lastName: 'Ive',
},
},
},
{
__typename: 'Company',
domainName: 'facebook.com',
name: 'Facebook',
employees: 220323,
accountOwner: null,
address: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-5d81-46d6-bf83-f7fd33ea6102',
position: 6.0625,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: 'asdasd',
},
},
{
__typename: 'Company',
domainName: 'microsoft.com',
name: 'Microsoft',
employees: 10000,
address: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-ed89-413a-b31a-962986e67bb4',
position: 6.09375,
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 10000000000,
currencyCode: 'USD',
},
linkedinLink: {
__typename: 'Link',
label: '',
url: '',
},
accountOwner: {
__typename: 'WorkspaceMember',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-0687-4c41-b707-ed1bfca972a7',
colorScheme: 'Light',
updatedAt: '2024-05-30T09:00:31.127Z',
locale: 'en',
avatarUrl: '',
userId: '20202020-9e3b-46d4-a556-88b9ddc2b034',
userEmail: 'tim@apple.dev',
name: {
__typename: 'FullName',
firstName: 'Tim',
lastName: 'Apple',
},
},
},
];
export const mockedDuplicateCompanyData: MockedCompanyV2 = {
...mockedCompaniesData[0],
id: '8b40856a-2ec9-4c03-8bc0-c032c89e1824',
};
export const mockedEmptyCompanyData = {
id: '9231e6ee-4cc2-4c7b-8c55-dff16f4d968a',
name: '',
domainName: '',
address: '',
accountOwner: null,
annualRecurringRevenue: null,
createdAt: null,
updatedAt: null,
employees: null,
idealCustomerProfile: null,
linkedinLink: null,
xLink: null,
_activityCount: null,
__typename: 'Company',
};

View File

@ -1,8 +1,4 @@
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
import {
FieldMetadataType,
RelationMetadataType,
} from '~/generated-metadata/graphql';
import { mockedStandardObjectMetadataQueryResult } from '~/testing/mock-data/generated/standard-metadata-query-result';
export const generatedMockObjectMetadataItems: ObjectMetadataItem[] =
@ -10,431 +6,3 @@ export const generatedMockObjectMetadataItems: ObjectMetadataItem[] =
...edge.node,
fields: edge.node.fields.edges.map((edge) => edge.node),
}));
export const mockObjectMetadataItem: ObjectMetadataItem = {
__typename: 'object',
id: 'b79a038c-b06b-4a5a-b7ee-f8ba412aa1c0',
nameSingular: 'company',
namePlural: 'companies',
labelSingular: 'Company',
labelPlural: 'Companies',
description: 'A company',
icon: 'IconBuildingSkyscraper',
isCustom: false,
isRemote: false,
isActive: true,
isSystem: false,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
labelIdentifierFieldMetadataId: null,
imageIdentifierFieldMetadataId: null,
fields: [
{
__typename: 'field',
id: '390eb5e5-d8d1-4064-bf75-3461251eb142',
type: FieldMetadataType.Boolean,
name: 'idealCustomerProfile',
label: 'ICP',
description:
'Ideal Customer Profile: Indicates whether the company is the most suitable and valuable customer for you',
icon: 'IconTarget',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: '72a43010-f236-4fa2-8ac4-a31e6b37d692',
type: FieldMetadataType.Relation,
name: 'people',
label: 'People',
description: 'People linked to the company.',
icon: 'IconUsers',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: {
id: 'f08943fe-e8a0-4747-951c-c3b391842453',
relationType: RelationMetadataType.OneToMany,
toObjectMetadata: {
id: 'fcccc985-5edf-405c-aa2b-80c82b230f35',
nameSingular: 'person',
namePlural: 'people',
isSystem: false,
isRemote: false,
},
toFieldMetadataId: 'c756f6ff-8c00-4fe5-a923-c6cfc7b1ac4a',
},
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: '51636fba-1bd9-4344-bba8-9639cbc8e134',
type: FieldMetadataType.Relation,
name: 'opportunities',
label: 'Opportunities',
description: 'Opportunities linked to the company.',
icon: 'IconTargetArrow',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: {
id: '7ffae8bb-b12b-4ad9-8922-da0d517b5612',
relationType: RelationMetadataType.OneToMany,
toObjectMetadata: {
id: '169e5b21-dc95-44a8-acd0-5e9447dd0784',
nameSingular: 'opportunity',
namePlural: 'opportunities',
isSystem: false,
isRemote: false,
},
toFieldMetadataId: '00468e2a-a601-4635-ae9c-a9bb826cc860',
},
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: 'd541f76b-d327-4dda-8ef8-81b60e5ad01e',
type: FieldMetadataType.Relation,
name: 'activityTargets',
label: 'Activities',
description: 'Activities tied to the company',
icon: 'IconCheckbox',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: {
id: 'bc42672b-350f-45c3-bd1f-4debb536ccd1',
relationType: RelationMetadataType.OneToMany,
toObjectMetadata: {
id: 'b87c6cac-a8e7-4156-a525-30ec536acd75',
nameSingular: 'activityTarget',
namePlural: 'activityTargets',
isSystem: true,
isRemote: false,
},
toFieldMetadataId: 'bba19feb-c248-487b-92d7-98df54c51e44',
},
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: 'dacb7562-497e-4080-8ef5-746d6786ed49',
type: FieldMetadataType.DateTime,
name: 'createdAt',
label: 'Creation date',
description: null,
icon: 'IconCalendar',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: false,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: {
type: 'now',
},
},
{
__typename: 'field',
id: 'f3b4ff22-800b-4f13-8262-8003da8eed5b',
type: FieldMetadataType.Number,
name: 'employees',
label: 'Employees',
description: 'Number of employees in the company',
icon: 'IconUsers',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: 'c3e64012-32cc-43f1-af2f-33b37cc4e59d',
type: FieldMetadataType.Link,
name: 'linkedinLink',
label: 'Linkedin',
description: 'The company Linkedin account',
icon: 'IconBrandLinkedin',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: 'fced9acc-0374-487d-9da4-579a17435df0',
type: FieldMetadataType.Link,
name: 'xLink',
label: 'X',
description: 'The company Twitter/X account',
icon: 'IconBrandX',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: '63db0a2f-ffb4-4ea1-98c7-f7e13ce75c38',
type: FieldMetadataType.Relation,
name: 'attachments',
label: 'Attachments',
description: 'Attachments linked to the company.',
icon: 'IconFileImport',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: {
id: '901fd405-c6bf-4559-9d1f-d0937b6f16d9',
relationType: RelationMetadataType.OneToMany,
toObjectMetadata: {
id: '77240b4b-6bcf-454d-a102-19bbba181716',
nameSingular: 'attachment',
namePlural: 'attachments',
isSystem: true,
isRemote: false,
},
toFieldMetadataId: '0880dac5-37d2-43a6-b143-722126d4923f',
},
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: 'e775ce12-87c0-4feb-bcfe-9af3d8ca117b',
type: FieldMetadataType.Uuid,
name: 'id',
label: 'Id',
description: null,
icon: null,
isCustom: false,
isActive: true,
isSystem: true,
isNullable: false,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: {
type: 'uuid',
},
},
{
__typename: 'field',
id: '2278ef91-3d6a-45cf-86f5-76b7bfa2bf32',
type: FieldMetadataType.Text,
name: 'domainName',
label: 'Domain Name',
description:
'The company website URL. We use this url to fetch the company icon',
icon: 'IconLink',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: {
value: '',
},
},
{
__typename: 'field',
id: '438291d7-18f4-48cf-8dca-05e96c5a0765',
type: FieldMetadataType.Currency,
name: 'annualRecurringRevenue',
label: 'ARR',
description:
'Annual Recurring Revenue: The actual or estimated annual revenue of the company',
icon: 'IconMoneybag',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: 'edb8475f-03fc-4ac1-9305-e9d4e2dacd11',
type: FieldMetadataType.DateTime,
name: 'updatedAt',
label: 'Update date',
description: null,
icon: 'IconCalendar',
isCustom: false,
isActive: true,
isSystem: true,
isNullable: false,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: {
type: 'now',
},
},
{
__typename: 'field',
id: 'e3c9ba7f-cecf-4ac6-a7b9-7a9987be0253',
type: FieldMetadataType.Relation,
name: 'accountOwner',
label: 'Account Owner',
description:
'Your team member responsible for managing the company account',
icon: 'IconUserCircle',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: {
id: '0317d74c-5187-491f-9e1d-d22f06ca2a38',
relationType: RelationMetadataType.OneToMany,
fromObjectMetadata: {
id: '92c306ce-ad06-4712-99d2-5d0daf13c95f',
nameSingular: 'workspaceMember',
namePlural: 'workspaceMembers',
isSystem: true,
isRemote: false,
},
fromFieldMetadataId: '0f3e456f-3bb4-4261-a436-95246dc0e159',
},
defaultValue: null,
},
{
__typename: 'field',
id: 'a34bd3b3-6949-4793-bac6-d2c054639c7f',
type: FieldMetadataType.Text,
name: 'address',
label: 'Address',
description: 'The company address',
icon: 'IconMap',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: {
value: '',
},
},
{
__typename: 'field',
id: '4b204845-f1fc-4fd8-8fdd-f4caeaab749f',
type: FieldMetadataType.Relation,
name: 'favorites',
label: 'Favorites',
description: 'Favorites linked to the company',
icon: 'IconHeart',
isCustom: false,
isActive: true,
isSystem: true,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: {
id: '8e0d3aa1-6135-4d65-aa28-15a5b6d1619c',
relationType: RelationMetadataType.OneToMany,
toObjectMetadata: {
id: '1415392e-0ecb-462e-aa67-001e424e6a37',
nameSingular: 'favorite',
namePlural: 'favorites',
isSystem: true,
isRemote: false,
},
toFieldMetadataId: '8fd8965b-bd4e-4a9b-90e9-c75652dadda1',
},
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: 'a795e81e-0bcf-4fd6-8f2f-b3764b990d2d',
type: FieldMetadataType.Uuid,
name: 'accountOwnerId',
label: 'Account Owner id (foreign key)',
description:
'Your team member responsible for managing the company account id foreign key',
icon: 'IconUserCircle',
isCustom: false,
isActive: true,
isSystem: true,
isNullable: true,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: null,
},
{
__typename: 'field',
id: '87887d23-f632-4d3e-840a-02fcee960660',
type: FieldMetadataType.Text,
name: 'name',
label: 'Name',
description: 'The company name',
icon: 'IconBuildingSkyscraper',
isCustom: false,
isActive: true,
isSystem: false,
isNullable: false,
createdAt: '2023-12-19T12:15:28.459Z',
updatedAt: '2023-12-19T12:15:28.459Z',
fromRelationMetadata: null,
toRelationMetadata: null,
defaultValue: {
value: '',
},
},
],
};

File diff suppressed because it is too large Load Diff

View File

@ -1,533 +0,0 @@
import { Company } from '@/companies/types/Company';
import { Person } from '@/people/types/Person';
export type MockedPersonV2 = Pick<
Person,
| '__typename'
| 'id'
| 'name'
| 'linkedinLink'
| 'xLink'
| 'links'
| 'jobTitle'
| 'email'
| 'phone'
| 'city'
| 'avatarUrl'
| 'createdAt'
| 'updatedAt'
| 'companyId'
| 'position'
> & {
company?: Company;
};
export const mockPeopleDataV2: MockedPersonV2[] = [
{
__typename: 'Person',
city: 'Seattle',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-1c0e-494c-a1b6-85b1c6fefaa5',
email: 'christoph.calisto@linkedin.com',
phone: '+33789012345',
position: 1,
name: {
__typename: 'FullName',
firstName: 'Christoph',
lastName: 'Callisto',
},
linkedinLink: { __typename: 'Link', label: '', url: 'asd' },
xLink: { __typename: 'Link', label: '', url: 'asd' },
company: {
__typename: 'Company',
domainName: 'linkedin.com',
name: 'Linkedin',
employees: 10102,
accountOwnerId: null,
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-3ec3-4fe3-8997-b76aa0bfa408',
position: 1,
updatedAt: '2024-05-23T13:21:41.159Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: { __typename: 'Link', label: 'adasd', url: 'adasd' },
},
},
{
__typename: 'Person',
city: 'Los Angeles',
jobTitle: '@',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-ac73-4797-824e-87a1f5aea9e0',
email: 'sylvie.palmer@linkedin.com',
phone: '+33780123456',
position: 2,
name: { __typename: 'FullName', firstName: 'Sylvie', lastName: 'Palmer' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'algolia.com',
name: 'Algolia',
employees: 10000,
accountOwnerId: '20202020-77d5-4cb6-b60a-f4a835a85d61',
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-1455-4c57-afaf-dd5dc086361d',
position: 13,
updatedAt: '2024-05-28T15:52:31.839Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Seattle',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-f517-42fd-80ae-14173b3b70ae',
email: 'christopher.gonzalez@qonto.com',
phone: '+33789012345',
position: 3,
name: {
__typename: 'FullName',
firstName: 'Christopher',
lastName: 'Gonzalez',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'qonto.com',
name: 'Qonto',
employees: 123123123,
accountOwnerId: '20202020-1553-45c6-a028-5a9064cce07f',
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-08T13:16:29.000Z',
id: '20202020-0713-40a5-8216-82802401d33e',
position: 9.5,
updatedAt: '2024-05-28T15:52:46.961Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Los Angeles',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-eee1-4690-ad2c-8619e5b56a2e',
email: 'ashley.parker@qonto.com',
phone: '+33780123456',
position: 4,
name: { __typename: 'FullName', firstName: 'Ashley', lastName: 'Parker' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'qonto.com',
name: 'Qonto',
employees: 123123123,
accountOwnerId: '20202020-1553-45c6-a028-5a9064cce07f',
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-08T13:16:29.000Z',
id: '20202020-0713-40a5-8216-82802401d33e',
position: 9.5,
updatedAt: '2024-05-28T15:52:46.961Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Seattle',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-6784-4449-afdf-dc62cb8702f2',
email: 'nicholas.wright@microsoft.com',
phone: '+33781234567',
position: 5,
name: { __typename: 'FullName', firstName: 'Nicholas', lastName: 'Wright' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'microsoft.com',
name: 'Microsoft',
employees: 10000,
accountOwnerId: '20202020-0687-4c41-b707-ed1bfca972a7',
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-ed89-413a-b31a-962986e67bb4',
position: 6.09375,
updatedAt: '2024-05-28T15:52:35.621Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 10000000000,
currencyCode: 'USD',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'New York',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-490f-4466-8391-733cfd66a0c8',
email: 'isabella.scott@microsoft.com',
phone: '+33782345678',
position: 6,
name: { __typename: 'FullName', firstName: 'Isabella', lastName: 'Scott' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'microsoft.com',
name: 'Microsoft',
employees: 10000,
accountOwnerId: '20202020-0687-4c41-b707-ed1bfca972a7',
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-ed89-413a-b31a-962986e67bb4',
position: 6.09375,
updatedAt: '2024-05-28T15:52:35.621Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 10000000000,
currencyCode: 'USD',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Seattle',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-80f1-4dff-b570-a74942528de3',
email: 'matthew.green@microsoft.com',
phone: '+33783456789',
position: 7,
name: { __typename: 'FullName', firstName: 'Matthew', lastName: 'Green' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'microsoft.com',
name: 'Microsoft',
employees: 10000,
accountOwnerId: '20202020-0687-4c41-b707-ed1bfca972a7',
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-ed89-413a-b31a-962986e67bb4',
position: 6.09375,
updatedAt: '2024-05-28T15:52:35.621Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 10000000000,
currencyCode: 'USD',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'New York',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-338b-46df-8811-fa08c7d19d35',
email: 'elizabeth.baker@airbnb.com',
phone: '+33784567890',
position: 8,
name: { __typename: 'FullName', firstName: 'Elizabeth', lastName: 'Baker' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'airbnb.com',
name: 'Airbnb',
employees: 123333,
accountOwnerId: null,
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-171e-4bcc-9cf7-43448d6fb278',
position: 5,
updatedAt: '2024-05-28T15:52:27.902Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'San Francisco',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-64ad-4b0e-bbfd-e9fd795b7016',
email: 'christopher.nelson@airbnb.com',
phone: '+33785678901',
position: 9,
name: {
__typename: 'FullName',
firstName: 'Christopher',
lastName: 'Nelson',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'airbnb.com',
name: 'Airbnb',
employees: 123333,
accountOwnerId: null,
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-171e-4bcc-9cf7-43448d6fb278',
position: 5,
updatedAt: '2024-05-28T15:52:27.902Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'New York',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-5d54-41b7-ba36-f0d20e1417ae',
email: 'avery.carter@airbnb.com',
phone: '+33786789012',
position: 10,
name: { __typename: 'FullName', firstName: 'Avery', lastName: 'Carter' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'airbnb.com',
name: 'Airbnb',
employees: 123333,
accountOwnerId: null,
address: '',
idealCustomerProfile: false,
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-171e-4bcc-9cf7-43448d6fb278',
position: 5,
updatedAt: '2024-05-28T15:52:27.902Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: null,
currencyCode: '',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Los Angeles',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-623d-41fe-92e7-dd45b7c568e1',
email: 'ethan.mitchell@google.com',
phone: '+33787890123',
position: 11,
name: { __typename: 'FullName', firstName: 'Ethan', lastName: 'Mitchell' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'google.com',
name: 'Google',
employees: 10202,
accountOwnerId: '20202020-0687-4c41-b707-ed1bfca972a7',
address: 'Paris France',
idealCustomerProfile: false,
createdAt: '2024-05-21T13:16:29.000Z',
id: '20202020-c21e-4ec2-873b-de4264d89025',
position: 7.5,
updatedAt: '2024-05-28T15:53:28.838Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 1001000000,
currencyCode: 'USD',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Seattle',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-2d40-4e49-8df4-9c6a049190ef',
email: 'madison.perez@google.com',
phone: '+33788901234',
position: 12,
name: { __typename: 'FullName', firstName: 'Madison', lastName: 'Perez' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'google.com',
name: 'Google',
employees: 10202,
accountOwnerId: '20202020-0687-4c41-b707-ed1bfca972a7',
address: 'Paris France',
idealCustomerProfile: false,
createdAt: '2024-05-21T13:16:29.000Z',
id: '20202020-c21e-4ec2-873b-de4264d89025',
position: 7.5,
updatedAt: '2024-05-28T15:53:28.838Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 1001000000,
currencyCode: 'USD',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Seattle',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-2d40-4e49-8df4-9c6a049190df',
email: 'bertrand.voulzy@google.com',
phone: '+33788901234',
position: 13,
name: { __typename: 'FullName', firstName: 'Bertrand', lastName: 'Voulzy' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'google.com',
name: 'Google',
employees: 10202,
accountOwnerId: '20202020-0687-4c41-b707-ed1bfca972a7',
address: 'Paris France',
idealCustomerProfile: false,
createdAt: '2024-05-21T13:16:29.000Z',
id: '20202020-c21e-4ec2-873b-de4264d89025',
position: 7.5,
updatedAt: '2024-05-28T15:53:28.838Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 1001000000,
currencyCode: 'USD',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Seattle',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-2d40-4e49-8df4-9c6a049191de',
email: 'louis.duss@google.com',
phone: '+33788901234',
position: 14,
name: { __typename: 'FullName', firstName: 'Louis', lastName: 'Duss' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'google.com',
name: 'Google',
employees: 10202,
accountOwnerId: '20202020-0687-4c41-b707-ed1bfca972a7',
address: 'Paris France',
idealCustomerProfile: false,
createdAt: '2024-05-21T13:16:29.000Z',
id: '20202020-c21e-4ec2-873b-de4264d89025',
position: 7.5,
updatedAt: '2024-05-28T15:53:28.838Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 1001000000,
currencyCode: 'USD',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
{
__typename: 'Person',
city: 'Seattle',
jobTitle: '',
createdAt: '2024-05-01T13:16:29.046Z',
id: '20202020-2d40-4e49-8df4-9c6a049191df',
email: 'lorie.vladim@google.com',
phone: '+33788901235',
position: 15,
name: { __typename: 'FullName', firstName: 'Lorie', lastName: 'Vladim' },
linkedinLink: { __typename: 'Link', label: '', url: '' },
xLink: { __typename: 'Link', label: '', url: '' },
company: {
__typename: 'Company',
domainName: 'google.com',
name: 'Google',
employees: 10202,
accountOwnerId: '20202020-0687-4c41-b707-ed1bfca972a7',
address: 'Paris France',
idealCustomerProfile: false,
createdAt: '2024-05-21T13:16:29.000Z',
id: '20202020-c21e-4ec2-873b-de4264d89025',
position: 7.5,
updatedAt: '2024-05-28T15:53:28.838Z',
xLink: { __typename: 'Link', label: '', url: '' },
annualRecurringRevenue: {
__typename: 'Currency',
amountMicros: 1001000000,
currencyCode: 'USD',
},
linkedinLink: { __typename: 'Link', label: '', url: '' },
},
},
];