Add default relation to standard object on custom object in manifest (#18033)

add default relation fields when creating an object from an application

---------

Co-authored-by: prastoin <paul@twenty.com>
This commit is contained in:
martmull
2026-02-20 11:49:06 +01:00
committed by GitHub
parent d060c843d1
commit 3bc887e12e
48 changed files with 1812 additions and 554 deletions
@@ -0,0 +1,25 @@
export const ALL_METADATA_NAME = {
fieldMetadata: 'fieldMetadata',
objectMetadata: 'objectMetadata',
view: 'view',
viewField: 'viewField',
viewFieldGroup: 'viewFieldGroup',
viewGroup: 'viewGroup',
rowLevelPermissionPredicate: 'rowLevelPermissionPredicate',
rowLevelPermissionPredicateGroup: 'rowLevelPermissionPredicateGroup',
viewFilterGroup: 'viewFilterGroup',
index: 'index',
logicFunction: 'logicFunction',
viewFilter: 'viewFilter',
role: 'role',
roleTarget: 'roleTarget',
agent: 'agent',
skill: 'skill',
pageLayout: 'pageLayout',
pageLayoutWidget: 'pageLayoutWidget',
pageLayoutTab: 'pageLayoutTab',
commandMenuItem: 'commandMenuItem',
navigationMenuItem: 'navigationMenuItem',
frontComponent: 'frontComponent',
webhook: 'webhook',
} as const;
@@ -0,0 +1,9 @@
import { type STANDARD_OBJECTS } from '@/metadata/constants/standard-object.constant';
export const DEFAULT_RELATIONS_OBJECTS_STANDARD_IDS = [
'timelineActivity',
'favorite',
'attachment',
'noteTarget',
'taskTarget',
] as const satisfies (keyof typeof STANDARD_OBJECTS)[];
@@ -0,0 +1,69 @@
const CORE_OBJECT_NAMES = [
'approvedAccessDomain',
'approvedAccessDomains',
'appToken',
'appTokens',
'billingCustomer',
'billingCustomers',
'billingEntitlement',
'billingEntitlements',
'billingMeter',
'billingMeters',
'billingProduct',
'billingProducts',
'billingSubscription',
'billingSubscriptions',
'billingSubscriptionItem',
'billingSubscriptionItems',
'featureFlag',
'featureFlags',
'job',
'jobs',
'keyValuePair',
'keyValuePairs',
'pageLayout',
'pageLayouts',
'pageLayoutTab',
'pageLayoutTabs',
'pageLayoutWidget',
'pageLayoutWidgets',
'postgresCredential',
'postgresCredentials',
'twoFactorMethod',
'twoFactorMethods',
'user',
'users',
'userWorkspace',
'userWorkspaces',
'workspace',
'workspaces',
'role',
'roles',
'userWorkspaceRole',
'userWorkspaceRoles',
];
export const RESERVED_METADATA_NAME_KEYWORDS = [
...CORE_OBJECT_NAMES,
'plan',
'plans',
'event',
'events',
'field',
'fields',
'link',
'links',
'currency',
'currencies',
'fullNames',
'address',
'addresses',
'type',
'types',
'object',
'objects',
'index',
'relation',
'relations',
'aggregate',
];
File diff suppressed because it is too large Load Diff