Deprecate messageChannel messageFolder calendarChannel standard objects (#20836)

# Introduction

Removing old standard objects `messageChannel` and `messageFolder` and
`calendarChannel`

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Paul Rastoin
2026-05-22 15:40:53 +02:00
committed by GitHub
parent 8f24cda586
commit 76e144e85a
55 changed files with 1070 additions and 6966 deletions
@@ -0,0 +1,8 @@
export const CALENDAR_CHANNEL_DATA_SEED_IDS = {
TIM: '20202020-a40f-4faf-bb9f-c6f9945b8203',
JONY: '20202020-a40f-4faf-bb9f-c6f9945b8204',
PHIL: '20202020-a40f-4faf-bb9f-c6f9945b8205',
JANE: '20202020-a40f-4faf-bb9f-c6f9945b8208',
COMPANY_MAIN: '20202020-a40f-4faf-bb9f-c6f9945b8206',
TEAM_CALENDAR: '20202020-a40f-4faf-bb9f-c6f9945b8207',
} as const;
@@ -0,0 +1,8 @@
export const MESSAGE_CHANNEL_DATA_SEED_IDS = {
TIM: '20202020-9b80-4c2c-a597-383db48de1d6',
JONY: '20202020-5ffe-4b32-814a-983d5e4911cd',
PHIL: '20202020-e2f1-49b5-85d2-5d3a3386990c',
JANE: '20202020-8c4d-4e71-a672-2e6a8c9f1b3d',
SUPPORT: '20202020-e2f1-49b5-85d2-5d3a3386990d',
SALES: '20202020-e2f1-49b5-85d2-5d3a3386990e',
} as const;
@@ -0,0 +1,7 @@
export const MESSAGE_FOLDER_DATA_SEED_IDS = {
TIM_INBOX: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d0e',
TIM_SENT: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d1e',
JONY_INBOX: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d2e',
JANE_INBOX: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d3e',
JANE_SENT: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d4e',
} as const;
@@ -13,10 +13,10 @@ import {
SEED_YCOMBINATOR_WORKSPACE_ID,
} from 'src/engine/workspace-manager/dev-seeder/core/constants/seeder-workspaces.constant';
import { USER_WORKSPACE_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/utils/seed-user-workspaces.util';
import { CALENDAR_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/calendar-channel-data-seeds.constant';
import { CALENDAR_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/constants/calendar-channel-seed-ids.constant';
import { MESSAGE_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/constants/message-channel-seed-ids.constant';
import { MESSAGE_FOLDER_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/constants/message-folder-seed-ids.constant';
import { CONNECTED_ACCOUNT_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant';
import { MESSAGE_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/message-channel-data-seeds.constant';
import { MESSAGE_FOLDER_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/message-folder-data-seeds.constant';
type SeedMetadataEntitiesArgs = {
queryRunner: QueryRunner;
@@ -40,7 +40,7 @@ const YC_MESSAGE_CHANNEL_IDS = {
JANE: '30303030-8c4d-4e71-a672-2e6a8c9f1b3d',
SUPPORT: '30303030-e2f1-49b5-85d2-5d3a3386990d',
SALES: '30303030-e2f1-49b5-85d2-5d3a3386990e',
};
} as const;
const YC_CALENDAR_CHANNEL_IDS = {
TIM: '30303030-a40f-4faf-bb9f-c6f9945b8203',
@@ -49,7 +49,7 @@ const YC_CALENDAR_CHANNEL_IDS = {
JANE: '30303030-a40f-4faf-bb9f-c6f9945b8208',
COMPANY_MAIN: '30303030-a40f-4faf-bb9f-c6f9945b8206',
TEAM_CALENDAR: '30303030-a40f-4faf-bb9f-c6f9945b8207',
};
} as const;
const YC_MESSAGE_FOLDER_IDS = {
TIM_INBOX: '30303030-1234-4567-8901-abcdef012345',
@@ -57,22 +57,9 @@ const YC_MESSAGE_FOLDER_IDS = {
JONY_INBOX: '30303030-1234-4567-8901-abcdef012346',
JANE_INBOX: '30303030-1234-4567-8901-abcdef012347',
JANE_SENT: '30303030-1234-4567-8901-abcdef012348',
};
} as const;
type WorkspaceSeedIds = {
userWorkspaceIds: {
TIM: string;
JONY: string;
PHIL: string;
JANE: string;
};
connectedAccountIds: typeof CONNECTED_ACCOUNT_DATA_SEED_IDS;
messageChannelIds: typeof MESSAGE_CHANNEL_DATA_SEED_IDS;
calendarChannelIds: typeof CALENDAR_CHANNEL_DATA_SEED_IDS;
messageFolderIds: typeof MESSAGE_FOLDER_DATA_SEED_IDS;
};
const getSeedIds = (workspaceId: string): WorkspaceSeedIds => {
const getSeedIds = (workspaceId: string) => {
if (workspaceId === SEED_YCOMBINATOR_WORKSPACE_ID) {
return {
userWorkspaceIds: {
@@ -1,78 +0,0 @@
import { CalendarChannelVisibility } from 'twenty-shared/types';
type CalendarChannelDataSeed = {
id: string;
handle: string;
visibility: CalendarChannelVisibility;
isContactAutoCreationEnabled: boolean;
isSyncEnabled: boolean;
};
export const CALENDAR_CHANNEL_DATA_SEED_COLUMNS: (keyof CalendarChannelDataSeed)[] =
[
'id',
'handle',
'visibility',
'isContactAutoCreationEnabled',
'isSyncEnabled',
];
const GENERATE_CALENDAR_CHANNEL_IDS = (): Record<string, string> => {
const CHANNEL_IDS: Record<string, string> = {};
CHANNEL_IDS['TIM'] = '20202020-a40f-4faf-bb9f-c6f9945b8203';
CHANNEL_IDS['JONY'] = '20202020-a40f-4faf-bb9f-c6f9945b8204';
CHANNEL_IDS['PHIL'] = '20202020-a40f-4faf-bb9f-c6f9945b8205';
CHANNEL_IDS['JANE'] = '20202020-a40f-4faf-bb9f-c6f9945b8208';
CHANNEL_IDS['COMPANY_MAIN'] = '20202020-a40f-4faf-bb9f-c6f9945b8206';
CHANNEL_IDS['TEAM_CALENDAR'] = '20202020-a40f-4faf-bb9f-c6f9945b8207';
return CHANNEL_IDS;
};
export const CALENDAR_CHANNEL_DATA_SEED_IDS = GENERATE_CALENDAR_CHANNEL_IDS();
export const CALENDAR_CHANNEL_DATA_SEEDS: CalendarChannelDataSeed[] = [
{
id: CALENDAR_CHANNEL_DATA_SEED_IDS.TIM,
handle: 'tim@apple.dev',
visibility: CalendarChannelVisibility.METADATA,
isContactAutoCreationEnabled: true,
isSyncEnabled: false,
},
{
id: CALENDAR_CHANNEL_DATA_SEED_IDS.JONY,
handle: 'jony@apple.dev',
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
isContactAutoCreationEnabled: true,
isSyncEnabled: false,
},
{
id: CALENDAR_CHANNEL_DATA_SEED_IDS.PHIL,
handle: 'phil@apple.dev',
visibility: CalendarChannelVisibility.METADATA,
isContactAutoCreationEnabled: true,
isSyncEnabled: false,
},
{
id: CALENDAR_CHANNEL_DATA_SEED_IDS.JANE,
handle: 'jane.austen@apple.dev',
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
isContactAutoCreationEnabled: true,
isSyncEnabled: false,
},
{
id: CALENDAR_CHANNEL_DATA_SEED_IDS.COMPANY_MAIN,
handle: 'company-main@apple.dev',
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
isContactAutoCreationEnabled: true,
isSyncEnabled: false,
},
{
id: CALENDAR_CHANNEL_DATA_SEED_IDS.TEAM_CALENDAR,
handle: 'team-calendar@apple.dev',
visibility: CalendarChannelVisibility.SHARE_EVERYTHING,
isContactAutoCreationEnabled: true,
isSyncEnabled: false,
},
];
@@ -1,4 +1,4 @@
import { CALENDAR_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/calendar-channel-data-seeds.constant';
import { CALENDAR_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/constants/calendar-channel-seed-ids.constant';
import { CALENDAR_EVENT_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/calendar-event-data-seeds.constant';
type CalendarChannelEventAssociationDataSeed = {
@@ -1,122 +0,0 @@
import {
MessageChannelSyncStage,
MessageChannelType,
MessageChannelVisibility,
} from 'twenty-shared/types';
type MessageChannelDataSeed = {
id: string;
createdAt: Date;
updatedAt: Date;
deletedAt: Date | null;
isContactAutoCreationEnabled: boolean;
type: MessageChannelType;
handle: string;
isSyncEnabled: boolean;
visibility: MessageChannelVisibility;
syncStage: MessageChannelSyncStage;
};
export const MESSAGE_CHANNEL_DATA_SEED_COLUMNS: (keyof MessageChannelDataSeed)[] =
[
'id',
'createdAt',
'updatedAt',
'deletedAt',
'isContactAutoCreationEnabled',
'type',
'handle',
'isSyncEnabled',
'visibility',
'syncStage',
];
const GENERATE_MESSAGE_CHANNEL_IDS = (): Record<string, string> => {
const CHANNEL_IDS: Record<string, string> = {};
CHANNEL_IDS['TIM'] = '20202020-9b80-4c2c-a597-383db48de1d6';
CHANNEL_IDS['JONY'] = '20202020-5ffe-4b32-814a-983d5e4911cd';
CHANNEL_IDS['PHIL'] = '20202020-e2f1-49b5-85d2-5d3a3386990c';
CHANNEL_IDS['JANE'] = '20202020-8c4d-4e71-a672-2e6a8c9f1b3d';
CHANNEL_IDS['SUPPORT'] = '20202020-e2f1-49b5-85d2-5d3a3386990d';
CHANNEL_IDS['SALES'] = '20202020-e2f1-49b5-85d2-5d3a3386990e';
return CHANNEL_IDS;
};
export const MESSAGE_CHANNEL_DATA_SEED_IDS = GENERATE_MESSAGE_CHANNEL_IDS();
export const MESSAGE_CHANNEL_DATA_SEEDS: MessageChannelDataSeed[] = [
{
id: MESSAGE_CHANNEL_DATA_SEED_IDS.TIM,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
isContactAutoCreationEnabled: true,
type: MessageChannelType.EMAIL,
handle: 'tim@apple.dev',
isSyncEnabled: false,
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,
},
{
id: MESSAGE_CHANNEL_DATA_SEED_IDS.JONY,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
isContactAutoCreationEnabled: true,
type: MessageChannelType.EMAIL,
handle: 'jony.ive@apple.dev',
isSyncEnabled: false,
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,
},
{
id: MESSAGE_CHANNEL_DATA_SEED_IDS.PHIL,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
isContactAutoCreationEnabled: true,
type: MessageChannelType.EMAIL,
handle: 'phil.schiler@apple.dev',
isSyncEnabled: false,
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,
},
{
id: MESSAGE_CHANNEL_DATA_SEED_IDS.JANE,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
isContactAutoCreationEnabled: true,
type: MessageChannelType.EMAIL,
handle: 'jane.austen@apple.dev',
isSyncEnabled: false,
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,
},
{
id: MESSAGE_CHANNEL_DATA_SEED_IDS.SUPPORT,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
isContactAutoCreationEnabled: true,
type: MessageChannelType.EMAIL,
handle: 'support@apple.dev',
isSyncEnabled: false,
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,
},
{
id: MESSAGE_CHANNEL_DATA_SEED_IDS.SALES,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
isContactAutoCreationEnabled: true,
type: MessageChannelType.EMAIL,
handle: 'sales@apple.dev',
isSyncEnabled: false,
visibility: MessageChannelVisibility.SHARE_EVERYTHING,
syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,
},
];
@@ -1,4 +1,4 @@
import { MESSAGE_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/message-channel-data-seeds.constant';
import { MESSAGE_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/constants/message-channel-seed-ids.constant';
import { MESSAGE_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/message-data-seeds.constant';
import { MessageDirection } from 'src/modules/messaging/common/enums/message-direction.enum';
@@ -1,94 +0,0 @@
import { MessageFolderPendingSyncAction } from 'twenty-shared/types';
import { MESSAGE_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/message-channel-data-seeds.constant';
type MessageFolderDataSeed = {
id: string;
createdAt: Date;
updatedAt: Date;
deletedAt: Date | null;
name: string;
isSynced: boolean;
isSentFolder: boolean;
messageChannelId: string;
pendingSyncAction: MessageFolderPendingSyncAction;
};
export const MESSAGE_FOLDER_DATA_SEED_COLUMNS: (keyof MessageFolderDataSeed)[] =
[
'id',
'createdAt',
'updatedAt',
'deletedAt',
'name',
'isSynced',
'isSentFolder',
'messageChannelId',
'pendingSyncAction',
];
export const MESSAGE_FOLDER_DATA_SEED_IDS = {
TIM_INBOX: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d0e',
TIM_SENT: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d1e',
JONY_INBOX: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d2e',
JANE_INBOX: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d3e',
JANE_SENT: '20202020-f1a2-4b3c-8d4e-5f6a7b8c9d4e',
};
export const MESSAGE_FOLDER_DATA_SEEDS: MessageFolderDataSeed[] = [
{
id: MESSAGE_FOLDER_DATA_SEED_IDS.TIM_INBOX,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
name: 'INBOX',
isSynced: true,
isSentFolder: false,
messageChannelId: MESSAGE_CHANNEL_DATA_SEED_IDS.TIM,
pendingSyncAction: MessageFolderPendingSyncAction.NONE,
},
{
id: MESSAGE_FOLDER_DATA_SEED_IDS.TIM_SENT,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
name: 'Sent',
isSynced: true,
isSentFolder: true,
messageChannelId: MESSAGE_CHANNEL_DATA_SEED_IDS.TIM,
pendingSyncAction: MessageFolderPendingSyncAction.NONE,
},
{
id: MESSAGE_FOLDER_DATA_SEED_IDS.JONY_INBOX,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
name: 'INBOX',
isSynced: true,
isSentFolder: false,
messageChannelId: MESSAGE_CHANNEL_DATA_SEED_IDS.JONY,
pendingSyncAction: MessageFolderPendingSyncAction.NONE,
},
{
id: MESSAGE_FOLDER_DATA_SEED_IDS.JANE_INBOX,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
name: 'INBOX',
isSynced: true,
isSentFolder: false,
messageChannelId: MESSAGE_CHANNEL_DATA_SEED_IDS.JANE,
pendingSyncAction: MessageFolderPendingSyncAction.NONE,
},
{
id: MESSAGE_FOLDER_DATA_SEED_IDS.JANE_SENT,
createdAt: new Date(),
updatedAt: new Date(),
deletedAt: null,
name: 'Sent',
isSynced: true,
isSentFolder: true,
messageChannelId: MESSAGE_CHANNEL_DATA_SEED_IDS.JANE,
pendingSyncAction: MessageFolderPendingSyncAction.NONE,
},
];
@@ -45,10 +45,6 @@ import {
EMPLOYMENT_HISTORY_DATA_SEED_COLUMNS,
EMPLOYMENT_HISTORY_DATA_SEEDS,
} from 'src/engine/workspace-manager/dev-seeder/data/constants/employment-history-data-seeds.constant';
import {
MESSAGE_CHANNEL_DATA_SEED_COLUMNS,
MESSAGE_CHANNEL_DATA_SEEDS,
} from 'src/engine/workspace-manager/dev-seeder/data/constants/message-channel-data-seeds.constant';
import {
MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_DATA_SEED_COLUMNS,
MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_DATA_SEEDS,
@@ -173,11 +169,6 @@ const getRecordSeedsBatches = (
pgColumns: PET_DATA_SEED_COLUMNS,
recordSeeds: PET_DATA_SEEDS,
},
{
tableName: 'messageChannel',
pgColumns: MESSAGE_CHANNEL_DATA_SEED_COLUMNS,
recordSeeds: MESSAGE_CHANNEL_DATA_SEEDS,
},
];
// Batch 4: Depends on person/company/messageChannel or independent
@@ -1,14 +1,11 @@
import {
STANDARD_BLOCKLIST_PAGE_LAYOUT_CONFIG,
STANDARD_CALENDAR_CHANNEL_EVENT_ASSOCIATION_PAGE_LAYOUT_CONFIG,
STANDARD_CALENDAR_CHANNEL_PAGE_LAYOUT_CONFIG,
STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG,
STANDARD_COMPANY_PAGE_LAYOUT_CONFIG,
STANDARD_DASHBOARD_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,
STANDARD_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG,
STANDARD_MESSAGE_PARTICIPANT_PAGE_LAYOUT_CONFIG,
STANDARD_MESSAGE_THREAD_PAGE_LAYOUT_CONFIG,
STANDARD_NOTE_PAGE_LAYOUT_CONFIG,
@@ -25,18 +22,15 @@ import { type StandardRecordPageLayouts } from 'src/engine/workspace-manager/twe
export const STANDARD_PAGE_LAYOUTS = {
myFirstDashboard: STANDARD_DASHBOARD_PAGE_LAYOUT_CONFIG,
blocklistRecordPage: STANDARD_BLOCKLIST_PAGE_LAYOUT_CONFIG,
calendarChannelRecordPage: STANDARD_CALENDAR_CHANNEL_PAGE_LAYOUT_CONFIG,
calendarChannelEventAssociationRecordPage:
STANDARD_CALENDAR_CHANNEL_EVENT_ASSOCIATION_PAGE_LAYOUT_CONFIG,
calendarEventParticipantRecordPage:
STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG,
companyRecordPage: STANDARD_COMPANY_PAGE_LAYOUT_CONFIG,
messageChannelRecordPage: STANDARD_MESSAGE_CHANNEL_PAGE_LAYOUT_CONFIG,
messageChannelMessageAssociationRecordPage:
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG,
messageChannelMessageAssociationMessageFolderRecordPage:
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG,
messageFolderRecordPage: STANDARD_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG,
messageParticipantRecordPage: STANDARD_MESSAGE_PARTICIPANT_PAGE_LAYOUT_CONFIG,
messageThreadRecordPage: STANDARD_MESSAGE_THREAD_PAGE_LAYOUT_CONFIG,
noteRecordPage: STANDARD_NOTE_PAGE_LAYOUT_CONFIG,
@@ -24,27 +24,6 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
"calendarChannelEventAssociationRecordPage": {
"id": "00000000-0000-0000-0000-000000000021",
"tabs": {
"home": {
"id": "00000000-0000-0000-0000-000000000022",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000023",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000024",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000025",
},
},
},
},
},
"calendarChannelRecordPage": {
"id": "00000000-0000-0000-0000-000000000016",
"tabs": {
"home": {
@@ -66,136 +45,94 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
"calendarEventParticipantRecordPage": {
"id": "00000000-0000-0000-0000-000000000026",
"id": "00000000-0000-0000-0000-000000000021",
"tabs": {
"home": {
"id": "00000000-0000-0000-0000-000000000027",
"id": "00000000-0000-0000-0000-000000000022",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000028",
"id": "00000000-0000-0000-0000-000000000023",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000029",
"id": "00000000-0000-0000-0000-000000000024",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000030",
"id": "00000000-0000-0000-0000-000000000025",
},
},
},
},
},
"companyRecordPage": {
"id": "00000000-0000-0000-0000-000000000031",
"id": "00000000-0000-0000-0000-000000000026",
"tabs": {
"calendar": {
"id": "00000000-0000-0000-0000-000000000046",
"id": "00000000-0000-0000-0000-000000000041",
"widgets": {
"calendar": {
"id": "00000000-0000-0000-0000-000000000047",
"id": "00000000-0000-0000-0000-000000000042",
},
},
},
"emails": {
"id": "00000000-0000-0000-0000-000000000044",
"id": "00000000-0000-0000-0000-000000000039",
"widgets": {
"emails": {
"id": "00000000-0000-0000-0000-000000000045",
"id": "00000000-0000-0000-0000-000000000040",
},
},
},
"files": {
"id": "00000000-0000-0000-0000-000000000042",
"id": "00000000-0000-0000-0000-000000000037",
"widgets": {
"files": {
"id": "00000000-0000-0000-0000-000000000043",
"id": "00000000-0000-0000-0000-000000000038",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000032",
"id": "00000000-0000-0000-0000-000000000027",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000033",
"id": "00000000-0000-0000-0000-000000000028",
},
"opportunities": {
"id": "00000000-0000-0000-0000-000000000035",
"id": "00000000-0000-0000-0000-000000000030",
},
"people": {
"id": "00000000-0000-0000-0000-000000000034",
"id": "00000000-0000-0000-0000-000000000029",
},
},
},
"notes": {
"id": "00000000-0000-0000-0000-000000000040",
"id": "00000000-0000-0000-0000-000000000035",
"widgets": {
"notes": {
"id": "00000000-0000-0000-0000-000000000041",
"id": "00000000-0000-0000-0000-000000000036",
},
},
},
"tasks": {
"id": "00000000-0000-0000-0000-000000000038",
"id": "00000000-0000-0000-0000-000000000033",
"widgets": {
"tasks": {
"id": "00000000-0000-0000-0000-000000000039",
"id": "00000000-0000-0000-0000-000000000034",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000036",
"id": "00000000-0000-0000-0000-000000000031",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000037",
"id": "00000000-0000-0000-0000-000000000032",
},
},
},
},
},
"messageChannelMessageAssociationMessageFolderRecordPage": {
"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",
},
},
},
},
},
"messageChannelMessageAssociationRecordPage": {
"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",
},
},
},
},
},
"messageChannelRecordPage": {
"id": "00000000-0000-0000-0000-000000000048",
"tabs": {
"home": {
@@ -216,56 +153,56 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
},
"messageFolderRecordPage": {
"id": "00000000-0000-0000-0000-000000000063",
"messageChannelMessageAssociationRecordPage": {
"id": "00000000-0000-0000-0000-000000000043",
"tabs": {
"home": {
"id": "00000000-0000-0000-0000-000000000064",
"id": "00000000-0000-0000-0000-000000000044",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000065",
"id": "00000000-0000-0000-0000-000000000045",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000066",
"id": "00000000-0000-0000-0000-000000000046",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000067",
"id": "00000000-0000-0000-0000-000000000047",
},
},
},
},
},
"messageParticipantRecordPage": {
"id": "00000000-0000-0000-0000-000000000068",
"id": "00000000-0000-0000-0000-000000000053",
"tabs": {
"home": {
"id": "00000000-0000-0000-0000-000000000069",
"id": "00000000-0000-0000-0000-000000000054",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000070",
"id": "00000000-0000-0000-0000-000000000055",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000071",
"id": "00000000-0000-0000-0000-000000000056",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000072",
"id": "00000000-0000-0000-0000-000000000057",
},
},
},
},
},
"messageThreadRecordPage": {
"id": "00000000-0000-0000-0000-000000000073",
"id": "00000000-0000-0000-0000-000000000058",
"tabs": {
"home": {
"id": "00000000-0000-0000-0000-000000000074",
"id": "00000000-0000-0000-0000-000000000059",
"widgets": {
"emailThread": {
"id": "00000000-0000-0000-0000-000000000075",
"id": "00000000-0000-0000-0000-000000000060",
},
},
},
@@ -306,249 +243,273 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
"noteRecordPage": {
"id": "00000000-0000-0000-0000-000000000076",
"id": "00000000-0000-0000-0000-000000000061",
"tabs": {
"files": {
"id": "00000000-0000-0000-0000-000000000084",
"id": "00000000-0000-0000-0000-000000000069",
"widgets": {
"files": {
"id": "00000000-0000-0000-0000-000000000085",
"id": "00000000-0000-0000-0000-000000000070",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000077",
"id": "00000000-0000-0000-0000-000000000062",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000078",
"id": "00000000-0000-0000-0000-000000000063",
},
"noteRichText": {
"id": "00000000-0000-0000-0000-000000000079",
"id": "00000000-0000-0000-0000-000000000064",
},
},
},
"note": {
"id": "00000000-0000-0000-0000-000000000080",
"id": "00000000-0000-0000-0000-000000000065",
"widgets": {
"noteRichText": {
"id": "00000000-0000-0000-0000-000000000081",
"id": "00000000-0000-0000-0000-000000000066",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000082",
"id": "00000000-0000-0000-0000-000000000067",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000083",
"id": "00000000-0000-0000-0000-000000000068",
},
},
},
},
},
"opportunityRecordPage": {
"id": "00000000-0000-0000-0000-000000000086",
"id": "00000000-0000-0000-0000-000000000071",
"tabs": {
"calendar": {
"id": "00000000-0000-0000-0000-000000000102",
"id": "00000000-0000-0000-0000-000000000087",
"widgets": {
"calendar": {
"id": "00000000-0000-0000-0000-000000000103",
"id": "00000000-0000-0000-0000-000000000088",
},
},
},
"emails": {
"id": "00000000-0000-0000-0000-000000000100",
"id": "00000000-0000-0000-0000-000000000085",
"widgets": {
"emails": {
"id": "00000000-0000-0000-0000-000000000101",
"id": "00000000-0000-0000-0000-000000000086",
},
},
},
"files": {
"id": "00000000-0000-0000-0000-000000000098",
"id": "00000000-0000-0000-0000-000000000083",
"widgets": {
"files": {
"id": "00000000-0000-0000-0000-000000000099",
"id": "00000000-0000-0000-0000-000000000084",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000087",
"id": "00000000-0000-0000-0000-000000000072",
"widgets": {
"company": {
"id": "00000000-0000-0000-0000-000000000090",
"id": "00000000-0000-0000-0000-000000000075",
},
"fields": {
"id": "00000000-0000-0000-0000-000000000088",
"id": "00000000-0000-0000-0000-000000000073",
},
"owner": {
"id": "00000000-0000-0000-0000-000000000091",
"id": "00000000-0000-0000-0000-000000000076",
},
"pointOfContact": {
"id": "00000000-0000-0000-0000-000000000089",
"id": "00000000-0000-0000-0000-000000000074",
},
},
},
"notes": {
"id": "00000000-0000-0000-0000-000000000096",
"id": "00000000-0000-0000-0000-000000000081",
"widgets": {
"notes": {
"id": "00000000-0000-0000-0000-000000000097",
"id": "00000000-0000-0000-0000-000000000082",
},
},
},
"tasks": {
"id": "00000000-0000-0000-0000-000000000094",
"id": "00000000-0000-0000-0000-000000000079",
"widgets": {
"tasks": {
"id": "00000000-0000-0000-0000-000000000095",
"id": "00000000-0000-0000-0000-000000000080",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000092",
"id": "00000000-0000-0000-0000-000000000077",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000093",
"id": "00000000-0000-0000-0000-000000000078",
},
},
},
},
},
"personRecordPage": {
"id": "00000000-0000-0000-0000-000000000104",
"id": "00000000-0000-0000-0000-000000000089",
"tabs": {
"calendar": {
"id": "00000000-0000-0000-0000-000000000119",
"id": "00000000-0000-0000-0000-000000000104",
"widgets": {
"calendar": {
"id": "00000000-0000-0000-0000-000000000120",
"id": "00000000-0000-0000-0000-000000000105",
},
},
},
"emails": {
"id": "00000000-0000-0000-0000-000000000117",
"id": "00000000-0000-0000-0000-000000000102",
"widgets": {
"emails": {
"id": "00000000-0000-0000-0000-000000000118",
"id": "00000000-0000-0000-0000-000000000103",
},
},
},
"files": {
"id": "00000000-0000-0000-0000-000000000115",
"id": "00000000-0000-0000-0000-000000000100",
"widgets": {
"files": {
"id": "00000000-0000-0000-0000-000000000116",
"id": "00000000-0000-0000-0000-000000000101",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000105",
"id": "00000000-0000-0000-0000-000000000090",
"widgets": {
"company": {
"id": "00000000-0000-0000-0000-000000000107",
"id": "00000000-0000-0000-0000-000000000092",
},
"fields": {
"id": "00000000-0000-0000-0000-000000000106",
"id": "00000000-0000-0000-0000-000000000091",
},
"pointOfContactForOpportunities": {
"id": "00000000-0000-0000-0000-000000000108",
"id": "00000000-0000-0000-0000-000000000093",
},
},
},
"notes": {
"id": "00000000-0000-0000-0000-000000000113",
"id": "00000000-0000-0000-0000-000000000098",
"widgets": {
"notes": {
"id": "00000000-0000-0000-0000-000000000114",
"id": "00000000-0000-0000-0000-000000000099",
},
},
},
"tasks": {
"id": "00000000-0000-0000-0000-000000000111",
"id": "00000000-0000-0000-0000-000000000096",
"widgets": {
"tasks": {
"id": "00000000-0000-0000-0000-000000000112",
"id": "00000000-0000-0000-0000-000000000097",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000109",
"id": "00000000-0000-0000-0000-000000000094",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000110",
"id": "00000000-0000-0000-0000-000000000095",
},
},
},
},
},
"taskRecordPage": {
"id": "00000000-0000-0000-0000-000000000121",
"id": "00000000-0000-0000-0000-000000000106",
"tabs": {
"files": {
"id": "00000000-0000-0000-0000-000000000129",
"id": "00000000-0000-0000-0000-000000000114",
"widgets": {
"files": {
"id": "00000000-0000-0000-0000-000000000130",
"id": "00000000-0000-0000-0000-000000000115",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000122",
"id": "00000000-0000-0000-0000-000000000107",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000123",
"id": "00000000-0000-0000-0000-000000000108",
},
"taskRichText": {
"id": "00000000-0000-0000-0000-000000000124",
"id": "00000000-0000-0000-0000-000000000109",
},
},
},
"note": {
"id": "00000000-0000-0000-0000-000000000125",
"id": "00000000-0000-0000-0000-000000000110",
"widgets": {
"taskRichText": {
"id": "00000000-0000-0000-0000-000000000126",
"id": "00000000-0000-0000-0000-000000000111",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000127",
"id": "00000000-0000-0000-0000-000000000112",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000128",
"id": "00000000-0000-0000-0000-000000000113",
},
},
},
},
},
"workflowAutomatedTriggerRecordPage": {
"id": "00000000-0000-0000-0000-000000000134",
"id": "00000000-0000-0000-0000-000000000119",
"tabs": {
"home": {
"id": "00000000-0000-0000-0000-000000000135",
"id": "00000000-0000-0000-0000-000000000120",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000136",
"id": "00000000-0000-0000-0000-000000000121",
},
},
},
"timeline": {
"id": "00000000-0000-0000-0000-000000000137",
"id": "00000000-0000-0000-0000-000000000122",
"widgets": {
"timeline": {
"id": "00000000-0000-0000-0000-000000000138",
"id": "00000000-0000-0000-0000-000000000123",
},
},
},
},
},
"workflowRecordPage": {
"id": "00000000-0000-0000-0000-000000000131",
"id": "00000000-0000-0000-0000-000000000116",
"tabs": {
"flow": {
"id": "00000000-0000-0000-0000-000000000132",
"id": "00000000-0000-0000-0000-000000000117",
"widgets": {
"workflow": {
"id": "00000000-0000-0000-0000-000000000118",
},
},
},
},
},
"workflowRunRecordPage": {
"id": "00000000-0000-0000-0000-000000000130",
"tabs": {
"flow": {
"id": "00000000-0000-0000-0000-000000000134",
"widgets": {
"workflowRun": {
"id": "00000000-0000-0000-0000-000000000135",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000131",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000132",
},
"workflow": {
"id": "00000000-0000-0000-0000-000000000133",
},
@@ -556,49 +517,25 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
},
"workflowRunRecordPage": {
"id": "00000000-0000-0000-0000-000000000145",
"tabs": {
"flow": {
"id": "00000000-0000-0000-0000-000000000149",
"widgets": {
"workflowRun": {
"id": "00000000-0000-0000-0000-000000000150",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000146",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000147",
},
"workflow": {
"id": "00000000-0000-0000-0000-000000000148",
},
},
},
},
},
"workflowVersionRecordPage": {
"id": "00000000-0000-0000-0000-000000000139",
"id": "00000000-0000-0000-0000-000000000124",
"tabs": {
"flow": {
"id": "00000000-0000-0000-0000-000000000143",
"id": "00000000-0000-0000-0000-000000000128",
"widgets": {
"workflowVersion": {
"id": "00000000-0000-0000-0000-000000000144",
"id": "00000000-0000-0000-0000-000000000129",
},
},
},
"home": {
"id": "00000000-0000-0000-0000-000000000140",
"id": "00000000-0000-0000-0000-000000000125",
"widgets": {
"fields": {
"id": "00000000-0000-0000-0000-000000000141",
"id": "00000000-0000-0000-0000-000000000126",
},
"workflow": {
"id": "00000000-0000-0000-0000-000000000142",
"id": "00000000-0000-0000-0000-000000000127",
},
},
},
@@ -8,15 +8,12 @@ import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-
import { buildAttachmentStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-attachment-standard-flat-field-metadata.util';
import { buildBlocklistStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-blocklist-standard-flat-field-metadata.util';
import { buildCalendarChannelEventAssociationStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-event-association-standard-flat-field-metadata.util';
import { buildCalendarChannelStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-channel-standard-flat-field-metadata.util';
import { buildCalendarEventParticipantStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-participant-standard-flat-field-metadata.util';
import { buildCalendarEventStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-calendar-event-standard-flat-field-metadata.util';
import { buildCompanyStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-company-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 { 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';
import { buildMessageFolderStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-folder-standard-flat-field-metadata.util';
import { buildMessageParticipantStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util';
import { buildMessageStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util';
import { buildMessageThreadStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-thread-standard-flat-field-metadata.util';
@@ -41,7 +38,6 @@ type StandardFieldBuilder<P extends AllStandardObjectName> = (
const STANDARD_FLAT_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
attachment: buildAttachmentStandardFlatFieldMetadatas,
blocklist: buildBlocklistStandardFlatFieldMetadatas,
calendarChannel: buildCalendarChannelStandardFlatFieldMetadatas,
calendarChannelEventAssociation:
buildCalendarChannelEventAssociationStandardFlatFieldMetadatas,
calendarEventParticipant:
@@ -50,12 +46,10 @@ const STANDARD_FLAT_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
company: buildCompanyStandardFlatFieldMetadatas,
dashboard: buildDashboardStandardFlatFieldMetadatas,
message: buildMessageStandardFlatFieldMetadatas,
messageChannel: buildMessageChannelStandardFlatFieldMetadatas,
messageChannelMessageAssociation:
buildMessageChannelMessageAssociationStandardFlatFieldMetadatas,
messageChannelMessageAssociationMessageFolder:
buildMessageChannelMessageAssociationMessageFolderStandardFlatFieldMetadatas,
messageFolder: buildMessageFolderStandardFlatFieldMetadatas,
messageParticipant: buildMessageParticipantStandardFlatFieldMetadatas,
messageThread: buildMessageThreadStandardFlatFieldMetadatas,
note: buildNoteStandardFlatFieldMetadatas,
@@ -1,533 +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 } 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 { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
import { SEARCH_FIELDS_FOR_CALENDAR_CHANNEL } from 'src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity';
export const buildCalendarChannelStandardFlatFieldMetadatas = ({
now,
objectName,
workspaceId,
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
}: Omit<
CreateStandardFieldArgs<'calendarChannel', FieldMetadataType>,
'context'
>): Record<
AllStandardObjectFieldName<'calendarChannel'>,
FlatFieldMetadata
> => ({
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,
}),
position: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'position',
type: FieldMetadataType.POSITION,
label: i18nLabel(msg`Position`),
description: i18nLabel(msg`Calendar channel record position`),
icon: 'IconHierarchy2',
isSystem: true,
isNullable: false,
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_CALENDAR_CHANNEL,
),
},
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
handle: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'handle',
type: FieldMetadataType.TEXT,
label: i18nLabel(msg`Handle`),
description: i18nLabel(msg`Handle`),
icon: 'IconAt',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
visibility: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'visibility',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Visibility`),
description: i18nLabel(msg`Visibility`),
icon: 'IconEyeglass',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'SHARE_EVERYTHING'",
options: [
{
id: '20202020-82a0-4859-b356-f5a1d6e3e53d',
value: 'METADATA',
label: i18nLabel(msg`Metadata`),
position: 0,
color: 'green',
},
{
id: '20202020-e5ec-4df5-ba3f-66ca2a79c283',
value: 'SHARE_EVERYTHING',
label: i18nLabel(msg`Share Everything`),
position: 1,
color: 'orange',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
isContactAutoCreationEnabled: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'isContactAutoCreationEnabled',
type: FieldMetadataType.BOOLEAN,
label: i18nLabel(msg`Is Contact Auto Creation Enabled`),
description: i18nLabel(msg`Is Contact Auto Creation Enabled`),
icon: 'IconUserCircle',
isNullable: false,
isUIReadOnly: true,
defaultValue: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
contactAutoCreationPolicy: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'contactAutoCreationPolicy',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Contact auto creation policy`),
description: i18nLabel(
msg`Automatically create records for people you participated with in an event.`,
),
icon: 'IconUserCircle',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'AS_PARTICIPANT_AND_ORGANIZER'",
options: [
{
id: '20202020-47c1-4af1-a8a6-540edeafc55e',
value: 'AS_PARTICIPANT_AND_ORGANIZER',
label: i18nLabel(msg`As Participant and Organizer`),
color: 'green',
position: 0,
},
{
id: '20202020-b3cc-4248-b0d1-c8d45c2418b3',
value: 'AS_PARTICIPANT',
label: i18nLabel(msg`As Participant`),
color: 'orange',
position: 1,
},
{
id: '20202020-84ef-4061-9c22-db596e237ddc',
value: 'AS_ORGANIZER',
label: i18nLabel(msg`As Organizer`),
color: 'blue',
position: 2,
},
{
id: '20202020-f170-491f-9597-0e5817e46c17',
value: 'NONE',
label: i18nLabel(msg`None`),
color: 'red',
position: 3,
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
isSyncEnabled: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'isSyncEnabled',
type: FieldMetadataType.BOOLEAN,
label: i18nLabel(msg`Is Sync Enabled`),
description: i18nLabel(msg`Is Sync Enabled`),
icon: 'IconRefresh',
isNullable: false,
isUIReadOnly: true,
defaultValue: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncCursor: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncCursor',
type: FieldMetadataType.TEXT,
label: i18nLabel(msg`Sync Cursor`),
description: i18nLabel(
msg`Sync Cursor. Used for syncing events from the calendar provider`,
),
icon: 'IconReload',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncStatus: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncStatus',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Sync status`),
description: i18nLabel(msg`Sync status`),
icon: 'IconStatusChange',
isNullable: true,
isUIReadOnly: true,
options: [
{
id: '20202020-ebdc-4fc8-a5c1-4bc6a90fdc3c',
value: 'ONGOING',
label: i18nLabel(msg`Ongoing`),
position: 1,
color: 'yellow',
},
{
id: '20202020-7126-4c26-9940-f5807ed87266',
value: 'NOT_SYNCED',
label: i18nLabel(msg`Not Synced`),
position: 2,
color: 'blue',
},
{
id: '20202020-0302-4201-bf84-aaa26b7ca94e',
value: 'ACTIVE',
label: i18nLabel(msg`Active`),
position: 3,
color: 'green',
},
{
id: '20202020-6dbb-449d-96b0-092189010f42',
value: 'FAILED_INSUFFICIENT_PERMISSIONS',
label: i18nLabel(msg`Failed Insufficient Permissions`),
position: 4,
color: 'red',
},
{
id: '20202020-935c-4333-a614-f49ee2ec6aa7',
value: 'FAILED_UNKNOWN',
label: i18nLabel(msg`Failed Unknown`),
position: 5,
color: 'red',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncStage: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncStage',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Sync stage`),
description: i18nLabel(msg`Sync stage`),
icon: 'IconStatusChange',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'PENDING_CONFIGURATION'",
options: [
{
id: '20202020-60c1-40a3-90ae-61d9ee1083c1',
value: 'CALENDAR_EVENT_LIST_FETCH_PENDING',
label: i18nLabel(msg`Calendar event list fetch pending`),
position: 0,
color: 'blue',
},
{
id: '20202020-8652-444a-b72e-d4b7112179ca',
value: 'CALENDAR_EVENT_LIST_FETCH_SCHEDULED',
label: i18nLabel(msg`Calendar event list fetch scheduled`),
position: 1,
color: 'green',
},
{
id: '20202020-e87c-4cfe-aefc-635ad34ef223',
value: 'CALENDAR_EVENT_LIST_FETCH_ONGOING',
label: i18nLabel(msg`Calendar event list fetch ongoing`),
position: 2,
color: 'orange',
},
{
id: '20202020-876f-449d-9f09-de5c369ff95f',
value: 'CALENDAR_EVENTS_IMPORT_PENDING',
label: i18nLabel(msg`Calendar events import pending`),
position: 3,
color: 'blue',
},
{
id: '20202020-3d2a-4acd-a0ed-197343b3bf60',
value: 'CALENDAR_EVENTS_IMPORT_SCHEDULED',
label: i18nLabel(msg`Calendar events import scheduled`),
position: 4,
color: 'green',
},
{
id: '20202020-e762-4152-bb20-29fdd49e1dff',
value: 'CALENDAR_EVENTS_IMPORT_ONGOING',
label: i18nLabel(msg`Calendar events import ongoing`),
position: 5,
color: 'orange',
},
{
id: '20202020-487c-464f-8caa-c6393b82b17c',
value: 'FAILED',
label: i18nLabel(msg`Failed`),
position: 6,
color: 'red',
},
{
id: '20202020-ba03-4221-b186-402662b68493',
value: 'PENDING_CONFIGURATION',
label: i18nLabel(msg`Pending configuration`),
position: 9,
color: 'gray',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncStageStartedAt: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncStageStartedAt',
type: FieldMetadataType.DATE_TIME,
label: i18nLabel(msg`Sync stage started at`),
description: i18nLabel(msg`Sync stage started at`),
icon: 'IconHistory',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncedAt: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncedAt',
type: FieldMetadataType.DATE_TIME,
label: i18nLabel(msg`Last sync date`),
description: i18nLabel(msg`Last sync date`),
icon: 'IconHistory',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
throttleFailureCount: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'throttleFailureCount',
type: FieldMetadataType.NUMBER,
label: i18nLabel(msg`Throttle Failure Count`),
description: i18nLabel(msg`Throttle Failure Count`),
icon: 'IconX',
isNullable: false,
isUIReadOnly: true,
defaultValue: 0,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
});
@@ -1,703 +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 } 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 { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
import {
MessageChannelType,
SEARCH_FIELDS_FOR_MESSAGE_CHANNEL,
} from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
export const buildMessageChannelStandardFlatFieldMetadatas = ({
now,
objectName,
workspaceId,
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
}: Omit<
CreateStandardFieldArgs<'messageChannel', FieldMetadataType>,
'context'
>): Record<
AllStandardObjectFieldName<'messageChannel'>,
FlatFieldMetadata
> => ({
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,
}),
position: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'position',
type: FieldMetadataType.POSITION,
label: i18nLabel(msg`Position`),
description: i18nLabel(msg`Message Channel record position`),
icon: 'IconHierarchy2',
isSystem: true,
isNullable: false,
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_MESSAGE_CHANNEL,
),
},
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
visibility: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'visibility',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Visibility`),
description: i18nLabel(msg`Visibility`),
icon: 'IconEyeglass',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'SHARE_EVERYTHING'",
options: [
{
id: '20202020-4548-4830-b3f8-221fd082ebc0',
value: 'METADATA',
label: i18nLabel(msg`Metadata`),
position: 0,
color: 'green',
},
{
id: '20202020-6a42-40a8-b81e-28b7e591c598',
value: 'SUBJECT',
label: i18nLabel(msg`Subject`),
position: 1,
color: 'blue',
},
{
id: '20202020-d520-4cba-8832-5bca315b64f3',
value: 'SHARE_EVERYTHING',
label: i18nLabel(msg`Share Everything`),
position: 2,
color: 'orange',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
handle: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'handle',
type: FieldMetadataType.TEXT,
label: i18nLabel(msg`Handle`),
description: i18nLabel(msg`Handle`),
icon: 'IconAt',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
type: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'type',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Type`),
description: i18nLabel(msg`Channel Type`),
icon: 'IconMessage',
isNullable: false,
isUIReadOnly: true,
defaultValue: `'${MessageChannelType.EMAIL}'`,
options: [
{
id: '20202020-1628-4bc0-aae1-1a46c648cf90',
value: MessageChannelType.EMAIL,
label: i18nLabel(msg`Email`),
position: 0,
color: 'green',
},
{
id: '20202020-fb11-4da3-80fd-b291cda8deb1',
value: MessageChannelType.SMS,
label: i18nLabel(msg`SMS`),
position: 1,
color: 'blue',
},
{
id: '20202020-7f22-4e58-aa33-9c3e2c72ab10',
value: MessageChannelType.EMAIL_GROUP,
label: i18nLabel(msg`Email group`),
position: 2,
color: 'turquoise',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
isContactAutoCreationEnabled: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'isContactAutoCreationEnabled',
type: FieldMetadataType.BOOLEAN,
label: i18nLabel(msg`Is Contact Auto Creation Enabled`),
description: i18nLabel(msg`Is Contact Auto Creation Enabled`),
icon: 'IconUserCircle',
isNullable: false,
isUIReadOnly: true,
defaultValue: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
contactAutoCreationPolicy: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'contactAutoCreationPolicy',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Contact auto creation policy`),
description: i18nLabel(
msg`Automatically create People records when receiving or sending emails`,
),
icon: 'IconUserCircle',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'SENT'",
options: [
{
id: '20202020-1923-4ffd-907d-be8cc37ecee5',
value: 'SENT_AND_RECEIVED',
label: i18nLabel(msg`Sent and Received`),
position: 0,
color: 'green',
},
{
id: '20202020-8f6a-44d8-bdbb-90cf8b919467',
value: 'SENT',
label: i18nLabel(msg`Sent`),
position: 1,
color: 'blue',
},
{
id: '20202020-b43e-4bc4-840e-d903a69e2ffc',
value: 'NONE',
label: i18nLabel(msg`None`),
position: 2,
color: 'red',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
messageFolderImportPolicy: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'messageFolderImportPolicy',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Message folder import policy`),
description: i18nLabel(msg`Message folder import policy`),
icon: 'IconFolder',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'ALL_FOLDERS'",
options: [
{
id: '20202020-140d-4326-978c-83ca0e9a4d8f',
value: 'ALL_FOLDERS',
label: i18nLabel(msg`All folders`),
position: 0,
color: 'green',
},
{
id: '20202020-513a-4b91-9033-5b74b404e2cb',
value: 'SELECTED_FOLDERS',
label: i18nLabel(msg`Selected folders`),
position: 1,
color: 'blue',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
excludeNonProfessionalEmails: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'excludeNonProfessionalEmails',
type: FieldMetadataType.BOOLEAN,
label: i18nLabel(msg`Exclude non professional emails`),
description: i18nLabel(msg`Exclude non professional emails`),
icon: 'IconBriefcase',
isNullable: false,
isUIReadOnly: true,
defaultValue: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
excludeGroupEmails: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'excludeGroupEmails',
type: FieldMetadataType.BOOLEAN,
label: i18nLabel(msg`Exclude group emails`),
description: i18nLabel(msg`Exclude group emails`),
icon: 'IconUsersGroup',
isNullable: false,
isUIReadOnly: true,
defaultValue: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
pendingGroupEmailsAction: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'pendingGroupEmailsAction',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Pending group emails action`),
description: i18nLabel(msg`Pending action for group emails`),
icon: 'IconUsersGroup',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'NONE'",
options: [
{
id: '20202020-2ead-4bd1-aa5d-5005c7a956b4',
value: 'GROUP_EMAILS_DELETION',
label: i18nLabel(msg`Group emails deletion`),
position: 0,
color: 'red',
},
{
id: '20202020-155d-447d-a36e-6ecbb30fc37c',
value: 'GROUP_EMAILS_IMPORT',
label: i18nLabel(msg`Group emails import`),
position: 1,
color: 'green',
},
{
id: '20202020-fe98-4018-9f94-f878c22b8ece',
value: 'NONE',
label: i18nLabel(msg`None`),
position: 2,
color: 'blue',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
isSyncEnabled: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'isSyncEnabled',
type: FieldMetadataType.BOOLEAN,
label: i18nLabel(msg`Is Sync Enabled`),
description: i18nLabel(msg`Is Sync Enabled`),
icon: 'IconRefresh',
isNullable: false,
isUIReadOnly: true,
defaultValue: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncCursor: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncCursor',
type: FieldMetadataType.TEXT,
label: i18nLabel(msg`Last sync cursor`),
description: i18nLabel(msg`Last sync cursor`),
icon: 'IconHistory',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncedAt: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncedAt',
type: FieldMetadataType.DATE_TIME,
label: i18nLabel(msg`Last sync date`),
description: i18nLabel(msg`Last sync date`),
icon: 'IconHistory',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncStatus: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncStatus',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Sync status`),
description: i18nLabel(msg`Sync status`),
icon: 'IconStatusChange',
isNullable: true,
isUIReadOnly: true,
options: [
{
id: '20202020-046b-4bc2-b085-bd69aaa8e577',
value: 'ONGOING',
label: i18nLabel(msg`Ongoing`),
position: 1,
color: 'yellow',
},
{
id: '20202020-09ec-4ea6-9a8a-bf48211b67e2',
value: 'NOT_SYNCED',
label: i18nLabel(msg`Not Synced`),
position: 2,
color: 'blue',
},
{
id: '20202020-2d1b-4d74-9689-9bd28fd3c3f9',
value: 'ACTIVE',
label: i18nLabel(msg`Active`),
position: 3,
color: 'green',
},
{
id: '20202020-0fb2-4a8b-9f9b-569144a45193',
value: 'FAILED_INSUFFICIENT_PERMISSIONS',
label: i18nLabel(msg`Failed Insufficient Permissions`),
position: 4,
color: 'red',
},
{
id: '20202020-bde3-415a-a8ac-55ced6014364',
value: 'FAILED_UNKNOWN',
label: i18nLabel(msg`Failed Unknown`),
position: 5,
color: 'red',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncStage: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncStage',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Sync stage`),
description: i18nLabel(msg`Sync stage`),
icon: 'IconStatusChange',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'PENDING_CONFIGURATION'",
options: [
{
id: '20202020-1f62-4d79-a633-33a0e4fce9a6',
value: 'MESSAGE_LIST_FETCH_PENDING',
label: i18nLabel(msg`Messages list fetch pending`),
position: 0,
color: 'blue',
},
{
id: '20202020-d24f-4c3d-94a6-86c42e0f51d7',
value: 'MESSAGE_LIST_FETCH_SCHEDULED',
label: i18nLabel(msg`Messages list fetch scheduled`),
position: 1,
color: 'green',
},
{
id: '20202020-8751-408a-ae46-21a51b76be28',
value: 'MESSAGE_LIST_FETCH_ONGOING',
label: i18nLabel(msg`Messages list fetch ongoing`),
position: 2,
color: 'orange',
},
{
id: '20202020-1cfa-4a7d-a82d-93c8e29d0671',
value: 'MESSAGES_IMPORT_PENDING',
label: i18nLabel(msg`Messages import pending`),
position: 3,
color: 'blue',
},
{
id: '20202020-341e-4fbd-9dbf-30a70828ca69',
value: 'MESSAGES_IMPORT_SCHEDULED',
label: i18nLabel(msg`Messages import scheduled`),
position: 4,
color: 'green',
},
{
id: '20202020-e944-4594-ab81-fdbc53a85026',
value: 'MESSAGES_IMPORT_ONGOING',
label: i18nLabel(msg`Messages import ongoing`),
position: 5,
color: 'orange',
},
{
id: '20202020-f7c5-4756-9084-02f6a0b1a5f8',
value: 'FAILED',
label: i18nLabel(msg`Failed`),
position: 6,
color: 'red',
},
{
id: '20202020-0ede-4c75-84f1-29c8309829ec',
value: 'PENDING_CONFIGURATION',
label: i18nLabel(msg`Pending configuration`),
position: 7,
color: 'gray',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncStageStartedAt: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncStageStartedAt',
type: FieldMetadataType.DATE_TIME,
label: i18nLabel(msg`Sync stage started at`),
description: i18nLabel(msg`Sync stage started at`),
icon: 'IconHistory',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
throttleFailureCount: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'throttleFailureCount',
type: FieldMetadataType.NUMBER,
label: i18nLabel(msg`Throttle Failure Count`),
description: i18nLabel(msg`Throttle Failure Count`),
icon: 'IconX',
isNullable: false,
isUIReadOnly: true,
defaultValue: 0,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
throttleRetryAfter: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'throttleRetryAfter',
type: FieldMetadataType.DATE_TIME,
label: i18nLabel(msg`Throttle Retry After`),
description: i18nLabel(msg`Throttle Retry After`),
icon: 'IconClock',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
});
@@ -1,347 +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 } 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 { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
import { SEARCH_FIELDS_FOR_MESSAGE_FOLDER } from 'src/modules/messaging/common/standard-objects/message-folder.workspace-entity';
export const buildMessageFolderStandardFlatFieldMetadatas = ({
now,
objectName,
workspaceId,
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
}: Omit<
CreateStandardFieldArgs<'messageFolder', FieldMetadataType>,
'context'
>): Record<AllStandardObjectFieldName<'messageFolder'>, FlatFieldMetadata> => ({
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,
}),
position: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'position',
type: FieldMetadataType.POSITION,
label: i18nLabel(msg`Position`),
description: i18nLabel(msg`Message Folder record position`),
icon: 'IconHierarchy2',
isSystem: true,
isNullable: false,
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_MESSAGE_FOLDER,
),
},
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
name: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'name',
type: FieldMetadataType.TEXT,
label: i18nLabel(msg`Name`),
description: i18nLabel(msg`Folder name`),
icon: 'IconFolder',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
syncCursor: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'syncCursor',
type: FieldMetadataType.TEXT,
label: i18nLabel(msg`Sync Cursor`),
description: i18nLabel(msg`Sync Cursor`),
icon: 'IconHash',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
isSentFolder: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'isSentFolder',
type: FieldMetadataType.BOOLEAN,
label: i18nLabel(msg`Is Sent Folder`),
description: i18nLabel(msg`Is Sent Folder`),
icon: 'IconCheck',
isNullable: false,
isUIReadOnly: true,
defaultValue: false,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
isSynced: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'isSynced',
type: FieldMetadataType.BOOLEAN,
label: i18nLabel(msg`Is Synced`),
description: i18nLabel(msg`Is Synced`),
icon: 'IconCheck',
isNullable: false,
isUIReadOnly: true,
defaultValue: false,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
parentFolderId: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'parentFolderId',
type: FieldMetadataType.TEXT,
label: i18nLabel(msg`Parent Folder ID`),
description: i18nLabel(msg`Parent Folder ID`),
icon: 'IconFolder',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
externalId: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'externalId',
type: FieldMetadataType.TEXT,
label: i18nLabel(msg`External ID`),
description: i18nLabel(msg`External ID`),
icon: 'IconHash',
isNullable: true,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
pendingSyncAction: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'pendingSyncAction',
type: FieldMetadataType.SELECT,
label: i18nLabel(msg`Pending Sync Action`),
description: i18nLabel(msg`Pending action for folder sync`),
icon: 'IconReload',
isNullable: false,
isUIReadOnly: true,
defaultValue: "'NONE'",
options: [
{
id: '20202020-dc59-4dd3-92fe-f41c6491a588',
value: 'FOLDER_DELETION',
label: i18nLabel(msg`Folder deletion`),
position: 0,
color: 'red',
},
{
id: '20202020-aa29-41d3-872b-142174fe6595',
value: 'NONE',
label: i18nLabel(msg`None`),
position: 1,
color: 'blue',
},
],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
messageChannelId: createStandardFieldFlatMetadata({
objectName,
workspaceId,
context: {
fieldName: 'messageChannelId',
type: FieldMetadataType.UUID,
label: i18nLabel(msg`Message Channel`),
description: i18nLabel(msg`Message Channel`),
icon: 'IconMessage',
isNullable: false,
isUIReadOnly: true,
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
});
@@ -11,7 +11,6 @@ import { buildCompanyStandardFlatIndexMetadatas } from 'src/engine/workspace-man
import { buildDashboardStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-dashboard-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 { buildMessageFolderStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-folder-standard-flat-index-metadata.util';
import { buildMessageParticipantStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util';
import { buildMessageStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util';
import { buildNoteStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-note-standard-flat-index-metadata.util';
@@ -46,7 +45,6 @@ const STANDARD_FLAT_INDEX_METADATA_BUILDERS_BY_OBJECT_NAME = {
buildMessageChannelMessageAssociationStandardFlatIndexMetadatas,
messageChannelMessageAssociationMessageFolder:
buildMessageChannelMessageAssociationMessageFolderStandardFlatIndexMetadatas,
messageFolder: buildMessageFolderStandardFlatIndexMetadatas,
messageParticipant: buildMessageParticipantStandardFlatIndexMetadatas,
note: buildNoteStandardFlatIndexMetadatas,
noteTarget: buildNoteTargetStandardFlatIndexMetadatas,
@@ -1,31 +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 buildMessageFolderStandardFlatIndexMetadatas = ({
now,
objectName,
workspaceId,
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
}: Omit<CreateStandardIndexArgs<'messageFolder'>, 'context'>): Record<
AllStandardObjectIndexName<'messageFolder'>,
FlatIndexMetadata
> => ({
messageChannelIdIndex: createStandardIndexFlatMetadata({
objectName,
workspaceId,
context: {
indexName: 'messageChannelIdIndex',
relatedFieldNames: ['messageChannelId'],
},
standardObjectMetadataRelatedEntityIds,
dependencyFlatEntityMaps,
twentyStandardApplicationId,
now,
}),
});
@@ -93,37 +93,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
twentyStandardApplicationId,
now,
}),
calendarChannel: ({
now,
workspaceId,
standardObjectMetadataRelatedEntityIds,
twentyStandardApplicationId,
dependencyFlatEntityMaps,
}: Omit<
CreateStandardObjectArgs<'calendarChannel'>,
'context' | 'objectName'
>) =>
createStandardObjectFlatMetadata({
objectName: 'calendarChannel',
dependencyFlatEntityMaps,
context: {
universalIdentifier:
STANDARD_OBJECTS.calendarChannel.universalIdentifier,
nameSingular: 'calendarChannel',
namePlural: 'calendarChannels',
labelSingular: i18nLabel(msg`Calendar Channel`),
labelPlural: i18nLabel(msg`Calendar Channels`),
description: i18nLabel(msg`Calendar Channels`),
icon: 'IconCalendar',
isSystem: true,
isAuditLogged: false,
labelIdentifierFieldMetadataName: 'handle',
},
workspaceId,
standardObjectMetadataRelatedEntityIds,
twentyStandardApplicationId,
now,
}),
calendarEventParticipant: ({
now,
workspaceId,
@@ -271,67 +240,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
twentyStandardApplicationId,
now,
}),
messageChannel: ({
now,
workspaceId,
standardObjectMetadataRelatedEntityIds,
twentyStandardApplicationId,
dependencyFlatEntityMaps,
}: Omit<
CreateStandardObjectArgs<'messageChannel'>,
'context' | 'objectName'
>) =>
createStandardObjectFlatMetadata({
objectName: 'messageChannel',
dependencyFlatEntityMaps,
context: {
universalIdentifier:
STANDARD_OBJECTS.messageChannel.universalIdentifier,
nameSingular: 'messageChannel',
namePlural: 'messageChannels',
labelSingular: i18nLabel(msg`Message Channel`),
labelPlural: i18nLabel(msg`Message Channels`),
description: i18nLabel(msg`Message Channels`),
icon: 'IconMessage',
isSystem: true,
isAuditLogged: false,
labelIdentifierFieldMetadataName: 'handle',
},
workspaceId,
standardObjectMetadataRelatedEntityIds,
twentyStandardApplicationId,
now,
}),
messageFolder: ({
now,
workspaceId,
standardObjectMetadataRelatedEntityIds,
twentyStandardApplicationId,
dependencyFlatEntityMaps,
}: Omit<
CreateStandardObjectArgs<'messageFolder'>,
'context' | 'objectName'
>) =>
createStandardObjectFlatMetadata({
objectName: 'messageFolder',
dependencyFlatEntityMaps,
context: {
universalIdentifier: STANDARD_OBJECTS.messageFolder.universalIdentifier,
nameSingular: 'messageFolder',
namePlural: 'messageFolders',
labelSingular: i18nLabel(msg`Message Folder`),
labelPlural: i18nLabel(msg`Message Folders`),
description: i18nLabel(msg`Message Folders`),
icon: 'IconFolder',
isSystem: true,
isAuditLogged: false,
labelIdentifierFieldMetadataName: 'id',
},
workspaceId,
standardObjectMetadataRelatedEntityIds,
twentyStandardApplicationId,
now,
}),
messageChannelMessageAssociationMessageFolder: ({
now,
workspaceId,
@@ -1,13 +1,10 @@
export { STANDARD_BLOCKLIST_PAGE_LAYOUT_CONFIG } from './standard-blocklist-page-layout.config';
export { STANDARD_CALENDAR_CHANNEL_EVENT_ASSOCIATION_PAGE_LAYOUT_CONFIG } from './standard-calendar-channel-event-association-page-layout.config';
export { STANDARD_CALENDAR_CHANNEL_PAGE_LAYOUT_CONFIG } from './standard-calendar-channel-page-layout.config';
export { STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG } from './standard-calendar-event-participant-page-layout.config';
export { STANDARD_COMPANY_PAGE_LAYOUT_CONFIG } from './standard-company-page-layout.config';
export { STANDARD_DASHBOARD_PAGE_LAYOUT_CONFIG } from './standard-dashboard-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';
export { STANDARD_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG } from './standard-message-folder-page-layout.config';
export { STANDARD_MESSAGE_PARTICIPANT_PAGE_LAYOUT_CONFIG } from './standard-message-participant-page-layout.config';
export { STANDARD_MESSAGE_THREAD_PAGE_LAYOUT_CONFIG } from './standard-message-thread-page-layout.config';
export { STANDARD_NOTE_PAGE_LAYOUT_CONFIG } from './standard-note-page-layout.config';
@@ -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 CALENDAR_CHANNEL_PAGE_TABS = {
home: {
universalIdentifier: '20202020-ab0a-400a-800a-ca1c4a0a0a01',
...TAB_PROPS.home,
widgets: {
fields: {
universalIdentifier: '20202020-ac0a-400a-800a-ca1c4a0a0a11',
...WIDGET_PROPS.fields,
},
},
},
timeline: {
universalIdentifier: '20202020-ab0a-400a-800a-ca1c4a0a0a02',
...TAB_PROPS.timeline,
widgets: {
timeline: {
universalIdentifier: '20202020-ac0a-400a-800a-ca1c4a0a0a21',
...WIDGET_PROPS.timeline,
},
},
},
} as const satisfies Record<string, StandardPageLayoutTabConfig>;
export const STANDARD_CALENDAR_CHANNEL_PAGE_LAYOUT_CONFIG = {
name: 'Default Calendar Channel Layout',
type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier:
STANDARD_OBJECTS.calendarChannel.universalIdentifier,
universalIdentifier: '20202020-a10a-400a-800a-ca1c4a0a0001',
defaultTabUniversalIdentifier: null,
tabs: CALENDAR_CHANNEL_PAGE_TABS,
} as const satisfies StandardPageLayoutConfig;
@@ -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 MESSAGE_CHANNEL_PAGE_TABS = {
home: {
universalIdentifier: '20202020-ab10-4010-8010-a5c4a1101001',
...TAB_PROPS.home,
widgets: {
fields: {
universalIdentifier: '20202020-ac10-4010-8010-a5c4a1101011',
...WIDGET_PROPS.fields,
},
},
},
timeline: {
universalIdentifier: '20202020-ab10-4010-8010-a5c4a1101002',
...TAB_PROPS.timeline,
widgets: {
timeline: {
universalIdentifier: '20202020-ac10-4010-8010-a5c4a1101021',
...WIDGET_PROPS.timeline,
},
},
},
} as const satisfies Record<string, StandardPageLayoutTabConfig>;
export const STANDARD_MESSAGE_CHANNEL_PAGE_LAYOUT_CONFIG = {
name: 'Default Message Channel Layout',
type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier:
STANDARD_OBJECTS.messageChannel.universalIdentifier,
universalIdentifier: '20202020-a110-4010-8010-a5c4a1100001',
defaultTabUniversalIdentifier: null,
tabs: MESSAGE_CHANNEL_PAGE_TABS,
} as const satisfies StandardPageLayoutConfig;
@@ -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 MESSAGE_FOLDER_PAGE_TABS = {
home: {
universalIdentifier: '20202020-ab13-4013-8013-a5efd1131301',
...TAB_PROPS.home,
widgets: {
fields: {
universalIdentifier: '20202020-ac13-4013-8013-a5efd1131311',
...WIDGET_PROPS.fields,
},
},
},
timeline: {
universalIdentifier: '20202020-ab13-4013-8013-a5efd1131302',
...TAB_PROPS.timeline,
widgets: {
timeline: {
universalIdentifier: '20202020-ac13-4013-8013-a5efd1131321',
...WIDGET_PROPS.timeline,
},
},
},
} as const satisfies Record<string, StandardPageLayoutTabConfig>;
export const STANDARD_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG = {
name: 'Default Message Folder Layout',
type: PageLayoutType.RECORD_PAGE,
objectUniversalIdentifier: STANDARD_OBJECTS.messageFolder.universalIdentifier,
universalIdentifier: '20202020-a113-4013-8013-a5efd1130001',
defaultTabUniversalIdentifier: null,
tabs: MESSAGE_FOLDER_PAGE_TABS,
} as const satisfies StandardPageLayoutConfig;
@@ -66,17 +66,14 @@ const RECORD_PAGE_FIELDS_VIEW_NAME_BY_OBJECT: Partial<
Record<AllStandardObjectName, string>
> = {
blocklist: 'blocklistRecordPageFields',
calendarChannel: 'calendarChannelRecordPageFields',
calendarChannelEventAssociation:
'calendarChannelEventAssociationRecordPageFields',
calendarEventParticipant: 'calendarEventParticipantRecordPageFields',
company: 'companyRecordPageFields',
messageChannel: 'messageChannelRecordPageFields',
messageChannelMessageAssociation:
'messageChannelMessageAssociationRecordPageFields',
messageChannelMessageAssociationMessageFolder:
'messageChannelMessageAssociationMessageFolderRecordPageFields',
messageFolder: 'messageFolderRecordPageFields',
messageParticipant: 'messageParticipantRecordPageFields',
note: 'noteRecordPageFields',
opportunity: 'opportunityRecordPageFields',
@@ -4,14 +4,11 @@ import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-module
import { type FlatViewFieldGroup } from 'src/engine/metadata-modules/flat-view-field-group/types/flat-view-field-group.type';
import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type';
import { computeStandardBlocklistViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-blocklist-view-field-groups.util';
import { computeStandardCalendarChannelViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-calendar-channel-view-field-groups.util';
import { computeStandardCalendarChannelEventAssociationViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-calendar-channel-event-association-view-field-groups.util';
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 { 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';
import { computeStandardMessageFolderViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-folder-view-field-groups.util';
import { computeStandardMessageParticipantViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-message-participant-view-field-groups.util';
import { computeStandardNoteViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-note-view-field-groups.util';
import { computeStandardOpportunityViewFieldGroups } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field-group/compute-standard-opportunity-view-field-groups.util';
@@ -28,18 +25,15 @@ type StandardViewFieldGroupBuilder<P extends AllStandardObjectName> = (
const STANDARD_FLAT_VIEW_FIELD_GROUP_METADATA_BUILDERS_BY_OBJECT_NAME = {
blocklist: computeStandardBlocklistViewFieldGroups,
calendarChannel: computeStandardCalendarChannelViewFieldGroups,
calendarChannelEventAssociation:
computeStandardCalendarChannelEventAssociationViewFieldGroups,
calendarEventParticipant:
computeStandardCalendarEventParticipantViewFieldGroups,
company: computeStandardCompanyViewFieldGroups,
messageChannel: computeStandardMessageChannelViewFieldGroups,
messageChannelMessageAssociation:
computeStandardMessageChannelMessageAssociationViewFieldGroups,
messageChannelMessageAssociationMessageFolder:
computeStandardMessageChannelMessageAssociationMessageFolderViewFieldGroups,
messageFolder: computeStandardMessageFolderViewFieldGroups,
messageParticipant: computeStandardMessageParticipantViewFieldGroups,
note: computeStandardNoteViewFieldGroups,
opportunity: computeStandardOpportunityViewFieldGroups,
@@ -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 computeStandardCalendarChannelViewFieldGroups = (
args: Omit<CreateStandardViewFieldGroupArgs<'calendarChannel'>, 'context'>,
): Record<string, FlatViewFieldGroup> => {
return {
calendarChannelRecordPageFieldsGeneral:
createStandardViewFieldGroupFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'calendarChannelRecordPageFields',
viewFieldGroupName: 'general',
name: 'General',
position: 0,
isVisible: true,
},
}),
calendarChannelRecordPageFieldsSystem:
createStandardViewFieldGroupFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'calendarChannelRecordPageFields',
viewFieldGroupName: 'system',
name: 'System',
position: 1,
isVisible: true,
},
}),
};
};
@@ -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 computeStandardMessageChannelViewFieldGroups = (
args: Omit<CreateStandardViewFieldGroupArgs<'messageChannel'>, 'context'>,
): Record<string, FlatViewFieldGroup> => {
return {
messageChannelRecordPageFieldsGeneral:
createStandardViewFieldGroupFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
viewFieldGroupName: 'general',
name: 'General',
position: 0,
isVisible: true,
},
}),
messageChannelRecordPageFieldsSystem:
createStandardViewFieldGroupFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
viewFieldGroupName: 'system',
name: 'System',
position: 1,
isVisible: true,
},
}),
};
};
@@ -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 computeStandardMessageFolderViewFieldGroups = (
args: Omit<CreateStandardViewFieldGroupArgs<'messageFolder'>, 'context'>,
): Record<string, FlatViewFieldGroup> => {
return {
messageFolderRecordPageFieldsGeneral:
createStandardViewFieldGroupFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'messageFolderRecordPageFields',
viewFieldGroupName: 'general',
name: 'General',
position: 0,
isVisible: true,
},
}),
messageFolderRecordPageFieldsSystem:
createStandardViewFieldGroupFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'messageFolderRecordPageFields',
viewFieldGroupName: 'system',
name: 'System',
position: 1,
isVisible: true,
},
}),
};
};
@@ -6,15 +6,12 @@ import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-
import { computeStandardAttachmentViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-attachment-view-fields.util';
import { computeStandardBlocklistViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-blocklist-view-fields.util';
import { computeStandardCalendarChannelEventAssociationViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-calendar-channel-event-association-view-fields.util';
import { computeStandardCalendarChannelViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-calendar-channel-view-fields.util';
import { computeStandardCalendarEventParticipantViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-calendar-event-participant-view-fields.util';
import { computeStandardCalendarEventViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-calendar-event-view-fields.util';
import { computeStandardCompanyViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-company-view-fields.util';
import { computeStandardDashboardViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-dashboard-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';
import { computeStandardMessageFolderViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-folder-view-fields.util';
import { computeStandardMessageParticipantViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-participant-view-fields.util';
import { computeStandardMessageThreadViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-thread-view-fields.util';
import { computeStandardMessageViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-message-view-fields.util';
@@ -39,7 +36,6 @@ type StandardViewFieldBuilder<P extends AllStandardObjectName> = (
const STANDARD_FLAT_VIEW_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
attachment: computeStandardAttachmentViewFields,
blocklist: computeStandardBlocklistViewFields,
calendarChannel: computeStandardCalendarChannelViewFields,
calendarChannelEventAssociation:
computeStandardCalendarChannelEventAssociationViewFields,
calendarEvent: computeStandardCalendarEventViewFields,
@@ -47,12 +43,10 @@ const STANDARD_FLAT_VIEW_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
company: computeStandardCompanyViewFields,
dashboard: computeStandardDashboardViewFields,
message: computeStandardMessageViewFields,
messageChannel: computeStandardMessageChannelViewFields,
messageChannelMessageAssociation:
computeStandardMessageChannelMessageAssociationViewFields,
messageChannelMessageAssociationMessageFolder:
computeStandardMessageChannelMessageAssociationMessageFolderViewFields,
messageFolder: computeStandardMessageFolderViewFields,
messageParticipant: computeStandardMessageParticipantViewFields,
messageThread: computeStandardMessageThreadViewFields,
note: computeStandardNoteViewFields,
@@ -1,143 +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 computeStandardCalendarChannelViewFields = (
args: Omit<CreateStandardViewFieldArgs<'calendarChannel'>, 'context'>,
): Record<string, FlatViewField> => {
return {
allCalendarChannelsHandle: createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'allCalendarChannels',
viewFieldName: 'handle',
fieldName: 'handle',
position: 0,
isVisible: true,
size: 150,
},
}),
allCalendarChannelsVisibility: createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'allCalendarChannels',
viewFieldName: 'visibility',
fieldName: 'visibility',
position: 2,
isVisible: true,
size: 150,
},
}),
allCalendarChannelsIsSyncEnabled: createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'allCalendarChannels',
viewFieldName: 'isSyncEnabled',
fieldName: 'isSyncEnabled',
position: 3,
isVisible: true,
size: 150,
},
}),
allCalendarChannelsSyncStatus: createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'allCalendarChannels',
viewFieldName: 'syncStatus',
fieldName: 'syncStatus',
position: 4,
isVisible: true,
size: 150,
},
}),
allCalendarChannelsCreatedAt: createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'allCalendarChannels',
viewFieldName: 'createdAt',
fieldName: 'createdAt',
position: 5,
isVisible: true,
size: 150,
},
}),
calendarChannelRecordPageFieldsVisibility:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'calendarChannelRecordPageFields',
viewFieldName: 'visibility',
fieldName: 'visibility',
position: 2,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
calendarChannelRecordPageFieldsIsSyncEnabled:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'calendarChannelRecordPageFields',
viewFieldName: 'isSyncEnabled',
fieldName: 'isSyncEnabled',
position: 3,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
calendarChannelRecordPageFieldsSyncStatus:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'calendarChannelRecordPageFields',
viewFieldName: 'syncStatus',
fieldName: 'syncStatus',
position: 4,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
calendarChannelRecordPageFieldsCreatedAt:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'calendarChannelRecordPageFields',
viewFieldName: 'createdAt',
fieldName: 'createdAt',
position: 0,
isVisible: true,
size: 150,
viewFieldGroupName: 'system',
},
}),
calendarChannelRecordPageFieldsCreatedBy:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'calendarChannelRecordPageFields',
viewFieldName: 'createdBy',
fieldName: 'createdBy',
position: 1,
isVisible: true,
size: 150,
viewFieldGroupName: 'system',
},
}),
};
};
@@ -1,168 +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 computeStandardMessageChannelViewFields = (
args: Omit<CreateStandardViewFieldArgs<'messageChannel'>, 'context'>,
): Record<string, FlatViewField> => {
return {
allMessageChannelsHandle: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'allMessageChannels',
viewFieldName: 'handle',
fieldName: 'handle',
position: 0,
isVisible: true,
size: 150,
},
}),
allMessageChannelsType: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'allMessageChannels',
viewFieldName: 'type',
fieldName: 'type',
position: 2,
isVisible: true,
size: 150,
},
}),
allMessageChannelsVisibility: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'allMessageChannels',
viewFieldName: 'visibility',
fieldName: 'visibility',
position: 3,
isVisible: true,
size: 150,
},
}),
allMessageChannelsIsSyncEnabled: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'allMessageChannels',
viewFieldName: 'isSyncEnabled',
fieldName: 'isSyncEnabled',
position: 4,
isVisible: true,
size: 150,
},
}),
allMessageChannelsSyncStatus: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'allMessageChannels',
viewFieldName: 'syncStatus',
fieldName: 'syncStatus',
position: 5,
isVisible: true,
size: 150,
},
}),
allMessageChannelsCreatedAt: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'allMessageChannels',
viewFieldName: 'createdAt',
fieldName: 'createdAt',
position: 6,
isVisible: true,
size: 150,
},
}),
messageChannelRecordPageFieldsType: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
viewFieldName: 'type',
fieldName: 'type',
position: 2,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
messageChannelRecordPageFieldsVisibility:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
viewFieldName: 'visibility',
fieldName: 'visibility',
position: 3,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
messageChannelRecordPageFieldsIsSyncEnabled:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
viewFieldName: 'isSyncEnabled',
fieldName: 'isSyncEnabled',
position: 4,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
messageChannelRecordPageFieldsSyncStatus:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
viewFieldName: 'syncStatus',
fieldName: 'syncStatus',
position: 5,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
messageChannelRecordPageFieldsCreatedAt:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
viewFieldName: 'createdAt',
fieldName: 'createdAt',
position: 0,
isVisible: true,
size: 150,
viewFieldGroupName: 'system',
},
}),
messageChannelRecordPageFieldsCreatedBy:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
viewFieldName: 'createdBy',
fieldName: 'createdBy',
position: 1,
isVisible: true,
size: 150,
viewFieldGroupName: 'system',
},
}),
};
};
@@ -1,144 +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 computeStandardMessageFolderViewFields = (
args: Omit<CreateStandardViewFieldArgs<'messageFolder'>, 'context'>,
): Record<string, FlatViewField> => {
return {
allMessageFoldersName: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'allMessageFolders',
viewFieldName: 'name',
fieldName: 'name',
position: 0,
isVisible: true,
size: 150,
},
}),
allMessageFoldersMessageChannel: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'allMessageFolders',
viewFieldName: 'messageChannelId',
fieldName: 'messageChannelId',
position: 1,
isVisible: true,
size: 150,
},
}),
allMessageFoldersIsSentFolder: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'allMessageFolders',
viewFieldName: 'isSentFolder',
fieldName: 'isSentFolder',
position: 2,
isVisible: true,
size: 150,
},
}),
allMessageFoldersIsSynced: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'allMessageFolders',
viewFieldName: 'isSynced',
fieldName: 'isSynced',
position: 3,
isVisible: true,
size: 150,
},
}),
allMessageFoldersCreatedAt: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'allMessageFolders',
viewFieldName: 'createdAt',
fieldName: 'createdAt',
position: 4,
isVisible: true,
size: 150,
},
}),
messageFolderRecordPageFieldsMessageChannel:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'messageFolderRecordPageFields',
viewFieldName: 'messageChannelId',
fieldName: 'messageChannelId',
position: 1,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
messageFolderRecordPageFieldsIsSentFolder:
createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'messageFolderRecordPageFields',
viewFieldName: 'isSentFolder',
fieldName: 'isSentFolder',
position: 2,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
messageFolderRecordPageFieldsIsSynced: createStandardViewFieldFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'messageFolderRecordPageFields',
viewFieldName: 'isSynced',
fieldName: 'isSynced',
position: 3,
isVisible: true,
size: 150,
viewFieldGroupName: 'general',
},
}),
messageFolderRecordPageFieldsCreatedAt: createStandardViewFieldFlatMetadata(
{
...args,
objectName: 'messageFolder',
context: {
viewName: 'messageFolderRecordPageFields',
viewFieldName: 'createdAt',
fieldName: 'createdAt',
position: 0,
isVisible: true,
size: 150,
viewFieldGroupName: 'system',
},
},
),
messageFolderRecordPageFieldsCreatedBy: createStandardViewFieldFlatMetadata(
{
...args,
objectName: 'messageFolder',
context: {
viewName: 'messageFolderRecordPageFields',
viewFieldName: 'createdBy',
fieldName: 'createdBy',
position: 1,
isVisible: true,
size: 150,
viewFieldGroupName: 'system',
},
},
),
};
};
@@ -5,7 +5,6 @@ import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-
import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type';
import { computeStandardAttachmentViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-attachment-views.util';
import { computeStandardBlocklistViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-blocklist-views.util';
import { computeStandardCalendarChannelViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-calendar-channel-views.util';
import { computeStandardCalendarChannelEventAssociationViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-calendar-channel-event-association-views.util';
import { computeStandardCalendarEventParticipantViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-calendar-event-participant-views.util';
import { computeStandardCalendarEventViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-calendar-event-views.util';
@@ -13,8 +12,6 @@ import { computeStandardCompanyViews } from 'src/engine/workspace-manager/twenty
import { computeStandardDashboardViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-dashboard-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';
import { computeStandardMessageFolderViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-folder-views.util';
import { computeStandardMessageParticipantViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-participant-views.util';
import { computeStandardMessageThreadViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-thread-views.util';
import { computeStandardMessageViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-message-views.util';
@@ -39,7 +36,6 @@ type StandardViewBuilder<P extends AllStandardObjectName> = (
const STANDARD_FLAT_VIEW_METADATA_BUILDERS_BY_OBJECT_NAME = {
attachment: computeStandardAttachmentViews,
blocklist: computeStandardBlocklistViews,
calendarChannel: computeStandardCalendarChannelViews,
calendarChannelEventAssociation:
computeStandardCalendarChannelEventAssociationViews,
calendarEvent: computeStandardCalendarEventViews,
@@ -47,12 +43,10 @@ const STANDARD_FLAT_VIEW_METADATA_BUILDERS_BY_OBJECT_NAME = {
company: computeStandardCompanyViews,
dashboard: computeStandardDashboardViews,
message: computeStandardMessageViews,
messageChannel: computeStandardMessageChannelViews,
messageChannelMessageAssociation:
computeStandardMessageChannelMessageAssociationViews,
messageChannelMessageAssociationMessageFolder:
computeStandardMessageChannelMessageAssociationMessageFolderViews,
messageFolder: computeStandardMessageFolderViews,
messageParticipant: computeStandardMessageParticipantViews,
messageThread: computeStandardMessageThreadViews,
note: computeStandardNoteViews,
@@ -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 computeStandardCalendarChannelViews = (
args: Omit<CreateStandardViewArgs<'calendarChannel'>, 'context'>,
): Record<string, FlatView> => {
return {
allCalendarChannels: createStandardViewFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'allCalendarChannels',
name: 'All {objectLabelPlural}',
type: ViewType.TABLE,
key: ViewKey.INDEX,
position: 0,
icon: 'IconList',
},
}),
calendarChannelRecordPageFields: createStandardViewFlatMetadata({
...args,
objectName: 'calendarChannel',
context: {
viewName: 'calendarChannelRecordPageFields',
name: 'Calendar Channel Record Page Fields',
type: ViewType.FIELDS_WIDGET,
key: null,
position: 0,
icon: 'IconList',
},
}),
};
};
@@ -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 computeStandardMessageChannelViews = (
args: Omit<CreateStandardViewArgs<'messageChannel'>, 'context'>,
): Record<string, FlatView> => {
return {
allMessageChannels: createStandardViewFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'allMessageChannels',
name: 'All {objectLabelPlural}',
type: ViewType.TABLE,
key: ViewKey.INDEX,
position: 0,
icon: 'IconList',
},
}),
messageChannelRecordPageFields: createStandardViewFlatMetadata({
...args,
objectName: 'messageChannel',
context: {
viewName: 'messageChannelRecordPageFields',
name: 'Message Channel Record Page Fields',
type: ViewType.FIELDS_WIDGET,
key: null,
position: 0,
icon: 'IconList',
},
}),
};
};
@@ -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 computeStandardMessageFolderViews = (
args: Omit<CreateStandardViewArgs<'messageFolder'>, 'context'>,
): Record<string, FlatView> => {
return {
allMessageFolders: createStandardViewFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'allMessageFolders',
name: 'All {objectLabelPlural}',
type: ViewType.TABLE,
key: ViewKey.INDEX,
position: 0,
icon: 'IconList',
},
}),
messageFolderRecordPageFields: createStandardViewFlatMetadata({
...args,
objectName: 'messageFolder',
context: {
viewName: 'messageFolderRecordPageFields',
name: 'Message Folder Record Page Fields',
type: ViewType.FIELDS_WIDGET,
key: null,
position: 0,
icon: 'IconList',
},
}),
};
};
@@ -6,7 +6,6 @@ export const STANDARD_OBJECT_ICONS = {
blocklist: 'IconForbid2',
behavioralEvent: 'IconTimelineEvent',
calendarChannelEventAssociation: 'IconCalendar',
calendarChannel: 'IconCalendar',
calendarEventParticipant: 'IconCalendar',
calendarEvent: 'IconCalendar',
comment: 'IconMessageCircle',
@@ -14,8 +13,6 @@ export const STANDARD_OBJECT_ICONS = {
dashboard: 'IconLayoutDashboard',
auditLog: 'IconTimelineEvent',
messageChannelMessageAssociation: 'IconMessage',
messageChannel: 'IconMessage',
messageFolder: 'IconFolder',
messageParticipant: 'IconUserCircle',
messageThread: 'IconMessage',
messageThreadSubscriber: 'IconPerson',