feat: configure standard views and migrate attachment seeds to FILES field (#17958)
## Summary - Add default visible view fields for `timelineActivity`, `attachment`, `noteTarget`, `taskTarget`, and `workspaceMember` objects so they display useful columns out of the box - Standardize morph relation field labels to "Target" with `IconArrowUpRight` for consistency across all pivot/junction tables - Mark deprecated fields (`fullPath`, `fileCategory`, `linkedRecordCachedName`, `linkedRecordId`, `linkedObjectMetadataId`) as `isSystem` to hide them from the UI column picker - Fix morph field deduplication logic (`pickMorphGroupSurvivor`) to prefer active, non-system fields over auto-generated system fields from custom objects - Migrate attachment seeds from legacy `fullPath`/`fileCategory` to the new `FILES` field type, creating proper `FileEntity` records in `core.file` via `fileStorageService.writeFile()` - Restore `customDomain` in the user query fragment <img width="825" height="754" alt="Screenshot 2026-02-15 at 15 44 27" src="https://github.com/user-attachments/assets/9596a3dd-8d3a-43c0-925a-0adef9ee68a8" /> <img width="736" height="731" alt="Screenshot 2026-02-15 at 15 44 13" src="https://github.com/user-attachments/assets/cd1a66c5-731d-43e6-bbc3-703cbeda1652" /> <img width="722" height="757" alt="Screenshot 2026-02-15 at 15 44 03" src="https://github.com/user-attachments/assets/b5210546-6a40-4940-8e4f-874818a614fb" /> <img width="907" height="757" alt="Screenshot 2026-02-15 at 15 43 52" src="https://github.com/user-attachments/assets/ead5b9a8-1989-4d68-9640-583da6233711" /> <img width="1002" height="731" alt="Screenshot 2026-02-15 at 15 43 38" src="https://github.com/user-attachments/assets/38accb8c-f5d5-4bfc-b245-06389849810b" /> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches migration/upgrade commands that write to core metadata tables and adjust field/view definitions, plus changes dev seeding to create `core.file` records; mistakes could affect UI visibility or seed integrity across workspaces. > > **Overview** > Adds a new `upgrade:1-18:backfill-standard-views-and-field-metadata` command that, per workspace, marks specific fields as `isSystem`, normalizes morph-relation field `label`/`icon` to `Target`/`IconArrowUpRight`, and backfills missing standard `view`/`viewField` rows for `attachment`, `noteTarget`, `taskTarget`, `timelineActivity`, and `workspaceMember`, followed by cache invalidation + metadata version bump. > > Refactors morph-relation deduplication to pick a single survivor per `morphId` using a new `pickMorphGroupSurvivor` rule (prefer active + non-system, then smallest id), with new unit tests. > > Updates standard metadata generators and snapshots to reflect the new system flags and default view fields, and rewrites attachment dev seeding to populate the new `file` (FILES field) JSON and create corresponding `core.file` entries via `FileStorageService.writeFile` with workspace-scoped file IDs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b1939bbf6f8cce294f9b4cdec06b19778daa205e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
This commit is contained in:
+1114
-994
File diff suppressed because it is too large
Load Diff
+23
-21
@@ -156,6 +156,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
label: 'Full path',
|
||||
description: 'Attachment full path',
|
||||
icon: 'IconLink',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
},
|
||||
@@ -174,6 +175,7 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
label: 'File category',
|
||||
description: 'Attachment file category',
|
||||
icon: 'IconList',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
defaultValue: "'OTHER'",
|
||||
@@ -261,9 +263,9 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.attachment.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetTask',
|
||||
label: 'Task',
|
||||
description: 'Attachment task',
|
||||
icon: 'IconNotes',
|
||||
label: 'Target',
|
||||
description: 'Attachment target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'task',
|
||||
@@ -286,9 +288,9 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.attachment.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetNote',
|
||||
label: 'Note',
|
||||
description: 'Attachment note',
|
||||
icon: 'IconNotes',
|
||||
label: 'Target',
|
||||
description: 'Attachment target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'note',
|
||||
@@ -311,9 +313,9 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.attachment.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetPerson',
|
||||
label: 'Person',
|
||||
description: 'Attachment person',
|
||||
icon: 'IconUser',
|
||||
label: 'Target',
|
||||
description: 'Attachment target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'person',
|
||||
@@ -336,9 +338,9 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.attachment.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetCompany',
|
||||
label: 'Company',
|
||||
description: 'Attachment company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
label: 'Target',
|
||||
description: 'Attachment target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'company',
|
||||
@@ -361,9 +363,9 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.attachment.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetOpportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'Attachment opportunity',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
label: 'Target',
|
||||
description: 'Attachment target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'opportunity',
|
||||
@@ -386,9 +388,9 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.attachment.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetDashboard',
|
||||
label: 'Dashboard',
|
||||
description: 'Attachment dashboard',
|
||||
icon: 'IconLayout',
|
||||
label: 'Target',
|
||||
description: 'Attachment target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'dashboard',
|
||||
@@ -411,9 +413,9 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.attachment.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetWorkflow',
|
||||
label: 'Workflow',
|
||||
description: 'Attachment workflow',
|
||||
icon: 'IconSettingsAutomation',
|
||||
label: 'Target',
|
||||
description: 'Attachment target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'workflow',
|
||||
|
||||
+9
-9
@@ -141,9 +141,9 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.noteTarget.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetPerson',
|
||||
label: 'Person',
|
||||
description: 'NoteTarget person',
|
||||
icon: 'IconUser',
|
||||
label: 'Target',
|
||||
description: 'NoteTarget target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'person',
|
||||
@@ -166,9 +166,9 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.noteTarget.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetCompany',
|
||||
label: 'Company',
|
||||
description: 'NoteTarget company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
label: 'Target',
|
||||
description: 'NoteTarget target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'company',
|
||||
@@ -191,9 +191,9 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.noteTarget.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetOpportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'NoteTarget opportunity',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'NoteTarget target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'opportunity',
|
||||
|
||||
+9
-9
@@ -141,9 +141,9 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.taskTarget.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetPerson',
|
||||
label: 'Person',
|
||||
description: 'TaskTarget person',
|
||||
icon: 'IconUser',
|
||||
label: 'Target',
|
||||
description: 'TaskTarget target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'person',
|
||||
@@ -166,9 +166,9 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.taskTarget.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetCompany',
|
||||
label: 'Company',
|
||||
description: 'TaskTarget company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
label: 'Target',
|
||||
description: 'TaskTarget target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'company',
|
||||
@@ -191,9 +191,9 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.taskTarget.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetOpportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'TaskTarget opportunity',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'TaskTarget target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'opportunity',
|
||||
|
||||
+30
-27
@@ -167,6 +167,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
label: 'Linked Record cached name',
|
||||
description: 'Cached record name',
|
||||
icon: 'IconAbc',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
},
|
||||
@@ -184,6 +185,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
label: 'Linked Record id',
|
||||
description: 'Linked Record id',
|
||||
icon: 'IconAbc',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
},
|
||||
@@ -201,6 +203,7 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
label: 'Linked Object Metadata Id',
|
||||
description: 'Linked Object Metadata Id',
|
||||
icon: 'IconAbc',
|
||||
isSystem: true,
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
},
|
||||
@@ -243,9 +246,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetPerson',
|
||||
label: 'Person',
|
||||
description: 'Event person',
|
||||
icon: 'IconUser',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'person',
|
||||
@@ -268,9 +271,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetCompany',
|
||||
label: 'Company',
|
||||
description: 'Event company',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'company',
|
||||
@@ -293,9 +296,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetOpportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'Event opportunity',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'opportunity',
|
||||
@@ -318,9 +321,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetNote',
|
||||
label: 'Note',
|
||||
description: 'Event note',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'note',
|
||||
@@ -343,9 +346,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetTask',
|
||||
label: 'Task',
|
||||
description: 'Event task',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'task',
|
||||
@@ -368,9 +371,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetWorkflow',
|
||||
label: 'Workflow',
|
||||
description: 'Event workflow',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'workflow',
|
||||
@@ -393,9 +396,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetWorkflowVersion',
|
||||
label: 'WorkflowVersion',
|
||||
description: 'Event workflow version',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'workflowVersion',
|
||||
@@ -418,9 +421,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetWorkflowRun',
|
||||
label: 'Workflow Run',
|
||||
description: 'Event workflow run',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'workflowRun',
|
||||
@@ -443,9 +446,9 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
|
||||
fieldName: 'targetDashboard',
|
||||
label: 'Dashboard',
|
||||
description: 'Event dashboard',
|
||||
icon: 'IconTargetArrow',
|
||||
label: 'Target',
|
||||
description: 'Event target',
|
||||
icon: 'IconArrowUpRight',
|
||||
isNullable: true,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'dashboard',
|
||||
|
||||
+6
@@ -444,6 +444,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the workspace member',
|
||||
icon: 'IconHeart',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'favorite',
|
||||
@@ -467,6 +468,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
label: 'Account Owner For Companies',
|
||||
description: 'Account owner for companies',
|
||||
icon: 'IconBriefcase',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'company',
|
||||
@@ -490,6 +492,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
label: 'Connected accounts',
|
||||
description: 'Connected accounts',
|
||||
icon: 'IconAt',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'connectedAccount',
|
||||
@@ -513,6 +516,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
label: 'Message Participants',
|
||||
description: 'Message Participants',
|
||||
icon: 'IconUserCircle',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'messageParticipant',
|
||||
@@ -536,6 +540,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
label: 'Blocklist',
|
||||
description: 'Blocklisted handles',
|
||||
icon: 'IconForbid2',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'blocklist',
|
||||
@@ -559,6 +564,7 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
label: 'Calendar Event Participants',
|
||||
description: 'Calendar Event Participants',
|
||||
icon: 'IconCalendar',
|
||||
isSystem: true,
|
||||
isNullable: false,
|
||||
isUIReadOnly: true,
|
||||
targetObjectName: 'calendarEventParticipant',
|
||||
|
||||
+10
@@ -5,18 +5,23 @@ import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/typ
|
||||
import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util';
|
||||
import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type';
|
||||
import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type';
|
||||
import { computeStandardAttachmentViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-attachment-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 { 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';
|
||||
import { computeStandardNoteTargetViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-note-target-view-fields.util';
|
||||
import { computeStandardNoteViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-note-view-fields.util';
|
||||
import { computeStandardOpportunityViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-opportunity-view-fields.util';
|
||||
import { computeStandardPersonViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-person-view-fields.util';
|
||||
import { computeStandardTaskTargetViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-task-target-view-fields.util';
|
||||
import { computeStandardTaskViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-task-view-fields.util';
|
||||
import { computeStandardTimelineActivityViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-timeline-activity-view-fields.util';
|
||||
import { computeStandardWorkflowRunViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-workflow-run-view-fields.util';
|
||||
import { computeStandardWorkflowVersionViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-workflow-version-view-fields.util';
|
||||
import { computeStandardWorkflowViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-workflow-view-fields.util';
|
||||
import { computeStandardWorkspaceMemberViewFields } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-workspace-member-view-fields.util';
|
||||
import { type CreateStandardViewFieldArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/create-standard-view-field-flat-metadata.util';
|
||||
|
||||
type StandardViewFieldBuilder<P extends AllStandardObjectName> = (
|
||||
@@ -24,18 +29,23 @@ type StandardViewFieldBuilder<P extends AllStandardObjectName> = (
|
||||
) => Record<string, FlatViewField>;
|
||||
|
||||
const STANDARD_FLAT_VIEW_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
attachment: computeStandardAttachmentViewFields,
|
||||
calendarEvent: computeStandardCalendarEventViewFields,
|
||||
company: computeStandardCompanyViewFields,
|
||||
dashboard: computeStandardDashboardViewFields,
|
||||
message: computeStandardMessageViewFields,
|
||||
messageThread: computeStandardMessageThreadViewFields,
|
||||
note: computeStandardNoteViewFields,
|
||||
noteTarget: computeStandardNoteTargetViewFields,
|
||||
opportunity: computeStandardOpportunityViewFields,
|
||||
person: computeStandardPersonViewFields,
|
||||
task: computeStandardTaskViewFields,
|
||||
taskTarget: computeStandardTaskTargetViewFields,
|
||||
timelineActivity: computeStandardTimelineActivityViewFields,
|
||||
workflow: computeStandardWorkflowViewFields,
|
||||
workflowRun: computeStandardWorkflowRunViewFields,
|
||||
workflowVersion: computeStandardWorkflowVersionViewFields,
|
||||
workspaceMember: computeStandardWorkspaceMemberViewFields,
|
||||
} as const satisfies {
|
||||
[P in AllStandardObjectName]?: StandardViewFieldBuilder<P>;
|
||||
};
|
||||
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
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 computeStandardAttachmentViewFields = (
|
||||
args: Omit<CreateStandardViewFieldArgs<'attachment'>, 'context'>,
|
||||
): Record<string, FlatViewField> => {
|
||||
return {
|
||||
allAttachmentsName: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'name',
|
||||
fieldName: 'name',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 210,
|
||||
},
|
||||
}),
|
||||
allAttachmentsFile: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'file',
|
||||
fieldName: 'file',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
// All morph targets are included so the surviving field after dedup always has a viewField
|
||||
allAttachmentsTargetPerson: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'targetPerson',
|
||||
fieldName: 'targetPerson',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allAttachmentsTargetCompany: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'targetCompany',
|
||||
fieldName: 'targetCompany',
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allAttachmentsTargetOpportunity: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'targetOpportunity',
|
||||
fieldName: 'targetOpportunity',
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allAttachmentsTargetTask: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'targetTask',
|
||||
fieldName: 'targetTask',
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allAttachmentsTargetNote: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'targetNote',
|
||||
fieldName: 'targetNote',
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allAttachmentsTargetDashboard: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'targetDashboard',
|
||||
fieldName: 'targetDashboard',
|
||||
position: 7,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allAttachmentsTargetWorkflow: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'targetWorkflow',
|
||||
fieldName: 'targetWorkflow',
|
||||
position: 8,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allAttachmentsCreatedBy: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'createdBy',
|
||||
fieldName: 'createdBy',
|
||||
position: 9,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allAttachmentsCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
viewFieldName: 'createdAt',
|
||||
fieldName: 'createdAt',
|
||||
position: 10,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
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 computeStandardNoteTargetViewFields = (
|
||||
args: Omit<CreateStandardViewFieldArgs<'noteTarget'>, 'context'>,
|
||||
): Record<string, FlatViewField> => {
|
||||
return {
|
||||
// Label identifier for junction tables
|
||||
allNoteTargetsId: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'noteTarget',
|
||||
context: {
|
||||
viewName: 'allNoteTargets',
|
||||
viewFieldName: 'id',
|
||||
fieldName: 'id',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 210,
|
||||
},
|
||||
}),
|
||||
allNoteTargetsNote: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'noteTarget',
|
||||
context: {
|
||||
viewName: 'allNoteTargets',
|
||||
viewFieldName: 'note',
|
||||
fieldName: 'note',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
// All morph targets are included so the surviving field after dedup always has a viewField
|
||||
allNoteTargetsTargetPerson: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'noteTarget',
|
||||
context: {
|
||||
viewName: 'allNoteTargets',
|
||||
viewFieldName: 'targetPerson',
|
||||
fieldName: 'targetPerson',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allNoteTargetsTargetCompany: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'noteTarget',
|
||||
context: {
|
||||
viewName: 'allNoteTargets',
|
||||
viewFieldName: 'targetCompany',
|
||||
fieldName: 'targetCompany',
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allNoteTargetsTargetOpportunity: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'noteTarget',
|
||||
context: {
|
||||
viewName: 'allNoteTargets',
|
||||
viewFieldName: 'targetOpportunity',
|
||||
fieldName: 'targetOpportunity',
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
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 computeStandardTaskTargetViewFields = (
|
||||
args: Omit<CreateStandardViewFieldArgs<'taskTarget'>, 'context'>,
|
||||
): Record<string, FlatViewField> => {
|
||||
return {
|
||||
// Label identifier for junction tables
|
||||
allTaskTargetsId: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'taskTarget',
|
||||
context: {
|
||||
viewName: 'allTaskTargets',
|
||||
viewFieldName: 'id',
|
||||
fieldName: 'id',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 210,
|
||||
},
|
||||
}),
|
||||
allTaskTargetsTask: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'taskTarget',
|
||||
context: {
|
||||
viewName: 'allTaskTargets',
|
||||
viewFieldName: 'task',
|
||||
fieldName: 'task',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
// All morph targets are included so the surviving field after dedup always has a viewField
|
||||
allTaskTargetsTargetPerson: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'taskTarget',
|
||||
context: {
|
||||
viewName: 'allTaskTargets',
|
||||
viewFieldName: 'targetPerson',
|
||||
fieldName: 'targetPerson',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTaskTargetsTargetCompany: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'taskTarget',
|
||||
context: {
|
||||
viewName: 'allTaskTargets',
|
||||
viewFieldName: 'targetCompany',
|
||||
fieldName: 'targetCompany',
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTaskTargetsTargetOpportunity: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'taskTarget',
|
||||
context: {
|
||||
viewName: 'allTaskTargets',
|
||||
viewFieldName: 'targetOpportunity',
|
||||
fieldName: 'targetOpportunity',
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
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 computeStandardTimelineActivityViewFields = (
|
||||
args: Omit<CreateStandardViewFieldArgs<'timelineActivity'>, 'context'>,
|
||||
): Record<string, FlatViewField> => {
|
||||
return {
|
||||
allTimelineActivitiesName: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'name',
|
||||
fieldName: 'name',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 210,
|
||||
},
|
||||
}),
|
||||
allTimelineActivitiesHappensAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'happensAt',
|
||||
fieldName: 'happensAt',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
// All morph targets are included so the surviving field after dedup always has a viewField
|
||||
allTimelineActivitiesTargetPerson: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetPerson',
|
||||
fieldName: 'targetPerson',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTimelineActivitiesTargetCompany: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetCompany',
|
||||
fieldName: 'targetCompany',
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTimelineActivitiesTargetOpportunity: createStandardViewFieldFlatMetadata(
|
||||
{
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetOpportunity',
|
||||
fieldName: 'targetOpportunity',
|
||||
position: 4,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
},
|
||||
),
|
||||
allTimelineActivitiesTargetTask: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetTask',
|
||||
fieldName: 'targetTask',
|
||||
position: 5,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTimelineActivitiesTargetNote: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetNote',
|
||||
fieldName: 'targetNote',
|
||||
position: 6,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTimelineActivitiesTargetWorkflow: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetWorkflow',
|
||||
fieldName: 'targetWorkflow',
|
||||
position: 7,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTimelineActivitiesTargetWorkflowVersion:
|
||||
createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetWorkflowVersion',
|
||||
fieldName: 'targetWorkflowVersion',
|
||||
position: 8,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTimelineActivitiesTargetWorkflowRun: createStandardViewFieldFlatMetadata(
|
||||
{
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetWorkflowRun',
|
||||
fieldName: 'targetWorkflowRun',
|
||||
position: 9,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
},
|
||||
),
|
||||
allTimelineActivitiesTargetDashboard: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'targetDashboard',
|
||||
fieldName: 'targetDashboard',
|
||||
position: 10,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allTimelineActivitiesWorkspaceMember: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
viewFieldName: 'workspaceMember',
|
||||
fieldName: 'workspaceMember',
|
||||
position: 11,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
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 computeStandardWorkspaceMemberViewFields = (
|
||||
args: Omit<CreateStandardViewFieldArgs<'workspaceMember'>, 'context'>,
|
||||
): Record<string, FlatViewField> => {
|
||||
return {
|
||||
allWorkspaceMembersName: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'workspaceMember',
|
||||
context: {
|
||||
viewName: 'allWorkspaceMembers',
|
||||
viewFieldName: 'name',
|
||||
fieldName: 'name',
|
||||
position: 0,
|
||||
isVisible: true,
|
||||
size: 210,
|
||||
},
|
||||
}),
|
||||
allWorkspaceMembersCreatedAt: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'workspaceMember',
|
||||
context: {
|
||||
viewName: 'allWorkspaceMembers',
|
||||
viewFieldName: 'createdAt',
|
||||
fieldName: 'createdAt',
|
||||
position: 1,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allWorkspaceMembersOwnedOpportunities: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'workspaceMember',
|
||||
context: {
|
||||
viewName: 'allWorkspaceMembers',
|
||||
viewFieldName: 'ownedOpportunities',
|
||||
fieldName: 'ownedOpportunities',
|
||||
position: 2,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
allWorkspaceMembersAssignedTasks: createStandardViewFieldFlatMetadata({
|
||||
...args,
|
||||
objectName: 'workspaceMember',
|
||||
context: {
|
||||
viewName: 'allWorkspaceMembers',
|
||||
viewFieldName: 'assignedTasks',
|
||||
fieldName: 'assignedTasks',
|
||||
position: 3,
|
||||
isVisible: true,
|
||||
size: 150,
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+10
@@ -4,18 +4,23 @@ import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-module
|
||||
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
|
||||
import { ViewType } from 'src/engine/metadata-modules/view/enums/view-type.enum';
|
||||
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 { computeStandardCalendarEventViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-calendar-event-views.util';
|
||||
import { computeStandardCompanyViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-company-views.util';
|
||||
import { computeStandardDashboardViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-dashboard-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';
|
||||
import { computeStandardNoteTargetViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-note-target-views.util';
|
||||
import { computeStandardNoteViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-note-views.util';
|
||||
import { computeStandardOpportunityViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-opportunity-views.util';
|
||||
import { computeStandardPersonViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-person-views.util';
|
||||
import { computeStandardTaskTargetViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-task-target-views.util';
|
||||
import { computeStandardTaskViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-task-views.util';
|
||||
import { computeStandardTimelineActivityViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-timeline-activity-views.util';
|
||||
import { computeStandardWorkflowRunViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-workflow-run-views.util';
|
||||
import { computeStandardWorkflowVersionViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-workflow-version-views.util';
|
||||
import { computeStandardWorkflowViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-workflow-views.util';
|
||||
import { computeStandardWorkspaceMemberViews } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/compute-standard-workspace-member-views.util';
|
||||
import { type CreateStandardViewArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
|
||||
|
||||
type StandardViewBuilder<P extends AllStandardObjectName> = (
|
||||
@@ -23,18 +28,23 @@ type StandardViewBuilder<P extends AllStandardObjectName> = (
|
||||
) => Record<string, FlatView>;
|
||||
|
||||
const STANDARD_FLAT_VIEW_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
attachment: computeStandardAttachmentViews,
|
||||
calendarEvent: computeStandardCalendarEventViews,
|
||||
company: computeStandardCompanyViews,
|
||||
dashboard: computeStandardDashboardViews,
|
||||
message: computeStandardMessageViews,
|
||||
messageThread: computeStandardMessageThreadViews,
|
||||
note: computeStandardNoteViews,
|
||||
noteTarget: computeStandardNoteTargetViews,
|
||||
opportunity: computeStandardOpportunityViews,
|
||||
person: computeStandardPersonViews,
|
||||
task: computeStandardTaskViews,
|
||||
taskTarget: computeStandardTaskTargetViews,
|
||||
timelineActivity: computeStandardTimelineActivityViews,
|
||||
workflow: computeStandardWorkflowViews,
|
||||
workflowRun: computeStandardWorkflowRunViews,
|
||||
workflowVersion: computeStandardWorkflowVersionViews,
|
||||
workspaceMember: computeStandardWorkspaceMemberViews,
|
||||
} as const satisfies {
|
||||
[P in AllStandardObjectName]?: StandardViewBuilder<P>;
|
||||
};
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
|
||||
import { ViewKey } from 'src/engine/metadata-modules/view/enums/view-key.enum';
|
||||
import { ViewType } from 'src/engine/metadata-modules/view/enums/view-type.enum';
|
||||
import {
|
||||
createStandardViewFlatMetadata,
|
||||
type CreateStandardViewArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
|
||||
|
||||
export const computeStandardAttachmentViews = (
|
||||
args: Omit<CreateStandardViewArgs<'attachment'>, 'context'>,
|
||||
): Record<string, FlatView> => {
|
||||
return {
|
||||
allAttachments: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'attachment',
|
||||
context: {
|
||||
viewName: 'allAttachments',
|
||||
name: 'All Attachments',
|
||||
type: ViewType.TABLE,
|
||||
key: ViewKey.INDEX,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
|
||||
import { ViewKey } from 'src/engine/metadata-modules/view/enums/view-key.enum';
|
||||
import { ViewType } from 'src/engine/metadata-modules/view/enums/view-type.enum';
|
||||
import {
|
||||
createStandardViewFlatMetadata,
|
||||
type CreateStandardViewArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
|
||||
|
||||
export const computeStandardNoteTargetViews = (
|
||||
args: Omit<CreateStandardViewArgs<'noteTarget'>, 'context'>,
|
||||
): Record<string, FlatView> => {
|
||||
return {
|
||||
allNoteTargets: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'noteTarget',
|
||||
context: {
|
||||
viewName: 'allNoteTargets',
|
||||
name: 'All Note Targets',
|
||||
type: ViewType.TABLE,
|
||||
key: ViewKey.INDEX,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
|
||||
import { ViewKey } from 'src/engine/metadata-modules/view/enums/view-key.enum';
|
||||
import { ViewType } from 'src/engine/metadata-modules/view/enums/view-type.enum';
|
||||
import {
|
||||
createStandardViewFlatMetadata,
|
||||
type CreateStandardViewArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
|
||||
|
||||
export const computeStandardTaskTargetViews = (
|
||||
args: Omit<CreateStandardViewArgs<'taskTarget'>, 'context'>,
|
||||
): Record<string, FlatView> => {
|
||||
return {
|
||||
allTaskTargets: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'taskTarget',
|
||||
context: {
|
||||
viewName: 'allTaskTargets',
|
||||
name: 'All Task Targets',
|
||||
type: ViewType.TABLE,
|
||||
key: ViewKey.INDEX,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
|
||||
import { ViewKey } from 'src/engine/metadata-modules/view/enums/view-key.enum';
|
||||
import { ViewType } from 'src/engine/metadata-modules/view/enums/view-type.enum';
|
||||
import {
|
||||
createStandardViewFlatMetadata,
|
||||
type CreateStandardViewArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
|
||||
|
||||
export const computeStandardTimelineActivityViews = (
|
||||
args: Omit<CreateStandardViewArgs<'timelineActivity'>, 'context'>,
|
||||
): Record<string, FlatView> => {
|
||||
return {
|
||||
allTimelineActivities: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'timelineActivity',
|
||||
context: {
|
||||
viewName: 'allTimelineActivities',
|
||||
name: 'All Timeline Activities',
|
||||
type: ViewType.TABLE,
|
||||
key: ViewKey.INDEX,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { type FlatView } from 'src/engine/metadata-modules/flat-view/types/flat-view.type';
|
||||
import { ViewKey } from 'src/engine/metadata-modules/view/enums/view-key.enum';
|
||||
import { ViewType } from 'src/engine/metadata-modules/view/enums/view-type.enum';
|
||||
import {
|
||||
createStandardViewFlatMetadata,
|
||||
type CreateStandardViewArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/view/create-standard-view-flat-metadata.util';
|
||||
|
||||
export const computeStandardWorkspaceMemberViews = (
|
||||
args: Omit<CreateStandardViewArgs<'workspaceMember'>, 'context'>,
|
||||
): Record<string, FlatView> => {
|
||||
return {
|
||||
allWorkspaceMembers: createStandardViewFlatMetadata({
|
||||
...args,
|
||||
objectName: 'workspaceMember',
|
||||
context: {
|
||||
viewName: 'allWorkspaceMembers',
|
||||
name: 'All Workspace Members',
|
||||
type: ViewType.TABLE,
|
||||
key: ViewKey.INDEX,
|
||||
position: 0,
|
||||
icon: 'IconList',
|
||||
},
|
||||
}),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user