Remove Favorite and FavoriteFolder from workspace schema (#19536)
## Summary - Removes all workspace schema definitions for `Favorite` and `FavoriteFolder` entities, which have been fully migrated to `NavigationMenuItems` - Deletes 26 standalone files including workspace entities, NestJS modules, services, listeners, jobs, standard application builders (field metadata, views, view fields, view field groups, indexes, page layouts), mocks, and integration tests - Cleans up ~40 modified files: removes `favorites` relation from 10 workspace entities and their field metadata utils, removes entries from all builder maps, shared constants (`STANDARD_OBJECTS`, `CoreObjectNameSingular`, `DEFAULT_RELATIONS_OBJECTS_STANDARD_IDS`), SDK default relations, AI tool filtering, and standard object icons
This commit is contained in:
@@ -16,8 +16,6 @@ const OBJECTS_TO_GENERATE = [
|
||||
'note',
|
||||
'timelineActivity',
|
||||
'workspaceMember',
|
||||
'favorite',
|
||||
'favoriteFolder',
|
||||
'connectedAccount',
|
||||
'calendarEvent',
|
||||
];
|
||||
|
||||
File diff suppressed because one or more lines are too long
-1
@@ -1,7 +1,6 @@
|
||||
import { CoreObjectNameSingular } from 'twenty-shared/types';
|
||||
|
||||
export const CORE_OBJECT_NAMES_TO_DELETE_ON_TRIGGER_RELATION_DETACH = [
|
||||
CoreObjectNameSingular.Favorite,
|
||||
CoreObjectNameSingular.NoteTarget,
|
||||
CoreObjectNameSingular.TaskTarget,
|
||||
CoreObjectNameSingular.Comment,
|
||||
|
||||
+1
-1
@@ -92,6 +92,6 @@ describe('useColumnDefinitionsFromObjectMetadata', () => {
|
||||
|
||||
const { columnDefinitions } = result.current;
|
||||
|
||||
expect(columnDefinitions.length).toBe(25);
|
||||
expect(columnDefinitions.length).toBe(24);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,7 +11,6 @@ export enum CoreObjectNamePlural {
|
||||
ConnectedAccount = 'connectedAccounts',
|
||||
Dashboard = 'dashboards',
|
||||
TimelineActivity = 'timelineActivities',
|
||||
Favorite = 'favorites',
|
||||
Message = 'messages',
|
||||
MessageChannel = 'messageChannels',
|
||||
MessageParticipant = 'messageParticipants',
|
||||
|
||||
+1
-4
@@ -1,4 +1,4 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`generateDepthRecordGqlFieldsFromObject should generate depth one record gql fields from object 1`] = `
|
||||
{
|
||||
@@ -25,9 +25,6 @@ exports[`generateDepthRecordGqlFieldsFromObject should generate depth one record
|
||||
"deletedAt": true,
|
||||
"domainName": true,
|
||||
"employees": true,
|
||||
"favorites": {
|
||||
"id": true,
|
||||
},
|
||||
"id": true,
|
||||
"idealCustomerProfile": true,
|
||||
"introVideo": true,
|
||||
|
||||
+1
-3
@@ -1,4 +1,4 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`generateDepthRecordGqlFieldsFromRecord should generate depth one record gql fields from empty record 1`] = `
|
||||
{
|
||||
@@ -13,7 +13,6 @@ exports[`generateDepthRecordGqlFieldsFromRecord should generate depth one record
|
||||
"deletedAt": false,
|
||||
"domainName": false,
|
||||
"employees": false,
|
||||
"favorites": false,
|
||||
"id": false,
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": false,
|
||||
@@ -49,7 +48,6 @@ exports[`generateDepthRecordGqlFieldsFromRecord should generate depth one record
|
||||
"deletedAt": false,
|
||||
"domainName": true,
|
||||
"employees": false,
|
||||
"favorites": false,
|
||||
"id": true,
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": false,
|
||||
|
||||
@@ -126,14 +126,6 @@ export const PERSON_FRAGMENT_WITH_DEPTH_ONE_RELATIONS = `
|
||||
primaryEmail
|
||||
additionalEmails
|
||||
}
|
||||
favorites {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
id
|
||||
intro
|
||||
jobTitle
|
||||
|
||||
@@ -31,9 +31,6 @@ export const responseData = {
|
||||
edges: [],
|
||||
},
|
||||
jobTitle: '',
|
||||
favorites: {
|
||||
edges: [],
|
||||
},
|
||||
attachments: {
|
||||
edges: [],
|
||||
},
|
||||
|
||||
@@ -100,20 +100,6 @@ export const query = gql`
|
||||
city
|
||||
email
|
||||
jobTitle
|
||||
favorites {
|
||||
edges {
|
||||
node {
|
||||
__typename
|
||||
id
|
||||
companyId
|
||||
createdAt
|
||||
forWorkspaceMemberId
|
||||
personId
|
||||
position
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
attachments {
|
||||
edges {
|
||||
node {
|
||||
|
||||
@@ -34,9 +34,6 @@ const basePerson = {
|
||||
};
|
||||
|
||||
const connectedObjects = {
|
||||
favorites: {
|
||||
edges: [],
|
||||
},
|
||||
opportunities: {
|
||||
edges: [],
|
||||
},
|
||||
|
||||
+1
-7
@@ -1,4 +1,4 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`useDeleteOneRecord A. Starting from empty cache 1. Should successfully delete record and update record cache entry 1`] = `
|
||||
{
|
||||
@@ -33,7 +33,6 @@ exports[`useDeleteOneRecord B. Starting from filled cache 1. Should handle succe
|
||||
"additionalEmails": [],
|
||||
"primaryEmail": "jeffery.griffin@example.com",
|
||||
},
|
||||
"favorites": [],
|
||||
"id": "20202020-b000-4485-94de-70c2a98daef2",
|
||||
"intro": "",
|
||||
"jobTitle": "Embryologist, clinical",
|
||||
@@ -137,7 +136,6 @@ exports[`useDeleteOneRecord B. Starting from filled cache 1. Should handle succe
|
||||
"secondaryLinks": [],
|
||||
},
|
||||
"employees": 894,
|
||||
"favorites": [],
|
||||
"id": "20202020-a000-4485-94de-70c2a98daef2",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -218,7 +216,6 @@ exports[`useDeleteOneRecord B. Starting from filled cache 2. Should handle optim
|
||||
"additionalEmails": [],
|
||||
"primaryEmail": "jeffery.griffin@example.com",
|
||||
},
|
||||
"favorites": [],
|
||||
"id": "20202020-b000-4485-94de-70c2a98daef2",
|
||||
"intro": "",
|
||||
"jobTitle": "Embryologist, clinical",
|
||||
@@ -322,7 +319,6 @@ exports[`useDeleteOneRecord B. Starting from filled cache 2. Should handle optim
|
||||
"secondaryLinks": [],
|
||||
},
|
||||
"employees": 894,
|
||||
"favorites": [],
|
||||
"id": "20202020-a000-4485-94de-70c2a98daef2",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -403,7 +399,6 @@ exports[`useDeleteOneRecord B. Starting from filled cache 3. Should handle optim
|
||||
"additionalEmails": [],
|
||||
"primaryEmail": "jeffery.griffin@example.com",
|
||||
},
|
||||
"favorites": [],
|
||||
"id": "20202020-b000-4485-94de-70c2a98daef2",
|
||||
"intro": "",
|
||||
"jobTitle": "Embryologist, clinical",
|
||||
@@ -507,7 +502,6 @@ exports[`useDeleteOneRecord B. Starting from filled cache 3. Should handle optim
|
||||
"secondaryLinks": [],
|
||||
},
|
||||
"employees": 894,
|
||||
"favorites": [],
|
||||
"id": "20202020-a000-4485-94de-70c2a98daef2",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
|
||||
-44
@@ -249,50 +249,6 @@ export const mockPerformance = {
|
||||
options: null,
|
||||
relation: null,
|
||||
},
|
||||
{
|
||||
__typename: 'field',
|
||||
id: 'b96e0e45-278c-44b6-a601-30ba24592dd6',
|
||||
type: 'RELATION',
|
||||
name: 'favorites',
|
||||
primaryLinkLabel: 'Favorites',
|
||||
description: 'Favorites linked to the contact',
|
||||
icon: 'IconHeart',
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
createdAt: '2024-05-16T10:54:27.788Z',
|
||||
updatedAt: '2024-05-16T10:54:27.788Z',
|
||||
defaultValue: null,
|
||||
options: null,
|
||||
relation: {
|
||||
__typename: 'Relation',
|
||||
relationId: '31542774-fb15-4d01-b00b-8fc94887f458',
|
||||
direction: 'ONE_TO_MANY',
|
||||
sourceObjectMetadata: {
|
||||
__typename: 'object',
|
||||
id: '4916628e-8570-4242-8970-f58c509e5a93',
|
||||
nameSingular: 'person',
|
||||
namePlural: 'people',
|
||||
},
|
||||
sourceFieldMetadata: {
|
||||
__typename: 'field',
|
||||
id: 'b96e0e45-278c-44b6-a601-30ba24592dd6',
|
||||
name: 'favorites',
|
||||
},
|
||||
targetObjectMetadata: {
|
||||
__typename: 'object',
|
||||
id: 'f08422e2-14cd-4966-9cd3-bce0302cc56f',
|
||||
nameSingular: 'favorite',
|
||||
namePlural: 'favorites',
|
||||
},
|
||||
targetFieldMetadata: {
|
||||
__typename: 'field',
|
||||
id: '67d28b17-ff3c-49b4-a6da-1354be9634b0',
|
||||
name: 'person',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
__typename: 'field',
|
||||
id: '430af81e-2a8c-4ce2-9969-c0f0e91818bb',
|
||||
|
||||
-40
@@ -59,10 +59,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 894,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a000-4485-94de-70c2a98daef2",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -267,10 +263,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 1415,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a018-492d-89de-f9cd4ee80437",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -467,10 +459,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 1001,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a023-4180-9da1-6b417beacf0e",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -676,10 +664,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 8891,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a026-43c0-b042-0123f72f6cf9",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -885,10 +869,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 3875,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a026-47d2-9474-75fb625f5eb1",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -1101,10 +1081,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 874,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a02e-4e28-b4a9-6096b36e26df",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -1301,10 +1277,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 691,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a043-441a-b269-a2378afed31c",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -1517,10 +1489,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 1261,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a045-4266-b9e4-0e7a0697322b",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -1733,10 +1701,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 978,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a045-4b32-8484-a6807e9e0d22",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
@@ -1990,10 +1954,6 @@ export const mockedCompanyRecords: ObjectRecord[] =
|
||||
"secondaryLinks": []
|
||||
},
|
||||
"employees": 3774,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-a048-4007-9024-3ac47b8484d5",
|
||||
"idealCustomerProfile": false,
|
||||
"introVideo": {
|
||||
|
||||
@@ -36,10 +36,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0001-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -119,10 +115,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0002-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -202,10 +194,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0003-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -285,10 +273,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0004-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -368,10 +352,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0005-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -451,10 +431,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0006-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -534,10 +510,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0007-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -617,10 +589,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0008-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -700,10 +668,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0009-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
@@ -783,10 +747,6 @@ export const mockedNoteRecords: ObjectRecord[] =
|
||||
"context": null
|
||||
},
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-000a-4e7c-8001-123456789abc",
|
||||
"noteTargets": {
|
||||
"__typename": "NoteTargetConnection",
|
||||
|
||||
@@ -50,10 +50,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "jeffery.griffin@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b000-4485-94de-70c2a98daef2",
|
||||
"intro": "",
|
||||
"jobTitle": "Embryologist, clinical",
|
||||
@@ -236,10 +232,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "terry.melendez@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b003-415a-9051-133248495f7f",
|
||||
"intro": "",
|
||||
"jobTitle": "Public relations officer",
|
||||
@@ -412,10 +404,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "lee.jones@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b00e-4bc1-87c8-00aeb49c10f8",
|
||||
"intro": "",
|
||||
"jobTitle": "Radiographer, therapeutic",
|
||||
@@ -604,10 +592,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "sarah.hernandez@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b012-44c1-9fdc-90f110962d07",
|
||||
"intro": "",
|
||||
"jobTitle": "Engineer, water",
|
||||
@@ -798,10 +782,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "suzanne.rodriguez@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b017-4ae0-9ece-01dcfa9627e8",
|
||||
"intro": "",
|
||||
"jobTitle": "Games developer",
|
||||
@@ -1000,10 +980,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "christy.hall@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b018-492d-89de-f9cd4ee80437",
|
||||
"intro": "",
|
||||
"jobTitle": "Pension scheme manager",
|
||||
@@ -1177,10 +1153,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "jacqueline.martin@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b01b-46cc-85b9-93b884b7cebe",
|
||||
"intro": "",
|
||||
"jobTitle": "Product manager",
|
||||
@@ -1345,10 +1317,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "brenda.brown@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b01b-49bf-85eb-8b1694edc057",
|
||||
"intro": "",
|
||||
"jobTitle": "Secretary, company",
|
||||
@@ -1537,10 +1505,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "anthony.green@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b01d-4aa3-afec-0b97a593b28d",
|
||||
"intro": "",
|
||||
"jobTitle": "Land",
|
||||
@@ -1722,10 +1686,6 @@ export const mockedPersonRecords: ObjectRecord[] =
|
||||
"primaryEmail": "ronald.smith@example.com",
|
||||
"additionalEmails": []
|
||||
},
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-b01e-4011-979d-33f260f97529",
|
||||
"intro": "",
|
||||
"jobTitle": "Engineer, aeronautical",
|
||||
|
||||
@@ -47,10 +47,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-02T01:17:25.389Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0001-4e7c-8001-123456789def",
|
||||
"position": 1,
|
||||
"status": "TODO",
|
||||
@@ -142,10 +138,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-04T01:17:25.389Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0002-4e7c-8001-123456789def",
|
||||
"position": 2,
|
||||
"status": "IN_PROGRESS",
|
||||
@@ -237,10 +229,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-06T01:17:25.389Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0003-4e7c-8001-123456789def",
|
||||
"position": 3,
|
||||
"status": "TODO",
|
||||
@@ -332,10 +320,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-01T01:17:25.389Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0004-4e7c-8001-123456789def",
|
||||
"position": 4,
|
||||
"status": "TODO",
|
||||
@@ -427,10 +411,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0005-4e7c-8001-123456789def",
|
||||
"position": 5,
|
||||
"status": "DONE",
|
||||
@@ -522,10 +502,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-03T01:17:25.389Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0006-4e7c-8001-123456789def",
|
||||
"position": 6,
|
||||
"status": "IN_PROGRESS",
|
||||
@@ -617,10 +593,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-05T01:17:25.390Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0007-4e7c-8001-123456789def",
|
||||
"position": 7,
|
||||
"status": "TODO",
|
||||
@@ -712,10 +684,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-07T01:17:25.390Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0008-4e7c-8001-123456789def",
|
||||
"position": 8,
|
||||
"status": "TODO",
|
||||
@@ -807,10 +775,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-02T01:17:25.390Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0009-4e7c-8001-123456789def",
|
||||
"position": 9,
|
||||
"status": "TODO",
|
||||
@@ -902,10 +866,6 @@ export const mockedTaskRecords: ObjectRecord[] =
|
||||
},
|
||||
"deletedAt": null,
|
||||
"dueAt": "2026-03-04T01:17:25.390Z",
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-000a-4e7c-8001-123456789def",
|
||||
"position": 10,
|
||||
"status": "IN_PROGRESS",
|
||||
|
||||
-40
@@ -4323,10 +4323,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-0687-4c41-b707-ed1bfca972a7",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -18630,10 +18626,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-1553-45c6-a028-5a9064cce07f",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -18712,10 +18704,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-463f-435b-828c-107e007a2711",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -23485,10 +23473,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "20202020-77d5-4cb6-b60a-f4a835a85d61",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -23558,10 +23542,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "32323232-0001-4000-8000-000000000000",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -23648,10 +23628,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "32323232-0002-4000-8000-000000000000",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -23730,10 +23706,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "32323232-0003-4000-8000-000000000000",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -23812,10 +23784,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "32323232-0004-4000-8000-000000000000",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -23885,10 +23853,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "32323232-0005-4000-8000-000000000000",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
@@ -23958,10 +23922,6 @@ export const mockedWorkspaceMemberRecords: ObjectRecord[] =
|
||||
},
|
||||
"dateFormat": "SYSTEM",
|
||||
"deletedAt": null,
|
||||
"favorites": {
|
||||
"__typename": "FavoriteConnection",
|
||||
"edges": []
|
||||
},
|
||||
"id": "32323232-0006-4000-8000-000000000000",
|
||||
"locale": "en",
|
||||
"messageParticipants": {
|
||||
|
||||
+469
-571
File diff suppressed because it is too large
Load Diff
+102
-153
@@ -8,160 +8,160 @@ import { type NavigationMenuItem } from '~/generated-metadata/graphql';
|
||||
export const mockedNavigationMenuItems: NavigationMenuItem[] =
|
||||
[
|
||||
{
|
||||
"id": "6c5f8eeb-e0eb-419c-959f-35971c4307da",
|
||||
"id": "ad334306-764d-4158-b043-a16416fcd724",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "60a2a05b-3c27-4c0b-b70e-d9e3230101d6",
|
||||
"folderId": "c626185c-ce8b-4d99-a239-07411fbb3e0c",
|
||||
"targetObjectMetadataId": "29a80d39-c931-4ed2-8ae7-8eac638f7f95",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "blue",
|
||||
"position": 0,
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "d6cc6806-100d-4c6e-91fd-e82fc1d8237a",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": "a3c473c4-6f08-4fa1-8ece-e429bb3cfce9",
|
||||
"viewId": null,
|
||||
"folderId": "c91d2186-fd13-4a4c-b95a-d90b61628c2c",
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "gray",
|
||||
"position": 0,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "d9ac8e9f-26dc-4571-8d78-7a829862f37b",
|
||||
"id": "b3d5ea51-6004-467c-9757-ce1d736f983e",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "07f3ccf3-0e66-48b9-a25a-9e3146487ac0",
|
||||
"targetObjectMetadataId": "2e0d7477-8143-4d8f-bc36-2b4f92cbd101",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "blue",
|
||||
"position": 1,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "ce60ce3c-28ba-45af-8391-457d9066884e",
|
||||
"id": "514542c0-c165-495a-a54a-b57efa14ecfe",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "d55fe3ad-7d0a-449c-816e-fcaa8e2e0c3d",
|
||||
"folderId": "c626185c-ce8b-4d99-a239-07411fbb3e0c",
|
||||
"targetObjectMetadataId": "61d7672d-5c4f-42e1-812e-99eb0a2565de",
|
||||
"viewId": null,
|
||||
"folderId": "c91d2186-fd13-4a4c-b95a-d90b61628c2c",
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "gray",
|
||||
"position": 1,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "f8a54baa-c1df-460c-9bd1-9fd3450a72af",
|
||||
"id": "55ca829c-0033-4069-a889-febc12512ee2",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "014bcf01-837e-4ac0-8fa7-db8eb5853e0c",
|
||||
"targetObjectMetadataId": "d493b617-19c8-4cbb-a50f-c084e4b9f276",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "red",
|
||||
"position": 2,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "e4bcdbe3-a511-42e9-b454-0914eedcd414",
|
||||
"id": "a5effa77-b1e0-434f-9116-242159386b05",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "d954fdb7-fd84-4427-8a16-e5e573ab8260",
|
||||
"folderId": "c626185c-ce8b-4d99-a239-07411fbb3e0c",
|
||||
"targetObjectMetadataId": "2f5f0567-c6f1-48f7-bd11-19f316d4395a",
|
||||
"viewId": null,
|
||||
"folderId": "c91d2186-fd13-4a4c-b95a-d90b61628c2c",
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "gray",
|
||||
"position": 2,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "67258966-aaa8-42ac-a2d7-19a6d897f829",
|
||||
"id": "91170d5e-85ef-4164-b06d-143f468009f8",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "4fbe1837-e5b2-4d8b-9f0d-0191f11da17f",
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "blue",
|
||||
"position": 2.5,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-15T10:21:41.704Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "8a5dc1d9-05d3-4630-8c92-dc6503b6979a",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "baa47df1-d385-4abf-b0f8-41b71a1d874f",
|
||||
"targetObjectMetadataId": "34ac72b8-0aaa-4c01-b8a8-8390415fdf8a",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "turquoise",
|
||||
"position": 3,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "f91f583d-18f0-4f74-ab23-cbf8b27960f4",
|
||||
"id": "4ec3a5d8-59a0-4d9e-8012-86030364da32",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "3ea68976-f3ea-4800-919f-d10b6b8b82df",
|
||||
"targetObjectMetadataId": "254e79a9-80e6-4841-b22c-2d67b04d97d6",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "turquoise",
|
||||
"position": 4,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "535d064e-6a83-4a21-aa29-71ca764462da",
|
||||
"id": "81bac961-a2de-4144-aa3f-93d6fc58ecf2",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "f160aaf2-3e6a-4f5c-a61c-551d77c9bef3",
|
||||
"targetObjectMetadataId": "e2e2a576-9631-4bba-8a15-88a3dc4d84a1",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": "gray",
|
||||
"position": 5,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "c626185c-ce8b-4d99-a239-07411fbb3e0c",
|
||||
"id": "c91d2186-fd13-4a4c-b95a-d90b61628c2c",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
@@ -172,145 +172,94 @@ export const mockedNavigationMenuItems: NavigationMenuItem[] =
|
||||
"icon": "IconSettingsAutomation",
|
||||
"color": "orange",
|
||||
"position": 6,
|
||||
"applicationId": "76c2f582-7223-4e93-8413-75ff4949325b",
|
||||
"createdAt": "2026-03-14T18:16:51.168Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.168Z",
|
||||
"applicationId": "dd6a5463-023d-4a10-855f-a4abaf32c1ec",
|
||||
"createdAt": "2026-04-10T08:55:56.200Z",
|
||||
"updatedAt": "2026-04-10T08:55:56.200Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "05c88371-46e0-41e9-a3bc-e176148db9cf",
|
||||
"id": "b55420ec-f3bb-49a2-b685-c6c3bac58dc1",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "21e62404-bb05-47e3-89da-f515cadeb82e",
|
||||
"targetObjectMetadataId": "6934bd29-d89d-479e-8b32-f4f3a9af19b6",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": null,
|
||||
"position": 7,
|
||||
"applicationId": "42e22aff-5cbf-478e-b54c-229b2bc21805",
|
||||
"createdAt": "2026-03-14T18:16:51.837Z",
|
||||
"updatedAt": "2026-03-14T18:16:51.837Z",
|
||||
"applicationId": "029204a9-b419-41d8-a483-57690c3d1a18",
|
||||
"createdAt": "2026-04-10T08:55:57.800Z",
|
||||
"updatedAt": "2026-04-10T08:55:57.800Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "d18a347e-70ca-4e37-8f5c-4c38a944ed04",
|
||||
"id": "2e3ae7b7-e40e-40e8-a835-865abdcd7c4d",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "f4044ef2-99a9-4ae5-a5e0-d5664dfcd4ee",
|
||||
"targetObjectMetadataId": "4646d650-bc55-42f2-9544-4c804c6616a0",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": null,
|
||||
"position": 8,
|
||||
"applicationId": "42e22aff-5cbf-478e-b54c-229b2bc21805",
|
||||
"createdAt": "2026-03-14T18:16:52.091Z",
|
||||
"updatedAt": "2026-03-14T18:16:52.091Z",
|
||||
"applicationId": "029204a9-b419-41d8-a483-57690c3d1a18",
|
||||
"createdAt": "2026-04-10T08:55:58.075Z",
|
||||
"updatedAt": "2026-04-10T08:55:58.075Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "9bdde562-66b0-42b2-89fc-bd3ee42345f2",
|
||||
"id": "33e146b1-2c51-4882-83af-764807dfdbbe",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "cc83a36a-4c40-4aa9-8529-13c5fc9efe41",
|
||||
"targetObjectMetadataId": "9b374f59-ccba-4cfe-8f1f-0725332c4a13",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": null,
|
||||
"position": 9,
|
||||
"applicationId": "42e22aff-5cbf-478e-b54c-229b2bc21805",
|
||||
"createdAt": "2026-03-14T18:16:52.352Z",
|
||||
"updatedAt": "2026-03-14T18:16:52.352Z",
|
||||
"applicationId": "029204a9-b419-41d8-a483-57690c3d1a18",
|
||||
"createdAt": "2026-04-10T08:55:58.471Z",
|
||||
"updatedAt": "2026-04-10T08:55:58.471Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "1beeff3a-9245-4b01-b7e6-34581fa54340",
|
||||
"id": "b0b422e1-afae-4269-b9c4-71219f8e104b",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "53fc7567-b6b6-440e-a06b-5ed8bb7164fb",
|
||||
"targetObjectMetadataId": "057951b6-46e0-4ae9-956a-b3b72f2cf800",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": null,
|
||||
"position": 10,
|
||||
"applicationId": "42e22aff-5cbf-478e-b54c-229b2bc21805",
|
||||
"createdAt": "2026-03-14T18:16:52.534Z",
|
||||
"updatedAt": "2026-03-14T18:16:52.534Z",
|
||||
"applicationId": "029204a9-b419-41d8-a483-57690c3d1a18",
|
||||
"createdAt": "2026-04-10T08:55:58.898Z",
|
||||
"updatedAt": "2026-04-10T08:55:58.898Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "db51d71f-0cf3-4ae2-8670-0326b1dabe50",
|
||||
"id": "1b52442b-5414-441f-832b-c79d9df97bec",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "d555d97b-041f-4b83-a7a5-93c526598ff8",
|
||||
"targetObjectMetadataId": "4397cb61-4bcc-49f8-b024-739b74ed9928",
|
||||
"viewId": null,
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": null,
|
||||
"position": 11,
|
||||
"applicationId": "42e22aff-5cbf-478e-b54c-229b2bc21805",
|
||||
"createdAt": "2026-03-14T18:16:52.660Z",
|
||||
"updatedAt": "2026-03-14T18:16:52.660Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "e31c0236-fdec-4b1e-a0bd-f4ae5159fdd4",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "5af3f071-074b-4a7b-9f6a-bd7e5c4d2b15",
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": null,
|
||||
"position": 12,
|
||||
"applicationId": "42e22aff-5cbf-478e-b54c-229b2bc21805",
|
||||
"createdAt": "2026-03-14T18:18:57.135Z",
|
||||
"updatedAt": "2026-03-14T18:18:57.135Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "058e70ce-d136-46c6-84d9-7907622a4808",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "54379c74-3248-4474-b6a8-511bf79a2c72",
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": null,
|
||||
"position": 13,
|
||||
"applicationId": "42e22aff-5cbf-478e-b54c-229b2bc21805",
|
||||
"createdAt": "2026-03-15T09:09:39.132Z",
|
||||
"updatedAt": "2026-03-15T09:09:39.132Z",
|
||||
"targetRecordIdentifier": null
|
||||
},
|
||||
{
|
||||
"id": "14d0630a-a73f-4045-8613-1e98e58d09b5",
|
||||
"userWorkspaceId": null,
|
||||
"targetRecordId": null,
|
||||
"targetObjectMetadataId": null,
|
||||
"viewId": "c1332d82-c75d-40da-9d30-dc44c7d93444",
|
||||
"folderId": null,
|
||||
"name": null,
|
||||
"link": null,
|
||||
"icon": null,
|
||||
"color": null,
|
||||
"position": 14,
|
||||
"applicationId": "42e22aff-5cbf-478e-b54c-229b2bc21805",
|
||||
"createdAt": "2026-03-15T10:23:50.323Z",
|
||||
"updatedAt": "2026-03-15T10:23:50.323Z",
|
||||
"applicationId": "029204a9-b419-41d8-a483-57690c3d1a18",
|
||||
"createdAt": "2026-04-10T08:55:59.196Z",
|
||||
"updatedAt": "2026-04-10T08:55:59.196Z",
|
||||
"targetRecordIdentifier": null
|
||||
}
|
||||
];
|
||||
|
||||
+19569
-22432
File diff suppressed because it is too large
Load Diff
+19
-19
@@ -9,7 +9,7 @@ export const mockedRoles: Role[] =
|
||||
[
|
||||
{
|
||||
"__typename": "Role",
|
||||
"id": "28f0a741-33c8-4af0-8542-f9ca2ad43285",
|
||||
"id": "5722c41f-6ed1-42e7-a61c-525a377d4a83",
|
||||
"label": "Admin",
|
||||
"description": "Admin role",
|
||||
"icon": "IconUserCog",
|
||||
@@ -34,7 +34,7 @@ export const mockedRoles: Role[] =
|
||||
"__typename": "ApiKeyForRole",
|
||||
"id": "20202020-f401-4d8a-a731-64d007c27bad",
|
||||
"name": "My api key",
|
||||
"expiresAt": "2025-12-31T23:59:59.000Z",
|
||||
"expiresAt": "2126-03-17T08:55:56.135Z",
|
||||
"revokedAt": null
|
||||
}
|
||||
],
|
||||
@@ -54,7 +54,7 @@ export const mockedRoles: Role[] =
|
||||
},
|
||||
{
|
||||
"__typename": "Role",
|
||||
"id": "bd590ccc-8818-4a3f-8a02-e9c2ed290d1f",
|
||||
"id": "7e1d1fc4-e9b2-4376-b052-0ddc77428863",
|
||||
"label": "Guest",
|
||||
"description": "Guest role",
|
||||
"icon": "IconUser",
|
||||
@@ -91,7 +91,7 @@ export const mockedRoles: Role[] =
|
||||
},
|
||||
{
|
||||
"__typename": "Role",
|
||||
"id": "157b0226-1283-47b1-8d76-b21a281408a7",
|
||||
"id": "1e5b6baf-cd29-4d78-a3f1-55fb1fd27a81",
|
||||
"label": "Object-restricted",
|
||||
"description": "All permissions except read on Rockets and update on Pets",
|
||||
"icon": "custom",
|
||||
@@ -109,7 +109,7 @@ export const mockedRoles: Role[] =
|
||||
"objectPermissions": [
|
||||
{
|
||||
"__typename": "ObjectPermission",
|
||||
"objectMetadataId": "532838bd-be8c-40e7-8344-c1ae38c28361",
|
||||
"objectMetadataId": "6934bd29-d89d-479e-8b32-f4f3a9af19b6",
|
||||
"canReadObjectRecords": false,
|
||||
"canUpdateObjectRecords": false,
|
||||
"canSoftDeleteObjectRecords": false,
|
||||
@@ -120,7 +120,7 @@ export const mockedRoles: Role[] =
|
||||
},
|
||||
{
|
||||
"__typename": "ObjectPermission",
|
||||
"objectMetadataId": "6b348756-2824-4eff-ade4-4129abe625f8",
|
||||
"objectMetadataId": "4646d650-bc55-42f2-9544-4c804c6616a0",
|
||||
"canReadObjectRecords": true,
|
||||
"canUpdateObjectRecords": false,
|
||||
"canSoftDeleteObjectRecords": false,
|
||||
@@ -133,21 +133,21 @@ export const mockedRoles: Role[] =
|
||||
"fieldPermissions": [
|
||||
{
|
||||
"__typename": "FieldPermission",
|
||||
"objectMetadataId": "8847c51c-8289-4ad7-9e07-8d20f5126e16",
|
||||
"fieldMetadataId": "c38ed21b-9e25-450e-a627-1085249ad83a",
|
||||
"objectMetadataId": "2e0d7477-8143-4d8f-bc36-2b4f92cbd101",
|
||||
"fieldMetadataId": "cda0c3bf-980e-4697-8583-93c6a772cf24",
|
||||
"canReadFieldValue": null,
|
||||
"canUpdateFieldValue": false,
|
||||
"id": "48981fdf-7d25-4efa-9c44-a0f8fbcf9fcf",
|
||||
"roleId": "157b0226-1283-47b1-8d76-b21a281408a7"
|
||||
"id": "898e3794-f751-4b08-802f-6cc5ca04752a",
|
||||
"roleId": "1e5b6baf-cd29-4d78-a3f1-55fb1fd27a81"
|
||||
},
|
||||
{
|
||||
"__typename": "FieldPermission",
|
||||
"objectMetadataId": "f25b9e3e-610c-46a8-90da-0ccaa17dea89",
|
||||
"fieldMetadataId": "0954834a-3adc-48d6-a07e-7b4645fb24f3",
|
||||
"objectMetadataId": "29a80d39-c931-4ed2-8ae7-8eac638f7f95",
|
||||
"fieldMetadataId": "6b924609-14c9-42ea-84c4-4168d7e0d7ea",
|
||||
"canReadFieldValue": false,
|
||||
"canUpdateFieldValue": false,
|
||||
"id": "b05b532c-2277-4129-8b3e-7be29a96d607",
|
||||
"roleId": "157b0226-1283-47b1-8d76-b21a281408a7"
|
||||
"id": "44a43971-c9f3-4078-917d-d37221a3ab8b",
|
||||
"roleId": "1e5b6baf-cd29-4d78-a3f1-55fb1fd27a81"
|
||||
}
|
||||
],
|
||||
"rowLevelPermissionPredicates": [],
|
||||
@@ -165,12 +165,12 @@ export const mockedRoles: Role[] =
|
||||
"userEmail": "tim@apple.dev"
|
||||
}
|
||||
],
|
||||
"apiKeys": [],
|
||||
"agents": []
|
||||
"agents": [],
|
||||
"apiKeys": []
|
||||
},
|
||||
{
|
||||
"__typename": "Role",
|
||||
"id": "5e996a3a-496a-4686-ac21-c8074cf47ef2",
|
||||
"id": "29de14e0-6efe-4b8a-81b4-e2be87a02860",
|
||||
"label": "Member",
|
||||
"description": "Member role",
|
||||
"icon": "IconUser",
|
||||
@@ -11202,7 +11202,7 @@ export const mockedRoles: Role[] =
|
||||
"userEmail": "richard.palmer1000@apple.dev"
|
||||
}
|
||||
],
|
||||
"apiKeys": [],
|
||||
"agents": []
|
||||
"agents": [],
|
||||
"apiKeys": []
|
||||
}
|
||||
];
|
||||
|
||||
+3190
-3097
File diff suppressed because it is too large
Load Diff
-35
@@ -40,25 +40,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: '20202020-9a2b-4c3d-a4e5-f6a7b8c9d0e1',
|
||||
},
|
||||
{
|
||||
name: 'targetMyNote',
|
||||
label: 'MyNote',
|
||||
description: 'MyNote My note',
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
universalSettings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||
joinColumnName: 'targetMyNoteId',
|
||||
},
|
||||
universalIdentifier: '698f12fe-3feb-55e3-b6cc-73375f1a8ae6',
|
||||
objectUniversalIdentifier: '20202020-ab56-4e05-92a3-e2414a499860',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'ed80c73b-25ff-5a3c-99c7-e27fa2f2611e',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'e1e2e3e4-e5e6-4000-8000-000000000030',
|
||||
type: FieldType.RELATION,
|
||||
},
|
||||
{
|
||||
name: 'targetMyNote',
|
||||
label: 'MyNote',
|
||||
@@ -250,22 +231,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'20202020-6736-4337-b5c4-8b39fae325a5',
|
||||
},
|
||||
{
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'My notes tied to the MyNote',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
type: FieldType.RELATION,
|
||||
universalSettings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
universalIdentifier: 'ed80c73b-25ff-5a3c-99c7-e27fa2f2611e',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'698f12fe-3feb-55e3-b6cc-73375f1a8ae6',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'20202020-ab56-4e05-92a3-e2414a499860',
|
||||
},
|
||||
{
|
||||
name: 'attachments',
|
||||
label: 'Attachments',
|
||||
|
||||
-140
@@ -119,25 +119,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'RootNote Root note',
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
label: 'RootNote',
|
||||
name: 'targetRootNote',
|
||||
objectUniversalIdentifier: '20202020-ab56-4e05-92a3-e2414a499860',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'bbc0dc11-9daa-5e3f-b939-e6f0a12bb277',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'b0b1b2b3-b4b5-4000-8000-000000000001',
|
||||
type: FieldType.RELATION,
|
||||
universalIdentifier: '13fb0eae-50b4-5e28-afbc-5b5a9c422ead',
|
||||
universalSettings: {
|
||||
joinColumnName: 'targetRootNoteId',
|
||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'RootNote Root note',
|
||||
icon: 'IconFileImport',
|
||||
@@ -326,25 +307,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'PostCardRecipient Post Card Recipient',
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
label: 'PostCardRecipient',
|
||||
name: 'targetPostCardRecipient',
|
||||
objectUniversalIdentifier: '20202020-ab56-4e05-92a3-e2414a499860',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'a284914f-650c-54ad-84ef-d6229d3fa453',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'e1a2b3c4-5e6f-4a7b-8c9d-0e1f2a3b4c5e',
|
||||
type: FieldType.RELATION,
|
||||
universalIdentifier: 'f3247843-dd1f-5b15-8873-c0062a021180',
|
||||
universalSettings: {
|
||||
joinColumnName: 'targetPostCardRecipientId',
|
||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'PostCardRecipient Post Card Recipient',
|
||||
icon: 'IconFileImport',
|
||||
@@ -426,25 +388,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'PostCard Post card',
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
label: 'PostCard',
|
||||
name: 'targetPostCard',
|
||||
objectUniversalIdentifier: '20202020-ab56-4e05-92a3-e2414a499860',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'94f43ec4-d2d1-5a50-b414-78da27d24258',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'54b589ca-eeed-4950-a176-358418b85c05',
|
||||
type: FieldType.RELATION,
|
||||
universalIdentifier: '9a5d4ae3-6f45-593f-923d-bcd16ede4345',
|
||||
universalSettings: {
|
||||
joinColumnName: 'targetPostCardId',
|
||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'PostCard Post card',
|
||||
icon: 'IconFileImport',
|
||||
@@ -526,25 +469,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Recipient Recipient',
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
label: 'Recipient',
|
||||
name: 'targetRecipient',
|
||||
objectUniversalIdentifier: '20202020-ab56-4e05-92a3-e2414a499860',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'd16a6387-273b-563c-a6cc-2cb4524b9b7b',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'd1a2b3c4-5e6f-4a7b-8c9d-0e1f2a3b4c5d',
|
||||
type: FieldType.RELATION,
|
||||
universalIdentifier: 'f4e6fd66-83bb-5f2d-b1ec-a3db2e0ca32d',
|
||||
universalSettings: {
|
||||
joinColumnName: 'targetRecipientId',
|
||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Recipient Recipient',
|
||||
icon: 'IconFileImport',
|
||||
@@ -745,22 +669,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Root notes tied to the RootNote',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
label: 'Favorites',
|
||||
name: 'favorites',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'13fb0eae-50b4-5e28-afbc-5b5a9c422ead',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'20202020-ab56-4e05-92a3-e2414a499860',
|
||||
type: FieldType.RELATION,
|
||||
universalIdentifier: 'bbc0dc11-9daa-5e3f-b939-e6f0a12bb277',
|
||||
universalSettings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Root notes tied to the RootNote',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
@@ -943,22 +851,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Post Card Recipients tied to the PostCardRecipient',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
label: 'Favorites',
|
||||
name: 'favorites',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'f3247843-dd1f-5b15-8873-c0062a021180',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'20202020-ab56-4e05-92a3-e2414a499860',
|
||||
type: FieldType.RELATION,
|
||||
universalIdentifier: 'a284914f-650c-54ad-84ef-d6229d3fa453',
|
||||
universalSettings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Post Card Recipients tied to the PostCardRecipient',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
@@ -1208,22 +1100,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Post cards tied to the PostCard',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
label: 'Favorites',
|
||||
name: 'favorites',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'9a5d4ae3-6f45-593f-923d-bcd16ede4345',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'20202020-ab56-4e05-92a3-e2414a499860',
|
||||
type: FieldType.RELATION,
|
||||
universalIdentifier: '94f43ec4-d2d1-5a50-b414-78da27d24258',
|
||||
universalSettings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Post cards tied to the PostCard',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
@@ -1411,22 +1287,6 @@ export const EXPECTED_MANIFEST: Manifest = {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Recipients tied to the Recipient',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
label: 'Favorites',
|
||||
name: 'favorites',
|
||||
relationTargetFieldMetadataUniversalIdentifier:
|
||||
'f4e6fd66-83bb-5f2d-b1ec-a3db2e0ca32d',
|
||||
relationTargetObjectMetadataUniversalIdentifier:
|
||||
'20202020-ab56-4e05-92a3-e2414a499860',
|
||||
type: FieldType.RELATION,
|
||||
universalIdentifier: 'd16a6387-273b-563c-a6cc-2cb4524b9b7b',
|
||||
universalSettings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
{
|
||||
description: 'Recipients tied to the Recipient',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export const defineManifestTests = (appPath: string): void => {
|
||||
expect(manifest.logicFunctions).toHaveLength(6);
|
||||
expect(manifest.frontComponents).toHaveLength(4);
|
||||
expect(manifest.roles).toHaveLength(2);
|
||||
expect(manifest.fields).toHaveLength(27);
|
||||
expect(manifest.fields).toHaveLength(23);
|
||||
expect(manifest.views).toHaveLength(3);
|
||||
expect(manifest.navigationMenuItems).toHaveLength(3);
|
||||
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ describe('getDefaultFieldsInObjectFields', () => {
|
||||
it('should return reverse relation fields for each default relation', () => {
|
||||
const { fields } = getDefaultFieldsInObjectFields(baseObjectConfig);
|
||||
|
||||
expect(fields).toHaveLength(5);
|
||||
expect(fields).toHaveLength(4);
|
||||
|
||||
const fieldNames = fields.map((f) => f.name);
|
||||
|
||||
|
||||
-9
@@ -41,15 +41,6 @@ const DEFAULT_RELATION_CONFIGS = [
|
||||
standardObjectKey: 'timelineActivity',
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
},
|
||||
{
|
||||
...DEFAULT_DEFAULT_RELATION,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
targetIcon: 'IconHeart',
|
||||
targetFieldType: FieldMetadataType.RELATION,
|
||||
standardObjectKey: 'favorite',
|
||||
},
|
||||
{
|
||||
...DEFAULT_DEFAULT_RELATION,
|
||||
fieldName: 'attachments',
|
||||
|
||||
@@ -35,7 +35,6 @@ import { WorkspaceCleanerModule } from 'src/engine/workspace-manager/workspace-c
|
||||
import { CalendarEventParticipantManagerModule } from 'src/modules/calendar/calendar-event-participant-manager/calendar-event-participant-manager.module';
|
||||
import { CalendarModule } from 'src/modules/calendar/calendar.module';
|
||||
import { AutoCompaniesAndContactsCreationJobModule } from 'src/modules/contact-creation-manager/jobs/auto-companies-and-contacts-creation-job.module';
|
||||
import { FavoriteModule } from 'src/modules/favorite/favorite.module';
|
||||
import { MessagingModule } from 'src/modules/messaging/messaging.module';
|
||||
import { TimelineJobModule } from 'src/modules/timeline/jobs/timeline-job.module';
|
||||
import { TimelineActivityModule } from 'src/modules/timeline/timeline-activity.module';
|
||||
@@ -62,7 +61,6 @@ import { WorkflowModule } from 'src/modules/workflow/workflow.module';
|
||||
TimelineJobModule,
|
||||
WebhookJobModule,
|
||||
WorkflowModule,
|
||||
FavoriteModule,
|
||||
NavigationMenuItemModule,
|
||||
SdkClientModule,
|
||||
WorkspaceCleanerModule,
|
||||
|
||||
+1
-5
@@ -26,7 +26,6 @@ import {
|
||||
import { ToolCategory } from 'twenty-shared/ai';
|
||||
import { type ToolDescriptor } from 'src/engine/core-modules/tool-provider/types/tool-descriptor.type';
|
||||
import { type ToolIndexEntry } from 'src/engine/core-modules/tool-provider/types/tool-index-entry.type';
|
||||
import { isFavoriteRelatedObject } from 'src/engine/metadata-modules/ai/ai-agent/utils/is-favorite-related-object.util';
|
||||
import { isWorkflowRelatedObject } from 'src/engine/metadata-modules/ai/ai-agent/utils/is-workflow-related-object.util';
|
||||
import { WorkspaceManyOrAllFlatEntityMapsCacheService } from 'src/engine/metadata-modules/flat-entity/services/workspace-many-or-all-flat-entity-maps-cache.service';
|
||||
import { computePermissionIntersection } from 'src/engine/twenty-orm/utils/compute-permission-intersection.util';
|
||||
@@ -81,10 +80,7 @@ export class DatabaseToolProvider implements ToolProvider {
|
||||
.filter((obj) => obj.isActive);
|
||||
|
||||
for (const flatObject of allFlatObjects) {
|
||||
if (
|
||||
isWorkflowRelatedObject(flatObject) ||
|
||||
isFavoriteRelatedObject(flatObject)
|
||||
) {
|
||||
if (isWorkflowRelatedObject(flatObject)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
|
||||
|
||||
const FAVORITE_STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS = [
|
||||
STANDARD_OBJECTS.favorite.universalIdentifier,
|
||||
STANDARD_OBJECTS.favoriteFolder.universalIdentifier,
|
||||
] as const;
|
||||
|
||||
export const isFavoriteRelatedObject = (objectMetadata: {
|
||||
universalIdentifier: string;
|
||||
}): boolean => {
|
||||
return FAVORITE_STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS.includes(
|
||||
objectMetadata.universalIdentifier as (typeof FAVORITE_STANDARD_OBJECT_UNIVERSAL_IDENTIFIERS)[number],
|
||||
);
|
||||
};
|
||||
-23
@@ -503,29 +503,6 @@ export const COMPANY_FLAT_FIELDS_MOCK = {
|
||||
relationTargetObjectMetadataId: 'e6996bbf-dd41-423a-9324-8546f5b22fa7',
|
||||
universalIdentifier: '20202020-add3-4658-8e23-d70dccb6d0ec',
|
||||
}),
|
||||
favorites: getFlatFieldMetadataMock({
|
||||
id: '72415216-fed4-450b-aa00-691e37718b01',
|
||||
objectMetadataId: '7f5c2c7a-bb23-46fb-b59d-9b7a52a8d1cc',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
defaultValue: null,
|
||||
description: 'Favorites linked to the company',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { relationType: RelationType.ONE_TO_MANY },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '9a11532c-6839-46ed-a2f5-ed03f88b86f6',
|
||||
relationTargetObjectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
universalIdentifier: '20202020-4d1d-41ac-b13b-621631298d55',
|
||||
}),
|
||||
attachments: getFlatFieldMetadataMock({
|
||||
id: '44a572c5-d620-47f5-943a-346ae967e99e',
|
||||
objectMetadataId: '7f5c2c7a-bb23-46fb-b59d-9b7a52a8d1cc',
|
||||
|
||||
-506
@@ -1,506 +0,0 @@
|
||||
import {
|
||||
FieldMetadataType,
|
||||
DateDisplayFormat,
|
||||
RelationOnDeleteAction,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
|
||||
|
||||
import { getFlatFieldMetadataMock } from 'src/engine/metadata-modules/flat-field-metadata/__mocks__/get-flat-field-metadata.mock';
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
|
||||
export const FAVORITE_FLAT_FIELDS_MOCK = {
|
||||
position: getFlatFieldMetadataMock({
|
||||
id: '64dbf3ef-a352-44bb-9055-f95822f18d0a',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.NUMBER,
|
||||
name: 'position',
|
||||
label: 'Position',
|
||||
defaultValue: 0,
|
||||
description: 'Favorite position',
|
||||
icon: 'IconList',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-dd26-42c6-8c3c-2a7598c204f6',
|
||||
}),
|
||||
id: getFlatFieldMetadataMock({
|
||||
id: '49f58497-4e7c-49e6-b3bc-c91d4b8a8ddc',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.UUID,
|
||||
name: 'id',
|
||||
label: 'Id',
|
||||
defaultValue: 'uuid',
|
||||
description: 'Id',
|
||||
icon: 'Icon123',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-eda0-4cee-9577-3eb357e3c22b',
|
||||
}),
|
||||
createdAt: getFlatFieldMetadataMock({
|
||||
id: '0606a76c-8a72-48ca-90c6-526c729c25eb',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
name: 'createdAt',
|
||||
label: 'Creation date',
|
||||
defaultValue: 'now',
|
||||
description: 'Creation date',
|
||||
icon: 'IconCalendar',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-66ac-4502-9975-e4d959c50311',
|
||||
}),
|
||||
updatedAt: getFlatFieldMetadataMock({
|
||||
id: 'fb202982-0c8e-4917-8dda-acb8248be749',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
name: 'updatedAt',
|
||||
label: 'Last update',
|
||||
defaultValue: 'now',
|
||||
description: 'Last time the record was changed',
|
||||
icon: 'IconCalendarClock',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-d767-4622-bdcf-d8a084834d86',
|
||||
}),
|
||||
deletedAt: getFlatFieldMetadataMock({
|
||||
id: 'ef52e151-a974-470f-bbe7-f345fd4eca65',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
name: 'deletedAt',
|
||||
label: 'Deleted at',
|
||||
defaultValue: null,
|
||||
description: 'Date when the record was deleted',
|
||||
icon: 'IconCalendarMinus',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-b9a7-48d8-8387-b9a3090a50ec',
|
||||
}),
|
||||
forWorkspaceMember: getFlatFieldMetadataMock({
|
||||
id: '07f2c3ba-63d1-4e44-bac4-bc4591e51bac',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'forWorkspaceMember',
|
||||
label: 'Workspace Member',
|
||||
defaultValue: null,
|
||||
description: 'Favorite workspace member',
|
||||
icon: 'IconCircleUser',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'forWorkspaceMemberId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: 'a15a4b41-1849-4dea-aa43-f53caad016be',
|
||||
relationTargetObjectMetadataId: '7d8264db-2b55-4b74-81ff-b7064ed43840',
|
||||
universalIdentifier: '20202020-ce63-49cb-9676-fdc0c45892cd',
|
||||
}),
|
||||
person: getFlatFieldMetadataMock({
|
||||
id: '013cec20-e9cc-42db-b9b9-ff6bd0f52abd',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'person',
|
||||
label: 'Person',
|
||||
defaultValue: null,
|
||||
description: 'Favorite person',
|
||||
icon: 'IconUser',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'personId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: 'a1a72bee-1c15-4598-ba23-67ba8e3e505d',
|
||||
relationTargetObjectMetadataId: '843e0b67-9619-4628-91c4-2fa62256a611',
|
||||
universalIdentifier: '20202020-c428-4f40-b6f3-86091511c41c',
|
||||
}),
|
||||
company: getFlatFieldMetadataMock({
|
||||
id: '9a11532c-6839-46ed-a2f5-ed03f88b86f6',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'company',
|
||||
label: 'Company',
|
||||
defaultValue: null,
|
||||
description: 'Favorite company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'companyId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '72415216-fed4-450b-aa00-691e37718b01',
|
||||
relationTargetObjectMetadataId: '7f5c2c7a-bb23-46fb-b59d-9b7a52a8d1cc',
|
||||
universalIdentifier: '20202020-cff5-4682-8bf9-069169e08279',
|
||||
}),
|
||||
favoriteFolder: getFlatFieldMetadataMock({
|
||||
id: 'fabbe669-b8fc-49fe-8010-f13d01eb61f1',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favoriteFolder',
|
||||
label: 'Favorite Folder',
|
||||
defaultValue: null,
|
||||
description: 'The folder this favorite belongs to',
|
||||
icon: 'IconFolder',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'favoriteFolderId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '71b95076-6b8d-45c9-9a7c-ab981b81bd1b',
|
||||
relationTargetObjectMetadataId: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
universalIdentifier: '20202020-f658-4d12-8b4d-248356aa4bd9',
|
||||
}),
|
||||
opportunity: getFlatFieldMetadataMock({
|
||||
id: '6380cf8e-4327-4d1e-ad21-1826ce4ecf05',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'opportunity',
|
||||
label: 'Opportunity',
|
||||
defaultValue: null,
|
||||
description: 'Favorite opportunity',
|
||||
icon: 'IconTargetArrow',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'opportunityId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '87bb9924-a1cc-4357-9c8a-52141dabf266',
|
||||
relationTargetObjectMetadataId: 'e6996bbf-dd41-423a-9324-8546f5b22fa7',
|
||||
universalIdentifier: '20202020-dabc-48e1-8318-2781a2b32aa2',
|
||||
}),
|
||||
workflow: getFlatFieldMetadataMock({
|
||||
id: '12c20527-9b1d-4922-9650-00cc31b26387',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'workflow',
|
||||
label: 'Workflow',
|
||||
defaultValue: null,
|
||||
description: 'Favorite workflow',
|
||||
icon: 'IconSettingsAutomation',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'workflowId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: 'b848abe8-276b-46c9-9eab-baf34d2a0583',
|
||||
relationTargetObjectMetadataId: '664c19a5-0693-45d4-a4e5-76c3717db83c',
|
||||
universalIdentifier: '20202020-b11b-4dc8-999a-6bd0a947b463',
|
||||
}),
|
||||
workflowVersion: getFlatFieldMetadataMock({
|
||||
id: '5cb92f25-c067-4e19-afb3-c7cc038ed1a4',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'workflowVersion',
|
||||
label: 'Workflow',
|
||||
defaultValue: null,
|
||||
description: 'Favorite workflow version',
|
||||
icon: 'IconSettingsAutomation',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'workflowVersionId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: 'ea6b6bda-6ba7-4549-b81a-1f3ced0d4b25',
|
||||
relationTargetObjectMetadataId: '99cf5f27-b41d-4f25-a23b-9e47d27dae9b',
|
||||
universalIdentifier: '20202020-e1b8-4caf-b55a-3ab4d4cbcd21',
|
||||
}),
|
||||
workflowRun: getFlatFieldMetadataMock({
|
||||
id: 'a4bdd0d8-c36f-4519-812b-be4800ab14b0',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'workflowRun',
|
||||
label: 'Workflow',
|
||||
defaultValue: null,
|
||||
description: 'Favorite workflow run',
|
||||
icon: 'IconSettingsAutomation',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'workflowRunId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: '444a6e9e-443d-4f04-a60d-32f76f17049c',
|
||||
relationTargetObjectMetadataId: '06d95e96-b050-443f-946e-dd276d291a2f',
|
||||
universalIdentifier: '20202020-db5a-4fe4-9a13-9afa22b1e762',
|
||||
}),
|
||||
task: getFlatFieldMetadataMock({
|
||||
id: 'db16ab78-ea3f-4b67-93e3-6ad9ab1b7273',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'task',
|
||||
label: 'Task',
|
||||
defaultValue: null,
|
||||
description: 'Favorite task',
|
||||
icon: 'IconCheckbox',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'taskId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '33e4eff0-ff0f-4530-802a-cd630481ee84',
|
||||
relationTargetObjectMetadataId: '3186920d-2a15-4b5f-96c7-2bf6567024b0',
|
||||
universalIdentifier: '20202020-1b1b-4b3b-8b1b-7f8d6a1d7d5c',
|
||||
}),
|
||||
note: getFlatFieldMetadataMock({
|
||||
id: 'a61baf0f-2d43-4fda-9baf-efb000c17ecd',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'note',
|
||||
label: 'Note',
|
||||
defaultValue: null,
|
||||
description: 'Favorite note',
|
||||
icon: 'IconNotes',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'noteId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '065a1ede-f773-48ca-84bf-70f61d838396',
|
||||
relationTargetObjectMetadataId: '1253e3e5-5b00-4a34-93b8-02f3dc6e2b7c',
|
||||
universalIdentifier: '20202020-1f25-43fe-8b00-af212fdde824',
|
||||
}),
|
||||
view: getFlatFieldMetadataMock({
|
||||
id: 'accd216c-790e-4bd2-83bb-0700e06d0e5c',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'view',
|
||||
label: 'View',
|
||||
defaultValue: null,
|
||||
description: 'Favorite view',
|
||||
icon: 'IconLayoutCollage',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'viewId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '90a103ec-7dce-4bd4-aed4-e2c9d46ecf32',
|
||||
relationTargetObjectMetadataId: '8377fc0d-ec1c-4fb5-b6ae-9381d9b22a95',
|
||||
universalIdentifier: '20202020-5a93-4fa9-acce-e73481a0bbdf',
|
||||
}),
|
||||
rocket: getFlatFieldMetadataMock({
|
||||
id: '9448627d-725d-499e-a071-90fd5cfcf0ea',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'rocket',
|
||||
label: 'Rocket',
|
||||
defaultValue: null,
|
||||
description: 'Favorites Rocket',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'rocketId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: '14010360-f3c2-442e-b05f-43c30158f246',
|
||||
relationTargetObjectMetadataId: 'd78ec657-74a4-4652-a350-1f44ff62970a',
|
||||
universalIdentifier: '20202020-78f7-4d7d-86e9-7562ced0b381',
|
||||
}),
|
||||
pet: getFlatFieldMetadataMock({
|
||||
id: 'd34b4048-bf0c-4c61-8ffe-59f1838a2cc4',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'pet',
|
||||
label: 'Pet',
|
||||
defaultValue: null,
|
||||
description: 'Favorites Pet',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'petId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: '80bc4e7a-6bd1-4f2b-98b1-6333c631cc1a',
|
||||
relationTargetObjectMetadataId: 'd34e0f07-1b8c-4de0-938e-599cf05e1f7f',
|
||||
universalIdentifier: '20202020-1bd7-4d10-80dc-968b9f5d1a8a',
|
||||
}),
|
||||
surveyResult: getFlatFieldMetadataMock({
|
||||
id: '9cdfb5a1-bb9c-4a59-811d-f5a1034a8f8b',
|
||||
objectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'surveyResult',
|
||||
label: 'Survey result',
|
||||
defaultValue: null,
|
||||
description: 'Favorites Survey result',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: {
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
joinColumnName: 'surveyResultId',
|
||||
},
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: '8e11aced-3a20-4551-baa1-b38b98a74e1c',
|
||||
relationTargetObjectMetadataId: '713da753-0340-49b5-b1fa-add34d2dc9a8',
|
||||
universalIdentifier: '20202020-d049-4912-80ee-43b09fe3b0ac',
|
||||
}),
|
||||
} as const satisfies Record<string, FlatFieldMetadata>;
|
||||
-170
@@ -1,170 +0,0 @@
|
||||
import { FieldMetadataType, DateDisplayFormat } from 'twenty-shared/types';
|
||||
|
||||
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
|
||||
|
||||
import { getFlatFieldMetadataMock } from 'src/engine/metadata-modules/flat-field-metadata/__mocks__/get-flat-field-metadata.mock';
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
|
||||
export const FAVORITE_FOLDER_FLAT_FIELDS_MOCK = {
|
||||
position: getFlatFieldMetadataMock({
|
||||
id: '5894ab56-99b7-49e8-98be-dd6524250df5',
|
||||
objectMetadataId: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
type: FieldMetadataType.NUMBER,
|
||||
name: 'position',
|
||||
label: 'Position',
|
||||
defaultValue: 0,
|
||||
description: 'Favorite folder position',
|
||||
icon: 'IconList',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-5278-4bde-8909-2cec74d43744',
|
||||
}),
|
||||
name: getFlatFieldMetadataMock({
|
||||
id: '1502abe0-b2f8-43a7-ae55-91c826b34ffe',
|
||||
objectMetadataId: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
type: FieldMetadataType.TEXT,
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
defaultValue: "''",
|
||||
description: 'Name of the favorite folder',
|
||||
icon: 'IconText',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-82a3-4537-8ff0-dbce7eec35d6',
|
||||
}),
|
||||
id: getFlatFieldMetadataMock({
|
||||
id: '85ab1864-0a92-4682-8583-82e8b696410b',
|
||||
objectMetadataId: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
type: FieldMetadataType.UUID,
|
||||
name: 'id',
|
||||
label: 'Id',
|
||||
defaultValue: 'uuid',
|
||||
description: 'Id',
|
||||
icon: 'Icon123',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: null,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-eda0-4cee-9577-3eb357e3c22b',
|
||||
}),
|
||||
createdAt: getFlatFieldMetadataMock({
|
||||
id: 'a92b4b66-c2de-483e-8973-6f12bf36ac1a',
|
||||
objectMetadataId: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
name: 'createdAt',
|
||||
label: 'Creation date',
|
||||
defaultValue: 'now',
|
||||
description: 'Creation date',
|
||||
icon: 'IconCalendar',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-66ac-4502-9975-e4d959c50311',
|
||||
}),
|
||||
updatedAt: getFlatFieldMetadataMock({
|
||||
id: '3907fc24-3bf0-4f0b-88be-f9635e473145',
|
||||
objectMetadataId: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
name: 'updatedAt',
|
||||
label: 'Last update',
|
||||
defaultValue: 'now',
|
||||
description: 'Last time the record was changed',
|
||||
icon: 'IconCalendarClock',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: false,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-d767-4622-bdcf-d8a084834d86',
|
||||
}),
|
||||
deletedAt: getFlatFieldMetadataMock({
|
||||
id: '52dcb335-5ce1-4165-a30b-4a61e84af21f',
|
||||
objectMetadataId: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
name: 'deletedAt',
|
||||
label: 'Deleted at',
|
||||
defaultValue: null,
|
||||
description: 'Date when the record was deleted',
|
||||
icon: 'IconCalendarMinus',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: false,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: null,
|
||||
relationTargetObjectMetadataId: null,
|
||||
universalIdentifier: '20202020-b9a7-48d8-8387-b9a3090a50ec',
|
||||
}),
|
||||
favorites: getFlatFieldMetadataMock({
|
||||
id: '71b95076-6b8d-45c9-9a7c-ab981b81bd1b',
|
||||
objectMetadataId: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
defaultValue: null,
|
||||
description: 'Favorites in this folder',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { relationType: RelationType.ONE_TO_MANY },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: 'fabbe669-b8fc-49fe-8010-f13d01eb61f1',
|
||||
relationTargetObjectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
universalIdentifier: '20202020-b5e3-4b42-8af2-03cd4fd2e4d2',
|
||||
}),
|
||||
} as const satisfies Record<string, FlatFieldMetadata>;
|
||||
-23
@@ -286,27 +286,4 @@ export const NOTE_FLAT_FIELDS_MOCK = {
|
||||
relationTargetObjectMetadataId: '3090f830-c4b1-41a1-8e18-815760830bec',
|
||||
universalIdentifier: '20202020-7030-42f8-929c-1a57b25d6bce',
|
||||
}),
|
||||
favorites: getFlatFieldMetadataMock({
|
||||
id: '065a1ede-f773-48ca-84bf-70f61d838396',
|
||||
objectMetadataId: '1253e3e5-5b00-4a34-93b8-02f3dc6e2b7c',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
defaultValue: null,
|
||||
description: 'Favorites linked to the note',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { relationType: RelationType.ONE_TO_MANY },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: 'a61baf0f-2d43-4fda-9baf-efb000c17ecd',
|
||||
relationTargetObjectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
universalIdentifier: '20202020-4d1d-41ac-b13b-621631298d67',
|
||||
}),
|
||||
} as const satisfies Record<string, FlatFieldMetadata>;
|
||||
|
||||
-23
@@ -357,29 +357,6 @@ export const OPPORTUNITY_FLAT_FIELDS_MOCK = {
|
||||
relationTargetObjectMetadataId: '7f5c2c7a-bb23-46fb-b59d-9b7a52a8d1cc',
|
||||
universalIdentifier: '20202020-cbac-457e-b565-adece5fc815f',
|
||||
}),
|
||||
favorites: getFlatFieldMetadataMock({
|
||||
id: '87bb9924-a1cc-4357-9c8a-52141dabf266',
|
||||
objectMetadataId: 'e6996bbf-dd41-423a-9324-8546f5b22fa7',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
defaultValue: null,
|
||||
description: 'Favorites linked to the opportunity',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { relationType: RelationType.ONE_TO_MANY },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '6380cf8e-4327-4d1e-ad21-1826ce4ecf05',
|
||||
relationTargetObjectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
universalIdentifier: '20202020-a1c2-4500-aaae-83ba8a0e827a',
|
||||
}),
|
||||
taskTargets: getFlatFieldMetadataMock({
|
||||
id: 'c0c9f9ac-0d40-4206-90e5-0d1e14f8a09f',
|
||||
objectMetadataId: 'e6996bbf-dd41-423a-9324-8546f5b22fa7',
|
||||
|
||||
-23
@@ -469,29 +469,6 @@ export const PERSON_FLAT_FIELDS_MOCK = {
|
||||
relationTargetObjectMetadataId: '12e3cb51-c3de-4192-b0d5-965d48d001c0',
|
||||
universalIdentifier: '20202020-c8fc-4258-8250-15905d3fcfec',
|
||||
}),
|
||||
favorites: getFlatFieldMetadataMock({
|
||||
id: 'a1a72bee-1c15-4598-ba23-67ba8e3e505d',
|
||||
objectMetadataId: '843e0b67-9619-4628-91c4-2fa62256a611',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
defaultValue: null,
|
||||
description: 'Favorites linked to the contact',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { relationType: RelationType.ONE_TO_MANY },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: '013cec20-e9cc-42db-b9b9-ff6bd0f52abd',
|
||||
relationTargetObjectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
universalIdentifier: '20202020-4073-4117-9cf1-203bcdc91cbd',
|
||||
}),
|
||||
attachments: getFlatFieldMetadataMock({
|
||||
id: '367ad117-de09-466c-94f8-ce99d951b5ce',
|
||||
objectMetadataId: '843e0b67-9619-4628-91c4-2fa62256a611',
|
||||
|
||||
-23
@@ -213,29 +213,6 @@ export const PET_FLAT_FIELDS_MOCK = {
|
||||
relationTargetObjectMetadataId: '3090f830-c4b1-41a1-8e18-815760830bec',
|
||||
universalIdentifier: '20202020-f1ef-4ba4-8f33-1a4577afa477',
|
||||
}),
|
||||
favorites: getFlatFieldMetadataMock({
|
||||
id: '80bc4e7a-6bd1-4f2b-98b1-6333c631cc1a',
|
||||
objectMetadataId: 'd34e0f07-1b8c-4de0-938e-599cf05e1f7f',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
defaultValue: null,
|
||||
description: 'Favorites tied to the Pet',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { relationType: RelationType.ONE_TO_MANY },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: 'd34b4048-bf0c-4c61-8ffe-59f1838a2cc4',
|
||||
relationTargetObjectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
universalIdentifier: '20202020-a4a7-4686-b296-1c6c3482ee21',
|
||||
}),
|
||||
attachments: getFlatFieldMetadataMock({
|
||||
id: '231903d0-3b14-47ed-9a88-fbf11031c451',
|
||||
objectMetadataId: 'd34e0f07-1b8c-4de0-938e-599cf05e1f7f',
|
||||
|
||||
-23
@@ -190,29 +190,6 @@ export const ROCKET_FLAT_FIELDS_MOCK = {
|
||||
relationTargetObjectMetadataId: '3090f830-c4b1-41a1-8e18-815760830bec',
|
||||
universalIdentifier: '20202020-f1ef-4ba4-8f33-1a4577afa477',
|
||||
}),
|
||||
favorites: getFlatFieldMetadataMock({
|
||||
id: '14010360-f3c2-442e-b05f-43c30158f246',
|
||||
objectMetadataId: 'd78ec657-74a4-4652-a350-1f44ff62970a',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
defaultValue: null,
|
||||
description: 'Favorites tied to the Rocket',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { relationType: RelationType.ONE_TO_MANY },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: false,
|
||||
relationTargetFieldMetadataId: '9448627d-725d-499e-a071-90fd5cfcf0ea',
|
||||
relationTargetObjectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
universalIdentifier: '20202020-a4a7-4686-b296-1c6c3482ee21',
|
||||
}),
|
||||
attachments: getFlatFieldMetadataMock({
|
||||
id: 'f5984acf-5128-42ac-840f-9d2888423699',
|
||||
objectMetadataId: 'd78ec657-74a4-4652-a350-1f44ff62970a',
|
||||
|
||||
-23
@@ -385,27 +385,4 @@ export const TASK_FLAT_FIELDS_MOCK = {
|
||||
relationTargetObjectMetadataId: '3090f830-c4b1-41a1-8e18-815760830bec',
|
||||
universalIdentifier: '20202020-c778-4278-99ee-23a2837aee64',
|
||||
}),
|
||||
favorites: getFlatFieldMetadataMock({
|
||||
id: '33e4eff0-ff0f-4530-802a-cd630481ee84',
|
||||
objectMetadataId: '3186920d-2a15-4b5f-96c7-2bf6567024b0',
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'favorites',
|
||||
label: 'Favorites',
|
||||
defaultValue: null,
|
||||
description: 'Favorites linked to the task',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
options: null,
|
||||
settings: { relationType: RelationType.ONE_TO_MANY },
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUnique: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isLabelSyncedWithName: true,
|
||||
relationTargetFieldMetadataId: 'db16ab78-ea3f-4b67-93e3-6ad9ab1b7273',
|
||||
relationTargetObjectMetadataId: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
universalIdentifier: '20202020-4d1d-41ac-b13b-621631298d65',
|
||||
}),
|
||||
} as const satisfies Record<string, FlatFieldMetadata>;
|
||||
|
||||
-4
@@ -1,7 +1,5 @@
|
||||
import { ATTACHMENT_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/attachment-flat-object.mock';
|
||||
import { COMPANY_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/company-flat-object.mock';
|
||||
import { FAVORITE_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/favorite-flat-object.mock';
|
||||
import { FAVORITE_FOLDER_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/favorite-folder-flat-object.mock';
|
||||
import { NOTE_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/note-flat-object.mock';
|
||||
import { NOTE_TARGET_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/note-target-flat-object.mock';
|
||||
import { OPPORTUNITY_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/opportunity-flat-object.mock';
|
||||
@@ -24,6 +22,4 @@ export const ALL_FLAT_OBJECT_METADATA_MOCKS = [
|
||||
NOTE_FLAT_OBJECT_MOCK,
|
||||
COMPANY_FLAT_OBJECT_MOCK,
|
||||
ATTACHMENT_FLAT_OBJECT_MOCK,
|
||||
FAVORITE_FLAT_OBJECT_MOCK,
|
||||
FAVORITE_FOLDER_FLAT_OBJECT_MOCK,
|
||||
] as const;
|
||||
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
import { getFlatObjectMetadataMock } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/get-flat-object-metadata.mock';
|
||||
|
||||
export const FAVORITE_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
id: 'f4749ffb-dde8-44ff-8b01-d3fc82df0ba2',
|
||||
nameSingular: 'favorite',
|
||||
namePlural: 'favorites',
|
||||
labelSingular: 'Favorite',
|
||||
labelPlural: 'Favorites',
|
||||
description: 'A favorite that can be accessed from the left menu',
|
||||
icon: 'IconHeart',
|
||||
standardOverrides: null,
|
||||
targetTableName: 'DEPRECATED',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isAuditLogged: true,
|
||||
isSearchable: false,
|
||||
shortcut: null,
|
||||
labelIdentifierFieldMetadataId: '49f58497-4e7c-49e6-b3bc-c91d4b8a8ddc',
|
||||
imageIdentifierFieldMetadataId: null,
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-ab56-4e05-92a3-e2414a499860',
|
||||
});
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
import { getFlatObjectMetadataMock } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/get-flat-object-metadata.mock';
|
||||
|
||||
export const FAVORITE_FOLDER_FLAT_OBJECT_MOCK = getFlatObjectMetadataMock({
|
||||
id: '35763b74-1abe-4c4b-9eab-27693f0ee06d',
|
||||
nameSingular: 'favoriteFolder',
|
||||
namePlural: 'favoriteFolders',
|
||||
labelSingular: 'Favorite Folder',
|
||||
labelPlural: 'Favorite Folders',
|
||||
description: 'A Folder of favorites',
|
||||
icon: 'IconFolder',
|
||||
standardOverrides: null,
|
||||
targetTableName: 'DEPRECATED',
|
||||
isCustom: false,
|
||||
isRemote: false,
|
||||
isActive: true,
|
||||
isSystem: true,
|
||||
isAuditLogged: true,
|
||||
isSearchable: false,
|
||||
shortcut: null,
|
||||
labelIdentifierFieldMetadataId: '85ab1864-0a92-4682-8583-82e8b696410b',
|
||||
imageIdentifierFieldMetadataId: null,
|
||||
isLabelSyncedWithName: false,
|
||||
workspaceId: '20202020-1c25-4d02-bf25-6aeccf7ea419',
|
||||
universalIdentifier: '20202020-7cf8-401f-8211-a9587d27fd2d',
|
||||
});
|
||||
-4
@@ -1,6 +1,4 @@
|
||||
import { ATTACHMENT_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/attachment-flat-object.mock';
|
||||
import { FAVORITE_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/favorite-flat-object.mock';
|
||||
import { FAVORITE_FOLDER_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/favorite-folder-flat-object.mock';
|
||||
import { NOTE_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/note-flat-object.mock';
|
||||
import { NOTE_TARGET_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/note-target-flat-object.mock';
|
||||
import { TASK_TARGET_FLAT_OBJECT_MOCK } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/task-target-flat-object.mock';
|
||||
@@ -10,8 +8,6 @@ export const STANDARD_RELATION_TARGET_FLAT_OBJECT_METADATA_MOCKS = [
|
||||
NOTE_FLAT_OBJECT_MOCK,
|
||||
TIMELINE_ACTIVITY_FLAT_OBJECT_MOCK,
|
||||
NOTE_TARGET_FLAT_OBJECT_MOCK,
|
||||
FAVORITE_FLAT_OBJECT_MOCK,
|
||||
ATTACHMENT_FLAT_OBJECT_MOCK,
|
||||
TASK_TARGET_FLAT_OBJECT_MOCK,
|
||||
FAVORITE_FOLDER_FLAT_OBJECT_MOCK,
|
||||
] as const;
|
||||
|
||||
-1
@@ -24,7 +24,6 @@ import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/w
|
||||
const morphIdByRelationObjectNameSingular = {
|
||||
timelineActivity:
|
||||
STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
favorite: null,
|
||||
attachment: STANDARD_OBJECTS.attachment.morphIds.targetMorphId.morphId,
|
||||
noteTarget: STANDARD_OBJECTS.noteTarget.morphIds.targetMorphId.morphId,
|
||||
taskTarget: STANDARD_OBJECTS.taskTarget.morphIds.targetMorphId.morphId,
|
||||
|
||||
@@ -4,7 +4,6 @@ import { DEFAULT_LABEL_IDENTIFIER_FIELD_NAME } from 'src/engine/metadata-modules
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
|
||||
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
|
||||
import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-objects/task-target.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
@@ -22,7 +21,6 @@ export class CustomWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
updatedBy: ActorMetadata;
|
||||
noteTargets: NoteTargetWorkspaceEntity[];
|
||||
taskTargets: TaskTargetWorkspaceEntity[];
|
||||
favorites: FavoriteWorkspaceEntity[];
|
||||
attachments: AttachmentWorkspaceEntity[];
|
||||
timelineActivities: TimelineActivityWorkspaceEntity[];
|
||||
searchVector: string;
|
||||
|
||||
-4
@@ -6,8 +6,6 @@ import {
|
||||
STANDARD_COMPANY_PAGE_LAYOUT_CONFIG,
|
||||
STANDARD_CONNECTED_ACCOUNT_PAGE_LAYOUT_CONFIG,
|
||||
STANDARD_DASHBOARD_PAGE_LAYOUT_CONFIG,
|
||||
STANDARD_FAVORITE_FOLDER_PAGE_LAYOUT_CONFIG,
|
||||
STANDARD_FAVORITE_PAGE_LAYOUT_CONFIG,
|
||||
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG,
|
||||
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG,
|
||||
STANDARD_MESSAGE_CHANNEL_PAGE_LAYOUT_CONFIG,
|
||||
@@ -35,8 +33,6 @@ export const STANDARD_PAGE_LAYOUTS = {
|
||||
STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG,
|
||||
companyRecordPage: STANDARD_COMPANY_PAGE_LAYOUT_CONFIG,
|
||||
connectedAccountRecordPage: STANDARD_CONNECTED_ACCOUNT_PAGE_LAYOUT_CONFIG,
|
||||
favoriteRecordPage: STANDARD_FAVORITE_PAGE_LAYOUT_CONFIG,
|
||||
favoriteFolderRecordPage: STANDARD_FAVORITE_FOLDER_PAGE_LAYOUT_CONFIG,
|
||||
messageChannelRecordPage: STANDARD_MESSAGE_CHANNEL_PAGE_LAYOUT_CONFIG,
|
||||
messageChannelMessageAssociationRecordPage:
|
||||
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG,
|
||||
|
||||
+993
-1259
File diff suppressed because it is too large
Load Diff
+209
-251
@@ -174,91 +174,7 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
|
||||
},
|
||||
},
|
||||
},
|
||||
"favoriteFolderRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000058",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000059",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000060",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000061",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000062",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"favoriteRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000053",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000054",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000055",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000056",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000057",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"messageChannelMessageAssociationMessageFolderRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000073",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000074",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000075",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000076",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000077",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"messageChannelMessageAssociationRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000068",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000069",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000070",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000071",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000072",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"messageChannelRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000063",
|
||||
"tabs": {
|
||||
"home": {
|
||||
@@ -279,56 +195,98 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
|
||||
},
|
||||
},
|
||||
},
|
||||
"messageFolderRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000078",
|
||||
"messageChannelMessageAssociationRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000058",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000079",
|
||||
"id": "00000000-0000-0000-0000-000000000059",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000080",
|
||||
"id": "00000000-0000-0000-0000-000000000060",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000081",
|
||||
"id": "00000000-0000-0000-0000-000000000061",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000082",
|
||||
"id": "00000000-0000-0000-0000-000000000062",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"messageChannelRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000053",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000054",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000055",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000056",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000057",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"messageFolderRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000068",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000069",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000070",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000071",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000072",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"messageParticipantRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000083",
|
||||
"id": "00000000-0000-0000-0000-000000000073",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000084",
|
||||
"id": "00000000-0000-0000-0000-000000000074",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000085",
|
||||
"id": "00000000-0000-0000-0000-000000000075",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000086",
|
||||
"id": "00000000-0000-0000-0000-000000000076",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000087",
|
||||
"id": "00000000-0000-0000-0000-000000000077",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"messageThreadRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000088",
|
||||
"id": "00000000-0000-0000-0000-000000000078",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000089",
|
||||
"id": "00000000-0000-0000-0000-000000000079",
|
||||
"widgets": {
|
||||
"emailThread": {
|
||||
"id": "00000000-0000-0000-0000-000000000090",
|
||||
"id": "00000000-0000-0000-0000-000000000080",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -369,32 +327,102 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
|
||||
},
|
||||
},
|
||||
"noteRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000091",
|
||||
"id": "00000000-0000-0000-0000-000000000081",
|
||||
"tabs": {
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000099",
|
||||
"id": "00000000-0000-0000-0000-000000000089",
|
||||
"widgets": {
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000100",
|
||||
"id": "00000000-0000-0000-0000-000000000090",
|
||||
},
|
||||
},
|
||||
},
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000082",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000083",
|
||||
},
|
||||
"noteRichText": {
|
||||
"id": "00000000-0000-0000-0000-000000000084",
|
||||
},
|
||||
},
|
||||
},
|
||||
"note": {
|
||||
"id": "00000000-0000-0000-0000-000000000085",
|
||||
"widgets": {
|
||||
"noteRichText": {
|
||||
"id": "00000000-0000-0000-0000-000000000086",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000087",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000088",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"opportunityRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000091",
|
||||
"tabs": {
|
||||
"calendar": {
|
||||
"id": "00000000-0000-0000-0000-000000000107",
|
||||
"widgets": {
|
||||
"calendar": {
|
||||
"id": "00000000-0000-0000-0000-000000000108",
|
||||
},
|
||||
},
|
||||
},
|
||||
"emails": {
|
||||
"id": "00000000-0000-0000-0000-000000000105",
|
||||
"widgets": {
|
||||
"emails": {
|
||||
"id": "00000000-0000-0000-0000-000000000106",
|
||||
},
|
||||
},
|
||||
},
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000103",
|
||||
"widgets": {
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000104",
|
||||
},
|
||||
},
|
||||
},
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000092",
|
||||
"widgets": {
|
||||
"company": {
|
||||
"id": "00000000-0000-0000-0000-000000000095",
|
||||
},
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000093",
|
||||
},
|
||||
"noteRichText": {
|
||||
"owner": {
|
||||
"id": "00000000-0000-0000-0000-000000000096",
|
||||
},
|
||||
"pointOfContact": {
|
||||
"id": "00000000-0000-0000-0000-000000000094",
|
||||
},
|
||||
},
|
||||
},
|
||||
"note": {
|
||||
"id": "00000000-0000-0000-0000-000000000095",
|
||||
"notes": {
|
||||
"id": "00000000-0000-0000-0000-000000000101",
|
||||
"widgets": {
|
||||
"noteRichText": {
|
||||
"id": "00000000-0000-0000-0000-000000000096",
|
||||
"notes": {
|
||||
"id": "00000000-0000-0000-0000-000000000102",
|
||||
},
|
||||
},
|
||||
},
|
||||
"tasks": {
|
||||
"id": "00000000-0000-0000-0000-000000000099",
|
||||
"widgets": {
|
||||
"tasks": {
|
||||
"id": "00000000-0000-0000-0000-000000000100",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -408,169 +436,120 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
|
||||
},
|
||||
},
|
||||
},
|
||||
"opportunityRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000101",
|
||||
"tabs": {
|
||||
"calendar": {
|
||||
"id": "00000000-0000-0000-0000-000000000117",
|
||||
"widgets": {
|
||||
"calendar": {
|
||||
"id": "00000000-0000-0000-0000-000000000118",
|
||||
},
|
||||
},
|
||||
},
|
||||
"emails": {
|
||||
"id": "00000000-0000-0000-0000-000000000115",
|
||||
"widgets": {
|
||||
"emails": {
|
||||
"id": "00000000-0000-0000-0000-000000000116",
|
||||
},
|
||||
},
|
||||
},
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000113",
|
||||
"widgets": {
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000114",
|
||||
},
|
||||
},
|
||||
},
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000102",
|
||||
"widgets": {
|
||||
"company": {
|
||||
"id": "00000000-0000-0000-0000-000000000105",
|
||||
},
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000103",
|
||||
},
|
||||
"owner": {
|
||||
"id": "00000000-0000-0000-0000-000000000106",
|
||||
},
|
||||
"pointOfContact": {
|
||||
"id": "00000000-0000-0000-0000-000000000104",
|
||||
},
|
||||
},
|
||||
},
|
||||
"notes": {
|
||||
"id": "00000000-0000-0000-0000-000000000111",
|
||||
"widgets": {
|
||||
"notes": {
|
||||
"id": "00000000-0000-0000-0000-000000000112",
|
||||
},
|
||||
},
|
||||
},
|
||||
"tasks": {
|
||||
"id": "00000000-0000-0000-0000-000000000109",
|
||||
"widgets": {
|
||||
"tasks": {
|
||||
"id": "00000000-0000-0000-0000-000000000110",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000107",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000108",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"personRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000119",
|
||||
"id": "00000000-0000-0000-0000-000000000109",
|
||||
"tabs": {
|
||||
"calendar": {
|
||||
"id": "00000000-0000-0000-0000-000000000134",
|
||||
"id": "00000000-0000-0000-0000-000000000124",
|
||||
"widgets": {
|
||||
"calendar": {
|
||||
"id": "00000000-0000-0000-0000-000000000135",
|
||||
"id": "00000000-0000-0000-0000-000000000125",
|
||||
},
|
||||
},
|
||||
},
|
||||
"emails": {
|
||||
"id": "00000000-0000-0000-0000-000000000132",
|
||||
"id": "00000000-0000-0000-0000-000000000122",
|
||||
"widgets": {
|
||||
"emails": {
|
||||
"id": "00000000-0000-0000-0000-000000000133",
|
||||
},
|
||||
},
|
||||
},
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000130",
|
||||
"widgets": {
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000131",
|
||||
},
|
||||
},
|
||||
},
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000120",
|
||||
"widgets": {
|
||||
"company": {
|
||||
"id": "00000000-0000-0000-0000-000000000122",
|
||||
},
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000121",
|
||||
},
|
||||
"pointOfContactForOpportunities": {
|
||||
"id": "00000000-0000-0000-0000-000000000123",
|
||||
},
|
||||
},
|
||||
},
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000120",
|
||||
"widgets": {
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000121",
|
||||
},
|
||||
},
|
||||
},
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000110",
|
||||
"widgets": {
|
||||
"company": {
|
||||
"id": "00000000-0000-0000-0000-000000000112",
|
||||
},
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000111",
|
||||
},
|
||||
"pointOfContactForOpportunities": {
|
||||
"id": "00000000-0000-0000-0000-000000000113",
|
||||
},
|
||||
},
|
||||
},
|
||||
"notes": {
|
||||
"id": "00000000-0000-0000-0000-000000000128",
|
||||
"id": "00000000-0000-0000-0000-000000000118",
|
||||
"widgets": {
|
||||
"notes": {
|
||||
"id": "00000000-0000-0000-0000-000000000129",
|
||||
"id": "00000000-0000-0000-0000-000000000119",
|
||||
},
|
||||
},
|
||||
},
|
||||
"tasks": {
|
||||
"id": "00000000-0000-0000-0000-000000000126",
|
||||
"id": "00000000-0000-0000-0000-000000000116",
|
||||
"widgets": {
|
||||
"tasks": {
|
||||
"id": "00000000-0000-0000-0000-000000000127",
|
||||
"id": "00000000-0000-0000-0000-000000000117",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000124",
|
||||
"id": "00000000-0000-0000-0000-000000000114",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000125",
|
||||
"id": "00000000-0000-0000-0000-000000000115",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"taskRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000136",
|
||||
"id": "00000000-0000-0000-0000-000000000126",
|
||||
"tabs": {
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000144",
|
||||
"id": "00000000-0000-0000-0000-000000000134",
|
||||
"widgets": {
|
||||
"files": {
|
||||
"id": "00000000-0000-0000-0000-000000000145",
|
||||
"id": "00000000-0000-0000-0000-000000000135",
|
||||
},
|
||||
},
|
||||
},
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000137",
|
||||
"id": "00000000-0000-0000-0000-000000000127",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000138",
|
||||
"id": "00000000-0000-0000-0000-000000000128",
|
||||
},
|
||||
"taskRichText": {
|
||||
"id": "00000000-0000-0000-0000-000000000139",
|
||||
"id": "00000000-0000-0000-0000-000000000129",
|
||||
},
|
||||
},
|
||||
},
|
||||
"note": {
|
||||
"id": "00000000-0000-0000-0000-000000000140",
|
||||
"id": "00000000-0000-0000-0000-000000000130",
|
||||
"widgets": {
|
||||
"taskRichText": {
|
||||
"id": "00000000-0000-0000-0000-000000000131",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000132",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000133",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"workflowAutomatedTriggerRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000139",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000140",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000141",
|
||||
},
|
||||
},
|
||||
@@ -585,83 +564,62 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
|
||||
},
|
||||
},
|
||||
},
|
||||
"workflowAutomatedTriggerRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000149",
|
||||
"tabs": {
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000150",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000151",
|
||||
},
|
||||
},
|
||||
},
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000152",
|
||||
"widgets": {
|
||||
"timeline": {
|
||||
"id": "00000000-0000-0000-0000-000000000153",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"workflowRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000146",
|
||||
"id": "00000000-0000-0000-0000-000000000136",
|
||||
"tabs": {
|
||||
"flow": {
|
||||
"id": "00000000-0000-0000-0000-000000000147",
|
||||
"id": "00000000-0000-0000-0000-000000000137",
|
||||
"widgets": {
|
||||
"workflow": {
|
||||
"id": "00000000-0000-0000-0000-000000000148",
|
||||
"id": "00000000-0000-0000-0000-000000000138",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"workflowRunRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000160",
|
||||
"id": "00000000-0000-0000-0000-000000000150",
|
||||
"tabs": {
|
||||
"flow": {
|
||||
"id": "00000000-0000-0000-0000-000000000164",
|
||||
"id": "00000000-0000-0000-0000-000000000154",
|
||||
"widgets": {
|
||||
"workflowRun": {
|
||||
"id": "00000000-0000-0000-0000-000000000165",
|
||||
"id": "00000000-0000-0000-0000-000000000155",
|
||||
},
|
||||
},
|
||||
},
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000161",
|
||||
"id": "00000000-0000-0000-0000-000000000151",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000162",
|
||||
"id": "00000000-0000-0000-0000-000000000152",
|
||||
},
|
||||
"workflow": {
|
||||
"id": "00000000-0000-0000-0000-000000000163",
|
||||
"id": "00000000-0000-0000-0000-000000000153",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"workflowVersionRecordPage": {
|
||||
"id": "00000000-0000-0000-0000-000000000154",
|
||||
"id": "00000000-0000-0000-0000-000000000144",
|
||||
"tabs": {
|
||||
"flow": {
|
||||
"id": "00000000-0000-0000-0000-000000000158",
|
||||
"id": "00000000-0000-0000-0000-000000000148",
|
||||
"widgets": {
|
||||
"workflowVersion": {
|
||||
"id": "00000000-0000-0000-0000-000000000159",
|
||||
"id": "00000000-0000-0000-0000-000000000149",
|
||||
},
|
||||
},
|
||||
},
|
||||
"home": {
|
||||
"id": "00000000-0000-0000-0000-000000000155",
|
||||
"id": "00000000-0000-0000-0000-000000000145",
|
||||
"widgets": {
|
||||
"fields": {
|
||||
"id": "00000000-0000-0000-0000-000000000156",
|
||||
"id": "00000000-0000-0000-0000-000000000146",
|
||||
},
|
||||
"workflow": {
|
||||
"id": "00000000-0000-0000-0000-000000000157",
|
||||
"id": "00000000-0000-0000-0000-000000000147",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-4
@@ -14,8 +14,6 @@ import { buildCalendarEventStandardFlatFieldMetadatas } from 'src/engine/workspa
|
||||
import { buildCompanyStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-company-standard-flat-field-metadata.util';
|
||||
import { buildConnectedAccountStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-connected-account-standard-flat-field-metadata.util';
|
||||
import { buildDashboardStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-dashboard-standard-flat-field-metadata.util';
|
||||
import { buildFavoriteFolderStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-folder-standard-flat-field-metadata.util';
|
||||
import { buildFavoriteStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-favorite-standard-flat-field-metadata.util';
|
||||
import { buildMessageChannelMessageAssociationMessageFolderStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-message-association-message-folder-standard-flat-field-metadata.util';
|
||||
import { buildMessageChannelStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-standard-flat-field-metadata.util';
|
||||
import { buildMessageChannelMessageAssociationStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-message-association-standard-flat-field-metadata.util';
|
||||
@@ -53,8 +51,6 @@ const STANDARD_FLAT_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
company: buildCompanyStandardFlatFieldMetadatas,
|
||||
connectedAccount: buildConnectedAccountStandardFlatFieldMetadatas,
|
||||
dashboard: buildDashboardStandardFlatFieldMetadatas,
|
||||
favorite: buildFavoriteStandardFlatFieldMetadatas,
|
||||
favoriteFolder: buildFavoriteFolderStandardFlatFieldMetadatas,
|
||||
message: buildMessageStandardFlatFieldMetadatas,
|
||||
messageChannel: buildMessageChannelStandardFlatFieldMetadatas,
|
||||
messageChannelMessageAssociation:
|
||||
|
||||
-22
@@ -461,28 +461,6 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the company`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'company',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
attachments: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-22
@@ -254,28 +254,6 @@ export const buildDashboardStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the dashboard`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: false,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'dashboard',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
attachments: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-246
@@ -1,246 +0,0 @@
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { i18nLabel } from 'src/engine/workspace-manager/twenty-standard-application/utils/i18n-label.util';
|
||||
import {
|
||||
DateDisplayFormat,
|
||||
FieldMetadataType,
|
||||
RelationType,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardFieldArgs,
|
||||
createStandardFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { SEARCH_FIELDS_FOR_FAVORITE_FOLDER } from 'src/modules/favorite-folder/standard-objects/favorite-folder.workspace-entity';
|
||||
|
||||
export const buildFavoriteFolderStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardFieldArgs<'favoriteFolder', FieldMetadataType>,
|
||||
'context'
|
||||
>): Record<
|
||||
AllStandardObjectFieldName<'favoriteFolder'>,
|
||||
FlatFieldMetadata
|
||||
> => ({
|
||||
// Base fields from BaseWorkspaceEntity
|
||||
id: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'id',
|
||||
type: FieldMetadataType.UUID,
|
||||
label: i18nLabel(msg`Id`),
|
||||
description: i18nLabel(msg`Id`),
|
||||
icon: 'Icon123',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: 'uuid',
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
createdAt: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'createdAt',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: i18nLabel(msg`Creation date`),
|
||||
description: i18nLabel(msg`Creation date`),
|
||||
icon: 'IconCalendar',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: 'now',
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
updatedAt: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'updatedAt',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: i18nLabel(msg`Last update`),
|
||||
description: i18nLabel(msg`Last time the record was changed`),
|
||||
icon: 'IconCalendarClock',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: 'now',
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
deletedAt: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'deletedAt',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: i18nLabel(msg`Deleted at`),
|
||||
description: i18nLabel(msg`Date when the record was deleted`),
|
||||
icon: 'IconCalendarMinus',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
createdBy: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'createdBy',
|
||||
type: FieldMetadataType.ACTOR,
|
||||
label: i18nLabel(msg`Created by`),
|
||||
description: i18nLabel(msg`The creator of the record`),
|
||||
icon: 'IconCreativeCommonsSa',
|
||||
isSystem: true,
|
||||
isUIReadOnly: true,
|
||||
isNullable: false,
|
||||
defaultValue: {
|
||||
source: "'MANUAL'",
|
||||
name: "'System'",
|
||||
workspaceMemberId: null,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
updatedBy: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'updatedBy',
|
||||
type: FieldMetadataType.ACTOR,
|
||||
label: i18nLabel(msg`Updated by`),
|
||||
description: i18nLabel(
|
||||
msg`The workspace member who last updated the record`,
|
||||
),
|
||||
icon: 'IconUserCircle',
|
||||
isSystem: true,
|
||||
isUIReadOnly: true,
|
||||
isNullable: false,
|
||||
defaultValue: {
|
||||
source: "'MANUAL'",
|
||||
name: "'System'",
|
||||
workspaceMemberId: null,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
|
||||
// FavoriteFolder-specific fields
|
||||
position: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'position',
|
||||
type: FieldMetadataType.POSITION,
|
||||
label: i18nLabel(msg`Position`),
|
||||
description: i18nLabel(msg`Favorite folder position`),
|
||||
icon: 'IconHierarchy2',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: 0,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
searchVector: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'searchVector',
|
||||
type: FieldMetadataType.TS_VECTOR,
|
||||
label: i18nLabel(msg`Search vector`),
|
||||
description: i18nLabel(msg`Field used for full-text search`),
|
||||
icon: 'IconUser',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields(
|
||||
SEARCH_FIELDS_FOR_FAVORITE_FOLDER,
|
||||
),
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
name: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'name',
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: i18nLabel(msg`Name`),
|
||||
description: i18nLabel(msg`Name of the favorite folder`),
|
||||
icon: 'IconText',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
|
||||
// Relation fields
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites in this folder`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'favoriteFolder',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
-495
@@ -1,495 +0,0 @@
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { i18nLabel } from 'src/engine/workspace-manager/twenty-standard-application/utils/i18n-label.util';
|
||||
import {
|
||||
DateDisplayFormat,
|
||||
FieldMetadataType,
|
||||
RelationOnDeleteAction,
|
||||
RelationType,
|
||||
} from 'twenty-shared/types';
|
||||
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
|
||||
import {
|
||||
type CreateStandardFieldArgs,
|
||||
createStandardFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
|
||||
export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<
|
||||
CreateStandardFieldArgs<'favorite', FieldMetadataType>,
|
||||
'context'
|
||||
>): Record<AllStandardObjectFieldName<'favorite'>, FlatFieldMetadata> => ({
|
||||
// Base fields from BaseWorkspaceEntity
|
||||
id: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'id',
|
||||
type: FieldMetadataType.UUID,
|
||||
label: i18nLabel(msg`Id`),
|
||||
description: i18nLabel(msg`Id`),
|
||||
icon: 'Icon123',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: 'uuid',
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
createdAt: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'createdAt',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: i18nLabel(msg`Creation date`),
|
||||
description: i18nLabel(msg`Creation date`),
|
||||
icon: 'IconCalendar',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: 'now',
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
updatedAt: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'updatedAt',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: i18nLabel(msg`Last update`),
|
||||
description: i18nLabel(msg`Last time the record was changed`),
|
||||
icon: 'IconCalendarClock',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: 'now',
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
deletedAt: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'deletedAt',
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: i18nLabel(msg`Deleted at`),
|
||||
description: i18nLabel(msg`Date when the record was deleted`),
|
||||
icon: 'IconCalendarMinus',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
settings: { displayFormat: DateDisplayFormat.RELATIVE },
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
createdBy: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'createdBy',
|
||||
type: FieldMetadataType.ACTOR,
|
||||
label: i18nLabel(msg`Created by`),
|
||||
description: i18nLabel(msg`The creator of the record`),
|
||||
icon: 'IconCreativeCommonsSa',
|
||||
isSystem: true,
|
||||
isUIReadOnly: true,
|
||||
isNullable: false,
|
||||
defaultValue: {
|
||||
source: "'MANUAL'",
|
||||
name: "'System'",
|
||||
workspaceMemberId: null,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
updatedBy: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'updatedBy',
|
||||
type: FieldMetadataType.ACTOR,
|
||||
label: i18nLabel(msg`Updated by`),
|
||||
description: i18nLabel(
|
||||
msg`The workspace member who last updated the record`,
|
||||
),
|
||||
icon: 'IconUserCircle',
|
||||
isSystem: true,
|
||||
isUIReadOnly: true,
|
||||
isNullable: false,
|
||||
defaultValue: {
|
||||
source: "'MANUAL'",
|
||||
name: "'System'",
|
||||
workspaceMemberId: null,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
|
||||
// Favorite-specific fields
|
||||
position: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'position',
|
||||
type: FieldMetadataType.POSITION,
|
||||
label: i18nLabel(msg`Position`),
|
||||
description: i18nLabel(msg`Favorite position`),
|
||||
icon: 'IconHierarchy2',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: 0,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
searchVector: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'searchVector',
|
||||
type: FieldMetadataType.TS_VECTOR,
|
||||
label: i18nLabel(msg`Search vector`),
|
||||
description: i18nLabel(msg`Field used for full-text search`),
|
||||
icon: 'IconUser',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
settings: {
|
||||
generatedType: 'STORED',
|
||||
asExpression: getTsVectorColumnExpressionFromFields([
|
||||
{ name: 'id', type: FieldMetadataType.UUID },
|
||||
]),
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
viewId: createStandardFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'viewId',
|
||||
type: FieldMetadataType.UUID,
|
||||
label: i18nLabel(msg`ViewId`),
|
||||
description: i18nLabel(msg`ViewId`),
|
||||
icon: 'IconView',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
|
||||
// Relation fields
|
||||
forWorkspaceMember: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'forWorkspaceMember',
|
||||
label: i18nLabel(msg`Workspace Member`),
|
||||
description: i18nLabel(msg`Favorite workspace member`),
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'workspaceMember',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'forWorkspaceMemberId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
person: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'person',
|
||||
label: i18nLabel(msg`Person`),
|
||||
description: i18nLabel(msg`Favorite person`),
|
||||
icon: 'IconUser',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'person',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'personId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
company: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'company',
|
||||
label: i18nLabel(msg`Company`),
|
||||
description: i18nLabel(msg`Favorite company`),
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'company',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'companyId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
opportunity: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'opportunity',
|
||||
label: i18nLabel(msg`Opportunity`),
|
||||
description: i18nLabel(msg`Favorite opportunity`),
|
||||
icon: 'IconTargetArrow',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'opportunity',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'opportunityId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
workflow: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflow',
|
||||
label: i18nLabel(msg`Workflow`),
|
||||
description: i18nLabel(msg`Favorite workflow`),
|
||||
icon: 'IconSettingsAutomation',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'workflow',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'workflowId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
workflowVersion: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflowVersion',
|
||||
label: i18nLabel(msg`Workflow`),
|
||||
description: i18nLabel(msg`Favorite workflow version`),
|
||||
icon: 'IconSettingsAutomation',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'workflowVersion',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'workflowVersionId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
workflowRun: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflowRun',
|
||||
label: i18nLabel(msg`Workflow`),
|
||||
description: i18nLabel(msg`Favorite workflow run`),
|
||||
icon: 'IconSettingsAutomation',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'workflowRun',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'workflowRunId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
task: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'task',
|
||||
label: i18nLabel(msg`Task`),
|
||||
description: i18nLabel(msg`Favorite task`),
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'task',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'taskId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
note: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'note',
|
||||
label: i18nLabel(msg`Note`),
|
||||
description: i18nLabel(msg`Favorite note`),
|
||||
icon: 'IconNotes',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'note',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'noteId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
dashboard: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'dashboard',
|
||||
label: i18nLabel(msg`Dashboard`),
|
||||
description: i18nLabel(msg`Favorite dashboard`),
|
||||
icon: 'IconLayoutDashboard',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'dashboard',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'dashboardId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favoriteFolder: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favoriteFolder',
|
||||
label: i18nLabel(msg`Favorite Folder`),
|
||||
description: i18nLabel(msg`The folder this favorite belongs to`),
|
||||
icon: 'IconFolder',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'favoriteFolder',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||
joinColumnName: 'favoriteFolderId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
-22
@@ -303,26 +303,4 @@ export const buildNoteStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the note`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: false,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'note',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
|
||||
-22
@@ -356,28 +356,6 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the opportunity`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'opportunity',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
taskTargets: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-22
@@ -434,28 +434,6 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the contact`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'person',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
attachments: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-22
@@ -384,26 +384,4 @@ export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the task`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: false,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'task',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
|
||||
-23
@@ -401,29 +401,6 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the workflow run`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'workflowRun',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
timelineActivities: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-22
@@ -340,28 +340,6 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the workflow`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: false,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'workflow',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
timelineActivities: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-23
@@ -347,29 +347,6 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the workflow version`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'workflowVersion',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
timelineActivities: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-23
@@ -476,29 +476,6 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorites: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`Favorites linked to the workspace member`),
|
||||
icon: 'IconHeart',
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'favorite',
|
||||
targetFieldName: 'forWorkspaceMember',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
accountOwnerForCompanies: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
|
||||
-2
@@ -11,7 +11,6 @@ import { buildCalendarEventParticipantStandardFlatIndexMetadatas } from 'src/eng
|
||||
import { buildCompanyStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-company-standard-flat-index-metadata.util';
|
||||
import { buildConnectedAccountStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-connected-account-standard-flat-index-metadata.util';
|
||||
import { buildDashboardStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-dashboard-standard-flat-index-metadata.util';
|
||||
import { buildFavoriteStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-favorite-standard-flat-index-metadata.util';
|
||||
import { buildMessageChannelMessageAssociationMessageFolderStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-message-association-message-folder-standard-flat-index-metadata.util';
|
||||
import { buildMessageChannelMessageAssociationStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-message-association-standard-flat-index-metadata.util';
|
||||
import { buildMessageChannelStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-standard-flat-index-metadata.util';
|
||||
@@ -47,7 +46,6 @@ const STANDARD_FLAT_INDEX_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
company: buildCompanyStandardFlatIndexMetadatas,
|
||||
connectedAccount: buildConnectedAccountStandardFlatIndexMetadatas,
|
||||
dashboard: buildDashboardStandardFlatIndexMetadatas,
|
||||
favorite: buildFavoriteStandardFlatIndexMetadatas,
|
||||
message: buildMessageStandardFlatIndexMetadatas,
|
||||
messageChannel: buildMessageChannelStandardFlatIndexMetadatas,
|
||||
messageChannelMessageAssociation:
|
||||
|
||||
-151
@@ -1,151 +0,0 @@
|
||||
import { type FlatIndexMetadata } from 'src/engine/metadata-modules/flat-index-metadata/types/flat-index-metadata.type';
|
||||
import { type AllStandardObjectIndexName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-index-name.type';
|
||||
import {
|
||||
type CreateStandardIndexArgs,
|
||||
createStandardIndexFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/index/create-standard-index-flat-metadata.util';
|
||||
|
||||
export const buildFavoriteStandardFlatIndexMetadatas = ({
|
||||
now,
|
||||
objectName,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
}: Omit<CreateStandardIndexArgs<'favorite'>, 'context'>): Record<
|
||||
AllStandardObjectIndexName<'favorite'>,
|
||||
FlatIndexMetadata
|
||||
> => ({
|
||||
forWorkspaceMemberIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'forWorkspaceMemberIdIndex',
|
||||
relatedFieldNames: ['forWorkspaceMember'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
personIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'personIdIndex',
|
||||
relatedFieldNames: ['person'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
companyIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'companyIdIndex',
|
||||
relatedFieldNames: ['company'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favoriteFolderIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'favoriteFolderIdIndex',
|
||||
relatedFieldNames: ['favoriteFolder'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
opportunityIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'opportunityIdIndex',
|
||||
relatedFieldNames: ['opportunity'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
workflowIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'workflowIdIndex',
|
||||
relatedFieldNames: ['workflow'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
workflowVersionIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'workflowVersionIdIndex',
|
||||
relatedFieldNames: ['workflowVersion'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
workflowRunIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'workflowRunIdIndex',
|
||||
relatedFieldNames: ['workflowRun'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
taskIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'taskIdIndex',
|
||||
relatedFieldNames: ['task'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
noteIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'noteIdIndex',
|
||||
relatedFieldNames: ['note'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
dashboardIdIndex: createStandardIndexFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
indexName: 'dashboardIdIndex',
|
||||
relatedFieldNames: ['dashboard'],
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
-56
@@ -270,62 +270,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favorite: ({
|
||||
now,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
twentyStandardApplicationId,
|
||||
dependencyFlatEntityMaps,
|
||||
}: Omit<CreateStandardObjectArgs<'favorite'>, 'context' | 'objectName'>) =>
|
||||
createStandardObjectFlatMetadata({
|
||||
objectName: 'favorite',
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.favorite.universalIdentifier,
|
||||
nameSingular: 'favorite',
|
||||
namePlural: 'favorites',
|
||||
labelSingular: i18nLabel(msg`Favorite`),
|
||||
labelPlural: i18nLabel(msg`Favorites`),
|
||||
description: i18nLabel(msg`A favorite`),
|
||||
icon: 'IconHeart',
|
||||
isSystem: true,
|
||||
labelIdentifierFieldMetadataName: 'id',
|
||||
},
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
favoriteFolder: ({
|
||||
now,
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
twentyStandardApplicationId,
|
||||
dependencyFlatEntityMaps,
|
||||
}: Omit<
|
||||
CreateStandardObjectArgs<'favoriteFolder'>,
|
||||
'context' | 'objectName'
|
||||
>) =>
|
||||
createStandardObjectFlatMetadata({
|
||||
objectName: 'favoriteFolder',
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.favoriteFolder.universalIdentifier,
|
||||
nameSingular: 'favoriteFolder',
|
||||
namePlural: 'favoriteFolders',
|
||||
labelSingular: i18nLabel(msg`Favorite Folder`),
|
||||
labelPlural: i18nLabel(msg`Favorite Folders`),
|
||||
description: i18nLabel(msg`A favorite folder`),
|
||||
icon: 'IconFolder',
|
||||
isSystem: true,
|
||||
labelIdentifierFieldMetadataName: 'id',
|
||||
},
|
||||
workspaceId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
messageChannelMessageAssociation: ({
|
||||
now,
|
||||
workspaceId,
|
||||
|
||||
-2
@@ -5,8 +5,6 @@ export { STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG } from './standa
|
||||
export { STANDARD_COMPANY_PAGE_LAYOUT_CONFIG } from './standard-company-page-layout.config';
|
||||
export { STANDARD_CONNECTED_ACCOUNT_PAGE_LAYOUT_CONFIG } from './standard-connected-account-page-layout.config';
|
||||
export { STANDARD_DASHBOARD_PAGE_LAYOUT_CONFIG } from './standard-dashboard-page-layout.config';
|
||||
export { STANDARD_FAVORITE_FOLDER_PAGE_LAYOUT_CONFIG } from './standard-favorite-folder-page-layout.config';
|
||||
export { STANDARD_FAVORITE_PAGE_LAYOUT_CONFIG } from './standard-favorite-page-layout.config';
|
||||
export { STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG } from './standard-message-channel-message-association-message-folder-page-layout.config';
|
||||
export { STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG } from './standard-message-channel-message-association-page-layout.config';
|
||||
export { STANDARD_MESSAGE_CHANNEL_PAGE_LAYOUT_CONFIG } from './standard-message-channel-page-layout.config';
|
||||
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
|
||||
|
||||
import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
|
||||
import {
|
||||
TAB_PROPS,
|
||||
WIDGET_PROPS,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
|
||||
import {
|
||||
type StandardPageLayoutConfig,
|
||||
type StandardPageLayoutTabConfig,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type';
|
||||
|
||||
const FAVORITE_FOLDER_PAGE_TABS = {
|
||||
home: {
|
||||
universalIdentifier: '20202020-ab0f-400f-800f-fa0efd0f0f01',
|
||||
...TAB_PROPS.home,
|
||||
widgets: {
|
||||
fields: {
|
||||
universalIdentifier: '20202020-ac0f-400f-800f-fa0efd0f0f11',
|
||||
...WIDGET_PROPS.fields,
|
||||
},
|
||||
},
|
||||
},
|
||||
timeline: {
|
||||
universalIdentifier: '20202020-ab0f-400f-800f-fa0efd0f0f02',
|
||||
...TAB_PROPS.timeline,
|
||||
widgets: {
|
||||
timeline: {
|
||||
universalIdentifier: '20202020-ac0f-400f-800f-fa0efd0f0f21',
|
||||
...WIDGET_PROPS.timeline,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const satisfies Record<string, StandardPageLayoutTabConfig>;
|
||||
|
||||
export const STANDARD_FAVORITE_FOLDER_PAGE_LAYOUT_CONFIG = {
|
||||
name: 'Default Favorite Folder Layout',
|
||||
type: PageLayoutType.RECORD_PAGE,
|
||||
objectUniversalIdentifier:
|
||||
STANDARD_OBJECTS.favoriteFolder.universalIdentifier,
|
||||
universalIdentifier: '20202020-a10f-400f-800f-fa0efd0f0001',
|
||||
defaultTabUniversalIdentifier: null,
|
||||
tabs: FAVORITE_FOLDER_PAGE_TABS,
|
||||
} as const satisfies StandardPageLayoutConfig;
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
|
||||
|
||||
import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
|
||||
import {
|
||||
TAB_PROPS,
|
||||
WIDGET_PROPS,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
|
||||
import {
|
||||
type StandardPageLayoutConfig,
|
||||
type StandardPageLayoutTabConfig,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type';
|
||||
|
||||
const FAVORITE_PAGE_TABS = {
|
||||
home: {
|
||||
universalIdentifier: '20202020-ab0e-400e-800e-fa0e0b1e0e01',
|
||||
...TAB_PROPS.home,
|
||||
widgets: {
|
||||
fields: {
|
||||
universalIdentifier: '20202020-ac0e-400e-800e-fa0e0b1e0e11',
|
||||
...WIDGET_PROPS.fields,
|
||||
},
|
||||
},
|
||||
},
|
||||
timeline: {
|
||||
universalIdentifier: '20202020-ab0e-400e-800e-fa0e0b1e0e02',
|
||||
...TAB_PROPS.timeline,
|
||||
widgets: {
|
||||
timeline: {
|
||||
universalIdentifier: '20202020-ac0e-400e-800e-fa0e0b1e0e21',
|
||||
...WIDGET_PROPS.timeline,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const satisfies Record<string, StandardPageLayoutTabConfig>;
|
||||
|
||||
export const STANDARD_FAVORITE_PAGE_LAYOUT_CONFIG = {
|
||||
name: 'Default Favorite Layout',
|
||||
type: PageLayoutType.RECORD_PAGE,
|
||||
objectUniversalIdentifier: STANDARD_OBJECTS.favorite.universalIdentifier,
|
||||
universalIdentifier: '20202020-a10e-400e-800e-fa0e0b1e0001',
|
||||
defaultTabUniversalIdentifier: null,
|
||||
tabs: FAVORITE_PAGE_TABS,
|
||||
} as const satisfies StandardPageLayoutConfig;
|
||||
-2
@@ -74,8 +74,6 @@ const RECORD_PAGE_FIELDS_VIEW_NAME_BY_OBJECT: Partial<
|
||||
calendarEventParticipant: 'calendarEventParticipantRecordPageFields',
|
||||
company: 'companyRecordPageFields',
|
||||
connectedAccount: 'connectedAccountRecordPageFields',
|
||||
favorite: 'favoriteRecordPageFields',
|
||||
favoriteFolder: 'favoriteFolderRecordPageFields',
|
||||
messageChannel: 'messageChannelRecordPageFields',
|
||||
messageChannelMessageAssociation:
|
||||
'messageChannelMessageAssociationRecordPageFields',
|
||||
|
||||
-4
@@ -9,8 +9,6 @@ import { computeStandardCalendarChannelEventAssociationViewFieldGroups } from 's
|
||||
import { computeStandardCalendarEventParticipantViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-calendar-event-participant-view-field-groups.util';
|
||||
import { computeStandardCompanyViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-company-view-field-groups.util';
|
||||
import { computeStandardConnectedAccountViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-connected-account-view-field-groups.util';
|
||||
import { computeStandardFavoriteViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-favorite-view-field-groups.util';
|
||||
import { computeStandardFavoriteFolderViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-favorite-folder-view-field-groups.util';
|
||||
import { computeStandardMessageChannelViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-channel-view-field-groups.util';
|
||||
import { computeStandardMessageChannelMessageAssociationViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-channel-message-association-view-field-groups.util';
|
||||
import { computeStandardMessageChannelMessageAssociationMessageFolderViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-channel-message-association-message-folder-view-field-groups.util';
|
||||
@@ -38,8 +36,6 @@ const STANDARD_FLAT_VIEW_FIELD_GROUP_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
computeStandardCalendarEventParticipantViewFieldGroups,
|
||||
company: computeStandardCompanyViewFieldGroups,
|
||||
connectedAccount: computeStandardConnectedAccountViewFieldGroups,
|
||||
favorite: computeStandardFavoriteViewFieldGroups,
|
||||
favoriteFolder: computeStandardFavoriteFolderViewFieldGroups,
|
||||
messageChannel: computeStandardMessageChannelViewFieldGroups,
|
||||
messageChannelMessageAssociation:
|
||||
computeStandardMessageChannelMessageAssociationViewFieldGroups,
|
||||
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
import { type FlatViewFieldGroup } from 'src/engine/metadata-modules/flat-view-field-group/types/flat-view-field-group.type';
|
||||
import {
|
||||
createStandardViewFieldGroupFlatMetadata,
|
||||
type CreateStandardViewFieldGroupArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/create-standard-view-field-group-flat-metadata.util';
|
||||
|
||||
export const computeStandardFavoriteFolderViewFieldGroups = (
|
||||
args: Omit<CreateStandardViewFieldGroupArgs<'favoriteFolder'>, 'context'>,
|
||||
): Record<string, FlatViewFieldGroup> => {
|
||||
return {
|
||||
favoriteFolderRecordPageFieldsGeneral:
|
||||
createStandardViewFieldGroupFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favoriteFolder',
|
||||
context: {
|
||||
viewName: 'favoriteFolderRecordPageFields',
|
||||
viewFieldGroupName: 'general',
|
||||
name: 'General',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
},
|
||||
}),
|
||||
favoriteFolderRecordPageFieldsSystem:
|
||||
createStandardViewFieldGroupFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favoriteFolder',
|
||||
context: {
|
||||
viewName: 'favoriteFolderRecordPageFields',
|
||||
viewFieldGroupName: 'system',
|
||||
name: 'System',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
import { type FlatViewFieldGroup } from 'src/engine/metadata-modules/flat-view-field-group/types/flat-view-field-group.type';
|
||||
import {
|
||||
createStandardViewFieldGroupFlatMetadata,
|
||||
type CreateStandardViewFieldGroupArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/create-standard-view-field-group-flat-metadata.util';
|
||||
|
||||
export const computeStandardFavoriteViewFieldGroups = (
|
||||
args: Omit<CreateStandardViewFieldGroupArgs<'favorite'>, 'context'>,
|
||||
): Record<string, FlatViewFieldGroup> => {
|
||||
return {
|
||||
favoriteRecordPageFieldsGeneral: createStandardViewFieldGroupFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldGroupName: 'general',
|
||||
name: 'General',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsSystem: createStandardViewFieldGroupFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldGroupName: 'system',
|
||||
name: 'System',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
-4
@@ -14,8 +14,6 @@ import { computeStandardCalendarEventViewFields } from 'src/engine/workspace-man
|
||||
import { computeStandardCompanyViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-company-view-fields.util';
|
||||
import { computeStandardConnectedAccountViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-connected-account-view-fields.util';
|
||||
import { computeStandardDashboardViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-dashboard-view-fields.util';
|
||||
import { computeStandardFavoriteFolderViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-favorite-folder-view-fields.util';
|
||||
import { computeStandardFavoriteViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-favorite-view-fields.util';
|
||||
import { computeStandardMessageChannelMessageAssociationMessageFolderViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-channel-message-association-message-folder-view-fields.util';
|
||||
import { computeStandardMessageChannelMessageAssociationViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-channel-message-association-view-fields.util';
|
||||
import { computeStandardMessageChannelViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-channel-view-fields.util';
|
||||
@@ -52,8 +50,6 @@ const STANDARD_FLAT_VIEW_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
company: computeStandardCompanyViewFields,
|
||||
connectedAccount: computeStandardConnectedAccountViewFields,
|
||||
dashboard: computeStandardDashboardViewFields,
|
||||
favorite: computeStandardFavoriteViewFields,
|
||||
favoriteFolder: computeStandardFavoriteFolderViewFields,
|
||||
message: computeStandardMessageViewFields,
|
||||
messageChannel: computeStandardMessageChannelViewFields,
|
||||
messageChannelMessageAssociation:
|
||||
|
||||
-13
@@ -191,19 +191,6 @@ export const computeStandardCompanyViewFields = (
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
companyRecordPageFieldsFavorites: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'company',
|
||||
context: {
|
||||
viewName: 'companyRecordPageFields',
|
||||
viewFieldName: 'favorites',
|
||||
fieldName: 'favorites',
|
||||
position: 6,
|
||||
isVisible: false,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
companyRecordPageFieldsAttachments: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'company',
|
||||
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type';
|
||||
import {
|
||||
createStandardViewFieldFlatMetadata,
|
||||
type CreateStandardViewFieldArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/create-standard-view-field-flat-metadata.util';
|
||||
|
||||
export const computeStandardFavoriteFolderViewFields = (
|
||||
args: Omit<CreateStandardViewFieldArgs<'favoriteFolder'>, 'context'>,
|
||||
): Record<string, FlatViewField> => {
|
||||
return {
|
||||
allFavoriteFoldersName: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favoriteFolder',
|
||||
context: {
|
||||
viewName: 'allFavoriteFolders',
|
||||
viewFieldName: 'name',
|
||||
fieldName: 'name',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoriteFoldersCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favoriteFolder',
|
||||
context: {
|
||||
viewName: 'allFavoriteFolders',
|
||||
viewFieldName: 'createdAt',
|
||||
fieldName: 'createdAt',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
|
||||
favoriteFolderRecordPageFieldsCreatedAt:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favoriteFolder',
|
||||
context: {
|
||||
viewName: 'favoriteFolderRecordPageFields',
|
||||
viewFieldName: 'createdAt',
|
||||
fieldName: 'createdAt',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'system',
|
||||
},
|
||||
}),
|
||||
favoriteFolderRecordPageFieldsCreatedBy:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favoriteFolder',
|
||||
context: {
|
||||
viewName: 'favoriteFolderRecordPageFields',
|
||||
viewFieldName: 'createdBy',
|
||||
fieldName: 'createdBy',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'system',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
-254
@@ -1,254 +0,0 @@
|
||||
import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type';
|
||||
import {
|
||||
createStandardViewFieldFlatMetadata,
|
||||
type CreateStandardViewFieldArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/create-standard-view-field-flat-metadata.util';
|
||||
|
||||
export const computeStandardFavoriteViewFields = (
|
||||
args: Omit<CreateStandardViewFieldArgs<'favorite'>, 'context'>,
|
||||
): Record<string, FlatViewField> => {
|
||||
return {
|
||||
allFavoritesForWorkspaceMember: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'forWorkspaceMember',
|
||||
fieldName: 'forWorkspaceMember',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoritesPerson: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'person',
|
||||
fieldName: 'person',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoritesCompany: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'company',
|
||||
fieldName: 'company',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoritesOpportunity: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'opportunity',
|
||||
fieldName: 'opportunity',
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoritesTask: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'task',
|
||||
fieldName: 'task',
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoritesNote: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'note',
|
||||
fieldName: 'note',
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoritesDashboard: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'dashboard',
|
||||
fieldName: 'dashboard',
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoritesFavoriteFolder: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'favoriteFolder',
|
||||
fieldName: 'favoriteFolder',
|
||||
position: 7,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allFavoritesCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
viewFieldName: 'createdAt',
|
||||
fieldName: 'createdAt',
|
||||
position: 8,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
|
||||
favoriteRecordPageFieldsForWorkspaceMember:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'forWorkspaceMember',
|
||||
fieldName: 'forWorkspaceMember',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsPerson: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'person',
|
||||
fieldName: 'person',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsCompany: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'company',
|
||||
fieldName: 'company',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsOpportunity: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'opportunity',
|
||||
fieldName: 'opportunity',
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsTask: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'task',
|
||||
fieldName: 'task',
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsNote: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'note',
|
||||
fieldName: 'note',
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsDashboard: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'dashboard',
|
||||
fieldName: 'dashboard',
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsFavoriteFolder: createStandardViewFieldFlatMetadata(
|
||||
{
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'favoriteFolder',
|
||||
fieldName: 'favoriteFolder',
|
||||
position: 7,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
},
|
||||
),
|
||||
favoriteRecordPageFieldsCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'createdAt',
|
||||
fieldName: 'createdAt',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'system',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFieldsCreatedBy: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
viewFieldName: 'createdBy',
|
||||
fieldName: 'createdBy',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'system',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
-13
@@ -125,19 +125,6 @@ export const computeStandardNoteViewFields = (
|
||||
},
|
||||
},
|
||||
),
|
||||
noteRecordPageFieldsFavorites: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'note',
|
||||
context: {
|
||||
viewName: 'noteRecordPageFields',
|
||||
viewFieldName: 'favorites',
|
||||
fieldName: 'favorites',
|
||||
position: 4,
|
||||
isVisible: false,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
// System group
|
||||
noteRecordPageFieldsCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
|
||||
-13
@@ -201,19 +201,6 @@ export const computeStandardOpportunityViewFields = (
|
||||
viewFieldGroupName: 'deal',
|
||||
},
|
||||
}),
|
||||
opportunityRecordPageFieldsFavorites: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'opportunity',
|
||||
context: {
|
||||
viewName: 'opportunityRecordPageFields',
|
||||
viewFieldName: 'favorites',
|
||||
fieldName: 'favorites',
|
||||
position: 3,
|
||||
isVisible: false,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'deal',
|
||||
},
|
||||
}),
|
||||
opportunityRecordPageFieldsTaskTargets: createStandardViewFieldFlatMetadata(
|
||||
{
|
||||
...args,
|
||||
|
||||
-13
@@ -216,19 +216,6 @@ export const computeStandardPersonViewFields = (
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
personRecordPageFieldsFavorites: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'person',
|
||||
context: {
|
||||
viewName: 'personRecordPageFields',
|
||||
viewFieldName: 'favorites',
|
||||
fieldName: 'favorites',
|
||||
position: 6,
|
||||
isVisible: false,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
personRecordPageFieldsAttachments: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'person',
|
||||
|
||||
-13
@@ -349,19 +349,6 @@ export const computeStandardTaskViewFields = (
|
||||
},
|
||||
},
|
||||
),
|
||||
taskRecordPageFieldsFavorites: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'task',
|
||||
context: {
|
||||
viewName: 'taskRecordPageFields',
|
||||
viewFieldName: 'favorites',
|
||||
fieldName: 'favorites',
|
||||
position: 7,
|
||||
isVisible: false,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
// System group
|
||||
taskRecordPageFieldsCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
|
||||
-13
@@ -190,19 +190,6 @@ export const computeStandardWorkflowRunViewFields = (
|
||||
viewFieldGroupName: 'system',
|
||||
},
|
||||
}),
|
||||
workflowRunRecordPageFieldsFavorites: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'workflowRun',
|
||||
context: {
|
||||
viewName: 'workflowRunRecordPageFields',
|
||||
viewFieldName: 'favorites',
|
||||
fieldName: 'favorites',
|
||||
position: 7,
|
||||
isVisible: false,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
workflowRunRecordPageFieldsTimelineActivities:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
|
||||
-14
@@ -194,20 +194,6 @@ export const computeStandardWorkflowVersionViewFields = (
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
workflowVersionRecordPageFieldsFavorites:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'workflowVersion',
|
||||
context: {
|
||||
viewName: 'workflowVersionRecordPageFields',
|
||||
viewFieldName: 'favorites',
|
||||
fieldName: 'favorites',
|
||||
position: 5,
|
||||
isVisible: false,
|
||||
size: 150,
|
||||
viewFieldGroupName: 'general',
|
||||
},
|
||||
}),
|
||||
workflowVersionRecordPageFieldsTimelineActivities:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
|
||||
-4
@@ -14,8 +14,6 @@ import { computeStandardCalendarEventViews } from 'src/engine/workspace-manager/
|
||||
import { computeStandardCompanyViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-company-views.util';
|
||||
import { computeStandardConnectedAccountViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-connected-account-views.util';
|
||||
import { computeStandardDashboardViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-dashboard-views.util';
|
||||
import { computeStandardFavoriteFolderViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-favorite-folder-views.util';
|
||||
import { computeStandardFavoriteViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-favorite-views.util';
|
||||
import { computeStandardMessageChannelMessageAssociationMessageFolderViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-channel-message-association-message-folder-views.util';
|
||||
import { computeStandardMessageChannelMessageAssociationViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-channel-message-association-views.util';
|
||||
import { computeStandardMessageChannelViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-channel-views.util';
|
||||
@@ -52,8 +50,6 @@ const STANDARD_FLAT_VIEW_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
company: computeStandardCompanyViews,
|
||||
connectedAccount: computeStandardConnectedAccountViews,
|
||||
dashboard: computeStandardDashboardViews,
|
||||
favorite: computeStandardFavoriteViews,
|
||||
favoriteFolder: computeStandardFavoriteFolderViews,
|
||||
message: computeStandardMessageViews,
|
||||
messageChannel: computeStandardMessageChannelViews,
|
||||
messageChannelMessageAssociation:
|
||||
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
import { ViewType, ViewKey } from 'twenty-shared/types';
|
||||
|
||||
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
|
||||
import {
|
||||
createStandardViewFlatMetadata,
|
||||
type CreateStandardViewArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
|
||||
|
||||
export const computeStandardFavoriteFolderViews = (
|
||||
args: Omit<CreateStandardViewArgs<'favoriteFolder'>, 'context'>,
|
||||
): Record<string, FlatView> => {
|
||||
return {
|
||||
allFavoriteFolders: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favoriteFolder',
|
||||
context: {
|
||||
viewName: 'allFavoriteFolders',
|
||||
name: 'All {objectLabelPlural}',
|
||||
type: ViewType.TABLE,
|
||||
key: ViewKey.INDEX,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
favoriteFolderRecordPageFields: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favoriteFolder',
|
||||
context: {
|
||||
viewName: 'favoriteFolderRecordPageFields',
|
||||
name: 'Favorite Folder Record Page Fields',
|
||||
type: ViewType.FIELDS_WIDGET,
|
||||
key: null,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
import { ViewType, ViewKey } from 'twenty-shared/types';
|
||||
|
||||
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
|
||||
import {
|
||||
createStandardViewFlatMetadata,
|
||||
type CreateStandardViewArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
|
||||
|
||||
export const computeStandardFavoriteViews = (
|
||||
args: Omit<CreateStandardViewArgs<'favorite'>, 'context'>,
|
||||
): Record<string, FlatView> => {
|
||||
return {
|
||||
allFavorites: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'allFavorites',
|
||||
name: 'All {objectLabelPlural}',
|
||||
type: ViewType.TABLE,
|
||||
key: ViewKey.INDEX,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
favoriteRecordPageFields: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'favorite',
|
||||
context: {
|
||||
viewName: 'favoriteRecordPageFields',
|
||||
name: 'Favorite Record Page Fields',
|
||||
type: ViewType.FIELDS_WIDGET,
|
||||
key: null,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
-1
@@ -13,7 +13,6 @@ export const STANDARD_OBJECT_ICONS = {
|
||||
company: 'IconBuildingSkyscraper',
|
||||
connectedAccount: 'IconAt',
|
||||
dashboard: 'IconLayoutDashboard',
|
||||
favorite: 'IconHeart',
|
||||
auditLog: 'IconTimelineEvent',
|
||||
messageChannelMessageAssociation: 'IconMessage',
|
||||
messageChannel: 'IconMessage',
|
||||
|
||||
-2
@@ -9,7 +9,6 @@ import {
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
|
||||
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
|
||||
import { type OpportunityWorkspaceEntity } from 'src/modules/opportunity/standard-objects/opportunity.workspace-entity';
|
||||
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
@@ -55,7 +54,6 @@ export class CompanyWorkspaceEntity {
|
||||
taskTargets: EntityRelation<TaskTargetWorkspaceEntity[]>;
|
||||
noteTargets: EntityRelation<NoteTargetWorkspaceEntity[]>;
|
||||
opportunities: EntityRelation<OpportunityWorkspaceEntity[]>;
|
||||
favorites: EntityRelation<FavoriteWorkspaceEntity[]>;
|
||||
attachments: EntityRelation<AttachmentWorkspaceEntity[]>;
|
||||
timelineActivities: EntityRelation<TimelineActivityWorkspaceEntity[]>;
|
||||
}
|
||||
|
||||
-2
@@ -4,7 +4,6 @@ import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
|
||||
const TITLE_FIELD_NAME = 'title';
|
||||
@@ -20,7 +19,6 @@ export class DashboardWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
createdBy: ActorMetadata;
|
||||
updatedBy: ActorMetadata;
|
||||
timelineActivities: EntityRelation<TimelineActivityWorkspaceEntity[]>;
|
||||
favorites: EntityRelation<FavoriteWorkspaceEntity[]>;
|
||||
attachments: EntityRelation<AttachmentWorkspaceEntity[]>;
|
||||
searchVector: string;
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { TwentyORMModule } from 'src/engine/twenty-orm/twenty-orm.module';
|
||||
import { FavoriteFolderDeletionListener } from 'src/modules/favorite-folder/listeners/favorite-folder.listener';
|
||||
|
||||
@Module({
|
||||
imports: [TwentyORMModule],
|
||||
providers: [FavoriteFolderDeletionListener],
|
||||
})
|
||||
export class FavoriteFolderModule {}
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { type ObjectRecordDeleteEvent } from 'twenty-shared/database-events';
|
||||
|
||||
import { OnDatabaseBatchEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-database-batch-event.decorator';
|
||||
import { DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
|
||||
import { GlobalWorkspaceOrmManager } from 'src/engine/twenty-orm/global-workspace-datasource/global-workspace-orm.manager';
|
||||
import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util';
|
||||
import { WorkspaceEventBatch } from 'src/engine/workspace-event-emitter/types/workspace-event-batch.type';
|
||||
import { type FavoriteFolderWorkspaceEntity } from 'src/modules/favorite-folder/standard-objects/favorite-folder.workspace-entity';
|
||||
import { type FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
|
||||
|
||||
@Injectable()
|
||||
export class FavoriteFolderDeletionListener {
|
||||
constructor(
|
||||
private readonly globalWorkspaceOrmManager: GlobalWorkspaceOrmManager,
|
||||
) {}
|
||||
|
||||
@OnDatabaseBatchEvent('favoriteFolder', DatabaseEventAction.DELETED)
|
||||
async handleDelete(
|
||||
payload: WorkspaceEventBatch<
|
||||
ObjectRecordDeleteEvent<FavoriteFolderWorkspaceEntity>
|
||||
>,
|
||||
) {
|
||||
const workspaceId = payload.workspaceId;
|
||||
const authContext = buildSystemAuthContext(workspaceId);
|
||||
|
||||
await this.globalWorkspaceOrmManager.executeInWorkspaceContext(async () => {
|
||||
for (const eventPayload of payload.events) {
|
||||
const favoriteRepository =
|
||||
await this.globalWorkspaceOrmManager.getRepository<FavoriteWorkspaceEntity>(
|
||||
workspaceId,
|
||||
'favorite',
|
||||
);
|
||||
|
||||
await favoriteRepository.update(
|
||||
{ favoriteFolderId: eventPayload.recordId },
|
||||
{ deletedAt: new Date().toISOString() },
|
||||
);
|
||||
}
|
||||
}, authContext);
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
|
||||
|
||||
const NAME_FIELD_NAME = 'name';
|
||||
|
||||
export const SEARCH_FIELDS_FOR_FAVORITE_FOLDER: FieldTypeAndNameMetadata[] = [
|
||||
{ name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
|
||||
];
|
||||
|
||||
export class FavoriteFolderWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
position: number;
|
||||
name: string | null;
|
||||
favorites: EntityRelation<FavoriteWorkspaceEntity[]>;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export const FAVORITE_DELETION_BATCH_SIZE = 100;
|
||||
@@ -1,21 +0,0 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { FavoriteDeletionJob } from 'src/modules/favorite/jobs/favorite-deletion.job';
|
||||
import { FavoriteDeletionListener } from 'src/modules/favorite/listeners/favorite-deletion.listener';
|
||||
import { FavoriteDeletionService } from 'src/modules/favorite/services/favorite-deletion.service';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([ObjectMetadataEntity, FieldMetadataEntity]),
|
||||
],
|
||||
providers: [
|
||||
FavoriteDeletionService,
|
||||
FavoriteDeletionListener,
|
||||
FavoriteDeletionJob,
|
||||
],
|
||||
exports: [],
|
||||
})
|
||||
export class FavoriteModule {}
|
||||
@@ -1,29 +0,0 @@
|
||||
import { Scope } from '@nestjs/common';
|
||||
|
||||
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
|
||||
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
|
||||
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||
import { FavoriteDeletionService } from 'src/modules/favorite/services/favorite-deletion.service';
|
||||
|
||||
export type FavoriteDeletionJobData = {
|
||||
workspaceId: string;
|
||||
deletedRecordIds: string[];
|
||||
};
|
||||
|
||||
@Processor({
|
||||
queueName: MessageQueue.deleteCascadeQueue,
|
||||
scope: Scope.REQUEST,
|
||||
})
|
||||
export class FavoriteDeletionJob {
|
||||
constructor(
|
||||
private readonly favoriteDeletionService: FavoriteDeletionService,
|
||||
) {}
|
||||
|
||||
@Process(FavoriteDeletionJob.name)
|
||||
async handle(data: FavoriteDeletionJobData): Promise<void> {
|
||||
await this.favoriteDeletionService.deleteFavoritesForDeletedRecords(
|
||||
data.deletedRecordIds,
|
||||
data.workspaceId,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { type ObjectRecordDeleteEvent } from 'twenty-shared/database-events';
|
||||
|
||||
import { OnDatabaseBatchEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-database-batch-event.decorator';
|
||||
import { DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
|
||||
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
|
||||
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
|
||||
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
|
||||
import { WorkspaceEventBatch } from 'src/engine/workspace-event-emitter/types/workspace-event-batch.type';
|
||||
import {
|
||||
FavoriteDeletionJob,
|
||||
type FavoriteDeletionJobData,
|
||||
} from 'src/modules/favorite/jobs/favorite-deletion.job';
|
||||
|
||||
@Injectable()
|
||||
export class FavoriteDeletionListener {
|
||||
constructor(
|
||||
@InjectMessageQueue(MessageQueue.deleteCascadeQueue)
|
||||
private readonly messageQueueService: MessageQueueService,
|
||||
) {}
|
||||
|
||||
@OnDatabaseBatchEvent('*', DatabaseEventAction.DELETED)
|
||||
async handleDeletedEvent(
|
||||
payload: WorkspaceEventBatch<ObjectRecordDeleteEvent>,
|
||||
) {
|
||||
const deletedRecordIds = payload.events.map(({ recordId }) => recordId);
|
||||
|
||||
await this.messageQueueService.add<FavoriteDeletionJobData>(
|
||||
FavoriteDeletionJob.name,
|
||||
{
|
||||
workspaceId: payload.workspaceId,
|
||||
deletedRecordIds,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
import { In, Repository } from 'typeorm';
|
||||
|
||||
import { FieldMetadataEntity } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
|
||||
import { ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
|
||||
import { GlobalWorkspaceOrmManager } from 'src/engine/twenty-orm/global-workspace-datasource/global-workspace-orm.manager';
|
||||
import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util';
|
||||
import { FAVORITE_DELETION_BATCH_SIZE } from 'src/modules/favorite/constants/favorite-deletion-batch-size';
|
||||
import { type FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
|
||||
|
||||
@Injectable()
|
||||
export class FavoriteDeletionService {
|
||||
constructor(
|
||||
@InjectRepository(ObjectMetadataEntity)
|
||||
private readonly objectMetadataRepository: Repository<ObjectMetadataEntity>,
|
||||
|
||||
@InjectRepository(FieldMetadataEntity)
|
||||
private readonly fieldMetadataRepository: Repository<FieldMetadataEntity>,
|
||||
private readonly globalWorkspaceOrmManager: GlobalWorkspaceOrmManager,
|
||||
) {}
|
||||
|
||||
async deleteFavoritesForDeletedRecords(
|
||||
deletedRecordIds: string[],
|
||||
workspaceId: string,
|
||||
): Promise<void> {
|
||||
const authContext = buildSystemAuthContext(workspaceId);
|
||||
|
||||
await this.globalWorkspaceOrmManager.executeInWorkspaceContext(async () => {
|
||||
const favoriteRepository =
|
||||
await this.globalWorkspaceOrmManager.getRepository<FavoriteWorkspaceEntity>(
|
||||
workspaceId,
|
||||
'favorite',
|
||||
);
|
||||
|
||||
const favoriteObjectMetadata =
|
||||
await this.objectMetadataRepository.findOne({
|
||||
where: {
|
||||
nameSingular: 'favorite',
|
||||
workspaceId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!favoriteObjectMetadata) {
|
||||
throw new Error('Favorite object metadata not found');
|
||||
}
|
||||
|
||||
const favoriteFields = await this.fieldMetadataRepository.find({
|
||||
where: {
|
||||
objectMetadataId: favoriteObjectMetadata.id,
|
||||
type: FieldMetadataType.RELATION,
|
||||
},
|
||||
});
|
||||
|
||||
const favoritesToDelete = await favoriteRepository.find({
|
||||
select: {
|
||||
id: true,
|
||||
},
|
||||
where: favoriteFields.map((field) => ({
|
||||
[`${field.name}Id`]: In(deletedRecordIds),
|
||||
})),
|
||||
withDeleted: true,
|
||||
});
|
||||
|
||||
if (favoritesToDelete.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const favoriteIdsToDelete = favoritesToDelete.map(
|
||||
(favorite) => favorite.id,
|
||||
);
|
||||
|
||||
const batches: string[][] = [];
|
||||
|
||||
for (
|
||||
let i = 0;
|
||||
i < favoriteIdsToDelete.length;
|
||||
i += FAVORITE_DELETION_BATCH_SIZE
|
||||
) {
|
||||
batches.push(
|
||||
favoriteIdsToDelete.slice(i, i + FAVORITE_DELETION_BATCH_SIZE),
|
||||
);
|
||||
}
|
||||
|
||||
for (const batch of batches) {
|
||||
await favoriteRepository.delete(batch);
|
||||
}
|
||||
}, authContext);
|
||||
}
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
|
||||
import { type CustomWorkspaceEntity } from 'src/engine/twenty-orm/custom.workspace-entity';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
import { type DashboardWorkspaceEntity } from 'src/modules/dashboard/standard-objects/dashboard.workspace-entity';
|
||||
import { type FavoriteFolderWorkspaceEntity } from 'src/modules/favorite-folder/standard-objects/favorite-folder.workspace-entity';
|
||||
import { type NoteWorkspaceEntity } from 'src/modules/note/standard-objects/note.workspace-entity';
|
||||
import { type OpportunityWorkspaceEntity } from 'src/modules/opportunity/standard-objects/opportunity.workspace-entity';
|
||||
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
import { type TaskWorkspaceEntity } from 'src/modules/task/standard-objects/task.workspace-entity';
|
||||
import { type WorkflowRunWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-run.workspace-entity';
|
||||
import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
|
||||
import { type WorkflowWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
|
||||
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
|
||||
export class FavoriteWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
position: number;
|
||||
forWorkspaceMember: EntityRelation<WorkspaceMemberWorkspaceEntity>;
|
||||
forWorkspaceMemberId: string;
|
||||
person: EntityRelation<PersonWorkspaceEntity> | null;
|
||||
personId: string;
|
||||
company: EntityRelation<CompanyWorkspaceEntity> | null;
|
||||
companyId: string;
|
||||
favoriteFolder: EntityRelation<FavoriteFolderWorkspaceEntity> | null;
|
||||
favoriteFolderId: string;
|
||||
opportunity: EntityRelation<OpportunityWorkspaceEntity> | null;
|
||||
opportunityId: string;
|
||||
workflow: EntityRelation<WorkflowWorkspaceEntity> | null;
|
||||
workflowId: string;
|
||||
workflowVersion: EntityRelation<WorkflowVersionWorkspaceEntity> | null;
|
||||
workflowVersionId: string;
|
||||
workflowRun: EntityRelation<WorkflowRunWorkspaceEntity> | null;
|
||||
workflowRunId: string;
|
||||
task: EntityRelation<TaskWorkspaceEntity> | null;
|
||||
taskId: string;
|
||||
note: EntityRelation<NoteWorkspaceEntity> | null;
|
||||
noteId: string;
|
||||
dashboard: EntityRelation<DashboardWorkspaceEntity> | null;
|
||||
dashboardId: string;
|
||||
viewId: string;
|
||||
custom: EntityRelation<CustomWorkspaceEntity>;
|
||||
}
|
||||
@@ -2,8 +2,6 @@ import { Module } from '@nestjs/common';
|
||||
|
||||
import { CalendarModule } from 'src/modules/calendar/calendar.module';
|
||||
import { ConnectedAccountModule } from 'src/modules/connected-account/connected-account.module';
|
||||
import { FavoriteFolderModule } from 'src/modules/favorite-folder/favorite-folder.module';
|
||||
import { FavoriteModule } from 'src/modules/favorite/favorite.module';
|
||||
import { MessagingModule } from 'src/modules/messaging/messaging.module';
|
||||
import { WorkflowModule } from 'src/modules/workflow/workflow.module';
|
||||
import { WorkspaceMemberModule } from 'src/modules/workspace-member/workspace-member.module';
|
||||
@@ -14,8 +12,6 @@ import { WorkspaceMemberModule } from 'src/modules/workspace-member/workspace-me
|
||||
CalendarModule,
|
||||
ConnectedAccountModule,
|
||||
WorkflowModule,
|
||||
FavoriteFolderModule,
|
||||
FavoriteModule,
|
||||
WorkspaceMemberModule,
|
||||
],
|
||||
providers: [],
|
||||
|
||||
@@ -8,7 +8,6 @@ import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity
|
||||
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
|
||||
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
|
||||
import { type TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
|
||||
|
||||
@@ -29,6 +28,5 @@ export class NoteWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
noteTargets: EntityRelation<NoteTargetWorkspaceEntity[]>;
|
||||
attachments: EntityRelation<AttachmentWorkspaceEntity[]>;
|
||||
timelineActivities: EntityRelation<TimelineActivityWorkspaceEntity[]>;
|
||||
favorites: EntityRelation<FavoriteWorkspaceEntity[]>;
|
||||
searchVector: string;
|
||||
}
|
||||
|
||||
-2
@@ -9,7 +9,6 @@ import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/util
|
||||
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
|
||||
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
|
||||
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
|
||||
import { type FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
|
||||
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
|
||||
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
import { type TaskTargetWorkspaceEntity } from 'src/modules/task/standard-objects/task-target.workspace-entity';
|
||||
@@ -34,7 +33,6 @@ export class OpportunityWorkspaceEntity extends BaseWorkspaceEntity {
|
||||
pointOfContactId: string | null;
|
||||
company: EntityRelation<CompanyWorkspaceEntity> | null;
|
||||
companyId: string | null;
|
||||
favorites: EntityRelation<FavoriteWorkspaceEntity[]>;
|
||||
taskTargets: EntityRelation<TaskTargetWorkspaceEntity[]>;
|
||||
noteTargets: EntityRelation<NoteTargetWorkspaceEntity[]>;
|
||||
attachments: EntityRelation<AttachmentWorkspaceEntity[]>;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user