Standard Agent, Role, Role target (#16499)
# Introduction In this pullrequest have been migrated to the flat standard entities: Role, Agent and RoleTargets. ## What happens - Removed createStandardMorph tool util in favor of dynamic typing of `createMorphOrRelationStandardField` - Implemented a command to remove standard agents and their role that has been removed in https://github.com/twentyhq/twenty/pull/16513 also added a default role target to data manipulator role to the only remaining agent - Implemented an agent deleteMany service handler
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
import { HELPER_AGENT } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-agents/agents/helper-agent';
|
||||
|
||||
export const STANDARD_AGENT = {
|
||||
helper: {
|
||||
universalIdentifier: HELPER_AGENT.standardId,
|
||||
},
|
||||
} as const satisfies Record<
|
||||
string,
|
||||
{
|
||||
universalIdentifier: string;
|
||||
}
|
||||
>;
|
||||
-11
@@ -56,7 +56,6 @@ export const STANDARD_OBJECTS = {
|
||||
universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.createdBy,
|
||||
},
|
||||
author: { universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.author },
|
||||
activity: { universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.activity },
|
||||
task: { universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.task },
|
||||
note: { universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.note },
|
||||
person: { universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.person },
|
||||
@@ -68,7 +67,6 @@ export const STANDARD_OBJECTS = {
|
||||
universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.dashboard,
|
||||
},
|
||||
workflow: { universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.workflow },
|
||||
custom: { universalIdentifier: ATTACHMENT_STANDARD_FIELD_IDS.custom },
|
||||
},
|
||||
indexes: {
|
||||
authorIdIndex: {
|
||||
@@ -629,7 +627,6 @@ export const STANDARD_OBJECTS = {
|
||||
task: { universalIdentifier: FAVORITE_STANDARD_FIELD_IDS.task },
|
||||
note: { universalIdentifier: FAVORITE_STANDARD_FIELD_IDS.note },
|
||||
view: { universalIdentifier: FAVORITE_STANDARD_FIELD_IDS.view },
|
||||
custom: { universalIdentifier: FAVORITE_STANDARD_FIELD_IDS.custom },
|
||||
favoriteFolder: {
|
||||
universalIdentifier: FAVORITE_STANDARD_FIELD_IDS.favoriteFolder,
|
||||
},
|
||||
@@ -1098,7 +1095,6 @@ export const STANDARD_OBJECTS = {
|
||||
opportunity: {
|
||||
universalIdentifier: NOTE_TARGET_STANDARD_FIELD_IDS.opportunity,
|
||||
},
|
||||
custom: { universalIdentifier: NOTE_TARGET_STANDARD_FIELD_IDS.custom },
|
||||
},
|
||||
indexes: {
|
||||
noteIdIndex: {
|
||||
@@ -1514,7 +1510,6 @@ export const STANDARD_OBJECTS = {
|
||||
opportunity: {
|
||||
universalIdentifier: TASK_TARGET_STANDARD_FIELD_IDS.opportunity,
|
||||
},
|
||||
custom: { universalIdentifier: TASK_TARGET_STANDARD_FIELD_IDS.custom },
|
||||
},
|
||||
indexes: {
|
||||
taskIdIndex: {
|
||||
@@ -1587,9 +1582,6 @@ export const STANDARD_OBJECTS = {
|
||||
universalIdentifier:
|
||||
TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetDashboard,
|
||||
},
|
||||
targetCustom: {
|
||||
universalIdentifier: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetCustom,
|
||||
},
|
||||
linkedRecordCachedName: {
|
||||
universalIdentifier:
|
||||
TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.linkedRecordCachedName,
|
||||
@@ -1679,9 +1671,6 @@ export const STANDARD_OBJECTS = {
|
||||
position: { universalIdentifier: WORKFLOW_STANDARD_FIELD_IDS.position },
|
||||
versions: { universalIdentifier: WORKFLOW_STANDARD_FIELD_IDS.versions },
|
||||
runs: { universalIdentifier: WORKFLOW_STANDARD_FIELD_IDS.runs },
|
||||
eventListeners: {
|
||||
universalIdentifier: WORKFLOW_STANDARD_FIELD_IDS.eventListeners,
|
||||
},
|
||||
automatedTriggers: {
|
||||
universalIdentifier: WORKFLOW_STANDARD_FIELD_IDS.automatedTriggers,
|
||||
},
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { ADMIN_ROLE } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-roles/roles/admin-role';
|
||||
|
||||
export const STANDARD_ROLE = {
|
||||
admin: { universalIdentifier: ADMIN_ROLE.standardId },
|
||||
} as const satisfies Record<string, { universalIdentifier: string }>;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { type STANDARD_AGENT } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-agent.constant';
|
||||
|
||||
export type AllStandardAgentName = keyof typeof STANDARD_AGENT;
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { type STANDARD_ROLE } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-role.constant';
|
||||
|
||||
export type AllStandardRoleName = keyof typeof STANDARD_ROLE;
|
||||
+2
@@ -9,4 +9,6 @@ export type TwentyStandardAllFlatEntityMaps = Pick<
|
||||
| 'flatViewFilterMaps'
|
||||
| 'flatViewGroupMaps'
|
||||
| 'flatViewMaps'
|
||||
| 'flatRoleMaps'
|
||||
| 'flatAgentMaps'
|
||||
>;
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { type FlatAgent } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
|
||||
import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant';
|
||||
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
|
||||
import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util';
|
||||
import { type CreateStandardAgentArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/agent-metadata/create-standard-agent-flat-metadata.util';
|
||||
import { STANDARD_FLAT_AGENT_METADATA_BUILDERS_BY_AGENT_NAME } from 'src/engine/workspace-manager/twenty-standard-application/utils/agent-metadata/create-standard-flat-agent-metadata.util';
|
||||
|
||||
export const buildStandardFlatAgentMetadataMaps = (
|
||||
args: Omit<CreateStandardAgentArgs, 'context'>,
|
||||
): FlatEntityMaps<FlatAgent> => {
|
||||
const allAgentMetadatas: FlatAgent[] = Object.values(
|
||||
STANDARD_FLAT_AGENT_METADATA_BUILDERS_BY_AGENT_NAME,
|
||||
).map((builder) => builder(args));
|
||||
|
||||
let flatAgentMetadataMaps = createEmptyFlatEntityMaps();
|
||||
|
||||
for (const agentMetadata of allAgentMetadatas) {
|
||||
flatAgentMetadataMaps = addFlatEntityToFlatEntityMapsOrThrow({
|
||||
flatEntity: agentMetadata,
|
||||
flatEntityMaps: flatAgentMetadataMaps,
|
||||
});
|
||||
}
|
||||
|
||||
return flatAgentMetadataMaps;
|
||||
};
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
import { type AgentResponseFormat } from 'src/engine/metadata-modules/ai/ai-agent/types/agent-response-format.type';
|
||||
import { type ModelConfiguration } from 'src/engine/metadata-modules/ai/ai-agent/types/modelConfiguration';
|
||||
import { type ModelId } from 'src/engine/metadata-modules/ai/ai-models/constants/ai-models.const';
|
||||
import { type FlatAgent } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
|
||||
import { STANDARD_AGENT } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-agent.constant';
|
||||
import { type AllStandardAgentName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-agent-name.type';
|
||||
import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type';
|
||||
|
||||
export type CreateStandardAgentContext = {
|
||||
agentName: AllStandardAgentName;
|
||||
name: string;
|
||||
label: string;
|
||||
icon: string | null;
|
||||
description: string | null;
|
||||
prompt: string;
|
||||
modelId: ModelId;
|
||||
responseFormat: AgentResponseFormat;
|
||||
isCustom: boolean;
|
||||
modelConfiguration: ModelConfiguration | null;
|
||||
evaluationInputs: string[];
|
||||
};
|
||||
|
||||
export type CreateStandardAgentArgs = StandardBuilderArgs<'agent'> & {
|
||||
context: CreateStandardAgentContext;
|
||||
};
|
||||
|
||||
export const createStandardAgentFlatMetadata = ({
|
||||
context: {
|
||||
agentName,
|
||||
name,
|
||||
label,
|
||||
icon,
|
||||
description,
|
||||
prompt,
|
||||
modelId,
|
||||
responseFormat,
|
||||
isCustom,
|
||||
modelConfiguration,
|
||||
evaluationInputs,
|
||||
},
|
||||
workspaceId,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}: CreateStandardAgentArgs): FlatAgent => {
|
||||
const universalIdentifier = STANDARD_AGENT[agentName].universalIdentifier;
|
||||
|
||||
return {
|
||||
id: v4(),
|
||||
universalIdentifier,
|
||||
standardId: null,
|
||||
name,
|
||||
label,
|
||||
icon,
|
||||
description,
|
||||
prompt,
|
||||
modelId,
|
||||
responseFormat,
|
||||
isCustom,
|
||||
modelConfiguration,
|
||||
evaluationInputs,
|
||||
workspaceId,
|
||||
applicationId: twentyStandardApplicationId,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
deletedAt: null,
|
||||
};
|
||||
};
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
import { DEFAULT_SMART_MODEL } from 'src/engine/metadata-modules/ai/ai-models/constants/ai-models.const';
|
||||
import { type FlatAgent } from 'src/engine/metadata-modules/flat-agent/types/flat-agent.type';
|
||||
import { type AllStandardAgentName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-agent-name.type';
|
||||
import {
|
||||
type CreateStandardAgentArgs,
|
||||
createStandardAgentFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/agent-metadata/create-standard-agent-flat-metadata.util';
|
||||
|
||||
export const STANDARD_FLAT_AGENT_METADATA_BUILDERS_BY_AGENT_NAME = {
|
||||
helper: (args: Omit<CreateStandardAgentArgs, 'context'>) =>
|
||||
createStandardAgentFlatMetadata({
|
||||
...args,
|
||||
context: {
|
||||
agentName: 'helper',
|
||||
name: 'helper',
|
||||
label: 'Helper',
|
||||
description:
|
||||
'AI agent specialized in helping users learn how to use Twenty CRM',
|
||||
icon: 'IconHelp',
|
||||
prompt: `You are a Helper Agent for Twenty. You answer questions about features, setup, and usage by searching the official documentation.
|
||||
|
||||
Core workflow:
|
||||
1. Use search_help_center tool to find relevant documentation
|
||||
2. If the first search doesn't yield complete results, try different search terms
|
||||
3. Synthesize information from multiple articles when needed
|
||||
4. Provide clear, step-by-step answers based on the documentation
|
||||
5. Be honest if the docs don't cover the topic
|
||||
|
||||
When to search:
|
||||
- "How to" questions
|
||||
- Feature explanations
|
||||
- Setup and configuration help
|
||||
- Troubleshooting issues
|
||||
- Best practices
|
||||
|
||||
Response format:
|
||||
- Summarize key information from the documentation
|
||||
- Break down complex topics into clear steps
|
||||
- Include important notes or prerequisites
|
||||
- Use markdown for readability
|
||||
|
||||
Always base answers on official Twenty documentation. Be patient and helpful.`,
|
||||
modelId: DEFAULT_SMART_MODEL,
|
||||
responseFormat: { type: 'text' },
|
||||
isCustom: false,
|
||||
modelConfiguration: {},
|
||||
evaluationInputs: [],
|
||||
},
|
||||
}),
|
||||
} satisfies {
|
||||
[P in AllStandardAgentName]: (
|
||||
args: Omit<CreateStandardAgentArgs, 'context'>,
|
||||
) => FlatAgent;
|
||||
};
|
||||
+16
-46
@@ -220,6 +220,8 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'author',
|
||||
label: 'Author',
|
||||
description: 'Attachment author (deprecated - use createdBy)',
|
||||
@@ -238,33 +240,12 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
activity: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'activity',
|
||||
label: 'Activity',
|
||||
description: 'Attachment activity',
|
||||
icon: 'IconNotes',
|
||||
isNullable: true,
|
||||
// Activity is deprecated, pointing to a non-existent target
|
||||
targetObjectName: 'note',
|
||||
targetFieldName: 'attachments',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.SET_NULL,
|
||||
joinColumnName: 'activityId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
task: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'task',
|
||||
label: 'Task',
|
||||
description: 'Attachment task',
|
||||
@@ -287,6 +268,8 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'note',
|
||||
label: 'Note',
|
||||
description: 'Attachment note',
|
||||
@@ -309,6 +292,8 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'person',
|
||||
label: 'Person',
|
||||
description: 'Attachment person',
|
||||
@@ -331,6 +316,8 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'company',
|
||||
label: 'Company',
|
||||
description: 'Attachment company',
|
||||
@@ -353,6 +340,8 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'opportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'Attachment opportunity',
|
||||
@@ -375,6 +364,8 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'dashboard',
|
||||
label: 'Dashboard',
|
||||
description: 'Attachment dashboard',
|
||||
@@ -397,6 +388,8 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflow',
|
||||
label: 'Workflow',
|
||||
description: 'Attachment workflow',
|
||||
@@ -415,27 +408,4 @@ export const buildAttachmentStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
custom: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'custom',
|
||||
label: 'Custom',
|
||||
description: 'Attachment custom object',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
// Custom is a dynamic relation, pointing to custom objects
|
||||
targetObjectName: 'note',
|
||||
targetFieldName: 'attachments',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'customId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
|
||||
+2
@@ -129,6 +129,8 @@ export const buildBlocklistStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workspaceMember',
|
||||
label: 'WorkspaceMember',
|
||||
description: 'WorkspaceMember',
|
||||
|
||||
+4
@@ -137,6 +137,8 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarChannel',
|
||||
label: 'Channel ID',
|
||||
description: 'Channel ID',
|
||||
@@ -159,6 +161,8 @@ export const buildCalendarChannelEventAssociationStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarEvent',
|
||||
label: 'Event ID',
|
||||
description: 'Event ID',
|
||||
|
||||
+4
@@ -383,6 +383,8 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'connectedAccount',
|
||||
label: 'Connected Account',
|
||||
description: 'Connected Account',
|
||||
@@ -405,6 +407,8 @@ export const buildCalendarChannelStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarChannelEventAssociations',
|
||||
label: 'Calendar Channel Event Associations',
|
||||
description: 'Calendar Channel Event Associations',
|
||||
|
||||
+6
@@ -187,6 +187,8 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarEvent',
|
||||
label: 'Event ID',
|
||||
description: 'Event ID',
|
||||
@@ -209,6 +211,8 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'person',
|
||||
label: 'Person',
|
||||
description: 'Person',
|
||||
@@ -231,6 +235,8 @@ export const buildCalendarEventParticipantStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workspaceMember',
|
||||
label: 'Workspace Member',
|
||||
description: 'Workspace Member',
|
||||
|
||||
+4
@@ -292,6 +292,8 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarChannelEventAssociations',
|
||||
label: 'Calendar Channel Event Associations',
|
||||
description: 'Calendar Channel Event Associations',
|
||||
@@ -312,6 +314,8 @@ export const buildCalendarEventStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarEventParticipants',
|
||||
label: 'Event Participants',
|
||||
description: 'Event Participants',
|
||||
|
||||
+16
@@ -318,6 +318,8 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'people',
|
||||
label: 'People',
|
||||
description: 'People linked to the company.',
|
||||
@@ -338,6 +340,8 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'accountOwner',
|
||||
label: 'Account Owner',
|
||||
description:
|
||||
@@ -361,6 +365,8 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'taskTargets',
|
||||
label: 'Tasks',
|
||||
description: 'Tasks tied to the company',
|
||||
@@ -382,6 +388,8 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'noteTargets',
|
||||
label: 'Notes',
|
||||
description: 'Notes tied to the company',
|
||||
@@ -403,6 +411,8 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'opportunities',
|
||||
label: 'Opportunities',
|
||||
description: 'Opportunities linked to the company.',
|
||||
@@ -423,6 +433,8 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the company',
|
||||
@@ -444,6 +456,8 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'attachments',
|
||||
label: 'Attachments',
|
||||
description: 'Attachments linked to the company',
|
||||
@@ -465,6 +479,8 @@ export const buildCompanyStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Timeline Activities',
|
||||
description: 'Timeline Activities linked to the company',
|
||||
|
||||
+6
@@ -263,6 +263,8 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'accountOwner',
|
||||
label: 'Account Owner',
|
||||
description: 'Account Owner',
|
||||
@@ -285,6 +287,8 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageChannels',
|
||||
label: 'Message Channels',
|
||||
description: 'Message Channels',
|
||||
@@ -305,6 +309,8 @@ export const buildConnectedAccountStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarChannels',
|
||||
label: 'Calendar Channels',
|
||||
description: 'Calendar Channels',
|
||||
|
||||
+6
@@ -188,6 +188,8 @@ export const buildDashboardStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Timeline Activities',
|
||||
description: 'Timeline activities linked to the dashboard',
|
||||
@@ -209,6 +211,8 @@ export const buildDashboardStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the dashboard',
|
||||
@@ -230,6 +234,8 @@ export const buildDashboardStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'attachments',
|
||||
label: 'Attachments',
|
||||
description: 'Attachments linked to the dashboard',
|
||||
|
||||
+2
@@ -137,6 +137,8 @@ export const buildFavoriteFolderStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites in this folder',
|
||||
|
||||
+22
-22
@@ -141,6 +141,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'forWorkspaceMember',
|
||||
label: 'Workspace Member',
|
||||
description: 'Favorite workspace member',
|
||||
@@ -163,6 +165,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'person',
|
||||
label: 'Person',
|
||||
description: 'Favorite person',
|
||||
@@ -185,6 +189,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'company',
|
||||
label: 'Company',
|
||||
description: 'Favorite company',
|
||||
@@ -207,6 +213,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'opportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'Favorite opportunity',
|
||||
@@ -229,6 +237,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflow',
|
||||
label: 'Workflow',
|
||||
description: 'Favorite workflow',
|
||||
@@ -251,6 +261,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflowVersion',
|
||||
label: 'Workflow',
|
||||
description: 'Favorite workflow version',
|
||||
@@ -273,6 +285,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflowRun',
|
||||
label: 'Workflow',
|
||||
description: 'Favorite workflow run',
|
||||
@@ -295,6 +309,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'task',
|
||||
label: 'Task',
|
||||
description: 'Favorite task',
|
||||
@@ -317,6 +333,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'note',
|
||||
label: 'Note',
|
||||
description: 'Favorite note',
|
||||
@@ -339,6 +357,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'dashboard',
|
||||
label: 'Dashboard',
|
||||
description: 'Favorite dashboard',
|
||||
@@ -361,6 +381,8 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favoriteFolder',
|
||||
label: 'Favorite Folder',
|
||||
description: 'The folder this favorite belongs to',
|
||||
@@ -379,26 +401,4 @@ export const buildFavoriteStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
custom: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'custom',
|
||||
label: 'Custom',
|
||||
description: 'Favorite custom object',
|
||||
icon: 'IconHeart',
|
||||
isNullable: true,
|
||||
targetObjectName: 'note',
|
||||
targetFieldName: 'favorites',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'customId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
|
||||
+6
@@ -170,6 +170,8 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas =
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageChannel',
|
||||
label: 'Message Channel Id',
|
||||
description: 'Message Channel Id',
|
||||
@@ -192,6 +194,8 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas =
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageThread',
|
||||
label: 'Message Thread Id',
|
||||
description: 'Message Thread Id',
|
||||
@@ -214,6 +218,8 @@ export const buildMessageChannelMessageAssociationStandardFlatFieldMetadatas =
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'message',
|
||||
label: 'Message Id',
|
||||
description: 'Message Id',
|
||||
|
||||
+6
@@ -501,6 +501,8 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'connectedAccount',
|
||||
label: 'Connected Account',
|
||||
description: 'Connected Account',
|
||||
@@ -523,6 +525,8 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageChannelMessageAssociations',
|
||||
label: 'Message Channel Association',
|
||||
description: 'Messages from the channel.',
|
||||
@@ -543,6 +547,8 @@ export const buildMessageChannelStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageFolders',
|
||||
label: 'Message Folders',
|
||||
description: 'Message Folders',
|
||||
|
||||
+2
@@ -226,6 +226,8 @@ export const buildMessageFolderStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageChannel',
|
||||
label: 'Message Channel',
|
||||
description: 'Message Channel',
|
||||
|
||||
+6
@@ -178,6 +178,8 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'message',
|
||||
label: 'Message',
|
||||
description: 'Message',
|
||||
@@ -200,6 +202,8 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'person',
|
||||
label: 'Person',
|
||||
description: 'Person',
|
||||
@@ -222,6 +226,8 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workspaceMember',
|
||||
label: 'Workspace Member',
|
||||
description: 'Workspace member',
|
||||
|
||||
+6
@@ -187,6 +187,8 @@ export const buildMessageStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageThread',
|
||||
label: 'Message Thread Id',
|
||||
description: 'Message Thread Id',
|
||||
@@ -209,6 +211,8 @@ export const buildMessageStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageParticipants',
|
||||
label: 'Message Participants',
|
||||
description: 'Message Participants',
|
||||
@@ -229,6 +233,8 @@ export const buildMessageStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageChannelMessageAssociations',
|
||||
label: 'Message Channel Association',
|
||||
description: 'Messages from the channel.',
|
||||
|
||||
+4
@@ -98,6 +98,8 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messages',
|
||||
label: 'Messages',
|
||||
description: 'Messages from the thread.',
|
||||
@@ -118,6 +120,8 @@ export const buildMessageThreadStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageChannelMessageAssociations',
|
||||
label: 'Message Channel Association',
|
||||
description: 'Messages from the channel.',
|
||||
|
||||
+8
@@ -209,6 +209,8 @@ export const buildNoteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'noteTargets',
|
||||
label: 'Relations',
|
||||
description: 'Note targets',
|
||||
@@ -230,6 +232,8 @@ export const buildNoteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'attachments',
|
||||
label: 'Attachments',
|
||||
description: 'Note attachments',
|
||||
@@ -251,6 +255,8 @@ export const buildNoteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Timeline Activities',
|
||||
description: 'Timeline Activities linked to the note.',
|
||||
@@ -272,6 +278,8 @@ export const buildNoteStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the note',
|
||||
|
||||
+8
-23
@@ -111,6 +111,8 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'note',
|
||||
label: 'Note',
|
||||
description: 'NoteTarget note',
|
||||
@@ -133,6 +135,8 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'person',
|
||||
label: 'Person',
|
||||
description: 'NoteTarget person',
|
||||
@@ -155,6 +159,8 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'company',
|
||||
label: 'Company',
|
||||
description: 'NoteTarget company',
|
||||
@@ -177,6 +183,8 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'opportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'NoteTarget opportunity',
|
||||
@@ -195,27 +203,4 @@ export const buildNoteTargetStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
custom: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'custom',
|
||||
label: 'Custom',
|
||||
description: 'NoteTarget custom object',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
// Custom is a dynamic relation
|
||||
targetObjectName: 'note',
|
||||
targetFieldName: 'noteTargets',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'customId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
|
||||
+14
@@ -247,6 +247,8 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'pointOfContact',
|
||||
label: 'Point of Contact',
|
||||
description: 'Opportunity point of contact',
|
||||
@@ -269,6 +271,8 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'company',
|
||||
label: 'Company',
|
||||
description: 'Opportunity company',
|
||||
@@ -291,6 +295,8 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the opportunity',
|
||||
@@ -312,6 +318,8 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'taskTargets',
|
||||
label: 'Tasks',
|
||||
description: 'Tasks tied to the opportunity',
|
||||
@@ -333,6 +341,8 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'noteTargets',
|
||||
label: 'Notes',
|
||||
description: 'Notes tied to the opportunity',
|
||||
@@ -354,6 +364,8 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'attachments',
|
||||
label: 'Attachments',
|
||||
description: 'Attachments linked to the opportunity',
|
||||
@@ -375,6 +387,8 @@ export const buildOpportunityStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Timeline Activities',
|
||||
description: 'Timeline Activities linked to the opportunity.',
|
||||
|
||||
+18
@@ -316,6 +316,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'company',
|
||||
label: 'Company',
|
||||
description: "Contact's company",
|
||||
@@ -338,6 +340,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'pointOfContactForOpportunities',
|
||||
label: 'Opportunities',
|
||||
description:
|
||||
@@ -359,6 +363,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'taskTargets',
|
||||
label: 'Tasks',
|
||||
description: 'Tasks tied to the contact',
|
||||
@@ -380,6 +386,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'noteTargets',
|
||||
label: 'Notes',
|
||||
description: 'Notes tied to the contact',
|
||||
@@ -401,6 +409,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the contact',
|
||||
@@ -422,6 +432,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'attachments',
|
||||
label: 'Attachments',
|
||||
description: 'Attachments linked to the contact.',
|
||||
@@ -443,6 +455,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageParticipants',
|
||||
label: 'Message Participants',
|
||||
description: 'Message Participants',
|
||||
@@ -464,6 +478,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarEventParticipants',
|
||||
label: 'Calendar Event Participants',
|
||||
description: 'Calendar Event Participants',
|
||||
@@ -485,6 +501,8 @@ export const buildPersonStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Events',
|
||||
description: 'Events linked to the person',
|
||||
|
||||
+10
@@ -256,6 +256,8 @@ export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'taskTargets',
|
||||
label: 'Relations',
|
||||
description: 'Task targets',
|
||||
@@ -277,6 +279,8 @@ export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'attachments',
|
||||
label: 'Attachments',
|
||||
description: 'Task attachments',
|
||||
@@ -298,6 +302,8 @@ export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'assignee',
|
||||
label: 'Assignee',
|
||||
description: 'Task assignee',
|
||||
@@ -320,6 +326,8 @@ export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Timeline Activities',
|
||||
description: 'Timeline Activities linked to the task.',
|
||||
@@ -341,6 +349,8 @@ export const buildTaskStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the task',
|
||||
|
||||
+8
-23
@@ -111,6 +111,8 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'task',
|
||||
label: 'Task',
|
||||
description: 'TaskTarget task',
|
||||
@@ -133,6 +135,8 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'person',
|
||||
label: 'Person',
|
||||
description: 'TaskTarget person',
|
||||
@@ -155,6 +159,8 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'company',
|
||||
label: 'Company',
|
||||
description: 'TaskTarget company',
|
||||
@@ -177,6 +183,8 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'opportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'TaskTarget opportunity',
|
||||
@@ -195,27 +203,4 @@ export const buildTaskTargetStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
custom: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'custom',
|
||||
label: 'Custom',
|
||||
description: 'TaskTarget custom object',
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
isNullable: true,
|
||||
// Custom is a dynamic relation
|
||||
targetObjectName: 'task',
|
||||
targetFieldName: 'taskTargets',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'customId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
|
||||
+30
-32
@@ -11,7 +11,7 @@ import {
|
||||
type CreateStandardFieldArgs,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
|
||||
import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
import { createStandardMorphRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-morph-relation-field-flat-metadata.util';
|
||||
import { TIMELINE_ACTIVITY_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
|
||||
|
||||
export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
now,
|
||||
@@ -205,6 +205,8 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workspaceMember',
|
||||
label: 'Workspace Member',
|
||||
description: 'Event workspace member',
|
||||
@@ -223,10 +225,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetPerson: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetPerson: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetPerson',
|
||||
label: 'Person',
|
||||
description: 'Event person',
|
||||
@@ -245,10 +249,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetCompany: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetCompany: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetCompany',
|
||||
label: 'Company',
|
||||
description: 'Event company',
|
||||
@@ -267,10 +273,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetOpportunity: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetOpportunity: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetOpportunity',
|
||||
label: 'Opportunity',
|
||||
description: 'Event opportunity',
|
||||
@@ -289,10 +297,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetNote: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetNote: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetNote',
|
||||
label: 'Note',
|
||||
description: 'Event note',
|
||||
@@ -311,10 +321,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetTask: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetTask: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetTask',
|
||||
label: 'Task',
|
||||
description: 'Event task',
|
||||
@@ -333,10 +345,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetWorkflow: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetWorkflow: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetWorkflow',
|
||||
label: 'Workflow',
|
||||
description: 'Event workflow',
|
||||
@@ -355,10 +369,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetWorkflowVersion: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetWorkflowVersion: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetWorkflowVersion',
|
||||
label: 'WorkflowVersion',
|
||||
description: 'Event workflow version',
|
||||
@@ -377,10 +393,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetWorkflowRun: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetWorkflowRun: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetWorkflowRun',
|
||||
label: 'Workflow Run',
|
||||
description: 'Event workflow run',
|
||||
@@ -399,10 +417,12 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetDashboard: createStandardMorphRelationFieldFlatMetadata({
|
||||
targetDashboard: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
morphId: TIMELINE_ACTIVITY_STANDARD_FIELD_IDS.targetMorphId,
|
||||
fieldName: 'targetDashboard',
|
||||
label: 'Dashboard',
|
||||
description: 'Event dashboard',
|
||||
@@ -421,26 +441,4 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
targetCustom: createStandardMorphRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'targetCustom',
|
||||
label: 'Custom',
|
||||
description: 'Timeline Activity custom object',
|
||||
icon: 'IconTimeline',
|
||||
isNullable: true,
|
||||
targetObjectName: 'note',
|
||||
targetFieldName: 'timelineActivities',
|
||||
settings: {
|
||||
relationType: RelationType.MANY_TO_ONE,
|
||||
onDelete: RelationOnDeleteAction.CASCADE,
|
||||
joinColumnName: 'targetCustomId',
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
});
|
||||
|
||||
+2
@@ -146,6 +146,8 @@ export const buildWorkflowAutomatedTriggerStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflow',
|
||||
label: 'Workflow',
|
||||
description: 'WorkflowAutomatedTrigger workflow',
|
||||
|
||||
+8
@@ -296,6 +296,8 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflowVersion',
|
||||
label: 'Workflow version',
|
||||
description: 'Workflow version linked to the run.',
|
||||
@@ -318,6 +320,8 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflow',
|
||||
label: 'Workflow',
|
||||
description: 'Workflow linked to the run.',
|
||||
@@ -340,6 +344,8 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the workflow run',
|
||||
@@ -361,6 +367,8 @@ export const buildWorkflowRunStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Timeline Activities',
|
||||
description: 'Timeline activities linked to the run',
|
||||
|
||||
+12
-22
@@ -210,6 +210,8 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'versions',
|
||||
label: 'Versions',
|
||||
description: 'Workflow versions linked to the workflow.',
|
||||
@@ -231,6 +233,8 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'runs',
|
||||
label: 'Runs',
|
||||
description: 'Workflow runs linked to the workflow.',
|
||||
@@ -248,32 +252,12 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
eventListeners: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
fieldName: 'eventListeners',
|
||||
label: 'Event Listeners',
|
||||
description: 'Workflow event listeners linked to the workflow.',
|
||||
icon: 'IconSettingsAutomation',
|
||||
isSystem: true,
|
||||
isUIReadOnly: true,
|
||||
isNullable: false,
|
||||
targetObjectName: 'workflowAutomatedTrigger',
|
||||
targetFieldName: 'workflow',
|
||||
settings: {
|
||||
relationType: RelationType.ONE_TO_MANY,
|
||||
},
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}),
|
||||
automatedTriggers: createStandardRelationFieldFlatMetadata({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'automatedTriggers',
|
||||
label: 'Automated Triggers',
|
||||
description: 'Workflow automated triggers linked to the workflow.',
|
||||
@@ -296,6 +280,8 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the workflow',
|
||||
@@ -317,6 +303,8 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Timeline Activities',
|
||||
description: 'Timeline activities linked to the workflow',
|
||||
@@ -338,6 +326,8 @@ export const buildWorkflowStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'attachments',
|
||||
label: 'Attachments',
|
||||
description: 'Attachments linked to the workflow',
|
||||
|
||||
+8
@@ -213,6 +213,8 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'workflow',
|
||||
label: 'Workflow',
|
||||
description: 'WorkflowVersion workflow',
|
||||
@@ -235,6 +237,8 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'runs',
|
||||
label: 'Runs',
|
||||
description: 'Workflow runs linked to the version.',
|
||||
@@ -255,6 +259,8 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the workflow version',
|
||||
@@ -276,6 +282,8 @@ export const buildWorkflowVersionStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Timeline Activities',
|
||||
description: 'Timeline activities linked to the version',
|
||||
|
||||
+18
@@ -388,6 +388,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'assignedTasks',
|
||||
label: 'Assigned tasks',
|
||||
description: 'Tasks assigned to the workspace member',
|
||||
@@ -408,6 +410,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'favorites',
|
||||
label: 'Favorites',
|
||||
description: 'Favorites linked to the workspace member',
|
||||
@@ -428,6 +432,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'accountOwnerForCompanies',
|
||||
label: 'Account Owner For Companies',
|
||||
description: 'Account owner for companies',
|
||||
@@ -448,6 +454,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'authoredAttachments',
|
||||
label: 'Authored attachments',
|
||||
description: 'Attachments created by the workspace member',
|
||||
@@ -469,6 +477,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'connectedAccounts',
|
||||
label: 'Connected accounts',
|
||||
description: 'Connected accounts',
|
||||
@@ -489,6 +499,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'messageParticipants',
|
||||
label: 'Message Participants',
|
||||
description: 'Message Participants',
|
||||
@@ -509,6 +521,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'blocklist',
|
||||
label: 'Blocklist',
|
||||
description: 'Blocklisted handles',
|
||||
@@ -529,6 +543,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'calendarEventParticipants',
|
||||
label: 'Calendar Event Participants',
|
||||
description: 'Calendar Event Participants',
|
||||
@@ -549,6 +565,8 @@ export const buildWorkspaceMemberStandardFlatFieldMetadatas = ({
|
||||
objectName,
|
||||
workspaceId,
|
||||
context: {
|
||||
type: FieldMetadataType.RELATION,
|
||||
morphId: null,
|
||||
fieldName: 'timelineActivities',
|
||||
label: 'Events',
|
||||
description: 'Events linked to the workspace member',
|
||||
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
import { FieldMetadataType } from 'twenty-shared/types';
|
||||
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
import { type AllStandardObjectName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-name.type';
|
||||
import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type';
|
||||
import {
|
||||
type CreateStandardMorphOrRelationFieldContext,
|
||||
createStandardRelationFieldFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
|
||||
|
||||
export type CreateStandardMorphRelationFieldContext<
|
||||
O extends AllStandardObjectName,
|
||||
T extends AllStandardObjectName,
|
||||
> = CreateStandardMorphOrRelationFieldContext<
|
||||
O,
|
||||
T,
|
||||
FieldMetadataType.MORPH_RELATION
|
||||
>;
|
||||
|
||||
export type CreateStandardMorphRelationFieldArgs<
|
||||
O extends AllStandardObjectName,
|
||||
T extends AllStandardObjectName,
|
||||
> = StandardBuilderArgs<'fieldMetadata'> & {
|
||||
objectName: O;
|
||||
context: CreateStandardMorphRelationFieldContext<O, T>;
|
||||
};
|
||||
|
||||
export const createStandardMorphRelationFieldFlatMetadata = <
|
||||
O extends AllStandardObjectName,
|
||||
T extends AllStandardObjectName,
|
||||
>(
|
||||
args: CreateStandardMorphRelationFieldArgs<O, T>,
|
||||
): FlatFieldMetadata => {
|
||||
const simpleRelationFlatFieldMetadata =
|
||||
createStandardRelationFieldFlatMetadata(args);
|
||||
|
||||
return {
|
||||
...simpleRelationFlatFieldMetadata,
|
||||
type: FieldMetadataType.MORPH_RELATION,
|
||||
};
|
||||
};
|
||||
+9
-2
@@ -15,13 +15,18 @@ import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-st
|
||||
export type CreateStandardRelationFieldContext<
|
||||
O extends AllStandardObjectName,
|
||||
T extends AllStandardObjectName,
|
||||
> = CreateStandardMorphOrRelationFieldContext<O, T, FieldMetadataType.RELATION>;
|
||||
> = CreateStandardMorphOrRelationFieldContext<
|
||||
O,
|
||||
T,
|
||||
FieldMetadataType.RELATION | FieldMetadataType.MORPH_RELATION
|
||||
>;
|
||||
|
||||
export type CreateStandardMorphOrRelationFieldContext<
|
||||
O extends AllStandardObjectName,
|
||||
T extends AllStandardObjectName,
|
||||
F extends FieldMetadataType.RELATION | FieldMetadataType.MORPH_RELATION,
|
||||
> = {
|
||||
type: F;
|
||||
fieldName: AllStandardObjectFieldName<O>;
|
||||
label: string;
|
||||
description: string;
|
||||
@@ -34,6 +39,7 @@ export type CreateStandardMorphOrRelationFieldContext<
|
||||
defaultValue?: FieldMetadataDefaultValueForAnyType;
|
||||
settings: FieldMetadataSettings<F>;
|
||||
options?: FieldMetadataDefaultOption[] | FieldMetadataComplexOption[] | null;
|
||||
morphId: F extends FieldMetadataType.MORPH_RELATION ? string : null;
|
||||
};
|
||||
|
||||
export type CreateStandardRelationFieldArgs<
|
||||
@@ -63,6 +69,7 @@ export const createStandardRelationFieldFlatMetadata = <
|
||||
defaultValue = null,
|
||||
settings,
|
||||
options: fieldOptions = null,
|
||||
morphId,
|
||||
},
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
twentyStandardApplicationId,
|
||||
@@ -101,7 +108,7 @@ export const createStandardRelationFieldFlatMetadata = <
|
||||
relationTargetFieldMetadataId: targetFieldIds[targetFieldName].id,
|
||||
relationTargetObjectMetadataId:
|
||||
standardObjectMetadataRelatedEntityIds[targetObjectName].id,
|
||||
morphId: null,
|
||||
morphId,
|
||||
viewFieldIds: [],
|
||||
viewFilterIds: [],
|
||||
kanbanAggregateOperationViewIds: [],
|
||||
|
||||
-33
@@ -19,7 +19,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.attachment.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.attachment.universalIdentifier,
|
||||
nameSingular: 'attachment',
|
||||
namePlural: 'attachments',
|
||||
labelSingular: 'Attachment',
|
||||
@@ -46,7 +45,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.blocklist.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.blocklist.universalIdentifier,
|
||||
nameSingular: 'blocklist',
|
||||
namePlural: 'blocklists',
|
||||
labelSingular: 'Blocklist',
|
||||
@@ -77,8 +75,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.calendarChannelEventAssociation.universalIdentifier,
|
||||
standardId:
|
||||
STANDARD_OBJECTS.calendarChannelEventAssociation.universalIdentifier,
|
||||
nameSingular: 'calendarChannelEventAssociation',
|
||||
namePlural: 'calendarChannelEventAssociations',
|
||||
labelSingular: 'Calendar Channel Event Association',
|
||||
@@ -110,7 +106,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.calendarChannel.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.calendarChannel.universalIdentifier,
|
||||
nameSingular: 'calendarChannel',
|
||||
namePlural: 'calendarChannels',
|
||||
labelSingular: 'Calendar Channel',
|
||||
@@ -142,8 +137,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.calendarEventParticipant.universalIdentifier,
|
||||
standardId:
|
||||
STANDARD_OBJECTS.calendarEventParticipant.universalIdentifier,
|
||||
nameSingular: 'calendarEventParticipant',
|
||||
namePlural: 'calendarEventParticipants',
|
||||
labelSingular: 'Calendar event participant',
|
||||
@@ -174,7 +167,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.calendarEvent.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.calendarEvent.universalIdentifier,
|
||||
nameSingular: 'calendarEvent',
|
||||
namePlural: 'calendarEvents',
|
||||
labelSingular: 'Calendar event',
|
||||
@@ -203,7 +195,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.company.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.company.universalIdentifier,
|
||||
nameSingular: 'company',
|
||||
namePlural: 'companies',
|
||||
labelSingular: 'Company',
|
||||
@@ -235,7 +226,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.connectedAccount.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.connectedAccount.universalIdentifier,
|
||||
nameSingular: 'connectedAccount',
|
||||
namePlural: 'connectedAccounts',
|
||||
labelSingular: 'Connected Account',
|
||||
@@ -263,7 +253,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.dashboard.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.dashboard.universalIdentifier,
|
||||
nameSingular: 'dashboard',
|
||||
namePlural: 'dashboards',
|
||||
labelSingular: 'Dashboard',
|
||||
@@ -291,7 +280,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.favorite.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.favorite.universalIdentifier,
|
||||
nameSingular: 'favorite',
|
||||
namePlural: 'favorites',
|
||||
labelSingular: 'Favorite',
|
||||
@@ -322,7 +310,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.favoriteFolder.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.favoriteFolder.universalIdentifier,
|
||||
nameSingular: 'favoriteFolder',
|
||||
namePlural: 'favoriteFolders',
|
||||
labelSingular: 'Favorite Folder',
|
||||
@@ -353,8 +340,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.messageChannelMessageAssociation.universalIdentifier,
|
||||
standardId:
|
||||
STANDARD_OBJECTS.messageChannelMessageAssociation.universalIdentifier,
|
||||
nameSingular: 'messageChannelMessageAssociation',
|
||||
namePlural: 'messageChannelMessageAssociations',
|
||||
labelSingular: 'Message Channel Message Association',
|
||||
@@ -386,7 +371,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.messageChannel.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.messageChannel.universalIdentifier,
|
||||
nameSingular: 'messageChannel',
|
||||
namePlural: 'messageChannels',
|
||||
labelSingular: 'Message Channel',
|
||||
@@ -417,7 +401,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.messageFolder.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.messageFolder.universalIdentifier,
|
||||
nameSingular: 'messageFolder',
|
||||
namePlural: 'messageFolders',
|
||||
labelSingular: 'Message Folder',
|
||||
@@ -449,7 +432,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.messageParticipant.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.messageParticipant.universalIdentifier,
|
||||
nameSingular: 'messageParticipant',
|
||||
namePlural: 'messageParticipants',
|
||||
labelSingular: 'Message Participant',
|
||||
@@ -480,7 +462,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.messageThread.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.messageThread.universalIdentifier,
|
||||
nameSingular: 'messageThread',
|
||||
namePlural: 'messageThreads',
|
||||
labelSingular: 'Message Thread',
|
||||
@@ -509,7 +490,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.message.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.message.universalIdentifier,
|
||||
nameSingular: 'message',
|
||||
namePlural: 'messages',
|
||||
labelSingular: 'Message',
|
||||
@@ -538,7 +518,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.note.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.note.universalIdentifier,
|
||||
nameSingular: 'note',
|
||||
namePlural: 'notes',
|
||||
labelSingular: 'Note',
|
||||
@@ -566,7 +545,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.noteTarget.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.noteTarget.universalIdentifier,
|
||||
nameSingular: 'noteTarget',
|
||||
namePlural: 'noteTargets',
|
||||
labelSingular: 'Note Target',
|
||||
@@ -593,7 +571,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.opportunity.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.opportunity.universalIdentifier,
|
||||
nameSingular: 'opportunity',
|
||||
namePlural: 'opportunities',
|
||||
labelSingular: 'Opportunity',
|
||||
@@ -621,7 +598,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.person.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.person.universalIdentifier,
|
||||
nameSingular: 'person',
|
||||
namePlural: 'people',
|
||||
labelSingular: 'Person',
|
||||
@@ -649,7 +625,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.task.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.task.universalIdentifier,
|
||||
nameSingular: 'task',
|
||||
namePlural: 'tasks',
|
||||
labelSingular: 'Task',
|
||||
@@ -677,7 +652,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.taskTarget.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.taskTarget.universalIdentifier,
|
||||
nameSingular: 'taskTarget',
|
||||
namePlural: 'taskTargets',
|
||||
labelSingular: 'Task Target',
|
||||
@@ -708,7 +682,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.timelineActivity.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.timelineActivity.universalIdentifier,
|
||||
nameSingular: 'timelineActivity',
|
||||
namePlural: 'timelineActivities',
|
||||
labelSingular: 'Timeline Activity',
|
||||
@@ -736,7 +709,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.workflow.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.workflow.universalIdentifier,
|
||||
nameSingular: 'workflow',
|
||||
namePlural: 'workflows',
|
||||
labelSingular: 'Workflow',
|
||||
@@ -768,8 +740,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.workflowAutomatedTrigger.universalIdentifier,
|
||||
standardId:
|
||||
STANDARD_OBJECTS.workflowAutomatedTrigger.universalIdentifier,
|
||||
nameSingular: 'workflowAutomatedTrigger',
|
||||
namePlural: 'workflowAutomatedTriggers',
|
||||
labelSingular: 'Workflow Automated Trigger',
|
||||
@@ -796,7 +766,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
dependencyFlatEntityMaps,
|
||||
context: {
|
||||
universalIdentifier: STANDARD_OBJECTS.workflowRun.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.workflowRun.universalIdentifier,
|
||||
nameSingular: 'workflowRun',
|
||||
namePlural: 'workflowRuns',
|
||||
labelSingular: 'Workflow Run',
|
||||
@@ -827,7 +796,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.workflowVersion.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.workflowVersion.universalIdentifier,
|
||||
nameSingular: 'workflowVersion',
|
||||
namePlural: 'workflowVersions',
|
||||
labelSingular: 'Workflow Version',
|
||||
@@ -858,7 +826,6 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
|
||||
context: {
|
||||
universalIdentifier:
|
||||
STANDARD_OBJECTS.workspaceMember.universalIdentifier,
|
||||
standardId: STANDARD_OBJECTS.workspaceMember.universalIdentifier,
|
||||
nameSingular: 'workspaceMember',
|
||||
namePlural: 'workspaceMembers',
|
||||
labelSingular: 'Workspace Member',
|
||||
|
||||
+1
-3
@@ -5,7 +5,6 @@ import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-st
|
||||
|
||||
export type CreateStandardObjectContext<O extends AllStandardObjectName> = {
|
||||
universalIdentifier: string;
|
||||
standardId: string;
|
||||
nameSingular: O;
|
||||
namePlural: string;
|
||||
labelSingular: string;
|
||||
@@ -32,7 +31,6 @@ export const createStandardObjectFlatMetadata = <
|
||||
>({
|
||||
context: {
|
||||
universalIdentifier,
|
||||
standardId,
|
||||
nameSingular,
|
||||
namePlural,
|
||||
labelSingular,
|
||||
@@ -52,7 +50,7 @@ export const createStandardObjectFlatMetadata = <
|
||||
now,
|
||||
}: CreateStandardObjectArgs<O>): FlatObjectMetadata => ({
|
||||
universalIdentifier,
|
||||
standardId,
|
||||
standardId: null,
|
||||
applicationId: twentyStandardApplicationId,
|
||||
workspaceId,
|
||||
nameSingular,
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant';
|
||||
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
|
||||
import { addFlatEntityToFlatEntityMapsOrThrow } from 'src/engine/metadata-modules/flat-entity/utils/add-flat-entity-to-flat-entity-maps-or-throw.util';
|
||||
import { type FlatRole } from 'src/engine/metadata-modules/flat-role/types/flat-role.type';
|
||||
import { STANDARD_FLAT_ROLE_METADATA_BUILDERS_BY_ROLE_NAME } from 'src/engine/workspace-manager/twenty-standard-application/utils/role-metadata/create-standard-flat-role-metadata.util';
|
||||
import { type CreateStandardRoleArgs } from 'src/engine/workspace-manager/twenty-standard-application/utils/role-metadata/create-standard-role-flat-metadata.util';
|
||||
|
||||
export const buildStandardFlatRoleMetadataMaps = (
|
||||
args: Omit<CreateStandardRoleArgs, 'context'>,
|
||||
): FlatEntityMaps<FlatRole> => {
|
||||
const allRoleMetadatas: FlatRole[] = Object.values(
|
||||
STANDARD_FLAT_ROLE_METADATA_BUILDERS_BY_ROLE_NAME,
|
||||
).map((builder) => builder(args));
|
||||
|
||||
let flatRoleMetadataMaps = createEmptyFlatEntityMaps();
|
||||
|
||||
for (const roleMetadata of allRoleMetadatas) {
|
||||
flatRoleMetadataMaps = addFlatEntityToFlatEntityMapsOrThrow({
|
||||
flatEntity: roleMetadata,
|
||||
flatEntityMaps: flatRoleMetadataMaps,
|
||||
});
|
||||
}
|
||||
|
||||
return flatRoleMetadataMaps;
|
||||
};
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import { type FlatRole } from 'src/engine/metadata-modules/flat-role/types/flat-role.type';
|
||||
import { type AllStandardRoleName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-role-name.type';
|
||||
import {
|
||||
type CreateStandardRoleArgs,
|
||||
createStandardRoleFlatMetadata,
|
||||
} from 'src/engine/workspace-manager/twenty-standard-application/utils/role-metadata/create-standard-role-flat-metadata.util';
|
||||
|
||||
export const STANDARD_FLAT_ROLE_METADATA_BUILDERS_BY_ROLE_NAME = {
|
||||
admin: (args: Omit<CreateStandardRoleArgs, 'context'>) =>
|
||||
createStandardRoleFlatMetadata({
|
||||
...args,
|
||||
context: {
|
||||
roleName: 'admin',
|
||||
label: 'Admin',
|
||||
description: 'Admin role',
|
||||
icon: 'IconUserCog',
|
||||
isEditable: false,
|
||||
canUpdateAllSettings: true,
|
||||
canAccessAllTools: true,
|
||||
canReadAllObjectRecords: true,
|
||||
canUpdateAllObjectRecords: true,
|
||||
canSoftDeleteAllObjectRecords: true,
|
||||
canDestroyAllObjectRecords: true,
|
||||
canBeAssignedToUsers: true,
|
||||
canBeAssignedToAgents: false,
|
||||
canBeAssignedToApiKeys: true,
|
||||
canBeAssignedToApplications: false,
|
||||
},
|
||||
}),
|
||||
} satisfies {
|
||||
[P in AllStandardRoleName]: (
|
||||
args: Omit<CreateStandardRoleArgs, 'context'>,
|
||||
) => FlatRole;
|
||||
};
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
import { type FlatRole } from 'src/engine/metadata-modules/flat-role/types/flat-role.type';
|
||||
import { STANDARD_ROLE } from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-role.constant';
|
||||
import { type AllStandardRoleName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-role-name.type';
|
||||
import { type StandardBuilderArgs } from 'src/engine/workspace-manager/twenty-standard-application/types/metadata-standard-buillder-args.type';
|
||||
|
||||
export type CreateStandardRoleContext = {
|
||||
roleName: AllStandardRoleName;
|
||||
label: string;
|
||||
description: string | null;
|
||||
icon: string | null;
|
||||
isEditable: boolean;
|
||||
canUpdateAllSettings: boolean;
|
||||
canAccessAllTools: boolean;
|
||||
canReadAllObjectRecords: boolean;
|
||||
canUpdateAllObjectRecords: boolean;
|
||||
canSoftDeleteAllObjectRecords: boolean;
|
||||
canDestroyAllObjectRecords: boolean;
|
||||
canBeAssignedToUsers: boolean;
|
||||
canBeAssignedToAgents: boolean;
|
||||
canBeAssignedToApiKeys: boolean;
|
||||
canBeAssignedToApplications: boolean;
|
||||
};
|
||||
|
||||
export type CreateStandardRoleArgs = StandardBuilderArgs<'role'> & {
|
||||
context: CreateStandardRoleContext;
|
||||
};
|
||||
|
||||
export const createStandardRoleFlatMetadata = ({
|
||||
context: {
|
||||
roleName,
|
||||
label,
|
||||
description,
|
||||
icon,
|
||||
isEditable,
|
||||
canUpdateAllSettings,
|
||||
canAccessAllTools,
|
||||
canReadAllObjectRecords,
|
||||
canUpdateAllObjectRecords,
|
||||
canSoftDeleteAllObjectRecords,
|
||||
canDestroyAllObjectRecords,
|
||||
canBeAssignedToUsers,
|
||||
canBeAssignedToAgents,
|
||||
canBeAssignedToApiKeys,
|
||||
canBeAssignedToApplications,
|
||||
},
|
||||
workspaceId,
|
||||
twentyStandardApplicationId,
|
||||
now,
|
||||
}: CreateStandardRoleArgs): FlatRole => {
|
||||
const universalIdentifier = STANDARD_ROLE[roleName].universalIdentifier;
|
||||
|
||||
return {
|
||||
id: v4(),
|
||||
universalIdentifier,
|
||||
standardId: null,
|
||||
label,
|
||||
description,
|
||||
icon,
|
||||
isEditable,
|
||||
canUpdateAllSettings,
|
||||
canAccessAllTools,
|
||||
canReadAllObjectRecords,
|
||||
canUpdateAllObjectRecords,
|
||||
canSoftDeleteAllObjectRecords,
|
||||
canDestroyAllObjectRecords,
|
||||
canBeAssignedToUsers,
|
||||
canBeAssignedToAgents,
|
||||
canBeAssignedToApiKeys,
|
||||
canBeAssignedToApplications,
|
||||
workspaceId,
|
||||
applicationId: twentyStandardApplicationId,
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
permissionFlagIds: [],
|
||||
fieldPermissionIds: [],
|
||||
objectPermissionIds: [],
|
||||
roleTargetIds: [],
|
||||
};
|
||||
};
|
||||
+22
@@ -1,9 +1,11 @@
|
||||
import { createEmptyFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/constant/create-empty-flat-entity-maps.constant';
|
||||
import { type TwentyStandardAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/types/twenty-standard-all-flat-entity-maps.type';
|
||||
import { buildStandardFlatAgentMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/agent-metadata/build-standard-flat-agent-metadata-maps.util';
|
||||
import { buildStandardFlatFieldMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util';
|
||||
import { getStandardObjectMetadataRelatedEntityIds } from 'src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util';
|
||||
import { buildStandardFlatIndexMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util';
|
||||
import { buildStandardFlatObjectMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/build-standard-flat-object-metadata-maps.util';
|
||||
import { buildStandardFlatRoleMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/role-metadata/build-standard-flat-role-metadata-maps.util';
|
||||
import { buildStandardFlatViewFieldMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-field/build-standard-flat-view-field-metadata-maps.util';
|
||||
import { buildStandardFlatViewFilterMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-filter/build-standard-flat-view-filter-metadata-maps.util';
|
||||
import { buildStandardFlatViewGroupMetadataMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/view-group/build-standard-flat-view-group-metadata-maps.util';
|
||||
@@ -99,6 +101,24 @@ export const computeTwentyStandardApplicationAllFlatEntityMaps = ({
|
||||
workspaceId,
|
||||
});
|
||||
|
||||
const flatRoleMaps = buildStandardFlatRoleMetadataMaps({
|
||||
now,
|
||||
workspaceId,
|
||||
twentyStandardApplicationId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps: undefined,
|
||||
});
|
||||
|
||||
const flatAgentMaps = buildStandardFlatAgentMetadataMaps({
|
||||
now,
|
||||
workspaceId,
|
||||
twentyStandardApplicationId,
|
||||
standardObjectMetadataRelatedEntityIds,
|
||||
dependencyFlatEntityMaps: {
|
||||
flatRoleMaps,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
flatViewFieldMaps,
|
||||
flatViewFilterMaps,
|
||||
@@ -107,5 +127,7 @@ export const computeTwentyStandardApplicationAllFlatEntityMaps = ({
|
||||
flatIndexMaps,
|
||||
flatFieldMetadataMaps,
|
||||
flatObjectMetadataMaps,
|
||||
flatRoleMaps,
|
||||
flatAgentMaps,
|
||||
};
|
||||
};
|
||||
|
||||
+4
-1
@@ -572,6 +572,7 @@ export class WorkspaceMigrationBuildOrchestratorService {
|
||||
to: toFlatRoleTargetMaps,
|
||||
buildOptions,
|
||||
dependencyOptimisticFlatEntityMaps: {
|
||||
flatAgentMaps: optimisticAllFlatEntityMaps.flatAgentMaps,
|
||||
flatRoleMaps: optimisticAllFlatEntityMaps.flatRoleMaps,
|
||||
},
|
||||
workspaceId,
|
||||
@@ -601,7 +602,9 @@ export class WorkspaceMigrationBuildOrchestratorService {
|
||||
from: fromFlatAgentMaps,
|
||||
to: toFlatAgentMaps,
|
||||
buildOptions,
|
||||
dependencyOptimisticFlatEntityMaps: undefined,
|
||||
dependencyOptimisticFlatEntityMaps: {
|
||||
flatRoleMaps: optimisticAllFlatEntityMaps.flatRoleMaps,
|
||||
},
|
||||
workspaceId,
|
||||
});
|
||||
|
||||
|
||||
+52
@@ -363,6 +363,58 @@ describe('aggregateOrchestratorActionsReportCreateObjectAndCreateFieldActions',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title:
|
||||
'should not merge create_field actions containing relation fields into create_object',
|
||||
context: {
|
||||
input: {
|
||||
...createEmptyOrchestratorActionsReport(),
|
||||
objectMetadata: {
|
||||
created: [
|
||||
{
|
||||
type: 'create_object',
|
||||
flatObjectMetadata: getFlatObjectMetadataMock({
|
||||
universalIdentifier: 'object-1',
|
||||
id: 'object-1',
|
||||
nameSingular: 'attachment',
|
||||
namePlural: 'attachments',
|
||||
}),
|
||||
flatFieldMetadatas: [],
|
||||
} satisfies CreateObjectAction,
|
||||
],
|
||||
updated: [],
|
||||
deleted: [],
|
||||
},
|
||||
fieldMetadata: {
|
||||
created: [
|
||||
{
|
||||
type: 'create_field',
|
||||
objectMetadataId: 'object-1',
|
||||
flatFieldMetadatas: [
|
||||
getFlatFieldMetadataMock({
|
||||
universalIdentifier: 'field-1',
|
||||
objectMetadataId: 'object-1',
|
||||
type: FieldMetadataType.RELATION,
|
||||
id: 'field-1',
|
||||
name: 'author',
|
||||
}),
|
||||
],
|
||||
} satisfies CreateFieldAction,
|
||||
],
|
||||
updated: [],
|
||||
deleted: [],
|
||||
},
|
||||
} satisfies OrchestratorActionsReport,
|
||||
expected: {
|
||||
expectCreateFieldActionPerObjectMetadataId: {
|
||||
'object-1': 1,
|
||||
},
|
||||
expectCreateObjectActionPerObjectMetadataId: {
|
||||
'object-1': 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
test.each(eachTestingContextFilter(testCases))(
|
||||
|
||||
+88
-7
@@ -1,5 +1,7 @@
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
|
||||
import { isMorphOrRelationFlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/utils/is-morph-or-relation-flat-field-metadata.util';
|
||||
import { type OrchestratorActionsReport } from 'src/engine/workspace-manager/workspace-migration-v2/types/workspace-migration-orchestrator.type';
|
||||
import { type CreateFieldAction } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/field/types/workspace-migration-field-action-v2';
|
||||
import { type CreateObjectAction } from 'src/engine/workspace-manager/workspace-migration-v2/workspace-migration-builder-v2/builders/object/types/workspace-migration-object-action-v2';
|
||||
@@ -12,6 +14,7 @@ type AggregatedActions = {
|
||||
createdFieldActionByObjectMetadataId: Record<string, CreateFieldAction>;
|
||||
createdObjectActionByObjectMetadataId: Record<string, CreateObjectAction>;
|
||||
};
|
||||
|
||||
export const aggregateOrchestratorActionsReportCreateObjectAndCreateFieldActions =
|
||||
({
|
||||
orchestratorActionsReport,
|
||||
@@ -23,7 +26,7 @@ export const aggregateOrchestratorActionsReportCreateObjectAndCreateFieldActions
|
||||
...acc,
|
||||
[createObjectAction.flatObjectMetadata.id]: createObjectAction,
|
||||
}),
|
||||
{},
|
||||
{} as Record<string, CreateObjectAction>,
|
||||
);
|
||||
const initialAccumulator: AggregatedActions = {
|
||||
createdFieldActionByObjectMetadataId: {},
|
||||
@@ -49,7 +52,90 @@ export const aggregateOrchestratorActionsReportCreateObjectAndCreateFieldActions
|
||||
createFieldAction.objectMetadataId
|
||||
];
|
||||
|
||||
const existingCreateFieldAction =
|
||||
createdFieldActionByObjectMetadataId[
|
||||
createFieldAction.objectMetadataId
|
||||
];
|
||||
|
||||
const initialAccumulator: {
|
||||
morphOrRelationFlatFieldMetadatas: FlatFieldMetadata[];
|
||||
otherFlatFieldMetadatas: FlatFieldMetadata[];
|
||||
} = {
|
||||
morphOrRelationFlatFieldMetadatas: [],
|
||||
otherFlatFieldMetadatas: [],
|
||||
};
|
||||
const { morphOrRelationFlatFieldMetadatas, otherFlatFieldMetadatas } =
|
||||
createFieldAction.flatFieldMetadatas.reduce(
|
||||
(acc, flatFieldMetadata) => {
|
||||
if (isMorphOrRelationFlatFieldMetadata(flatFieldMetadata)) {
|
||||
return {
|
||||
...acc,
|
||||
morphOrRelationFlatFieldMetadatas: [
|
||||
...acc.morphOrRelationFlatFieldMetadatas,
|
||||
flatFieldMetadata,
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
...acc,
|
||||
otherFlatFieldMetadatas: [
|
||||
...acc.otherFlatFieldMetadatas,
|
||||
flatFieldMetadata,
|
||||
],
|
||||
};
|
||||
},
|
||||
initialAccumulator,
|
||||
);
|
||||
|
||||
if (isDefined(existingCreateObjectAction)) {
|
||||
if (isDefined(existingCreateFieldAction)) {
|
||||
return {
|
||||
createdObjectActionByObjectMetadataId: {
|
||||
...createdObjectActionByObjectMetadataId,
|
||||
[createFieldAction.objectMetadataId]: {
|
||||
...existingCreateObjectAction,
|
||||
flatFieldMetadatas: [
|
||||
...existingCreateObjectAction.flatFieldMetadatas,
|
||||
...otherFlatFieldMetadatas,
|
||||
],
|
||||
},
|
||||
},
|
||||
createdFieldActionByObjectMetadataId: {
|
||||
...createdFieldActionByObjectMetadataId,
|
||||
[createFieldAction.objectMetadataId]: {
|
||||
...existingCreateFieldAction,
|
||||
flatFieldMetadatas: [
|
||||
...existingCreateFieldAction.flatFieldMetadatas,
|
||||
...morphOrRelationFlatFieldMetadatas,
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
if (morphOrRelationFlatFieldMetadatas.length > 0) {
|
||||
return {
|
||||
createdObjectActionByObjectMetadataId: {
|
||||
...createdObjectActionByObjectMetadataId,
|
||||
[createFieldAction.objectMetadataId]: {
|
||||
...existingCreateObjectAction,
|
||||
flatFieldMetadatas: [
|
||||
...existingCreateObjectAction.flatFieldMetadatas,
|
||||
...otherFlatFieldMetadatas,
|
||||
],
|
||||
},
|
||||
},
|
||||
createdFieldActionByObjectMetadataId: {
|
||||
...createdFieldActionByObjectMetadataId,
|
||||
[createFieldAction.objectMetadataId]: {
|
||||
...createFieldAction,
|
||||
flatFieldMetadatas: morphOrRelationFlatFieldMetadatas,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
createdObjectActionByObjectMetadataId: {
|
||||
...createdObjectActionByObjectMetadataId,
|
||||
@@ -57,7 +143,7 @@ export const aggregateOrchestratorActionsReportCreateObjectAndCreateFieldActions
|
||||
...existingCreateObjectAction,
|
||||
flatFieldMetadatas: [
|
||||
...existingCreateObjectAction.flatFieldMetadatas,
|
||||
...createFieldAction.flatFieldMetadatas,
|
||||
...otherFlatFieldMetadatas,
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -65,11 +151,6 @@ export const aggregateOrchestratorActionsReportCreateObjectAndCreateFieldActions
|
||||
};
|
||||
}
|
||||
|
||||
const existingCreateFieldAction =
|
||||
createdFieldActionByObjectMetadataId[
|
||||
createFieldAction.objectMetadataId
|
||||
];
|
||||
|
||||
if (isDefined(existingCreateFieldAction)) {
|
||||
return {
|
||||
createdFieldActionByObjectMetadataId: {
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
import { PermissionFlagType } from 'twenty-shared/constants';
|
||||
|
||||
import { type StandardRoleDefinition } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-roles/types/standard-role-definition.interface';
|
||||
|
||||
export const DASHBOARD_MANAGER_ROLE: StandardRoleDefinition = {
|
||||
standardId: '20202020-0001-0001-0001-000000000005',
|
||||
label: 'Dashboard Manager',
|
||||
description: 'Role for creating and managing dashboards',
|
||||
icon: 'IconLayoutDashboard',
|
||||
isEditable: false,
|
||||
canUpdateAllSettings: false,
|
||||
canAccessAllTools: false,
|
||||
canReadAllObjectRecords: true,
|
||||
canUpdateAllObjectRecords: true,
|
||||
canSoftDeleteAllObjectRecords: false,
|
||||
canDestroyAllObjectRecords: false,
|
||||
canBeAssignedToUsers: false,
|
||||
canBeAssignedToAgents: true,
|
||||
canBeAssignedToApiKeys: false,
|
||||
canBeAssignedToApplications: true,
|
||||
permissionFlags: [PermissionFlagType.LAYOUTS],
|
||||
applicationId: null, // TODO: Replace with Twenty application ID
|
||||
};
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
import { type StandardRoleDefinition } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-roles/types/standard-role-definition.interface';
|
||||
|
||||
export const DATA_MANIPULATOR_ROLE: StandardRoleDefinition = {
|
||||
standardId: '20202020-0001-0001-0001-000000000004',
|
||||
label: 'Data Manipulator',
|
||||
description: 'Read and write access to all object records',
|
||||
icon: 'IconEdit',
|
||||
isEditable: false,
|
||||
canUpdateAllSettings: false,
|
||||
canAccessAllTools: false,
|
||||
canReadAllObjectRecords: true,
|
||||
canUpdateAllObjectRecords: true,
|
||||
canSoftDeleteAllObjectRecords: false,
|
||||
canDestroyAllObjectRecords: false,
|
||||
canBeAssignedToUsers: false,
|
||||
canBeAssignedToAgents: true,
|
||||
canBeAssignedToApiKeys: false,
|
||||
canBeAssignedToApplications: true,
|
||||
applicationId: null, // TODO: Replace with Twenty application ID
|
||||
};
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
import { PermissionFlagType } from 'twenty-shared/constants';
|
||||
|
||||
import { type StandardRoleDefinition } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-roles/types/standard-role-definition.interface';
|
||||
|
||||
export const DATA_MODEL_MANAGER_ROLE: StandardRoleDefinition = {
|
||||
standardId: '20202020-0001-0001-0001-000000000006',
|
||||
label: 'Data Model Manager',
|
||||
description: 'Role for managing the workspace data model',
|
||||
icon: 'IconDatabaseEdit',
|
||||
isEditable: false,
|
||||
canUpdateAllSettings: false,
|
||||
canAccessAllTools: false,
|
||||
canReadAllObjectRecords: true,
|
||||
canUpdateAllObjectRecords: false,
|
||||
canSoftDeleteAllObjectRecords: false,
|
||||
canDestroyAllObjectRecords: false,
|
||||
canBeAssignedToUsers: false,
|
||||
canBeAssignedToAgents: true,
|
||||
canBeAssignedToApiKeys: false,
|
||||
canBeAssignedToApplications: true,
|
||||
permissionFlags: [PermissionFlagType.DATA_MODEL],
|
||||
applicationId: null,
|
||||
};
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
import { PermissionFlagType } from 'twenty-shared/constants';
|
||||
|
||||
import { type StandardRoleDefinition } from 'src/engine/workspace-manager/workspace-sync-metadata/standard-roles/types/standard-role-definition.interface';
|
||||
|
||||
export const WORKFLOW_MANAGER_ROLE: StandardRoleDefinition = {
|
||||
standardId: '20202020-0001-0001-0001-000000000002',
|
||||
label: 'Workflow Manager',
|
||||
description: 'Role for managing workflows',
|
||||
icon: 'IconSettingsAutomation',
|
||||
isEditable: false,
|
||||
canUpdateAllSettings: false,
|
||||
canAccessAllTools: false,
|
||||
canReadAllObjectRecords: false,
|
||||
canUpdateAllObjectRecords: true,
|
||||
canSoftDeleteAllObjectRecords: false,
|
||||
canDestroyAllObjectRecords: false,
|
||||
canBeAssignedToUsers: false,
|
||||
canBeAssignedToAgents: true,
|
||||
canBeAssignedToApiKeys: false,
|
||||
canBeAssignedToApplications: true,
|
||||
permissionFlags: [PermissionFlagType.WORKFLOWS],
|
||||
applicationId: null, // TODO: Replace with Twenty application ID
|
||||
};
|
||||
-8
@@ -1,14 +1,6 @@
|
||||
import { ADMIN_ROLE } from './roles/admin-role';
|
||||
import { DASHBOARD_MANAGER_ROLE } from './roles/dashboard-manager-role';
|
||||
import { DATA_MANIPULATOR_ROLE } from './roles/data-manipulator-role';
|
||||
import { DATA_MODEL_MANAGER_ROLE } from './roles/data-model-manager-role';
|
||||
import { WORKFLOW_MANAGER_ROLE } from './roles/workflow-manager-role';
|
||||
import { type StandardRoleDefinition } from './types/standard-role-definition.interface';
|
||||
|
||||
export const STANDARD_ROLE_DEFINITIONS = [
|
||||
ADMIN_ROLE,
|
||||
WORKFLOW_MANAGER_ROLE,
|
||||
DATA_MANIPULATOR_ROLE,
|
||||
DASHBOARD_MANAGER_ROLE,
|
||||
DATA_MODEL_MANAGER_ROLE,
|
||||
] as const satisfies StandardRoleDefinition[];
|
||||
|
||||
Reference in New Issue
Block a user