Migrate to a monorepo structure (#2909)
This commit is contained in:
224
packages/twenty-front/src/testing/mock-data/activities.ts
Normal file
224
packages/twenty-front/src/testing/mock-data/activities.ts
Normal file
@ -0,0 +1,224 @@
|
||||
import { Activity } from '@/activities/types/Activity';
|
||||
import { ActivityTarget } from '@/activities/types/ActivityTarget';
|
||||
import { Comment } from '@/activities/types/Comment';
|
||||
import { Company } from '@/companies/types/Company';
|
||||
import { Person } from '@/people/types/Person';
|
||||
import { WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
|
||||
|
||||
type MockedActivity = Pick<
|
||||
Activity,
|
||||
| 'id'
|
||||
| 'createdAt'
|
||||
| 'updatedAt'
|
||||
| '__typename'
|
||||
| 'type'
|
||||
| 'body'
|
||||
| 'title'
|
||||
| 'authorId'
|
||||
| 'dueAt'
|
||||
| 'completedAt'
|
||||
> & {
|
||||
author: Pick<WorkspaceMember, 'id' | 'name' | 'avatarUrl'>;
|
||||
assignee: Pick<WorkspaceMember, 'id' | 'name' | 'avatarUrl'>;
|
||||
comments: Comment[];
|
||||
activityTargets: Array<
|
||||
Pick<
|
||||
ActivityTarget,
|
||||
| 'id'
|
||||
| '__typename'
|
||||
| 'createdAt'
|
||||
| 'updatedAt'
|
||||
| 'activityId'
|
||||
| 'personId'
|
||||
| 'companyId'
|
||||
> & {
|
||||
activity: Pick<Activity, 'id' | 'createdAt' | 'updatedAt'>;
|
||||
person?: Pick<Person, 'id' | 'name' | 'avatarUrl'> | null;
|
||||
company?: Pick<Company, 'id' | 'name' | 'domainName'> | null;
|
||||
}
|
||||
>;
|
||||
};
|
||||
|
||||
export const mockedTasks: Array<MockedActivity> = [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
title: 'My very first task',
|
||||
type: 'Task',
|
||||
body: '',
|
||||
dueAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
completedAt: null,
|
||||
author: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
assignee: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
comments: [],
|
||||
activityTargets: [],
|
||||
__typename: 'Activity',
|
||||
},
|
||||
];
|
||||
|
||||
export const mockedActivities: Array<MockedActivity> = [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
title: 'My very first note',
|
||||
type: 'Note',
|
||||
body: '',
|
||||
dueAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
completedAt: null,
|
||||
author: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
assignee: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
comments: [],
|
||||
activityTargets: [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb300',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
personId: null,
|
||||
companyId: '89bb825c-171e-4bcc-9cf7-43448d6fb280',
|
||||
company: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb280',
|
||||
name: 'Airbnb',
|
||||
domainName: 'airbnb.com',
|
||||
},
|
||||
person: null,
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
activity: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
},
|
||||
__typename: 'ActivityTarget',
|
||||
},
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb301',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
personId: null,
|
||||
companyId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
company: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
name: 'Aircall',
|
||||
domainName: 'aircall.io',
|
||||
},
|
||||
person: null,
|
||||
activityId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
activity: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb231',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
},
|
||||
__typename: 'ActivityTarget',
|
||||
},
|
||||
],
|
||||
__typename: 'Activity',
|
||||
},
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
title: 'Another note',
|
||||
body: '',
|
||||
type: 'Note',
|
||||
completedAt: null,
|
||||
dueAt: '2029-08-26T10:12:42.33625+00:00',
|
||||
author: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
assignee: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
comments: [],
|
||||
activityTargets: [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278t',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
personId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b', // Alexandre
|
||||
person: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
name: {
|
||||
firstName: 'Alexandre',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
company: null,
|
||||
companyId: null,
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
activity: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
},
|
||||
__typename: 'ActivityTarget',
|
||||
},
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb279t',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
personId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d', // Jean d'Eau
|
||||
companyId: null,
|
||||
company: null,
|
||||
person: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d',
|
||||
name: {
|
||||
firstName: 'Jean',
|
||||
lastName: "d'Eau",
|
||||
},
|
||||
avatarUrl: '',
|
||||
},
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
activity: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278a',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
},
|
||||
__typename: 'ActivityTarget',
|
||||
},
|
||||
],
|
||||
__typename: 'Activity',
|
||||
},
|
||||
];
|
||||
29
packages/twenty-front/src/testing/mock-data/api-keys.ts
Normal file
29
packages/twenty-front/src/testing/mock-data/api-keys.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import { ApiKey } from '@/settings/developers/types/ApiKey';
|
||||
|
||||
type MockedApiKey = Pick<
|
||||
ApiKey,
|
||||
'id' | 'name' | 'createdAt' | 'updatedAt' | 'expiresAt'
|
||||
>;
|
||||
export const mockedApiKeys: Array<MockedApiKey> = [
|
||||
{
|
||||
id: 'f7c6d736-8fcd-4e9c-ab99-28f6a9031570',
|
||||
name: 'Zapier Integration',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
expiresAt: '2100-11-06T23:59:59.825Z',
|
||||
},
|
||||
{
|
||||
id: 'f7c6d736-8fcd-4e9c-ab99-28f6a9031571',
|
||||
name: 'Gmail Integration',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
expiresAt: '2100-11-06T23:59:59.825Z',
|
||||
},
|
||||
{
|
||||
id: 'f7c6d736-8fcd-4e9c-ab99-28f6a9031572',
|
||||
name: 'Github Integration',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
expiresAt: '2022-11-06T23:59:59.825Z',
|
||||
},
|
||||
];
|
||||
196
packages/twenty-front/src/testing/mock-data/companies.ts
Normal file
196
packages/twenty-front/src/testing/mock-data/companies.ts
Normal file
@ -0,0 +1,196 @@
|
||||
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 = Pick<
|
||||
Company,
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'domainName'
|
||||
| 'createdAt'
|
||||
| 'address'
|
||||
| 'employees'
|
||||
| 'linkedinUrl'
|
||||
| 'xUrl'
|
||||
| 'annualRecurringRevenue'
|
||||
| 'idealCustomerProfile'
|
||||
| 'accountOwnerId'
|
||||
> & {
|
||||
accountOwner: Pick<WorkspaceMember, 'id' | 'avatarUrl' | 'name'> | null;
|
||||
Favorite: Pick<Favorite, 'id'> | null;
|
||||
};
|
||||
|
||||
export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
domainName: 'airbnb.com',
|
||||
name: 'Airbnb',
|
||||
createdAt: '2023-04-26T10:08:54.724515+00:00',
|
||||
address: '17 rue de clignancourt',
|
||||
employees: 12,
|
||||
linkedinUrl: {
|
||||
url: 'https://www.linkedin.com/company/airbnb/',
|
||||
label: 'https://www.linkedin.com/company/airbnb/',
|
||||
},
|
||||
xUrl: {
|
||||
url: 'https://twitter.com/airbnb',
|
||||
label: 'https://twitter.com/airbnb',
|
||||
},
|
||||
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
|
||||
idealCustomerProfile: true,
|
||||
Favorite: null,
|
||||
accountOwnerId: mockedUsersData[0].id,
|
||||
accountOwner: {
|
||||
name: {
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
},
|
||||
avatarUrl: null,
|
||||
id: mockedUsersData[0].id,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae',
|
||||
domainName: 'aircall.io',
|
||||
name: 'Aircall',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
address: '',
|
||||
employees: 1,
|
||||
accountOwnerId: null,
|
||||
linkedinUrl: {
|
||||
url: 'https://www.linkedin.com/company/aircall/',
|
||||
label: 'https://www.linkedin.com/company/aircall/',
|
||||
},
|
||||
xUrl: {
|
||||
url: 'https://twitter.com/aircall',
|
||||
label: 'https://twitter.com/aircall',
|
||||
},
|
||||
annualRecurringRevenue: { amountMicros: 500000, currencyCode: 'USD' },
|
||||
idealCustomerProfile: false,
|
||||
accountOwner: null,
|
||||
Favorite: null,
|
||||
},
|
||||
{
|
||||
id: 'a674fa6c-1455-4c57-afaf-dd5dc086361d',
|
||||
domainName: 'algolia.com',
|
||||
name: 'Algolia',
|
||||
createdAt: '2023-04-26T10:10:32.530184+00:00',
|
||||
address: '',
|
||||
employees: 1,
|
||||
linkedinUrl: {
|
||||
url: 'https://www.linkedin.com/company/algolia/',
|
||||
label: 'https://www.linkedin.com/company/algolia/',
|
||||
},
|
||||
xUrl: {
|
||||
url: 'https://twitter.com/algolia',
|
||||
label: 'https://twitter.com/algolia',
|
||||
},
|
||||
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
|
||||
idealCustomerProfile: true,
|
||||
accountOwner: null,
|
||||
Favorite: null,
|
||||
accountOwnerId: null,
|
||||
},
|
||||
{
|
||||
id: 'b1cfd51b-a831-455f-ba07-4e30671e1dc3',
|
||||
domainName: 'apple.com',
|
||||
name: 'Apple',
|
||||
createdAt: '2023-03-21T06:30:25.39474+00:00',
|
||||
address: '',
|
||||
employees: 10,
|
||||
linkedinUrl: {
|
||||
url: 'https://www.linkedin.com/company/apple/',
|
||||
label: 'https://www.linkedin.com/company/apple/',
|
||||
},
|
||||
xUrl: {
|
||||
url: 'https://twitter.com/apple',
|
||||
label: 'https://twitter.com/apple',
|
||||
},
|
||||
annualRecurringRevenue: { amountMicros: 1000000, currencyCode: 'USD' },
|
||||
idealCustomerProfile: false,
|
||||
accountOwner: null,
|
||||
Favorite: null,
|
||||
accountOwnerId: null,
|
||||
},
|
||||
{
|
||||
id: '5c21e19e-e049-4393-8c09-3e3f8fb09ecb',
|
||||
domainName: 'qonto.com',
|
||||
name: 'Qonto',
|
||||
createdAt: '2023-04-26T10:13:29.712485+00:00',
|
||||
address: '10 rue de la Paix',
|
||||
employees: 1,
|
||||
linkedinUrl: {
|
||||
url: 'https://www.linkedin.com/company/qonto/',
|
||||
label: 'https://www.linkedin.com/company/qonto/',
|
||||
},
|
||||
xUrl: {
|
||||
url: 'https://twitter.com/qonto',
|
||||
label: 'https://twitter.com/qonto',
|
||||
},
|
||||
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
|
||||
idealCustomerProfile: false,
|
||||
accountOwner: null,
|
||||
Favorite: null,
|
||||
accountOwnerId: null,
|
||||
},
|
||||
{
|
||||
id: '9d162de6-cfbf-4156-a790-e39854dcd4eb',
|
||||
domainName: 'facebook.com',
|
||||
name: 'Facebook',
|
||||
createdAt: '2023-04-26T10:09:25.656555+00:00',
|
||||
address: '',
|
||||
employees: 1,
|
||||
linkedinUrl: {
|
||||
url: 'https://www.linkedin.com/company/facebook/',
|
||||
label: 'https://www.linkedin.com/company/facebook/',
|
||||
},
|
||||
xUrl: {
|
||||
url: 'https://twitter.com/facebook',
|
||||
label: 'https://twitter.com/facebook',
|
||||
},
|
||||
annualRecurringRevenue: { amountMicros: 5000000, currencyCode: 'USD' },
|
||||
idealCustomerProfile: true,
|
||||
accountOwner: null,
|
||||
Favorite: null,
|
||||
accountOwnerId: null,
|
||||
},
|
||||
{
|
||||
id: '9d162de6-cfbf-4156-a790-e39854dcd4ef',
|
||||
domainName: 'sequoia.com',
|
||||
name: 'Sequoia',
|
||||
createdAt: '2023-04-26T10:09:25.656555+00:00',
|
||||
address: '',
|
||||
employees: 1,
|
||||
linkedinUrl: {
|
||||
url: 'https://www.linkedin.com/company/sequoia/',
|
||||
label: 'https://www.linkedin.com/company/sequoia/',
|
||||
},
|
||||
xUrl: {
|
||||
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 mockedEmptyCompanyData = {
|
||||
id: '9231e6ee-4cc2-4c7b-8c55-dff16f4d968a',
|
||||
name: '',
|
||||
domainName: '',
|
||||
address: '',
|
||||
accountOwner: null,
|
||||
annualRecurringRevenue: null,
|
||||
createdAt: null,
|
||||
employees: null,
|
||||
idealCustomerProfile: null,
|
||||
linkedinUrl: null,
|
||||
xUrl: null,
|
||||
_activityCount: null,
|
||||
__typename: 'Company',
|
||||
};
|
||||
161
packages/twenty-front/src/testing/mock-data/index.ts
Normal file
161
packages/twenty-front/src/testing/mock-data/index.ts
Normal file
@ -0,0 +1,161 @@
|
||||
import { isObject, isString } from '@sniptt/guards';
|
||||
import { GraphQLVariables } from 'msw';
|
||||
|
||||
import { isDefined } from '../../utils/isDefined';
|
||||
|
||||
type StringFilter = {
|
||||
equals?: string;
|
||||
contains?: string;
|
||||
in?: Array<string>;
|
||||
notIn?: Array<string>;
|
||||
};
|
||||
|
||||
const filterData = <DataT>(
|
||||
data: Array<DataT>,
|
||||
where: Record<string, any>,
|
||||
): Array<DataT> =>
|
||||
data.filter((item) => {
|
||||
// { firstName: {contains: '%string%' }}
|
||||
// { lastName: {equals: 'string' }}
|
||||
// { is: { company: { equals: 'string' }}}
|
||||
let isMatch: boolean = (
|
||||
Object.keys(where) as Array<keyof typeof where>
|
||||
).every((key) => {
|
||||
if (!['OR', 'AND', 'NOT'].includes(key)) {
|
||||
const filterElement = where[key] as StringFilter & { is?: object };
|
||||
|
||||
if (filterElement.is) {
|
||||
const nestedKey = Object.keys(filterElement.is)[0] as string;
|
||||
if (
|
||||
item[key as keyof typeof item] &&
|
||||
isObject(item[key as keyof typeof item])
|
||||
) {
|
||||
const nestedItem = item[key as keyof typeof item];
|
||||
return (
|
||||
nestedItem[nestedKey as keyof typeof nestedItem] ===
|
||||
(
|
||||
filterElement.is[
|
||||
nestedKey as keyof typeof filterElement.is
|
||||
] as StringFilter
|
||||
).equals
|
||||
);
|
||||
}
|
||||
}
|
||||
if (filterElement.equals) {
|
||||
return item[key as keyof typeof item] === filterElement.equals;
|
||||
}
|
||||
if (filterElement.contains) {
|
||||
return (item[key as keyof typeof item] as string)
|
||||
.toLocaleLowerCase()
|
||||
.includes(
|
||||
filterElement.contains.replaceAll('%', '').toLocaleLowerCase(),
|
||||
);
|
||||
}
|
||||
if (filterElement.in) {
|
||||
const itemValue = item[key as keyof typeof item] as string;
|
||||
|
||||
return filterElement.in.includes(itemValue);
|
||||
}
|
||||
if (filterElement.notIn) {
|
||||
const itemValue = item[key as keyof typeof item] as string;
|
||||
|
||||
if (filterElement.notIn.length === 0) return true;
|
||||
|
||||
return !filterElement.notIn.includes(itemValue);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// { OR: [{ firstName: filter }, { lastName: filter }]
|
||||
if (where.OR && Array.isArray(where.OR)) {
|
||||
isMatch =
|
||||
isMatch ||
|
||||
where.OR.some((orFilter) =>
|
||||
filterData<DataT>(data, orFilter).includes(item),
|
||||
);
|
||||
}
|
||||
|
||||
if (where.AND && Array.isArray(where.AND)) {
|
||||
isMatch =
|
||||
isMatch ||
|
||||
where.AND.every((andFilter) =>
|
||||
filterData<DataT>(data, andFilter).includes(item),
|
||||
);
|
||||
}
|
||||
|
||||
return isMatch;
|
||||
});
|
||||
|
||||
export const filterAndSortData = <DataT>(
|
||||
data: Array<DataT>,
|
||||
where?: Record<string, any>,
|
||||
orderBy?: Array<any>,
|
||||
limit?: number,
|
||||
): Array<DataT> => {
|
||||
let filteredData = data;
|
||||
|
||||
if (where) {
|
||||
filteredData = filterData<DataT>(data, where);
|
||||
}
|
||||
|
||||
if (Array.isArray(orderBy) && orderBy.length > 0 && orderBy[0]) {
|
||||
const firstOrderBy = orderBy[0];
|
||||
|
||||
const key = Object.keys(firstOrderBy)[0];
|
||||
|
||||
filteredData.sort((itemA, itemB) => {
|
||||
const itemAValue = itemA[key as unknown as keyof typeof itemA];
|
||||
const itemBValue = itemB[key as unknown as keyof typeof itemB];
|
||||
if (!itemAValue || !itemBValue) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const sortDirection =
|
||||
firstOrderBy[key as unknown as keyof typeof firstOrderBy];
|
||||
if (isString(itemAValue) && isString(itemBValue)) {
|
||||
return sortDirection === 'desc'
|
||||
? itemBValue.localeCompare(itemAValue)
|
||||
: -itemBValue.localeCompare(itemAValue);
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
if (limit) {
|
||||
filteredData = filteredData.slice(0, limit);
|
||||
}
|
||||
|
||||
return filteredData;
|
||||
};
|
||||
|
||||
export const fetchOneFromData = <DataT extends { id: string }>(
|
||||
data: Array<DataT>,
|
||||
id: string,
|
||||
): DataT | undefined => {
|
||||
if (!isDefined(id)) {
|
||||
throw new Error(
|
||||
`id is not defined in updateOneFromData, check that you provided where.id if needed.`,
|
||||
);
|
||||
}
|
||||
|
||||
return data.filter((item) => item.id === id)[0];
|
||||
};
|
||||
|
||||
export const updateOneFromData = <DataT extends { id: string }>(
|
||||
data: Array<DataT>,
|
||||
id: string | undefined,
|
||||
payload: GraphQLVariables,
|
||||
): DataT | undefined => {
|
||||
if (!isDefined(id)) {
|
||||
throw new Error(
|
||||
`id is not defined in updateOneFromData, check that you provided where.id if needed.`,
|
||||
);
|
||||
}
|
||||
|
||||
const object = data.filter((item) => item.id === id)[0];
|
||||
|
||||
const newObject = Object.assign(object, payload);
|
||||
|
||||
return newObject;
|
||||
};
|
||||
2
packages/twenty-front/src/testing/mock-data/jwt.ts
Normal file
2
packages/twenty-front/src/testing/mock-data/jwt.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export const mockedUserJWT =
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIzNzRmZTNhNS1kZjFlLTQxMTktYWZlMC0yYTYyYTJiYTQ4MWUiLCJ3b3Jrc3BhY2VJZCI6InR3ZW50eS03ZWQ5ZDIxMi0xYzI1LTRkMDItYmYyNS02YWVjY2Y3ZWE0MTkiLCJpYXQiOjE2ODY5OTMxODIsImV4cCI6MTY4Njk5MzQ4Mn0.F_FD6nJ5fssR_47v2XFhtzqjr-wrEQpqaWVq8iIlLJw';
|
||||
970
packages/twenty-front/src/testing/mock-data/metadata.ts
Normal file
970
packages/twenty-front/src/testing/mock-data/metadata.ts
Normal file
@ -0,0 +1,970 @@
|
||||
import {
|
||||
FieldMetadataType,
|
||||
RelationMetadataType,
|
||||
} from '~/generated-metadata/graphql';
|
||||
|
||||
export const mockedPeopleMetadata = {
|
||||
node: {
|
||||
__typename: 'object',
|
||||
id: '20202020-c64b-44bc-bd2c-502c99f49dca',
|
||||
nameSingular: 'person',
|
||||
namePlural: 'people',
|
||||
labelSingular: 'Person',
|
||||
labelPlural: 'People',
|
||||
description: 'A person',
|
||||
icon: 'IconUser',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
createdAt: '2023-11-24T03:29:18.207Z',
|
||||
updatedAt: '2023-11-24T03:29:18.207Z',
|
||||
fields: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-2bf4-42b8-8718-a3e852bfa6a6',
|
||||
type: 'DATE_TIME',
|
||||
name: 'updatedAt',
|
||||
label: 'Update date',
|
||||
description: null,
|
||||
icon: 'IconCalendar',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-03cd-4cd0-9afc-92077b69f24f',
|
||||
type: 'UUID',
|
||||
name: 'id',
|
||||
label: 'Id',
|
||||
description: null,
|
||||
icon: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-486f-45f9-bbdf-aac18b1831c0',
|
||||
type: 'TEXT',
|
||||
name: 'phone',
|
||||
label: 'Phone',
|
||||
description: 'Contact’s phone number',
|
||||
icon: 'IconPhone',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-dcf6-445a-b543-37e55de43c25',
|
||||
type: 'LINK',
|
||||
name: 'linkedinLink',
|
||||
label: 'Linkedin',
|
||||
description: 'Contact’s Linkedin account',
|
||||
icon: 'IconBrandLinkedin',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-64e1-4080-b6ad-db03c3809f8b',
|
||||
type: 'UUID',
|
||||
name: 'companyId',
|
||||
label: 'Company ID (foreign key)',
|
||||
description: 'Foreign key for company',
|
||||
icon: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-bb05-45cb-aa2a-71b58d49dd23',
|
||||
type: 'TEXT',
|
||||
name: 'avatarUrl',
|
||||
label: 'Avatar',
|
||||
description: 'Contact’s avatar',
|
||||
icon: 'IconFileUpload',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-a3a7-4f63-9303-10226f6055be',
|
||||
type: 'LINK',
|
||||
name: 'xLink',
|
||||
label: 'X',
|
||||
description: 'Contact’s X/Twitter account',
|
||||
icon: 'IconBrandX',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-3b86-413e-ab56-0ebd1a583ff3',
|
||||
type: 'TEXT',
|
||||
name: 'jobTitle',
|
||||
label: 'Job Title',
|
||||
description: 'Contact’s job title',
|
||||
icon: 'IconBriefcase',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-8a96-4e4b-86fd-ea126530e0c1',
|
||||
type: 'EMAIL',
|
||||
name: 'email',
|
||||
label: 'Email',
|
||||
description: 'Contact’s Email',
|
||||
icon: 'IconMail',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-9b56-4888-bfe3-f6f59aa999e3',
|
||||
type: 'FULL_NAME',
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
description: 'Contact’s name',
|
||||
icon: 'IconUser',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-78f8-4b4c-90ff-86adf77590f5',
|
||||
type: 'TEXT',
|
||||
name: 'city',
|
||||
label: 'City',
|
||||
description: 'Contact’s city',
|
||||
icon: 'IconMap',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-bec0-4cf0-bf1c-8b2ed21f027a',
|
||||
type: 'DATE_TIME',
|
||||
name: 'createdAt',
|
||||
label: 'Creation date',
|
||||
description: null,
|
||||
icon: 'IconCalendar',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
createdAt: '2023-11-24T03:29:18.268Z',
|
||||
updatedAt: '2023-11-24T03:29:18.268Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '531d5d57-1104-4ba9-b47b-6e526fc46cb6',
|
||||
type: FieldMetadataType.Relation,
|
||||
name: 'company',
|
||||
label: 'Company',
|
||||
description: '',
|
||||
placeholder: null,
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: {
|
||||
id: 'b53f8e8d-357c-4e75-8789-ecf95de200c9',
|
||||
relationType: RelationMetadataType.OneToMany,
|
||||
toObjectMetadata: {
|
||||
id: 'a3195559-cc20-4749-9565-572a2f506581',
|
||||
dataSourceId: '',
|
||||
nameSingular: 'company',
|
||||
namePlural: 'companies',
|
||||
},
|
||||
toFieldMetadataId: 'a578ffb2-13db-483c-ace7-5c30a13dff2d',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
startCursor: null,
|
||||
endCursor: null,
|
||||
},
|
||||
totalCount: 12,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const mockedCompaniesMetadata = {
|
||||
node: {
|
||||
id: 'a3195559-cc20-4749-9565-572a2f506581',
|
||||
dataSourceId: '',
|
||||
nameSingular: 'company',
|
||||
namePlural: 'companies',
|
||||
labelSingular: 'Company',
|
||||
labelPlural: 'Companies',
|
||||
description: null,
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fields: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
id: '397eabc0-c5a1-4550-8e68-839c878a8d0e',
|
||||
type: FieldMetadataType.Text,
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
description: 'The company name.',
|
||||
placeholder: null,
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '7ad234c7-f3b9-4efc-813c-43dc97070b07',
|
||||
type: FieldMetadataType.Link,
|
||||
name: 'URL',
|
||||
label: 'URL',
|
||||
description:
|
||||
'The company website URL. We use this url to fetch the company icon.',
|
||||
placeholder: null,
|
||||
icon: 'IconLink',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: 'a578ffb2-13db-483c-ace7-5c30a13dff2d',
|
||||
type: FieldMetadataType.Relation,
|
||||
name: 'people',
|
||||
label: 'People',
|
||||
description: 'People linked to the company.',
|
||||
placeholder: null,
|
||||
icon: 'IconUsers',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: {
|
||||
id: '91f07688-2243-43a4-91b4-e2984669fe8e',
|
||||
relationType: RelationMetadataType.OneToMany,
|
||||
toObjectMetadata: {
|
||||
id: mockedPeopleMetadata.node.id,
|
||||
nameSingular: mockedPeopleMetadata.node.nameSingular,
|
||||
namePlural: mockedPeopleMetadata.node.namePlural,
|
||||
},
|
||||
toFieldMetadataId: '531d5d57-1104-4ba9-b47b-6e526fc46cb6',
|
||||
},
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: 'b7fd622d-7d8b-4f5a-b148-a7e9fd2c4660',
|
||||
type: FieldMetadataType.Number,
|
||||
name: 'employees',
|
||||
label: 'Employees',
|
||||
description: 'Number of employees in the company.',
|
||||
placeholder: null,
|
||||
icon: 'IconUsers',
|
||||
isCustom: true,
|
||||
isActive: true,
|
||||
isNullable: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '60ab27ed-a959-471e-b583-887387f7accd',
|
||||
type: FieldMetadataType.Link,
|
||||
name: 'linkedinUrl',
|
||||
label: 'Linkedin URL',
|
||||
description: null,
|
||||
placeholder: null,
|
||||
icon: 'IconBrandLinkedin',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '6daadb98-83ca-4c85-bca5-7792a7d958ad',
|
||||
type: FieldMetadataType.Boolean,
|
||||
name: 'idealCustomerProfile',
|
||||
label: 'ICP',
|
||||
description: '',
|
||||
placeholder: null,
|
||||
icon: 'IconTarget',
|
||||
isCustom: true,
|
||||
isActive: false,
|
||||
isNullable: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: 'd9e366d5-d43d-4f71-ac97-f1d32768f79b',
|
||||
type: FieldMetadataType.Currency,
|
||||
name: 'annualRecurringRevenue',
|
||||
label: 'ARR',
|
||||
description: '',
|
||||
placeholder: null,
|
||||
icon: 'IconMoneybag',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '39c55b95-f8cf-49a3-9713-fc52bbd117ae',
|
||||
type: FieldMetadataType.DateTime,
|
||||
name: 'createdAt',
|
||||
label: 'Created At',
|
||||
description: '',
|
||||
placeholder: null,
|
||||
icon: 'IconCalendar',
|
||||
isCustom: false,
|
||||
isActive: false,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
startCursor: null,
|
||||
endCursor: null,
|
||||
},
|
||||
totalCount: 8,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const mockedWorkspacesMetadata = {
|
||||
node: {
|
||||
id: 'c973efa3-436e-47ea-8dbc-983ed869c04d',
|
||||
dataSourceId: '',
|
||||
nameSingular: 'workspace',
|
||||
namePlural: 'workspaces',
|
||||
labelSingular: 'Workspace',
|
||||
labelPlural: 'Workspaces',
|
||||
description: null,
|
||||
icon: 'IconApps',
|
||||
isCustom: true,
|
||||
isActive: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fields: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
id: 'f955402c-9e8f-4b91-a82c-95f6de392b99',
|
||||
type: 'TEXT',
|
||||
name: 'slug',
|
||||
label: 'Slug',
|
||||
description: null,
|
||||
placeholder: null,
|
||||
icon: 'IconSlash',
|
||||
isCustom: true,
|
||||
isActive: true,
|
||||
isNullable: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
startCursor: null,
|
||||
endCursor: null,
|
||||
},
|
||||
totalCount: 1,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const mockedActivitiesMetadata = {
|
||||
node: {
|
||||
__typename: 'object',
|
||||
id: '20202020-8ee3-4f67-84ab-1b7a6eb5a448',
|
||||
nameSingular: 'activity',
|
||||
namePlural: 'activities',
|
||||
labelSingular: 'Activity',
|
||||
labelPlural: 'Activities',
|
||||
description: 'An activity',
|
||||
icon: 'IconCheckbox',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
createdAt: '2023-11-24T03:29:18.207Z',
|
||||
updatedAt: '2023-11-24T03:29:18.207Z',
|
||||
fields: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-4694-4ec6-9084-8d932ebb3066',
|
||||
type: 'UUID',
|
||||
name: 'assigneeId',
|
||||
label: 'Assignee id (foreign key)',
|
||||
description: 'Acitivity assignee id foreign key',
|
||||
icon: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-88df-4202-bf82-6a06c6963280',
|
||||
type: 'DATE_TIME',
|
||||
name: 'updatedAt',
|
||||
label: 'Update date',
|
||||
description: null,
|
||||
icon: 'IconCalendar',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-aff0-4961-be8a-0e5c2598b9a6',
|
||||
type: 'TEXT',
|
||||
name: 'body',
|
||||
label: 'Body',
|
||||
description: 'Activity body',
|
||||
icon: 'IconList',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-cd46-44f4-bf22-b0aa20d009da',
|
||||
type: 'DATE_TIME',
|
||||
name: 'reminderAt',
|
||||
label: 'Reminder Date',
|
||||
description: 'Activity reminder date',
|
||||
icon: 'IconCalendarEvent',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-2584-4797-95a8-5cc90d48c040',
|
||||
type: 'TEXT',
|
||||
name: 'title',
|
||||
label: 'Title',
|
||||
description: 'Activity title',
|
||||
icon: 'IconNotes',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-f695-419c-b928-c488323d6df3',
|
||||
type: 'UUID',
|
||||
name: 'id',
|
||||
label: 'Id',
|
||||
description: null,
|
||||
icon: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-3acb-46bb-b993-0dc49fa2a48d',
|
||||
type: 'UUID',
|
||||
name: 'authorId',
|
||||
label: 'Author id (foreign key)',
|
||||
description: 'Activity author id foreign key',
|
||||
icon: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-0924-48f0-a8c2-d2dd4e2098e2',
|
||||
type: 'DATE_TIME',
|
||||
name: 'completedAt',
|
||||
label: 'Completion Date',
|
||||
description: 'Activity completion date',
|
||||
icon: 'IconCheck',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-a243-4b94-a4b4-25705af86be2',
|
||||
type: 'TEXT',
|
||||
name: 'type',
|
||||
label: 'Type',
|
||||
description: 'Activity type',
|
||||
icon: 'IconCheckbox',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-65a2-4d9c-b640-bac54007a14d',
|
||||
type: 'DATE_TIME',
|
||||
name: 'createdAt',
|
||||
label: 'Creation date',
|
||||
description: null,
|
||||
icon: 'IconCalendar',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
__typename: 'field',
|
||||
id: '20202020-20e1-4366-b386-750bdca2dfe3',
|
||||
type: 'DATE_TIME',
|
||||
name: 'dueAt',
|
||||
label: 'Due Date',
|
||||
description: 'Activity due date',
|
||||
icon: 'IconCalendarEvent',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
createdAt: '2023-11-24T03:29:18.228Z',
|
||||
updatedAt: '2023-11-24T03:29:18.228Z',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
startCursor: null,
|
||||
endCursor: null,
|
||||
},
|
||||
totalCount: 11,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const mockedObjectMetadataItems = {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
id: 'b25eb5e6-9fdc-4df2-a039-40ccea4c8032',
|
||||
dataSourceId: '',
|
||||
nameSingular: 'view',
|
||||
namePlural: 'views',
|
||||
labelSingular: 'View',
|
||||
labelPlural: 'Views',
|
||||
description: '(System) Views',
|
||||
icon: 'IconLayoutCollage',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fields: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
id: '5db475e7-8208-402d-97a1-62c9ce344dd4',
|
||||
type: 'TEXT',
|
||||
name: 'objectMetadataId',
|
||||
label: 'Object Metadata Id',
|
||||
description: 'View target object',
|
||||
icon: null,
|
||||
placeholder: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: 'ddc89a56-9add-4110-aa53-4ecdbba36767',
|
||||
type: 'TEXT',
|
||||
name: 'type',
|
||||
label: 'Type',
|
||||
description: 'View type',
|
||||
icon: null,
|
||||
placeholder: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '35fa806b-5d9d-446d-bd0e-1a6874b871ee',
|
||||
type: 'TEXT',
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
description: 'View name',
|
||||
icon: null,
|
||||
placeholder: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
startCursor: null,
|
||||
endCursor: null,
|
||||
},
|
||||
totalCount: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: 'c419540f-ff6e-47bf-9d87-3aa366afd8e4',
|
||||
dataSourceId: '',
|
||||
nameSingular: 'viewField',
|
||||
namePlural: 'viewFields',
|
||||
labelSingular: 'View Field',
|
||||
labelPlural: 'View Fields',
|
||||
description: '(System) View Fields',
|
||||
icon: 'IconColumns3',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fields: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
id: '1d718fcf-5a17-4694-91a4-4d3968a51aa4',
|
||||
type: 'TEXT',
|
||||
name: 'viewId',
|
||||
label: 'View Id',
|
||||
description: 'View Field related view',
|
||||
icon: null,
|
||||
placeholder: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '8ead2e86-7b60-4a47-9b4f-ad008e744d52',
|
||||
type: 'NUMBER',
|
||||
name: 'position',
|
||||
label: 'Position',
|
||||
description: 'View Field position',
|
||||
icon: null,
|
||||
placeholder: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '4d77c2dd-2b04-4989-b11e-cb0e386d1b4d',
|
||||
type: 'TEXT',
|
||||
name: 'fieldMetadataId',
|
||||
label: 'Field Metadata Id',
|
||||
description: 'View Field target field',
|
||||
icon: null,
|
||||
placeholder: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '0f5ab566-9fc4-44b7-85c5-1e05db9f6b49',
|
||||
type: 'BOOLEAN',
|
||||
name: 'isVisible',
|
||||
label: 'Visible',
|
||||
description: 'View Field visibility',
|
||||
icon: null,
|
||||
placeholder: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
node: {
|
||||
id: '21268ece-7002-4b04-a442-f25278f8ca13',
|
||||
type: 'NUMBER',
|
||||
name: 'size',
|
||||
label: 'Size',
|
||||
description: 'View Field size',
|
||||
icon: null,
|
||||
placeholder: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isNullable: false,
|
||||
createdAt: '',
|
||||
updatedAt: '',
|
||||
fromRelationMetadata: null,
|
||||
toRelationMetadata: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
startCursor: null,
|
||||
endCursor: null,
|
||||
},
|
||||
totalCount: 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
mockedPeopleMetadata,
|
||||
mockedCompaniesMetadata,
|
||||
mockedWorkspacesMetadata,
|
||||
mockedPeopleMetadata,
|
||||
mockedActivitiesMetadata,
|
||||
],
|
||||
pageInfo: {
|
||||
hasNextPage: false,
|
||||
hasPreviousPage: false,
|
||||
startCursor: null,
|
||||
endCursor: null,
|
||||
},
|
||||
totalCount: 6,
|
||||
};
|
||||
152
packages/twenty-front/src/testing/mock-data/people.ts
Normal file
152
packages/twenty-front/src/testing/mock-data/people.ts
Normal file
@ -0,0 +1,152 @@
|
||||
import { Company } from '@/companies/types/Company';
|
||||
import { Person } from '@/people/types/Person';
|
||||
|
||||
type RequiredAndNotNull<T> = {
|
||||
[P in keyof T]-?: Exclude<T[P], null | undefined>;
|
||||
};
|
||||
|
||||
type MockedPerson = RequiredAndNotNull<
|
||||
Pick<
|
||||
Person,
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'linkedinLink'
|
||||
| 'xLink'
|
||||
| 'jobTitle'
|
||||
| 'email'
|
||||
| 'phone'
|
||||
| 'city'
|
||||
| 'avatarUrl'
|
||||
| 'createdAt'
|
||||
| 'companyId'
|
||||
> & {
|
||||
company: Pick<Company, 'id' | 'name' | 'domainName'>;
|
||||
}
|
||||
>;
|
||||
|
||||
export const mockedPeopleData: MockedPerson[] = [
|
||||
{
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b',
|
||||
name: {
|
||||
firstName: 'Alexandre',
|
||||
lastName: 'Prot',
|
||||
},
|
||||
email: 'alexandre@qonto.com',
|
||||
linkedinLink: {
|
||||
url: 'https://www.linkedin.com/in/alexandreprot/',
|
||||
label: 'https://www.linkedin.com/in/alexandreprot/',
|
||||
},
|
||||
xLink: {
|
||||
url: 'https://twitter.com/alexandreprot',
|
||||
label: 'https://twitter.com/alexandreprot',
|
||||
},
|
||||
avatarUrl:
|
||||
'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAADygAwAEAAAAAQAAADwAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIADwAPAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAoHCBUSFRgSEhUYGBgYGBgYGBgYGBgYGBgYGBgZGRgaGBgcIS4lHB4rIRgYJjgmKy8xNTU1GiQ7QDszPy40NTH/2wBDAQwMDBAPEBwSEh40ISQkMTQ0NjQxNDQ2NDQ0NDQ0MTQ0NDQ0NDQ0NDQ0NDE0NDQ0NDQ0PzQ0NDQ0NDQ0NDQ0NDT/3QAEAAT/2gAMAwEAAhEDEQA/AOtApcUtLWpkJiub1TxlawHaC0pGM+WAQM9ixIGfal8bas8ESwwjMs5KLjqq4+ZgO55A/wCBe1cDceGLxVyYCysOqfNjnoQOQfzqJTs7GkYNq53uleLba5KoCyO2fldcDI7b/uk/jW8VrxSSJowQ6OPqhwPxxXofw81Mz27IxyYmCjPUKRlee/f8qIyuKUbHT4oxT6SrIP/Q6+ilorUyOJ147tTjzjbFArEk4A3M/wD9au20u4Rl+R1bHXawJFZ89vGbgM4GWj2898HI/rTbXSIo5lkj5fpuyWO3upPccVx1H7zO6nH3EizroBjbIB/KuL+H0eJ7soMIBGPx3Ocfkf1rUbRPPzM0jYYtv3MTjkjCDOF7flS+C7Hyo5XznzZSRxjhAEH16E1VH4ia/wAJ0dFFLXUcZ//R7HFIRWXq/iS1teJZRu6hEG9+/JC9Bx1OK43VPiM7ZW2iCejyHc34Ivyj8zWpmdtqkiq8QfoxYe3bGfryKbNb8HEzIwyUYKCQCOnbP0IPasPwtKb+3JlcvICUck8hgSVYAcLkFSMelSya3LbL5U8Bl28K67efTcD0P0rjm7zZ3UtIocsZEQhDEu5IXrnaTks+Scnqa3LWBY1EaDCqMDkn9TXCSapNBIb+ZR0ZRGSQArY+Vf8Aa4GD9a6XRvE9tdYCuFc/8s3IVvw7MPcVtRStcwrybZuilpopa2Oc/9Ly0J/kUBaVTS1sZl7SNWmtH8yB9pPBBGVYZzhl7j9R611T/ERmHzWqFvXzDt+uNuevb9a4eiolCMtyozlHYu6zrE12QZSAF+6ijCjPfHc+5/Ss3bUlFUkkrITbbuze8P8Aiqe0IDMZIsjcjEsQOh8ticqcduhx26163FKGUMpyGAII6EEZBrwQmvX/AAFIXso93O0ug/3Vdgo/KmI//9k=',
|
||||
jobTitle: 'CEO',
|
||||
companyId: '5c21e19e-e049-4393-8c09-3e3f8fb09ecb',
|
||||
company: {
|
||||
id: '5c21e19e-e049-4393-8c09-3e3f8fb09ecb',
|
||||
name: 'Qonto',
|
||||
domainName: 'qonto.com',
|
||||
},
|
||||
phone: '06 12 34 56 78',
|
||||
createdAt: '2023-04-20T13:20:09.158312+00:00',
|
||||
city: 'Paris',
|
||||
},
|
||||
{
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d',
|
||||
name: { firstName: 'John', lastName: 'Doe' },
|
||||
linkedinLink: {
|
||||
url: 'https://www.linkedin.com/in/johndoe/',
|
||||
label: 'https://www.linkedin.com/in/johndoe/',
|
||||
},
|
||||
xLink: {
|
||||
url: 'https://twitter.com/johndoe',
|
||||
label: 'https://twitter.com/johndoe',
|
||||
},
|
||||
avatarUrl: '',
|
||||
jobTitle: 'CTO',
|
||||
email: 'john@linkedin.com',
|
||||
companyId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6e',
|
||||
company: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6e',
|
||||
name: 'LinkedIn',
|
||||
domainName: 'linkedin.com',
|
||||
},
|
||||
phone: '06 12 34 56 78',
|
||||
createdAt: '2023-04-20T13:20:09.158312+00:00',
|
||||
city: 'Paris',
|
||||
},
|
||||
{
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6f',
|
||||
name: {
|
||||
firstName: 'Jane',
|
||||
lastName: 'Doe',
|
||||
},
|
||||
linkedinLink: {
|
||||
url: 'https://www.linkedin.com/in/janedoe/',
|
||||
label: 'https://www.linkedin.com/in/janedoe/',
|
||||
},
|
||||
xLink: {
|
||||
url: 'https://twitter.com/janedoe',
|
||||
label: 'https://twitter.com/janedoe',
|
||||
},
|
||||
avatarUrl: '',
|
||||
jobTitle: 'Investor',
|
||||
email: 'jane@sequoiacap.com',
|
||||
companyId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6g',
|
||||
company: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6g',
|
||||
name: 'Sequoia',
|
||||
domainName: 'sequoiacap.com',
|
||||
},
|
||||
phone: '06 12 34 56 78',
|
||||
createdAt: '2023-04-20T13:20:09.158312+00:00',
|
||||
city: 'Paris',
|
||||
},
|
||||
{
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6h',
|
||||
name: {
|
||||
firstName: 'Janice',
|
||||
lastName: 'Dane',
|
||||
},
|
||||
email: 'janice@facebook.com',
|
||||
linkedinLink: {
|
||||
url: 'https://www.linkedin.com/in/janicedane/',
|
||||
label: 'https://www.linkedin.com/in/janicedane/',
|
||||
},
|
||||
xLink: {
|
||||
url: 'https://twitter.com/janicedane',
|
||||
label: 'https://twitter.com/janicedane',
|
||||
},
|
||||
avatarUrl: '',
|
||||
jobTitle: 'CEO',
|
||||
companyId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6i',
|
||||
company: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6i',
|
||||
name: 'Facebook',
|
||||
domainName: 'facebook.com',
|
||||
},
|
||||
phone: '06 12 34 56 78',
|
||||
createdAt: '2023-04-20T13:20:09.158312+00:00',
|
||||
city: 'Paris',
|
||||
},
|
||||
];
|
||||
|
||||
export const mockedEmptyPersonData = {
|
||||
id: 'ce7f0a37-88d7-4cd8-8b41-6721c57195b5',
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
phone: null,
|
||||
email: null,
|
||||
city: null,
|
||||
displayName: null,
|
||||
avatarUrl: null,
|
||||
createdAt: null,
|
||||
jobTitle: null,
|
||||
linkedinUrl: null,
|
||||
xUrl: null,
|
||||
_activityCount: null,
|
||||
company: null,
|
||||
__typename: 'Person',
|
||||
};
|
||||
137
packages/twenty-front/src/testing/mock-data/users.ts
Normal file
137
packages/twenty-front/src/testing/mock-data/users.ts
Normal file
File diff suppressed because one or more lines are too long
185
packages/twenty-front/src/testing/mock-data/view-fields.ts
Normal file
185
packages/twenty-front/src/testing/mock-data/view-fields.ts
Normal file
@ -0,0 +1,185 @@
|
||||
import { mockedViewsData } from './views';
|
||||
|
||||
export const mockedViewFieldsData = [
|
||||
// Companies
|
||||
{
|
||||
id: '79035310-e955-4986-a4a4-73f9d9949c6a',
|
||||
fieldMetadataId: 'name',
|
||||
viewId: mockedViewsData[0].id,
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 180,
|
||||
},
|
||||
{
|
||||
id: '2a96bbc8-d86d-439a-8e50-4b07ebd27750',
|
||||
fieldMetadataId: 'domainName',
|
||||
viewId: mockedViewsData[0].id,
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 100,
|
||||
},
|
||||
{
|
||||
id: '0c1b4c7b-6a3d-4fb0-bf2b-5d7c8fb844ed',
|
||||
fieldMetadataId: 'accountOwner',
|
||||
viewId: mockedViewsData[0].id,
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: 'cc7f9560-32b5-4b82-8fd9-b05fe77c8cf7',
|
||||
fieldMetadataId: 'createdAt',
|
||||
viewId: mockedViewsData[0].id,
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: '3de4d078-3396-4480-be2d-6f3b1a228b0d',
|
||||
fieldMetadataId: 'employees',
|
||||
viewId: mockedViewsData[0].id,
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: '4650c8fb-0f1e-4342-88dc-adedae1445f9',
|
||||
fieldMetadataId: 'linkedin',
|
||||
viewId: mockedViewsData[0].id,
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 170,
|
||||
},
|
||||
{
|
||||
id: '727430bf-6ff8-4c85-9828-cbe72ac0fc27',
|
||||
fieldMetadataId: 'address',
|
||||
viewId: mockedViewsData[0].id,
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 170,
|
||||
},
|
||||
|
||||
// People
|
||||
{
|
||||
id: '28894146-4fde-4a16-a9ca-1a31b5b788b4',
|
||||
fieldMetadataId: 'displayName',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 210,
|
||||
},
|
||||
{
|
||||
id: 'e1e24864-8601-4cd8-8a63-09c1285f2e39',
|
||||
fieldMetadataId: 'email',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: '5a1df716-7211-445a-9f16-9783a00998a7',
|
||||
fieldMetadataId: 'company',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: 'a6e1197a-7e84-4d92-ace2-367c0bc46c49',
|
||||
fieldMetadataId: 'phone',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: 'c9343097-d14b-4559-a5fa-626c1527d39f',
|
||||
fieldMetadataId: 'createdAt',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: 'a873e5f0-fed6-47e9-a712-6854eab3ec77',
|
||||
fieldMetadataId: 'city',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: '66f134b8-5329-422f-b88e-83e6bb707eb5',
|
||||
fieldMetadataId: 'jobTitle',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: '648faa24-cabb-482a-8578-ba3f09906017',
|
||||
fieldMetadataId: 'linkedin',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 7,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: '3a9e7f0d-a4ce-4ad5-aac7-3a24eb1a412d',
|
||||
fieldMetadataId: 'x',
|
||||
viewId: mockedViewsData[1].id,
|
||||
position: 8,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
|
||||
// Opportunities
|
||||
{
|
||||
id: '35a42e2d-83dd-4b57-ada6-f90616da706d',
|
||||
fieldMetadataId: 'amount',
|
||||
viewId: mockedViewsData[2].id,
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 180,
|
||||
},
|
||||
{
|
||||
id: 'e5a731bb-82b9-4abe-ad22-1ddea94722f9',
|
||||
fieldMetadataId: 'probability',
|
||||
viewId: mockedViewsData[2].id,
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: '3159acd8-463f-458d-bf9a-af8ac6f57dc0',
|
||||
fieldMetadataId: 'closeDate',
|
||||
viewId: mockedViewsData[2].id,
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 100,
|
||||
},
|
||||
{
|
||||
id: 'afc0819d-b694-4e3c-a2e6-25261aa3ed2c',
|
||||
fieldMetadataId: 'company',
|
||||
viewId: mockedViewsData[2].id,
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: 'ec0507bb-aedc-4695-ba96-d81bdeb9db83',
|
||||
fieldMetadataId: 'createdAt',
|
||||
viewId: mockedViewsData[2].id,
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
{
|
||||
id: '3f1585f6-44f6-45c5-b840-bc05af5d0008',
|
||||
fieldMetadataId: 'pointOfContact',
|
||||
viewId: mockedViewsData[2].id,
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
];
|
||||
26
packages/twenty-front/src/testing/mock-data/views.ts
Normal file
26
packages/twenty-front/src/testing/mock-data/views.ts
Normal file
@ -0,0 +1,26 @@
|
||||
export const mockedViewsData = [
|
||||
{
|
||||
id: '37a8a866-eb17-4e76-9382-03143a2f6a80',
|
||||
name: 'All companies',
|
||||
objectMetadataId: 'company',
|
||||
type: 'table',
|
||||
},
|
||||
{
|
||||
id: '6095799e-b48f-4e00-b071-10818083593a',
|
||||
name: 'All people',
|
||||
objectMetadataId: 'person',
|
||||
type: 'table',
|
||||
},
|
||||
{
|
||||
id: 'e26f66b7-f890-4a5c-b4d2-ec09987b5308',
|
||||
name: 'All opportunities',
|
||||
objectMetadataId: 'company',
|
||||
type: 'kanban',
|
||||
},
|
||||
{
|
||||
id: '5c307222-1dd5-4ff3-ab06-8d990e9b3c74',
|
||||
name: 'All companies (v2)',
|
||||
objectMetadataId: 'a3195559-cc20-4749-9565-572a2f506581',
|
||||
type: 'table',
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user