Skip to content

The open alternative to Salesforce, designed for AI.

Surface Relations on email thread and calendar event record pages (#24994)

Félix Malfait4160a18929a3
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index bc860aac740..84d8cc372d1 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -2973,6 +2973,7 @@ type ChannelSyncSuccess {
type CreateCalendarEventOutput {
success: Boolean!
iCalUid: String
+ calendarEventId: String
conferenceLink: String
error: String
}
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index ab0e03c2016..292695c21db 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -2596,6 +2596,7 @@ export interface ChannelSyncSuccess {
export interface CreateCalendarEventOutput {
success: Scalars['Boolean']
iCalUid?: Scalars['String']
+ calendarEventId?: Scalars['String']
conferenceLink?: Scalars['String']
error?: Scalars['String']
__typename: 'CreateCalendarEventOutput'
@@ -6083,6 +6084,7 @@ export interface ChannelSyncSuccessGenqlSelection{
export interface CreateCalendarEventOutputGenqlSelection{
success?: boolean | number
iCalUid?: boolean | number
+ calendarEventId?: boolean | number
conferenceLink?: boolean | number
error?: boolean | number
__typename?: boolean | number
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index 6cb5dcfe2a3..427b8240887 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -5832,6 +5832,9 @@ export default {
"iCalUid": [
1
],
+ "calendarEventId": [
+ 1
+ ],
"conferenceLink": [
1
],
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 927c23910ea..9488baee807 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -1177,6 +1177,7 @@ export type CreateCalendarEventInput = {
export type CreateCalendarEventOutput = {
__typename?: 'CreateCalendarEventOutput';
+ calendarEventId?: Maybe<Scalars['String']['output']>;
conferenceLink?: Maybe<Scalars['String']['output']>;
error?: Maybe<Scalars['String']['output']>;
iCalUid?: Maybe<Scalars['String']['output']>;
@@ -7041,7 +7042,7 @@ export type CreateCalendarEventMutationVariables = Exact<{
}>;
-export type CreateCalendarEventMutation = { __typename?: 'Mutation', createCalendarEvent: { __typename?: 'CreateCalendarEventOutput', success: boolean, error?: string | null, iCalUid?: string | null, conferenceLink?: string | null } };
+export type CreateCalendarEventMutation = { __typename?: 'Mutation', createCalendarEvent: { __typename?: 'CreateCalendarEventOutput', success: boolean, error?: string | null, iCalUid?: string | null, calendarEventId?: string | null, conferenceLink?: string | null } };
export type PreviewMessageCampaignAudienceQueryVariables = Exact<{
input: PreviewMessageCampaignAudienceInput;
@@ -9716,7 +9717,7 @@ export const ViewFilterGroupFragmentFragmentDoc = {"kind":"Document","definition
export const ViewSortFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewSortFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewSort"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<ViewSortFragmentFragment, unknown>;
export const ViewGroupFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<ViewGroupFragmentFragment, unknown>;
export const ViewFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"View"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isCompact"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanAggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanAggregateOperationFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"mainGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"shouldHideEmptyGroups"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanColumnWidth"}},{"kind":"Field","name":{"kind":"Name","value":"anyFieldFilterValue"}},{"kind":"Field","name":{"kind":"Name","value":"calendarFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"calendarEndFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"calendarLayout"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"createdByUserWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldGroupFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFilters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFilterFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFilterGroupFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewSorts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewSortFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFieldGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilter"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"relationTargetFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilterGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentViewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewSortFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewSort"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<ViewFragmentFragment, unknown>;
-export const CreateCalendarEventDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCalendarEvent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateCalendarEventInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCalendarEvent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"iCalUid"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceLink"}}]}}]}}]} as unknown as DocumentNode<CreateCalendarEventMutation, CreateCalendarEventMutationVariables>;
+export const CreateCalendarEventDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCalendarEvent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateCalendarEventInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCalendarEvent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"iCalUid"}},{"kind":"Field","name":{"kind":"Name","value":"calendarEventId"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceLink"}}]}}]}}]} as unknown as DocumentNode<CreateCalendarEventMutation, CreateCalendarEventMutationVariables>;
export const PreviewMessageCampaignAudienceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PreviewMessageCampaignAudience"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PreviewMessageCampaignAudienceInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"previewMessageCampaignAudience"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalMembers"}},{"kind":"Field","name":{"kind":"Name","value":"withoutEmail"}},{"kind":"Field","name":{"kind":"Name","value":"duplicateEmails"}},{"kind":"Field","name":{"kind":"Name","value":"globallyUnsubscribed"}},{"kind":"Field","name":{"kind":"Name","value":"topicUnsubscribed"}},{"kind":"Field","name":{"kind":"Name","value":"sendable"}}]}}]}}]} as unknown as DocumentNode<PreviewMessageCampaignAudienceQuery, PreviewMessageCampaignAudienceQueryVariables>;
export const UnsubscribeTopicsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UnsubscribeTopics"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"unsubscribeTopics"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}}]}}]}}]} as unknown as DocumentNode<UnsubscribeTopicsQuery, UnsubscribeTopicsQueryVariables>;
export const SendEmailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SendEmail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SendEmailInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sendEmail"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"messageThreadId"}}]}}]}}]} as unknown as DocumentNode<SendEmailMutation, SendEmailMutationVariables>;
diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerFields.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerFields.tsx
index 729b95bd9e7..a358b05d94f 100644
--- a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerFields.tsx
+++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerFields.tsx
@@ -1,6 +1,7 @@
import { ComposerFieldRow } from '@/activities/components/ComposerFieldRow';
import { ComposerHeader } from '@/activities/components/ComposerHeader';
import { StyledComposerTextInput } from '@/activities/components/ComposerTextInput';
+import { CalendarEventComposerTargetsInput } from '@/activities/calendar/components/CalendarEventComposerTargetsInput';
import { CalendarEventLocationInput } from '@/activities/calendar/components/CalendarEventLocationInput';
import { type useCalendarEventComposer } from '@/activities/calendar/hooks/useCalendarEventComposer';
import { EmailRecipientsFieldInput } from '@/activities/emails/recipients/components/EmailRecipientsFieldInput';
@@ -83,8 +84,7 @@ export const CalendarEventComposerFields = ({
composerState.accountOptions.length === 0 ||
composerState.missingScopes.length > 0 ||
!composerState.hasValidDateRange ||
- composerState.hasTooManyAttendees ||
- !composerState.hasTargetAssociation;
+ composerState.hasTooManyAttendees;
return (
<StyledFieldsContainer>
@@ -125,6 +125,17 @@ export const CalendarEventComposerFields = ({
contextRecord={contextRecord}
/>
</ComposerFieldRow>
+ {composerState.canPickTargets && (
+ <ComposerFieldRow
+ label={t`Relations`}
+ labelMinWidth={COMPOSER_LABEL_MIN_WIDTH}
+ >
+ <CalendarEventComposerTargetsInput
+ targets={composerState.targets}
+ onTargetChange={composerState.handleTargetChange}
+ />
+ </ComposerFieldRow>
+ )}
<ComposerFieldRow
label={t`Title`}
labelMinWidth={COMPOSER_LABEL_MIN_WIDTH}
@@ -327,13 +338,6 @@ export const CalendarEventComposerFields = ({
description={t`Remove some guests before creating this event.`}
/>
)}
- {!composerState.hasTargetAssociation && (
- <Callout
- variant="warning"
- title={t`Keep this event related`}
- description={t`Keep the current record in the guest list and leave invitations on so the event remains visible on this record.`}
- />
- )}
</StyledNoticesContainer>
)}
</StyledFieldsContainer>
diff --git a/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerTargetsInput.tsx b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerTargetsInput.tsx
new file mode 100644
index 00000000000..e2a986cbc9e
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/calendar/components/CalendarEventComposerTargetsInput.tsx
@@ -0,0 +1,112 @@
+import { useCalendarEventTargetObjectMetadataItems } from '@/activities/calendar/hooks/useCalendarEventTargetObjectMetadataItems';
+import { useOpenCalendarEventTargetsPicker } from '@/activities/calendar/hooks/useOpenCalendarEventTargetsPicker';
+import { type CalendarEventComposerTarget } from '@/activities/calendar/types/CalendarEventComposerTarget';
+import { RecordChip } from '@/object-record/components/RecordChip';
+import { MultipleRecordPicker } from '@/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker';
+import { type RecordPickerPickableMorphItem } from '@/object-record/record-picker/types/RecordPickerPickableMorphItem';
+import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
+import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
+import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
+import { ExpandableList } from '@/ui/layout/expandable-list/components/ExpandableList';
+import { styled } from '@linaria/react';
+import { t } from '@lingui/core/macro';
+import { useId } from 'react';
+import { isDefined } from 'twenty-shared/utils';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+
+const StyledClickableContainer = styled.div`
+ align-items: center;
+ cursor: pointer;
+ display: flex;
+ gap: ${themeCssVariables.spacing[1]};
+ min-height: 24px;
+ min-width: 0;
+ overflow: hidden;
+ width: 100%;
+`;
+
+const StyledPlaceholder = styled.span`
+ color: ${themeCssVariables.font.color.light};
+ font-size: ${themeCssVariables.font.size.md};
+`;
+
+type CalendarEventComposerTargetsInputProps = {
+ targets: CalendarEventComposerTarget[];
+ onTargetChange: (morphItem: RecordPickerPickableMorphItem) => void;
+};
+
+export const CalendarEventComposerTargetsInput = ({
+ targets,
+ onTargetChange,
+}: CalendarEventComposerTargetsInputProps) => {
+ const componentId = useId();
+ const dropdownId = `calendar-event-composer-targets-${componentId}`;
+
+ const { closeDropdown } = useCloseDropdown();
+ const { openCalendarEventTargetsPicker } =
+ useOpenCalendarEventTargetsPicker();
+
+ const searchableObjectMetadataItems =
+ useCalendarEventTargetObjectMetadataItems();
+
+ if (searchableObjectMetadataItems.length === 0) {
+ return null;
+ }
+
+ const handleOpenDropdown = () => {
+ openCalendarEventTargetsPicker({
+ pickerInstanceId: dropdownId,
+ searchableObjectMetadataItems,
+ targets,
+ });
+ };
+
+ const chips = targets
+ .map((target) => {
+ const objectMetadataItem = searchableObjectMetadataItems.find(
+ ({ id }) => id === target.objectMetadataId,
+ );
+
+ if (!isDefined(objectMetadataItem)) {
+ return null;
+ }
+
+ return (
+ <RecordChip
+ key={target.recordId}
+ record={target.record}
+ objectNameSingular={objectMetadataItem.nameSingular}
+ forceDisableClick
+ />
+ );
+ })
+ .filter(isDefined);
+
+ return (
+ <Dropdown
+ dropdownId={dropdownId}
+ dropdownPlacement="bottom-start"
+ clickableComponentWidth="100%"
+ onOpen={handleOpenDropdown}
+ clickableComponent={
+ <StyledClickableContainer>
+ {chips.length > 0 ? (
+ <ExpandableList isChipCountDisplayed>{chips}</ExpandableList>
+ ) : (
+ <StyledPlaceholder>{t`Add a related record`}</StyledPlaceholder>
+ )}
+ </StyledClickableContainer>
+ }
+ dropdownComponents={
+ <MultipleRecordPicker
+ componentInstanceId={dropdownId}
+ focusId={dropdownId}
+ onChange={onTargetChange}
+ onSubmit={() => closeDropdown(dropdownId)}
+ onClickOutside={() => closeDropdown(dropdownId)}
+ dropdownWidth={GenericDropdownContentWidth.ExtraLarge}
+ />
+ }
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/activities/calendar/graphql/mutations/createCalendarEvent.ts b/packages/twenty-front/src/modules/activities/calendar/graphql/mutations/createCalendarEvent.ts
index 1099d6bc9e1..33b69a079d6 100644
--- a/packages/twenty-front/src/modules/activities/calendar/graphql/mutations/createCalendarEvent.ts
+++ b/packages/twenty-front/src/modules/activities/calendar/graphql/mutations/createCalendarEvent.ts
@@ -6,6 +6,7 @@ export const CREATE_CALENDAR_EVENT = gql`
success
error
iCalUid
+ calendarEventId
conferenceLink
}
}
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/__tests__/useCalendarEventComposer.test.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/__tests__/useCalendarEventComposer.test.ts
index db92d3c0604..d8f5ed8192b 100644
--- a/packages/twenty-front/src/modules/activities/calendar/hooks/__tests__/useCalendarEventComposer.test.ts
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/__tests__/useCalendarEventComposer.test.ts
@@ -2,8 +2,17 @@ import { act, renderHook } from '@testing-library/react';
import { Temporal } from 'temporal-polyfill';
import { useCalendarEventComposer } from '@/activities/calendar/hooks/useCalendarEventComposer';
+import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
const mockCreateCalendarEvent = jest.fn();
+const mockCreateCalendarEventTargets = jest.fn();
+const mockRefetchTimelineCalendarEvents = jest.fn();
+const mockContextRecord: { current: ObjectRecord | undefined } = {
+ current: undefined,
+};
+const mockTargetObjectMetadataItems: {
+ current: { id: string; nameSingular: string }[];
+} = { current: [] };
jest.mock('@/activities/calendar/hooks/useCreateCalendarEvent', () => ({
useCreateCalendarEvent: () => ({
@@ -12,6 +21,37 @@ jest.mock('@/activities/calendar/hooks/useCreateCalendarEvent', () => ({
}),
}));
+jest.mock(
+ '@/activities/calendar/hooks/useRefetchTimelineCalendarEvents',
+ () => ({
+ useRefetchTimelineCalendarEvents: () => ({
+ refetchTimelineCalendarEvents: mockRefetchTimelineCalendarEvents,
+ }),
+ }),
+);
+
+jest.mock('@/activities/calendar/hooks/useCreateCalendarEventTargets', () => ({
+ useCreateCalendarEventTargets: () => ({
+ createCalendarEventTargets: mockCreateCalendarEventTargets,
+ }),
+}));
+
+jest.mock(
+ '@/activities/calendar/hooks/useCalendarEventTargetObjectMetadataItems',
+ () => ({
+ useCalendarEventTargetObjectMetadataItems: () =>
+ mockTargetObjectMetadataItems.current,
+ }),
+);
+
+jest.mock('@/object-record/hooks/useFindOneRecord', () => ({
+ useFindOneRecord: () => ({ record: mockContextRecord.current }),
+}));
+
+jest.mock('@/ui/feedback/snack-bar-manager/hooks/useSnackBar', () => ({
+ useSnackBar: () => ({ enqueueErrorSnackBar: jest.fn() }),
+}));
+
jest.mock('@/settings/accounts/hooks/useMyConnectedAccounts', () => ({
useMyConnectedAccounts: () => ({
accounts: [
@@ -35,23 +75,20 @@ jest.mock('@/accounts/utils/hasMissingCreateCalendarEventScopes', () => ({
getMissingCreateCalendarEventScopes: () => [],
}));
-jest.mock(
- '@/activities/calendar/hooks/useCalendarEventTargetRelatedPersonIds',
- () => ({
- useCalendarEventTargetRelatedPersonIds: () => ['person-id'],
- }),
-);
-
describe('useCalendarEventComposer', () => {
beforeEach(() => {
jest.clearAllMocks();
+ mockContextRecord.current = undefined;
+ mockTargetObjectMetadataItems.current = [
+ { id: 'person-object-metadata-id', nameSingular: 'person' },
+ ];
});
it('submits only once while creation is pending', async () => {
- let resolveCreation: ((success: boolean) => void) | undefined;
+ let resolveCreation: ((result: { success: boolean }) => void) | undefined;
mockCreateCalendarEvent.mockReturnValue(
- new Promise<boolean>((resolve) => {
+ new Promise<{ success: boolean }>((resolve) => {
resolveCreation = resolve;
}),
);
@@ -86,7 +123,7 @@ describe('useCalendarEventComposer', () => {
expect(mockCreateCalendarEvent).toHaveBeenCalledTimes(1);
- resolveCreation?.(true);
+ resolveCreation?.({ success: true });
await act(async () => {
await Promise.all([firstCreation, secondCreation]);
@@ -96,7 +133,7 @@ describe('useCalendarEventComposer', () => {
});
it('keeps the location controlled and submits the selected value', async () => {
- mockCreateCalendarEvent.mockResolvedValue(true);
+ mockCreateCalendarEvent.mockResolvedValue({ success: true });
const { result } = renderHook(() =>
useCalendarEventComposer({
@@ -131,6 +168,127 @@ describe('useCalendarEventComposer', () => {
);
});
+ it('links the context record to the created event', async () => {
+ mockContextRecord.current = { id: 'person-id' } as ObjectRecord;
+ mockCreateCalendarEvent.mockResolvedValue({
+ success: true,
+ calendarEventId: 'calendar-event-id',
+ });
+
+ const { result } = renderHook(() =>
+ useCalendarEventComposer({
+ initialValues: {
+ connectedAccountId: 'account-id',
+ contextRecord: {
+ objectNameSingular: 'person',
+ recordId: 'person-id',
+ },
+ defaultAttendees: '',
+ timeZone: 'UTC',
+ },
+ onCreated: jest.fn(),
+ }),
+ );
+
+ expect(result.current.targets).toEqual([
+ {
+ objectMetadataId: 'person-object-metadata-id',
+ recordId: 'person-id',
+ record: { id: 'person-id' },
+ },
+ ]);
+
+ act(() => {
+ result.current.setTitle('Planning session');
+ });
+
+ await act(async () => {
+ await result.current.handleCreate();
+ });
+
+ expect(mockCreateCalendarEventTargets).toHaveBeenCalledWith({
+ calendarEventId: 'calendar-event-id',
+ targets: [
+ {
+ objectMetadataId: 'person-object-metadata-id',
+ recordId: 'person-id',
+ record: { id: 'person-id' },
+ },
+ ],
+ });
+
+ expect(mockRefetchTimelineCalendarEvents).toHaveBeenCalled();
+ });
+
+ it('drops a relation the user removed from the picker', () => {
+ mockContextRecord.current = { id: 'person-id' } as ObjectRecord;
+
+ const { result } = renderHook(() =>
+ useCalendarEventComposer({
+ initialValues: {
+ connectedAccountId: 'account-id',
+ contextRecord: {
+ objectNameSingular: 'person',
+ recordId: 'person-id',
+ },
+ defaultAttendees: '',
+ timeZone: 'UTC',
+ },
+ onCreated: jest.fn(),
+ }),
+ );
+
+ act(() => {
+ result.current.handleTargetChange({
+ recordId: 'person-id',
+ objectMetadataId: 'person-object-metadata-id',
+ isSelected: false,
+ isMatchingSearchFilter: true,
+ });
+ });
+
+ expect(result.current.targets).toEqual([]);
+ });
+
+ it('creates the event without relations when the workspace has no junction', async () => {
+ mockTargetObjectMetadataItems.current = [];
+ mockContextRecord.current = { id: 'person-id' } as ObjectRecord;
+ mockCreateCalendarEvent.mockResolvedValue({
+ success: true,
+ calendarEventId: 'calendar-event-id',
+ });
+
+ const onCreated = jest.fn();
+ const { result } = renderHook(() =>
+ useCalendarEventComposer({
+ initialValues: {
+ connectedAccountId: 'account-id',
+ contextRecord: {
+ objectNameSingular: 'person',
+ recordId: 'person-id',
+ },
+ defaultAttendees: '',
+ timeZone: 'UTC',
+ },
+ onCreated,
+ }),
+ );
+
+ expect(result.current.canPickTargets).toBe(false);
+ expect(result.current.targets).toEqual([]);
+
+ act(() => {
+ result.current.setTitle('Planning session');
+ });
+
+ await act(async () => {
+ await result.current.handleCreate();
+ });
+
+ expect(mockCreateCalendarEventTargets).not.toHaveBeenCalled();
+ expect(onCreated).toHaveBeenCalledTimes(1);
+ });
+
it('keeps an all-day event at least one day long', () => {
const { result } = renderHook(() =>
useCalendarEventComposer({
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/__tests__/useCreateCalendarEventTargets.test.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/__tests__/useCreateCalendarEventTargets.test.ts
new file mode 100644
index 00000000000..494931b431c
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/__tests__/useCreateCalendarEventTargets.test.ts
@@ -0,0 +1,83 @@
+import { renderHook } from '@testing-library/react';
+
+import { useCreateCalendarEventTargets } from '@/activities/calendar/hooks/useCreateCalendarEventTargets';
+
+const mockCreateManyRecords = jest.fn();
+const mockUseObjectMorphJunctionConfig = jest.fn();
+
+jest.mock('@/object-record/hooks/useCreateManyRecords', () => ({
+ useCreateManyRecords: () => ({ createManyRecords: mockCreateManyRecords }),
+}));
+
+jest.mock(
+ '@/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig',
+ () => ({
+ useObjectMorphJunctionConfig: () => mockUseObjectMorphJunctionConfig(),
+ }),
+);
+
+jest.mock('@/object-metadata/hooks/useObjectMetadataItems', () => ({
+ useObjectMetadataItems: () => ({ objectMetadataItems: [] }),
+}));
+
+const PERSON_OBJECT_METADATA_ID = '20202020-0000-4000-8000-0000000000a1';
+const CALENDAR_EVENT_ID = '20202020-0000-4000-8000-0000000000b1';
+const PERSON_ID = '20202020-0000-4000-8000-0000000000c1';
+
+const JUNCTION_CONFIG = {
+ junctionObjectMetadata: { nameSingular: 'calendarEventTarget' },
+ sourceJoinColumnName: 'calendarEventId',
+ targetFields: [
+ {
+ name: 'targetPerson',
+ relation: { targetObjectMetadata: { id: PERSON_OBJECT_METADATA_ID } },
+ },
+ ],
+};
+
+const TARGETS = [
+ {
+ objectMetadataId: PERSON_OBJECT_METADATA_ID,
+ recordId: PERSON_ID,
+ record: { id: PERSON_ID },
+ },
+];
+
+describe('useCreateCalendarEventTargets', () => {
+ beforeEach(() => {
+ jest.clearAllMocks();
+ mockUseObjectMorphJunctionConfig.mockReturnValue(JUNCTION_CONFIG);
+ });
+
+ it('upserts the junction rows so they survive participant matching', async () => {
+ const { result } = renderHook(() => useCreateCalendarEventTargets());
+
+ await result.current.createCalendarEventTargets({
+ calendarEventId: CALENDAR_EVENT_ID,
+ targets: TARGETS as never,
+ });
+
+ expect(mockCreateManyRecords).toHaveBeenCalledWith({
+ recordsToCreate: [
+ {
+ calendarEventId: CALENDAR_EVENT_ID,
+ targetPersonId: PERSON_ID,
+ },
+ ],
+ upsert: true,
+ });
+ });
+
+ it('writes nothing when the object has no junction', async () => {
+ mockUseObjectMorphJunctionConfig.mockReturnValue(null);
+
+ const { result } = renderHook(() => useCreateCalendarEventTargets());
+
+ await result.current.createCalendarEventTargets({
+ calendarEventId: CALENDAR_EVENT_ID,
+ targets: TARGETS as never,
+ });
+
+ expect(mockCreateManyRecords).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventComposer.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventComposer.ts
index c4478d80bd3..ab430dbc799 100644
--- a/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventComposer.ts
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventComposer.ts
@@ -1,23 +1,31 @@
import { getMissingCreateCalendarEventScopes } from '@/accounts/utils/hasMissingCreateCalendarEventScopes';
-import { useCalendarEventTargetRelatedPersonIds } from '@/activities/calendar/hooks/useCalendarEventTargetRelatedPersonIds';
+import { useCalendarEventTargetObjectMetadataItems } from '@/activities/calendar/hooks/useCalendarEventTargetObjectMetadataItems';
import { useCreateCalendarEvent } from '@/activities/calendar/hooks/useCreateCalendarEvent';
+import { useRefetchTimelineCalendarEvents } from '@/activities/calendar/hooks/useRefetchTimelineCalendarEvents';
+import { useCreateCalendarEventTargets } from '@/activities/calendar/hooks/useCreateCalendarEventTargets';
import { isCalendarEventComposerCreatingState } from '@/activities/calendar/states/isCalendarEventComposerCreatingState';
import { type CalendarEventComposerInitialValues } from '@/activities/calendar/types/CalendarEventComposerInitialValues';
+import { type CalendarEventComposerTarget } from '@/activities/calendar/types/CalendarEventComposerTarget';
import { getCalendarEventComposerDefaultDates } from '@/activities/calendar/utils/getCalendarEventComposerDefaultDates';
import { getCalendarEventDatesAfterModeChange } from '@/activities/calendar/utils/getCalendarEventDatesAfterModeChange';
import { getCalendarEventDatesAfterStartChange } from '@/activities/calendar/utils/getCalendarEventDatesAfterStartChange';
-import { hasCalendarEventTargetAssociation } from '@/activities/calendar/utils/hasCalendarEventTargetAssociation';
import { isCalendarCreationEnabledForAccount } from '@/activities/calendar/utils/isCalendarCreationEnabledForAccount';
import { type EmailRecipient } from '@/activities/emails/recipients/types/EmailRecipient';
import { isValidEmailRecipientAddress } from '@/activities/emails/recipients/utils/isValidEmailRecipientAddress';
import { parseEmailRecipients } from '@/activities/emails/recipients/utils/parseEmailRecipients';
import { serializeEmailRecipients } from '@/activities/emails/recipients/utils/serializeEmailRecipients';
+import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
+import { searchRecordStoreFamilyState } from '@/object-record/record-picker/multiple-record-picker/states/searchRecordStoreComponentFamilyState';
+import { type RecordPickerPickableMorphItem } from '@/object-record/record-picker/types/RecordPickerPickableMorphItem';
import { useMyConnectedAccounts } from '@/settings/accounts/hooks/useMyConnectedAccounts';
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { isNonEmptyString } from '@sniptt/guards';
+import { t } from '@lingui/core/macro';
import { useStore } from 'jotai';
import { useCallback, useState } from 'react';
import { MAX_EMAIL_RECIPIENTS } from 'twenty-shared/constants';
+import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { type SelectOption } from 'twenty-ui/input';
import { Temporal } from 'temporal-polyfill';
@@ -31,6 +39,9 @@ export const useCalendarEventComposer = ({
}) => {
const { accounts, loading: accountsLoading } = useMyConnectedAccounts();
const { createCalendarEvent, loading: isCreating } = useCreateCalendarEvent();
+ const { refetchTimelineCalendarEvents } = useRefetchTimelineCalendarEvents();
+ const { createCalendarEventTargets } = useCreateCalendarEventTargets();
+ const { enqueueErrorSnackBar } = useSnackBar();
const store = useStore();
const isCalendarEventComposerCreating = useAtomStateValue(
isCalendarEventComposerCreatingState,
@@ -53,6 +64,12 @@ export const useCalendarEventComposer = ({
),
);
const [sendInvitations, setSendInvitations] = useState(true);
+ const [pickedTargets, setPickedTargets] = useState<
+ CalendarEventComposerTarget[]
+ >([]);
+ const [discardedTargetRecordIds, setDiscardedTargetRecordIds] = useState<
+ string[]
+ >([]);
const [addConferencing, setAddConferencing] = useState(false);
const [dates, setDates] = useState(() =>
getCalendarEventComposerDefaultDates({
@@ -62,9 +79,6 @@ export const useCalendarEventComposer = ({
);
const calendarAccounts = accounts.filter(isCalendarCreationEnabledForAccount);
- const relatedPersonIds = useCalendarEventTargetRelatedPersonIds(
- initialValues?.contextRecord,
- );
const accountOptions: SelectOption<string>[] = calendarAccounts.map(
(account) => ({ label: account.handle, value: account.id }),
);
@@ -81,12 +95,87 @@ export const useCalendarEventComposer = ({
: [];
const hasTooManyAttendees =
sendInvitations && attendeeEmails.length > MAX_EMAIL_RECIPIENTS;
- const hasTargetAssociation = hasCalendarEventTargetAssociation({
- attendees,
- relatedPersonIds,
- requiredAttendee: initialValues?.defaultAttendees,
- sendInvitations,
- });
+
+ // Guests that match a person are related to the event server-side once
+ // participants are matched, so only the record the composer was opened from
+ // needs to be offered here.
+ const targetObjectMetadataItems = useCalendarEventTargetObjectMetadataItems();
+ const contextObjectMetadataItem = targetObjectMetadataItems.find(
+ ({ nameSingular }) =>
+ nameSingular === initialValues?.contextRecord.objectNameSingular,
+ );
+
+ const { record: contextRecord, loading: isContextRecordLoading } =
+ useFindOneRecord({
+ // The composer can be opened from a record the junction cannot target; the
+ // query is skipped there, but the hook still needs a resolvable object.
+ objectNameSingular:
+ contextObjectMetadataItem?.nameSingular ??
+ CoreObjectNameSingular.Person,
+ objectRecordId: initialValues?.contextRecord.recordId,
+ skip: !isDefined(contextObjectMetadataItem),
+ });
+
+ const contextTargets: CalendarEventComposerTarget[] =
+ isDefined(contextObjectMetadataItem) && isDefined(contextRecord)
+ ? [
+ {
+ objectMetadataId: contextObjectMetadataItem.id,
+ recordId: contextRecord.id,
+ record: contextRecord,
+ },
+ ]
+ : [];
+
+ const canPickTargets = targetObjectMetadataItems.length > 0;
+
+ const targets = [...contextTargets, ...pickedTargets].filter(
+ ({ recordId }, index, allTargets) =>
+ !discardedTargetRecordIds.includes(recordId) &&
+ allTargets.findIndex((target) => target.recordId === recordId) === index,
+ );
+
+ const handleTargetChange = (morphItem: RecordPickerPickableMorphItem) => {
+ if (!morphItem.isSelected) {
+ setPickedTargets((currentTargets) =>
+ currentTargets.filter(
+ ({ recordId }) => recordId !== morphItem.recordId,
+ ),
+ );
+ setDiscardedTargetRecordIds((currentRecordIds) => [
+ ...currentRecordIds,
+ morphItem.recordId,
+ ]);
+
+ return;
+ }
+
+ setDiscardedTargetRecordIds((currentRecordIds) =>
+ currentRecordIds.filter((recordId) => recordId !== morphItem.recordId),
+ );
+
+ const record = store.get(
+ searchRecordStoreFamilyState.atomFamily(morphItem.recordId),
+ )?.record;
+
+ if (!isDefined(record)) {
+ return;
+ }
+
+ setPickedTargets((currentTargets) =>
+ currentTargets.some(({ recordId }) => recordId === morphItem.recordId)
+ ? currentTargets
+ : [
+ ...currentTargets,
+ {
+ objectMetadataId: morphItem.objectMetadataId,
+ recordId: morphItem.recordId,
+ record,
+ },
+ ],
+ );
+ };
+
const hasValidDateRange = isFullDay
? dates.endsAt.slice(0, 10) > dates.startsAt.slice(0, 10)
: Date.parse(dates.endsAt) > Date.parse(dates.startsAt);
@@ -97,8 +186,10 @@ export const useCalendarEventComposer = ({
missingScopes.length === 0 &&
invalidAttendeeEmails.length === 0 &&
!hasTooManyAttendees &&
- hasTargetAssociation &&
hasValidDateRange &&
+ // Creating before it resolves would silently drop the relation the composer
+ // was opened for.
+ !(isDefined(contextObjectMetadataItem) && isContextRecordLoading) &&
!isCreating &&
!isCalendarEventComposerCreating;
@@ -150,7 +241,7 @@ export const useCalendarEventComposer = ({
store.set(isCalendarEventComposerCreatingState.atom, true);
try {
- const success = await createCalendarEvent({
+ const { success, calendarEventId } = await createCalendarEvent({
connectedAccountId,
title: title.trim(),
description: description.trim() || undefined,
@@ -164,9 +255,38 @@ export const useCalendarEventComposer = ({
addConferencing,
});
- if (success) {
- onCreated();
+ if (!success) {
+ return;
}
+
+ // The event already exists at this point, so a failure to link the
+ // related records must not keep the composer open: retrying would create
+ // a second event. A missing id means persistence failed, and the next
+ // provider sync then recreates the event without these links.
+ if (targets.length > 0) {
+ let areTargetsLinked = false;
+
+ if (isDefined(calendarEventId)) {
+ try {
+ await createCalendarEventTargets({ calendarEventId, targets });
+ areTargetsLinked = true;
+ } catch {
+ areTargetsLinked = false;
+ }
+ }
+
+ if (areTargetsLinked) {
+ // createCalendarEvent already refetched, but that ran before these
+ // links existed, so an event related only through them stays invisible.
+ await refetchTimelineCalendarEvents();
+ } else {
+ enqueueErrorSnackBar({
+ message: t`Failed to link the related records to this event`,
+ });
+ }
+ }
+
+ onCreated();
} finally {
store.set(isCalendarEventComposerCreatingState.atom, false);
}
@@ -176,14 +296,18 @@ export const useCalendarEventComposer = ({
canCreate,
connectedAccountId,
createCalendarEvent,
+ createCalendarEventTargets,
dates.endsAt,
dates.startsAt,
description,
+ enqueueErrorSnackBar,
isFullDay,
location,
onCreated,
+ refetchTimelineCalendarEvents,
sendInvitations,
store,
+ targets,
timeZone,
title,
]);
@@ -195,14 +319,15 @@ export const useCalendarEventComposer = ({
attendees,
attendeeEmails,
canCreate,
+ canPickTargets,
connectedAccountId,
dates,
description,
handleCreate,
handleIsFullDayChange,
handleStartsAtChange,
+ handleTargetChange,
hasTooManyAttendees,
- hasTargetAssociation,
hasValidDateRange,
invalidAttendeeEmails,
isFullDay,
@@ -219,6 +344,7 @@ export const useCalendarEventComposer = ({
setSendInvitations,
setTimeZone,
setTitle,
+ targets,
timeZone,
};
};
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventTargetObjectMetadataItems.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventTargetObjectMetadataItems.ts
new file mode 100644
index 00000000000..4f8183e14c2
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventTargetObjectMetadataItems.ts
@@ -0,0 +1,16 @@
+import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
+import { useObjectMorphJunctionConfig } from '@/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig';
+import { getSearchableObjectMetadataItems } from '@/object-record/record-field/ui/utils/junction/getSearchableObjectMetadataItems';
+import { CoreObjectNameSingular } from 'twenty-shared/types';
+
+export const useCalendarEventTargetObjectMetadataItems = () => {
+ const { objectMetadataItems } = useObjectMetadataItems();
+ const junctionConfig = useObjectMorphJunctionConfig({
+ objectNameSingular: CoreObjectNameSingular.CalendarEvent,
+ });
+
+ return getSearchableObjectMetadataItems(
+ junctionConfig?.targetFields ?? [],
+ objectMetadataItems,
+ );
+};
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventTargetRelatedPersonIds.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventTargetRelatedPersonIds.ts
deleted file mode 100644
index 22afa61fd13..00000000000
--- a/packages/twenty-front/src/modules/activities/calendar/hooks/useCalendarEventTargetRelatedPersonIds.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { TIMELINE_CALENDAR_EVENTS_DEFAULT_PAGE_SIZE } from '@/activities/calendar/constants/Calendar';
-import { getTimelineCalendarEventsFromObjectRecord } from '@/activities/calendar/graphql/queries/getTimelineCalendarEventsFromObjectRecord';
-import { type EmailComposerContextRecord } from '@/activities/emails/recipients/types/EmailComposerContextRecord';
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
-import { useQuery } from '@apollo/client/react';
-import { isDefined } from 'twenty-shared/utils';
-import {
- type GetTimelineCalendarEventsFromObjectRecordQuery,
- type GetTimelineCalendarEventsFromObjectRecordQueryVariables,
-} from '~/generated/graphql';
-
-export const useCalendarEventTargetRelatedPersonIds = (
- contextRecord: EmailComposerContextRecord | undefined,
-) => {
- const apolloCoreClient = useApolloCoreClient();
-
- const { data } = useQuery<
- GetTimelineCalendarEventsFromObjectRecordQuery,
- GetTimelineCalendarEventsFromObjectRecordQueryVariables
- >(getTimelineCalendarEventsFromObjectRecord, {
- client: apolloCoreClient,
- skip: !isDefined(contextRecord),
- variables: {
- objectNameSingular: contextRecord?.objectNameSingular ?? '',
- recordId: contextRecord?.recordId ?? '',
- page: 1,
- pageSize: TIMELINE_CALENDAR_EVENTS_DEFAULT_PAGE_SIZE,
- },
- });
-
- return data?.getTimelineCalendarEventsFromObjectRecord.relatedPersonIds ?? [];
-};
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEvent.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEvent.ts
index 45c87ebc815..e9989ea96cb 100644
--- a/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEvent.ts
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEvent.ts
@@ -1,6 +1,5 @@
import { CREATE_CALENDAR_EVENT } from '@/activities/calendar/graphql/mutations/createCalendarEvent';
-import { getTimelineCalendarEventsFromObjectRecord } from '@/activities/calendar/graphql/queries/getTimelineCalendarEventsFromObjectRecord';
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useRefetchTimelineCalendarEvents } from '@/activities/calendar/hooks/useRefetchTimelineCalendarEvents';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { useMutation } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
@@ -12,7 +11,7 @@ import {
} from '~/generated-metadata/graphql';
export const useCreateCalendarEvent = () => {
- const apolloCoreClient = useApolloCoreClient();
+ const { refetchTimelineCalendarEvents } = useRefetchTimelineCalendarEvents();
const { enqueueErrorSnackBar, enqueueSuccessSnackBar } = useSnackBar();
const [createCalendarEventMutation, { loading }] = useMutation<
@@ -34,28 +33,30 @@ export const useCreateCalendarEvent = () => {
t`Failed to create calendar event`,
});
- return false;
+ return { success: false };
}
enqueueSuccessSnackBar({
message: t`Calendar event created successfully`,
});
- await apolloCoreClient.refetchQueries({
- include: [getTimelineCalendarEventsFromObjectRecord],
- });
+ await refetchTimelineCalendarEvents();
- return true;
+ return {
+ success: true,
+ calendarEventId:
+ result.data.createCalendarEvent.calendarEventId ?? undefined,
+ };
} catch {
enqueueErrorSnackBar({
message: t`Failed to create calendar event`,
});
- return false;
+ return { success: false };
}
},
[
- apolloCoreClient,
+ refetchTimelineCalendarEvents,
createCalendarEventMutation,
enqueueErrorSnackBar,
enqueueSuccessSnackBar,
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEventTargets.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEventTargets.ts
new file mode 100644
index 00000000000..69c84526d36
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useCreateCalendarEventTargets.ts
@@ -0,0 +1,72 @@
+import { type CalendarEventComposerTarget } from '@/activities/calendar/types/CalendarEventComposerTarget';
+import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
+import { useCreateManyRecords } from '@/object-record/hooks/useCreateManyRecords';
+import { useObjectMorphJunctionConfig } from '@/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig';
+import { findTargetFieldInfo } from '@/object-record/record-field/ui/utils/junction/findTargetFieldInfo';
+import { useCallback } from 'react';
+import { CoreObjectNameSingular } from 'twenty-shared/types';
+import { isDefined } from 'twenty-shared/utils';
+
+export const useCreateCalendarEventTargets = () => {
+ const { objectMetadataItems } = useObjectMetadataItems();
+ const junctionConfig = useObjectMorphJunctionConfig({
+ objectNameSingular: CoreObjectNameSingular.CalendarEvent,
+ });
+
+ const { createManyRecords: createCalendarEventTargetRecords } =
+ useCreateManyRecords({
+ // Workspaces that predate the junction have no calendarEventTarget object
+ // and resolving one throws, so this falls back to the calendar event
+ // itself; without a junction config nothing is ever written.
+ objectNameSingular:
+ junctionConfig?.junctionObjectMetadata.nameSingular ??
+ CoreObjectNameSingular.CalendarEvent,
+ });
+
+ const createCalendarEventTargets = useCallback(
+ async ({
+ calendarEventId,
+ targets,
+ }: {
+ calendarEventId: string;
+ targets: CalendarEventComposerTarget[];
+ }) => {
+ if (!isDefined(junctionConfig)) {
+ return;
+ }
+
+ const recordsToCreate = targets.flatMap(
+ ({ objectMetadataId, recordId }) => {
+ const targetFieldInfo = findTargetFieldInfo(
+ junctionConfig.targetFields,
+ objectMetadataId,
+ objectMetadataItems,
+ );
+
+ if (!isDefined(targetFieldInfo?.joinColumnName)) {
+ return [];
+ }
+
+ return [
+ {
+ [junctionConfig.sourceJoinColumnName]: calendarEventId,
+ [targetFieldInfo.joinColumnName]: recordId,
+ },
+ ];
+ },
+ );
+
+ if (recordsToCreate.length === 0) {
+ return;
+ }
+
+ // Participant matching already linked the guests it resolved, including
+ // the record the composer was opened from, so these rows can collide with
+ // the junction's unique indexes. Upsert resolves against them.
+ await createCalendarEventTargetRecords({ recordsToCreate, upsert: true });
+ },
+ [createCalendarEventTargetRecords, junctionConfig, objectMetadataItems],
+ );
+
+ return { createCalendarEventTargets };
+};
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useOpenCalendarEventTargetsPicker.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useOpenCalendarEventTargetsPicker.ts
new file mode 100644
index 00000000000..01fc6766eee
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useOpenCalendarEventTargetsPicker.ts
@@ -0,0 +1,63 @@
+import { type CalendarEventComposerTarget } from '@/activities/calendar/types/CalendarEventComposerTarget';
+import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
+import { useMultipleRecordPickerOpen } from '@/object-record/record-picker/multiple-record-picker/hooks/useMultipleRecordPickerOpen';
+import { useMultipleRecordPickerPerformSearch } from '@/object-record/record-picker/multiple-record-picker/hooks/useMultipleRecordPickerPerformSearch';
+import { multipleRecordPickerPickableMorphItemsComponentState } from '@/object-record/record-picker/multiple-record-picker/states/multipleRecordPickerPickableMorphItemsComponentState';
+import { multipleRecordPickerSearchableObjectMetadataItemsComponentState } from '@/object-record/record-picker/multiple-record-picker/states/multipleRecordPickerSearchableObjectMetadataItemsComponentState';
+import { type RecordPickerPickableMorphItem } from '@/object-record/record-picker/types/RecordPickerPickableMorphItem';
+import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
+import { useStore } from 'jotai';
+
+export const useOpenCalendarEventTargetsPicker = () => {
+ const store = useStore();
+ const { openMultipleRecordPicker } = useMultipleRecordPickerOpen();
+ const { performSearch } = useMultipleRecordPickerPerformSearch();
+
+ const openCalendarEventTargetsPicker = ({
+ pickerInstanceId,
+ searchableObjectMetadataItems,
+ targets,
+ }: {
+ pickerInstanceId: string;
+ searchableObjectMetadataItems: EnrichedObjectMetadataItem[];
+ targets: CalendarEventComposerTarget[];
+ }) => {
+ openMultipleRecordPicker(pickerInstanceId);
+
+ const pickableMorphItems: RecordPickerPickableMorphItem[] = targets.map(
+ ({ objectMetadataId, recordId }) => ({
+ objectMetadataId,
+ recordId,
+ isSelected: true,
+ isMatchingSearchFilter: true,
+ }),
+ );
+
+ for (const { record } of targets) {
+ store.set(recordStoreFamilyState.atomFamily(record.id), record);
+ }
+
+ store.set(
+ multipleRecordPickerPickableMorphItemsComponentState.atomFamily({
+ instanceId: pickerInstanceId,
+ }),
+ pickableMorphItems,
+ );
+
+ store.set(
+ multipleRecordPickerSearchableObjectMetadataItemsComponentState.atomFamily(
+ { instanceId: pickerInstanceId },
+ ),
+ searchableObjectMetadataItems,
+ );
+
+ performSearch({
+ multipleRecordPickerInstanceId: pickerInstanceId,
+ forceSearchFilter: '',
+ forceSearchableObjectMetadataItems: searchableObjectMetadataItems,
+ forcePickableMorphItems: pickableMorphItems,
+ });
+ };
+
+ return { openCalendarEventTargetsPicker };
+};
diff --git a/packages/twenty-front/src/modules/activities/calendar/hooks/useRefetchTimelineCalendarEvents.ts b/packages/twenty-front/src/modules/activities/calendar/hooks/useRefetchTimelineCalendarEvents.ts
new file mode 100644
index 00000000000..a1f37e1bea4
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/calendar/hooks/useRefetchTimelineCalendarEvents.ts
@@ -0,0 +1,17 @@
+import { getTimelineCalendarEventsFromObjectRecord } from '@/activities/calendar/graphql/queries/getTimelineCalendarEventsFromObjectRecord';
+import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
+import { useCallback } from 'react';
+
+export const useRefetchTimelineCalendarEvents = () => {
+ const apolloCoreClient = useApolloCoreClient();
+
+ const refetchTimelineCalendarEvents = useCallback(
+ () =>
+ apolloCoreClient.refetchQueries({
+ include: [getTimelineCalendarEventsFromObjectRecord],
+ }),
+ [apolloCoreClient],
+ );
+
+ return { refetchTimelineCalendarEvents };
+};
diff --git a/packages/twenty-front/src/modules/activities/calendar/types/CalendarEventComposerTarget.ts b/packages/twenty-front/src/modules/activities/calendar/types/CalendarEventComposerTarget.ts
new file mode 100644
index 00000000000..1021246a46b
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/calendar/types/CalendarEventComposerTarget.ts
@@ -0,0 +1,7 @@
+import { type ObjectRecord } from '@/object-record/types/ObjectRecord';
+
+export type CalendarEventComposerTarget = {
+ objectMetadataId: string;
+ recordId: string;
+ record: ObjectRecord;
+};
diff --git a/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/hasCalendarEventTargetAssociation.test.ts b/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/hasCalendarEventTargetAssociation.test.ts
deleted file mode 100644
index 586c998f0c3..00000000000
--- a/packages/twenty-front/src/modules/activities/calendar/utils/__tests__/hasCalendarEventTargetAssociation.test.ts
+++ /dev/null
@@ -1,68 +0,0 @@
-import { hasCalendarEventTargetAssociation } from '@/activities/calendar/utils/hasCalendarEventTargetAssociation';
-
-describe('hasCalendarEventTargetAssociation', () => {
- it('requires invitations to preserve the provider participant', () => {
- expect(
- hasCalendarEventTargetAssociation({
- attendees: [{ address: '[email protected]' }],
- relatedPersonIds: [],
- requiredAttendee: '[email protected]',
- sendInvitations: false,
- }),
- ).toBe(false);
- });
-
- it('requires the current record email in the attendee list', () => {
- expect(
- hasCalendarEventTargetAssociation({
- attendees: [{ address: '[email protected]' }],
- relatedPersonIds: [],
- requiredAttendee: '[email protected]',
- sendInvitations: true,
- }),
- ).toBe(false);
- });
-
- it('matches the current record email case-insensitively', () => {
- expect(
- hasCalendarEventTargetAssociation({
- attendees: [{ address: '[email protected]' }],
- relatedPersonIds: [],
- requiredAttendee: '[email protected]',
- sendInvitations: true,
- }),
- ).toBe(true);
- });
-
- it('accepts another person related to the timeline record', () => {
- expect(
- hasCalendarEventTargetAssociation({
- attendees: [
- {
- address: '[email protected]',
- personId: 'related-person-id',
- },
- ],
- relatedPersonIds: ['related-person-id'],
- requiredAttendee: '[email protected]',
- sendInvitations: true,
- }),
- ).toBe(true);
- });
-
- it('rejects a person unrelated to the timeline record', () => {
- expect(
- hasCalendarEventTargetAssociation({
- attendees: [
- {
- address: '[email protected]',
- personId: 'unrelated-person-id',
- },
- ],
- relatedPersonIds: ['related-person-id'],
- requiredAttendee: '[email protected]',
- sendInvitations: true,
- }),
- ).toBe(false);
- });
-});
diff --git a/packages/twenty-front/src/modules/activities/calendar/utils/hasCalendarEventTargetAssociation.ts b/packages/twenty-front/src/modules/activities/calendar/utils/hasCalendarEventTargetAssociation.ts
deleted file mode 100644
index 30d41d8a671..00000000000
--- a/packages/twenty-front/src/modules/activities/calendar/utils/hasCalendarEventTargetAssociation.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { isNonEmptyString } from '@sniptt/guards';
-import { isDefined } from 'twenty-shared/utils';
-
-import { type EmailRecipient } from '@/activities/emails/recipients/types/EmailRecipient';
-
-export const hasCalendarEventTargetAssociation = ({
- attendees,
- relatedPersonIds,
- requiredAttendee,
- sendInvitations,
-}: {
- attendees: EmailRecipient[];
- relatedPersonIds: string[];
- requiredAttendee: string | undefined;
- sendInvitations: boolean;
-}) => {
- if (!sendInvitations) {
- return false;
- }
-
- const relatedPersonIdSet = new Set(relatedPersonIds);
-
- return attendees.some(
- (attendee) =>
- (isDefined(attendee.personId) &&
- relatedPersonIdSet.has(attendee.personId)) ||
- (isNonEmptyString(requiredAttendee) &&
- attendee.address.toLowerCase() === requiredAttendee.toLowerCase()),
- );
-};
diff --git a/packages/twenty-front/src/modules/object-record/read-only/utils/__tests__/isRecordFieldReadOnly.test.ts b/packages/twenty-front/src/modules/object-record/read-only/utils/__tests__/isRecordFieldReadOnly.test.ts
index 921b4f5ff19..4d297cbdd69 100644
--- a/packages/twenty-front/src/modules/object-record/read-only/utils/__tests__/isRecordFieldReadOnly.test.ts
+++ b/packages/twenty-front/src/modules/object-record/read-only/utils/__tests__/isRecordFieldReadOnly.test.ts
@@ -1,5 +1,5 @@
import { isRecordFieldReadOnly } from '@/object-record/read-only/utils/isRecordFieldReadOnly';
-import { FieldMetadataType } from '~/generated-metadata/graphql';
+import { FieldMetadataType, RelationType } from '~/generated-metadata/graphql';
describe('isRecordFieldReadOnly', () => {
const mockObjectPermissions = {
@@ -128,6 +128,54 @@ describe('isRecordFieldReadOnly', () => {
expect(result).toBe(true);
});
+ it('should return false for a junction target field on a system object', () => {
+ const result = isRecordFieldReadOnly({
+ ...mockParams,
+ isSystemObject: true,
+ isFieldFromStandardApplication: true,
+ fieldMetadataItem: {
+ id: 'field-123',
+ isUIEditable: true,
+ type: FieldMetadataType.RELATION,
+ settings: { junctionTargetFieldId: 'target-field-123' },
+ },
+ });
+
+ expect(result).toBe(false);
+ });
+
+ it('should return true for a plain relation field on a system object', () => {
+ const result = isRecordFieldReadOnly({
+ ...mockParams,
+ isSystemObject: true,
+ isFieldFromStandardApplication: true,
+ fieldMetadataItem: {
+ id: 'field-123',
+ isUIEditable: true,
+ type: FieldMetadataType.RELATION,
+ settings: { relationType: RelationType.ONE_TO_MANY },
+ },
+ });
+
+ expect(result).toBe(true);
+ });
+
+ it('should keep a junction target field read-only when the record is read-only', () => {
+ const result = isRecordFieldReadOnly({
+ ...mockParams,
+ isRecordReadOnly: true,
+ isSystemObject: true,
+ fieldMetadataItem: {
+ id: 'field-123',
+ isUIEditable: true,
+ type: FieldMetadataType.RELATION,
+ settings: { junctionTargetFieldId: 'target-field-123' },
+ },
+ });
+
+ expect(result).toBe(true);
+ });
+
it('should return false when isSystemObject is not provided', () => {
const result = isRecordFieldReadOnly({
...mockParams,
diff --git a/packages/twenty-front/src/modules/object-record/read-only/utils/isRecordFieldReadOnly.ts b/packages/twenty-front/src/modules/object-record/read-only/utils/isRecordFieldReadOnly.ts
index 9865ee7d18c..3a9559bcdfd 100644
--- a/packages/twenty-front/src/modules/object-record/read-only/utils/isRecordFieldReadOnly.ts
+++ b/packages/twenty-front/src/modules/object-record/read-only/utils/isRecordFieldReadOnly.ts
@@ -1,6 +1,7 @@
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { isFieldMetadataReadOnlyByPermissions } from '@/object-record/read-only/utils/internal/isFieldMetadataReadOnlyByPermissions';
import { isOneToManyRelationFieldReadOnlyDueToTargetUpdatePermission } from '@/object-record/read-only/utils/isOneToManyRelationFieldReadOnlyDueToTargetUpdatePermission';
+import { isConfiguredJunctionRelationField } from '@/object-record/record-field/ui/utils/junction/isConfiguredJunctionRelationField';
import { type FieldDefinition } from '@/object-record/record-field/ui/types/FieldDefinition';
import { type FieldMetadata } from '@/object-record/record-field/ui/types/FieldMetadata';
import { type ObjectPermission } from '~/generated-metadata/graphql';
@@ -16,7 +17,8 @@ type IsRecordFieldReadOnlyParams = {
isRecordReadOnly: boolean;
isSystemObject?: boolean;
isFieldFromStandardApplication?: boolean;
- fieldMetadataItem: Pick<FieldMetadataItem, 'id' | 'isUIEditable'>;
+ fieldMetadataItem: Pick<FieldMetadataItem, 'id' | 'isUIEditable'> &
+ Partial<Pick<FieldMetadataItem, 'type' | 'settings'>>;
objectPermissions: ObjectPermission;
fieldDefinition?: FieldDefinition<FieldMetadata>;
objectPermissionsByObjectMetadataId?: ObjectPermissionsByObjectMetadataId;
@@ -44,10 +46,22 @@ export const isRecordFieldReadOnly = ({
objectPermissionsByObjectMetadataId,
});
+ // A junction target field carries links the workspace owns, not data synced
+ // from the provider, so it is exempt from the system-object lock below.
+ // Record-level read-only still wins.
+ const isJunctionTargetField =
+ isDefined(fieldMetadataItem.type) &&
+ isConfiguredJunctionRelationField({
+ type: fieldMetadataItem.type,
+ settings: fieldMetadataItem.settings,
+ });
+
// Keep system-object standard fields read-only. If the application origin
// cannot be resolved yet, fail closed until metadata finishes loading.
const isReadOnlyStandardFieldOnSystemObject =
- isSystemObject === true && isFieldFromStandardApplication !== false;
+ isSystemObject === true &&
+ isFieldFromStandardApplication !== false &&
+ !isJunctionTargetField;
return (
isRecordReadOnly ||
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/anchored-portal/components/RecordFieldListInputContextProvider.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/anchored-portal/components/RecordFieldListInputContextProvider.tsx
index d9e8ad7f317..28ec8373f5d 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/anchored-portal/components/RecordFieldListInputContextProvider.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/anchored-portal/components/RecordFieldListInputContextProvider.tsx
@@ -1,20 +1,10 @@
-import { usePersistFieldFromFieldInputContext } from '@/object-record/record-field/ui/hooks/usePersistFieldFromFieldInputContext';
-import { RecordFieldComponentInstanceContext } from '@/object-record/record-field/ui/states/contexts/RecordFieldComponentInstanceContext';
-
-import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
+import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { formatFieldMetadataItemAsFieldDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsFieldDefinition';
import { recordFieldListCellEditModePositionComponentState } from '@/object-record/record-field-list/states/recordFieldListCellEditModePositionComponentState';
-import {
- FieldInputEventContext,
- type FieldInputClickOutsideEvent,
- type FieldInputEvent,
-} from '@/object-record/record-field/ui/contexts/FieldInputEventContext';
+import { FieldInputEventContextProvider } from '@/object-record/record-field/ui/components/FieldInputEventContextProvider';
import { useOpenFieldInputEditMode } from '@/object-record/record-field/ui/hooks/useOpenFieldInputEditMode';
-import { currentFocusIdSelector } from '@/ui/utilities/focus/states/currentFocusIdSelector';
-import { useAvailableComponentInstanceId } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceId';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
-import { useStore } from 'jotai';
import { useCallback } from 'react';
type RecordFieldListInputContextProviderProps = {
@@ -32,11 +22,6 @@ export const RecordFieldListInputContextProvider = ({
objectMetadataItem,
instanceIdPrefix,
}: RecordFieldListInputContextProviderProps) => {
- const store = useStore();
- const instanceId = useAvailableComponentInstanceId(
- RecordFieldComponentInstanceContext,
- );
-
const { closeFieldInput } = useOpenFieldInputEditMode();
const setRecordFieldListCellEditModePosition = useSetAtomComponentState(
@@ -64,96 +49,11 @@ export const RecordFieldListInputContextProvider = ({
instanceIdPrefix,
]);
- const { persistFieldFromFieldInputContext } =
- usePersistFieldFromFieldInputContext();
-
- const handleEnter: FieldInputEvent = ({ newValue, skipPersist }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCellAndResetEditModePosition();
- };
-
- const handleSubmit: FieldInputEvent = ({
- newValue,
- skipPersist,
- skipClose,
- }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- if (skipClose !== true) {
- closeInlineCellAndResetEditModePosition();
- }
- };
-
- const handleCancel = () => {
- closeInlineCellAndResetEditModePosition();
- };
-
- const handleClickOutside: FieldInputClickOutsideEvent = useCallback(
- ({ newValue, event, skipPersist }) => {
- const currentFocusId = store.get(currentFocusIdSelector.atom);
-
- if (currentFocusId !== instanceId) {
- return;
- }
- event?.preventDefault();
- event?.stopImmediatePropagation();
-
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCellAndResetEditModePosition();
- },
- [
- closeInlineCellAndResetEditModePosition,
- instanceId,
- persistFieldFromFieldInputContext,
- store,
- ],
- );
-
- const handleEscape: FieldInputEvent = ({ newValue, skipPersist }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCellAndResetEditModePosition();
- };
-
- const handleTab: FieldInputEvent = ({ newValue, skipPersist }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCellAndResetEditModePosition();
- };
-
- const handleShiftTab: FieldInputEvent = ({ newValue, skipPersist }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCellAndResetEditModePosition();
- };
-
return (
- <FieldInputEventContext.Provider
- value={{
- onCancel: handleCancel,
- onEnter: handleEnter,
- onEscape: handleEscape,
- onClickOutside: handleClickOutside,
- onShiftTab: handleShiftTab,
- onSubmit: handleSubmit,
- onTab: handleTab,
- }}
+ <FieldInputEventContextProvider
+ onClose={closeInlineCellAndResetEditModePosition}
>
{children}
- </FieldInputEventContext.Provider>
+ </FieldInputEventContextProvider>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/components/FieldContextProvider.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/components/FieldContextProvider.tsx
index 34d2d471df1..abd3e289f3f 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/components/FieldContextProvider.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/components/FieldContextProvider.tsx
@@ -23,6 +23,8 @@ export const FieldContextProvider = ({
showLabel = true,
maxWidth,
isDisplayModeFixHeight,
+ onOpenEditMode,
+ onCloseEditMode,
children,
}: {
clearable?: boolean;
@@ -38,6 +40,8 @@ export const FieldContextProvider = ({
showLabel?: boolean;
maxWidth?: number;
isDisplayModeFixHeight?: boolean;
+ onOpenEditMode?: () => void;
+ onCloseEditMode?: () => void;
children: ReactNode;
}) => {
const { objectMetadataItem } = useObjectMetadataItem({
@@ -94,6 +98,8 @@ export const FieldContextProvider = ({
anchorId,
maxWidth,
isDisplayModeFixHeight,
+ onOpenEditMode,
+ onCloseEditMode,
}}
>
{children}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/components/FieldInputEventContextProvider.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/components/FieldInputEventContextProvider.tsx
new file mode 100644
index 00000000000..345b90354a1
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/components/FieldInputEventContextProvider.tsx
@@ -0,0 +1,88 @@
+import {
+ FieldInputEventContext,
+ type FieldInputClickOutsideEvent,
+ type FieldInputEvent,
+} from '@/object-record/record-field/ui/contexts/FieldInputEventContext';
+import { usePersistFieldFromFieldInputContext } from '@/object-record/record-field/ui/hooks/usePersistFieldFromFieldInputContext';
+import { RecordFieldComponentInstanceContext } from '@/object-record/record-field/ui/states/contexts/RecordFieldComponentInstanceContext';
+import { currentFocusIdSelector } from '@/ui/utilities/focus/states/currentFocusIdSelector';
+import { useAvailableComponentInstanceId } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceId';
+import { useStore } from 'jotai';
+import { useCallback } from 'react';
+
+type FieldInputEventContextProviderProps = {
+ children: React.ReactNode;
+ onClose: () => void;
+};
+
+export const FieldInputEventContextProvider = ({
+ children,
+ onClose,
+}: FieldInputEventContextProviderProps) => {
+ const store = useStore();
+
+ const instanceId = useAvailableComponentInstanceId(
+ RecordFieldComponentInstanceContext,
+ );
+
+ const { persistFieldFromFieldInputContext } =
+ usePersistFieldFromFieldInputContext();
+
+ const persistAndClose: FieldInputEvent = ({ newValue, skipPersist }) => {
+ if (skipPersist !== true) {
+ persistFieldFromFieldInputContext(newValue);
+ }
+
+ onClose();
+ };
+
+ const handleSubmit: FieldInputEvent = ({
+ newValue,
+ skipPersist,
+ skipClose,
+ }) => {
+ if (skipPersist !== true) {
+ persistFieldFromFieldInputContext(newValue);
+ }
+
+ if (skipClose !== true) {
+ onClose();
+ }
+ };
+
+ const handleClickOutside: FieldInputClickOutsideEvent = useCallback(
+ ({ newValue, event, skipPersist }) => {
+ const currentFocusId = store.get(currentFocusIdSelector.atom);
+
+ if (currentFocusId !== instanceId) {
+ return;
+ }
+
+ event?.preventDefault();
+ event?.stopImmediatePropagation();
+
+ if (skipPersist !== true) {
+ persistFieldFromFieldInputContext(newValue);
+ }
+
+ onClose();
+ },
+ [onClose, instanceId, persistFieldFromFieldInputContext, store],
+ );
+
+ return (
+ <FieldInputEventContext.Provider
+ value={{
+ onCancel: onClose,
+ onEnter: persistAndClose,
+ onEscape: persistAndClose,
+ onClickOutside: handleClickOutside,
+ onShiftTab: persistAndClose,
+ onSubmit: handleSubmit,
+ onTab: persistAndClose,
+ }}
+ >
+ {children}
+ </FieldInputEventContext.Provider>
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/components/RecordTargetsInlineCell.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/components/RecordTargetsInlineCell.tsx
new file mode 100644
index 00000000000..b9c9cd934dd
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/components/RecordTargetsInlineCell.tsx
@@ -0,0 +1,108 @@
+import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
+import { formatFieldMetadataItemAsFieldDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsFieldDefinition';
+import { RecordFieldsScopeContextProvider } from '@/object-record/record-field-list/contexts/RecordFieldsScopeContext';
+import { FieldContextProvider } from '@/object-record/record-field/ui/components/FieldContextProvider';
+import { FieldInput } from '@/object-record/record-field/ui/components/FieldInput';
+import { FieldInputEventContextProvider } from '@/object-record/record-field/ui/components/FieldInputEventContextProvider';
+import { useObjectMorphJunctionConfig } from '@/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig';
+import { useOpenFieldInputEditMode } from '@/object-record/record-field/ui/hooks/useOpenFieldInputEditMode';
+import { RecordFieldComponentInstanceContext } from '@/object-record/record-field/ui/states/contexts/RecordFieldComponentInstanceContext';
+import { RecordInlineCell } from '@/object-record/record-inline-cell/components/RecordInlineCell';
+import { RecordInlineCellAnchoredPortal } from '@/object-record/record-inline-cell/components/RecordInlineCellAnchoredPortal';
+import { RecordInlineCellEditMode } from '@/object-record/record-inline-cell/components/RecordInlineCellEditMode';
+import { getRecordFieldInputInstanceId } from '@/object-record/utils/getRecordFieldInputId';
+import { useState } from 'react';
+import { isDefined } from 'twenty-shared/utils';
+
+type RecordTargetsInlineCellProps = {
+ objectNameSingular: string;
+ recordId: string;
+ instanceIdPrefix: string;
+ showLabel?: boolean;
+};
+
+export const RecordTargetsInlineCell = ({
+ objectNameSingular,
+ recordId,
+ instanceIdPrefix,
+ showLabel = false,
+}: RecordTargetsInlineCellProps) => {
+ const junctionConfig = useObjectMorphJunctionConfig({ objectNameSingular });
+ const { objectMetadataItem } = useObjectMetadataItem({ objectNameSingular });
+ const { openFieldInput, closeFieldInput } = useOpenFieldInputEditMode();
+
+ const [isEditing, setIsEditing] = useState(false);
+
+ if (!isDefined(junctionConfig)) {
+ return null;
+ }
+
+ const junctionField = junctionConfig.junctionField;
+
+ const fieldInstanceId = getRecordFieldInputInstanceId({
+ recordId,
+ fieldName: junctionField.name,
+ prefix: instanceIdPrefix,
+ });
+
+ const fieldDefinition = formatFieldMetadataItemAsFieldDefinition({
+ field: junctionField,
+ objectMetadataItem,
+ });
+
+ // Opening pushes the picker onto the focus stack, so closing has to pop it or
+ // the app keeps treating this dropdown as focused.
+ const closeEditMode = () => {
+ setIsEditing(false);
+
+ closeFieldInput({ fieldDefinition, recordId, prefix: instanceIdPrefix });
+ };
+
+ const openEditMode = () => {
+ setIsEditing(true);
+
+ openFieldInput({ fieldDefinition, recordId, prefix: instanceIdPrefix });
+ };
+
+ return (
+ <FieldContextProvider
+ objectNameSingular={objectNameSingular}
+ objectRecordId={recordId}
+ fieldMetadataName={junctionField.name}
+ fieldPosition={0}
+ showLabel={showLabel}
+ isDisplayModeFixHeight
+ anchorId={fieldInstanceId}
+ onOpenEditMode={openEditMode}
+ onCloseEditMode={closeEditMode}
+ >
+ <RecordFieldsScopeContextProvider
+ value={{ scopeInstanceId: instanceIdPrefix }}
+ >
+ <RecordFieldComponentInstanceContext.Provider
+ value={{ instanceId: fieldInstanceId }}
+ >
+ <RecordInlineCell instanceIdPrefix={instanceIdPrefix} />
+
+ {/* RecordInlineCell only renders display mode; the field input lives in
+ an anchored portal that each container mounts for itself. */}
+ {isEditing && (
+ <RecordInlineCellAnchoredPortal
+ fieldMetadataItem={junctionField}
+ objectMetadataItem={objectMetadataItem}
+ recordId={recordId}
+ instanceIdPrefix={instanceIdPrefix}
+ onCloseEditMode={closeEditMode}
+ >
+ <FieldInputEventContextProvider onClose={closeEditMode}>
+ <RecordInlineCellEditMode>
+ <FieldInput />
+ </RecordInlineCellEditMode>
+ </FieldInputEventContextProvider>
+ </RecordInlineCellAnchoredPortal>
+ )}
+ </RecordFieldComponentInstanceContext.Provider>
+ </RecordFieldsScopeContextProvider>
+ </FieldContextProvider>
+ );
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/components/__tests__/RecordTargetsInlineCell.test.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/components/__tests__/RecordTargetsInlineCell.test.tsx
new file mode 100644
index 00000000000..3d985be15fe
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/components/__tests__/RecordTargetsInlineCell.test.tsx
@@ -0,0 +1,99 @@
+import { i18n } from '@lingui/core';
+import { I18nProvider } from '@lingui/react';
+import { render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import { MemoryRouter } from 'react-router-dom';
+
+import { FileUploadProvider } from '@/file-upload/components/FileUploadProvider';
+import { RecordTargetsInlineCell } from '@/object-record/record-field/ui/components/RecordTargetsInlineCell';
+import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
+import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';
+
+// Opening the picker performs a record search over the network, which is out of
+// scope here and unreachable through MockedProvider.
+jest.mock(
+ '@/object-record/record-picker/multiple-record-picker/hooks/useMultipleRecordPickerPerformSearch',
+ () => ({
+ useMultipleRecordPickerPerformSearch: () => ({
+ performSearch: jest.fn(),
+ }),
+ }),
+);
+
+const NOTE_ID = '20202020-0000-4000-8000-000000000001';
+
+const renderCell = (objectNameSingular: string) => {
+ const Wrapper = getJestMetadataAndApolloMocksWrapper({
+ onInitializeJotaiStore: (store) => {
+ store.set(recordStoreFamilyState.atomFamily(NOTE_ID), {
+ __typename: 'Note',
+ id: NOTE_ID,
+ noteTargets: [],
+ });
+ },
+ });
+
+ return render(
+ <I18nProvider i18n={i18n}>
+ <MemoryRouter>
+ <FileUploadProvider>
+ <RecordTargetsInlineCell
+ objectNameSingular={objectNameSingular}
+ recordId={NOTE_ID}
+ instanceIdPrefix="test-relations"
+ showLabel
+ />
+ </FileUploadProvider>
+ </MemoryRouter>
+ </I18nProvider>,
+ { wrapper: Wrapper },
+ );
+};
+
+describe('RecordTargetsInlineCell', () => {
+ it('renders the morph junction field of the object', async () => {
+ renderCell('note');
+
+ expect((await screen.findAllByText('Relations')).length).toBeGreaterThan(0);
+ });
+
+ it('renders nothing for an object without a morph junction', () => {
+ renderCell('workspaceMember');
+
+ expect(screen.queryByText('Relations')).not.toBeInTheDocument();
+ });
+
+ it('opens the record picker when the cell is clicked', async () => {
+ renderCell('note');
+
+ const relationsTexts = await screen.findAllByText('Relations');
+
+ expect(
+ screen.queryByTestId('inline-cell-edit-mode-container'),
+ ).not.toBeInTheDocument();
+
+ await userEvent.click(relationsTexts[relationsTexts.length - 1]);
+
+ expect(
+ screen.getByTestId('inline-cell-edit-mode-container'),
+ ).toBeInTheDocument();
+ });
+
+ it('closes the record picker on escape', async () => {
+ renderCell('note');
+
+ const relationsTexts = await screen.findAllByText('Relations');
+
+ await userEvent.click(relationsTexts[relationsTexts.length - 1]);
+
+ expect(
+ screen.getByTestId('inline-cell-edit-mode-container'),
+ ).toBeInTheDocument();
+
+ await userEvent.keyboard('{Escape}');
+
+ expect(
+ screen.queryByTestId('inline-cell-edit-mode-container'),
+ ).not.toBeInTheDocument();
+ });
+});
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig.ts
new file mode 100644
index 00000000000..e12e60e905a
--- /dev/null
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig.ts
@@ -0,0 +1,17 @@
+import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
+import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
+import { getObjectMorphJunctionConfig } from '@/object-record/record-field/ui/utils/junction/getObjectMorphJunctionConfig';
+
+export const useObjectMorphJunctionConfig = ({
+ objectNameSingular,
+}: {
+ objectNameSingular: string;
+}) => {
+ const { objectMetadataItem } = useObjectMetadataItem({ objectNameSingular });
+ const { objectMetadataItems } = useObjectMetadataItems();
+
+ return getObjectMorphJunctionConfig({
+ objectMetadata: objectMetadataItem,
+ objectMetadataItems,
+ });
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useObjectMorphJunctionConfigOrThrow.ts b/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useObjectMorphJunctionConfigOrThrow.ts
index a9bd8fec96c..6fd875f7d4a 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useObjectMorphJunctionConfigOrThrow.ts
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/hooks/useObjectMorphJunctionConfigOrThrow.ts
@@ -1,6 +1,4 @@
-import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
-import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
-import { getObjectMorphJunctionConfig } from '@/object-record/record-field/ui/utils/junction/getObjectMorphJunctionConfig';
+import { useObjectMorphJunctionConfig } from '@/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig';
import { isDefined } from 'twenty-shared/utils';
export const useObjectMorphJunctionConfigOrThrow = ({
@@ -8,13 +6,7 @@ export const useObjectMorphJunctionConfigOrThrow = ({
}: {
objectNameSingular: string;
}) => {
- const { objectMetadataItem } = useObjectMetadataItem({ objectNameSingular });
- const { objectMetadataItems } = useObjectMetadataItems();
-
- const junctionConfig = getObjectMorphJunctionConfig({
- objectMetadata: objectMetadataItem,
- objectMetadataItems,
- });
+ const junctionConfig = useObjectMorphJunctionConfig({ objectNameSingular });
if (!isDefined(junctionConfig)) {
throw new Error(
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldEdit.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldEdit.tsx
index b850144f0b1..b6c0fb84914 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldEdit.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetActionFieldEdit.tsx
@@ -102,6 +102,8 @@ export const WidgetActionFieldEdit = ({
fieldMetadataItem: {
id: fieldMetadataItem.id,
isUIEditable: fieldMetadataItem.isUIEditable ?? true,
+ type: fieldMetadataItem.type,
+ settings: fieldMetadataItem.settings,
},
fieldDefinition,
objectPermissionsByObjectMetadataId,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetRelationsHeader.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetRelationsHeader.tsx
new file mode 100644
index 00000000000..67953cca8e0
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/WidgetRelationsHeader.tsx
@@ -0,0 +1,43 @@
+import { RecordTargetsInlineCell } from '@/object-record/record-field/ui/components/RecordTargetsInlineCell';
+import { useObjectMorphJunctionConfig } from '@/object-record/record-field/ui/hooks/useObjectMorphJunctionConfig';
+import { useLayoutRenderingContext } from '@/ui/layout/contexts/LayoutRenderingContext';
+import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
+import { SidePanelProvider } from '@/ui/layout/side-panel/contexts/SidePanelContext';
+import { styled } from '@linaria/react';
+import { isDefined } from 'twenty-shared/utils';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+
+const StyledContainer = styled.div`
+ border-bottom: 1px solid ${themeCssVariables.border.color.light};
+ box-sizing: border-box;
+ display: flex;
+ flex-shrink: 0;
+ padding: ${themeCssVariables.spacing[2]};
+ width: 100%;
+`;
+
+export const WidgetRelationsHeader = () => {
+ const targetRecord = useTargetRecord();
+ const { isInSidePanel } = useLayoutRenderingContext();
+
+ const junctionConfig = useObjectMorphJunctionConfig({
+ objectNameSingular: targetRecord.targetObjectNameSingular,
+ });
+
+ if (!isDefined(junctionConfig)) {
+ return null;
+ }
+
+ return (
+ <SidePanelProvider value={{ isInSidePanel }}>
+ <StyledContainer>
+ <RecordTargetsInlineCell
+ objectNameSingular={targetRecord.targetObjectNameSingular}
+ recordId={targetRecord.id}
+ instanceIdPrefix={`widget-relations-header${isInSidePanel ? '-side-panel' : ''}`}
+ showLabel
+ />
+ </StyledContainer>
+ </SidePanelProvider>
+ );
+};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/__tests__/WidgetRelationsHeader.test.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/__tests__/WidgetRelationsHeader.test.tsx
new file mode 100644
index 00000000000..2b50702ad7a
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/__tests__/WidgetRelationsHeader.test.tsx
@@ -0,0 +1,63 @@
+import { i18n } from '@lingui/core';
+import { I18nProvider } from '@lingui/react';
+import { render, screen } from '@testing-library/react';
+import { MemoryRouter } from 'react-router-dom';
+
+import { FileUploadProvider } from '@/file-upload/components/FileUploadProvider';
+import { recordStoreFamilyState } from '@/object-record/record-store/states/recordStoreFamilyState';
+import { WidgetRelationsHeader } from '@/page-layout/widgets/components/WidgetRelationsHeader';
+import { LayoutRenderingProvider } from '@/ui/layout/contexts/LayoutRenderingContext';
+import { getJestMetadataAndApolloMocksWrapper } from '~/testing/jest/getJestMetadataAndApolloMocksWrapper';
+import { PageLayoutType } from '~/generated-metadata/graphql';
+
+const RECORD_ID = '20202020-0000-4000-8000-000000000001';
+
+const renderHeader = (targetObjectNameSingular: string) => {
+ const Wrapper = getJestMetadataAndApolloMocksWrapper({
+ onInitializeJotaiStore: (store) => {
+ store.set(recordStoreFamilyState.atomFamily(RECORD_ID), {
+ __typename: 'Note',
+ id: RECORD_ID,
+ noteTargets: [],
+ });
+ },
+ });
+
+ return render(
+ <I18nProvider i18n={i18n}>
+ <MemoryRouter>
+ <FileUploadProvider>
+ <LayoutRenderingProvider
+ value={{
+ targetRecordIdentifier: {
+ id: RECORD_ID,
+ targetObjectNameSingular,
+ },
+ layoutType: PageLayoutType.RECORD_PAGE,
+ isInSidePanel: false,
+ }}
+ >
+ <div data-testid="header-slot">
+ <WidgetRelationsHeader />
+ </div>
+ </LayoutRenderingProvider>
+ </FileUploadProvider>
+ </MemoryRouter>
+ </I18nProvider>,
+ { wrapper: Wrapper },
+ );
+};
+
+describe('WidgetRelationsHeader', () => {
+ it('renders the relations cell when the object has a morph junction', async () => {
+ renderHeader('note');
+
+ expect((await screen.findAllByText('Relations')).length).toBeGreaterThan(0);
+ });
+
+ it('renders nothing when the object has no morph junction', () => {
+ renderHeader('workspaceMember');
+
+ expect(screen.getByTestId('header-slot')).toBeEmptyDOMElement();
+ });
+});
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadWidget.tsx b/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadWidget.tsx
index 32354eba6d8..11a1d14fec1 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadWidget.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/email-thread/components/EmailThreadWidget.tsx
@@ -15,6 +15,7 @@ import {
} from '@/ui/layout/components/WidgetContentContainer';
import { EmailThreadComposer } from '@/page-layout/widgets/email-thread/components/EmailThreadComposer';
import { EmailThreadIntermediaryMessages } from '@/page-layout/widgets/email-thread/components/EmailThreadIntermediaryMessages';
+import { WidgetRelationsHeader } from '@/page-layout/widgets/components/WidgetRelationsHeader';
import { useLayoutRenderingContext } from '@/ui/layout/contexts/LayoutRenderingContext';
import { useTargetRecord } from '@/ui/layout/contexts/useTargetRecord';
import { t } from '@lingui/core/macro';
@@ -93,6 +94,7 @@ export const EmailThreadWidget = ({
if (threadLoading || !thread || !messages.length) {
return (
<StyledWidgetContentContainer>
+ <WidgetRelationsHeader />
<StyledWidgetScrollContainer>
<EmailLoader loadingText={t`Loading thread`} />
</StyledWidgetScrollContainer>
@@ -102,6 +104,7 @@ export const EmailThreadWidget = ({
return (
<StyledWidgetContentContainer>
+ <WidgetRelationsHeader />
<StyledWidgetScrollContainer>
{firstMessages.map((message) => (
<EmailThreadMessage
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetDisplay.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetDisplay.tsx
index db2067932fb..6cf0c1e46b0 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetDisplay.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetDisplay.tsx
@@ -103,6 +103,8 @@ export const FieldWidgetDisplay = ({
fieldMetadataItem: {
id: fieldMetadataItem.id,
isUIEditable: fieldMetadataItem.isUIEditable ?? true,
+ type: fieldMetadataItem.type,
+ settings: fieldMetadataItem.settings,
},
fieldDefinition,
objectPermissionsByObjectMetadataId,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetInputContextProvider.tsx b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetInputContextProvider.tsx
index 45ee713a8ab..4e88cf49320 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetInputContextProvider.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/components/FieldWidgetInputContextProvider.tsx
@@ -1,15 +1,5 @@
-import {
- FieldInputEventContext,
- type FieldInputClickOutsideEvent,
- type FieldInputEvent,
-} from '@/object-record/record-field/ui/contexts/FieldInputEventContext';
-import { usePersistFieldFromFieldInputContext } from '@/object-record/record-field/ui/hooks/usePersistFieldFromFieldInputContext';
-import { RecordFieldComponentInstanceContext } from '@/object-record/record-field/ui/states/contexts/RecordFieldComponentInstanceContext';
+import { FieldInputEventContextProvider } from '@/object-record/record-field/ui/components/FieldInputEventContextProvider';
import { useInlineCell } from '@/object-record/record-inline-cell/hooks/useInlineCell';
-import { currentFocusIdSelector } from '@/ui/utilities/focus/states/currentFocusIdSelector';
-import { useAvailableComponentInstanceId } from '@/ui/utilities/state/component-state/hooks/useAvailableComponentInstanceId';
-import { useStore } from 'jotai';
-import { useCallback } from 'react';
type FieldWidgetInputContextProviderProps = {
children: React.ReactNode;
@@ -18,98 +8,11 @@ type FieldWidgetInputContextProviderProps = {
export const FieldWidgetInputContextProvider = ({
children,
}: FieldWidgetInputContextProviderProps) => {
- const store = useStore();
const { closeInlineCell } = useInlineCell();
- const instanceId = useAvailableComponentInstanceId(
- RecordFieldComponentInstanceContext,
- );
-
- const { persistFieldFromFieldInputContext } =
- usePersistFieldFromFieldInputContext();
-
- const handleEnter: FieldInputEvent = ({ newValue, skipPersist }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCell();
- };
-
- const handleSubmit: FieldInputEvent = ({
- newValue,
- skipPersist,
- skipClose,
- }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- if (skipClose !== true) {
- closeInlineCell();
- }
- };
-
- const handleCancel = () => {
- closeInlineCell();
- };
-
- const handleClickOutside: FieldInputClickOutsideEvent = useCallback(
- ({ newValue, event, skipPersist }) => {
- const currentFocusId = store.get(currentFocusIdSelector.atom);
-
- if (currentFocusId !== instanceId) {
- return;
- }
- event?.preventDefault();
- event?.stopImmediatePropagation();
-
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCell();
- },
- [closeInlineCell, instanceId, persistFieldFromFieldInputContext, store],
- );
-
- const handleEscape: FieldInputEvent = ({ newValue, skipPersist }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCell();
- };
-
- const handleTab: FieldInputEvent = ({ newValue, skipPersist }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCell();
- };
-
- const handleShiftTab: FieldInputEvent = ({ newValue, skipPersist }) => {
- if (skipPersist !== true) {
- persistFieldFromFieldInputContext(newValue);
- }
-
- closeInlineCell();
- };
-
return (
- <FieldInputEventContext.Provider
- value={{
- onCancel: handleCancel,
- onEnter: handleEnter,
- onEscape: handleEscape,
- onClickOutside: handleClickOutside,
- onShiftTab: handleShiftTab,
- onSubmit: handleSubmit,
- onTab: handleTab,
- }}
- >
+ <FieldInputEventContextProvider onClose={closeInlineCell}>
{children}
- </FieldInputEventContext.Provider>
+ </FieldInputEventContextProvider>
);
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/field/hooks/useFieldWidgetActionVisibility.ts b/packages/twenty-front/src/modules/page-layout/widgets/field/hooks/useFieldWidgetActionVisibility.ts
index e3cff0e9111..650e837ea03 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/field/hooks/useFieldWidgetActionVisibility.ts
+++ b/packages/twenty-front/src/modules/page-layout/widgets/field/hooks/useFieldWidgetActionVisibility.ts
@@ -87,6 +87,8 @@ export const useFieldWidgetActionVisibility = ({
fieldMetadataItem: {
id: fieldMetadataItem.id,
isUIEditable: fieldMetadataItem.isUIEditable ?? true,
+ type: fieldMetadataItem.type,
+ settings: fieldMetadataItem.settings,
},
fieldDefinition,
objectPermissionsByObjectMetadataId,
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidgetFieldItem.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidgetFieldItem.tsx
index a5a2ce2ac63..5d7c394cac9 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidgetFieldItem.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidgetFieldItem.tsx
@@ -77,6 +77,8 @@ export const FieldsWidgetFieldItem = ({
fieldMetadataItem: {
id: fieldMetadataItem.id,
isUIEditable: fieldMetadataItem.isUIEditable ?? true,
+ type: fieldMetadataItem.type,
+ settings: fieldMetadataItem.settings,
},
fieldDefinition,
objectPermissionsByObjectMetadataId,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-15/2-15-workspace-command-1800000002000-sync-calendar-event-record-page.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-15/2-15-workspace-command-1800000002000-sync-calendar-event-record-page.command.ts
index a23a47371a0..51d2909ddc2 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-15/2-15-workspace-command-1800000002000-sync-calendar-event-record-page.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-15/2-15-workspace-command-1800000002000-sync-calendar-event-record-page.command.ts
@@ -43,10 +43,30 @@ const CALENDAR_EVENT_RECORD_PAGE_VIEW_FIELD_GROUP_UNIVERSAL_IDENTIFIERS =
.viewFieldGroups,
);
+// Pinned to the fields this command shipped with. It runs before the
+// calendarEventTargets junction exists, so reading the live view would make it
+// create a view field for a field the workspace does not have yet.
+const CALENDAR_EVENT_RECORD_PAGE_VIEW_FIELD_NAMES = [
+ 'title',
+ 'startsAt',
+ 'endsAt',
+ 'isFullDay',
+ 'isCanceled',
+ 'conferenceLink',
+ 'location',
+ 'description',
+ 'externalCreatedAt',
+ 'externalUpdatedAt',
+ 'iCalUid',
+ 'conferenceSolution',
+] as const satisfies readonly (keyof typeof STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields.viewFields)[];
+
const CALENDAR_EVENT_RECORD_PAGE_VIEW_FIELD_UNIVERSAL_IDENTIFIERS =
- getUniversalIdentifiers(
- STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields
- .viewFields,
+ CALENDAR_EVENT_RECORD_PAGE_VIEW_FIELD_NAMES.map((viewFieldName) =>
+ toPre231RecordPageUniversalIdentifier(
+ STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields
+ .viewFields[viewFieldName].universalIdentifier,
+ ),
);
const CALENDAR_EVENT_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = [
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/2-38-upgrade-version-command.module.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/2-38-upgrade-version-command.module.ts
index e4841bfa654..4030e4ba14b 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/2-38-upgrade-version-command.module.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/2-38-upgrade-version-command.module.ts
@@ -4,6 +4,7 @@ import { TypeOrmModule } from '@nestjs/typeorm';
import { WorkspaceIteratorModule } from 'src/database/commands/command-runners/workspace-iterator.module';
import { NormalizeCompanyDomainNamesCommand } from 'src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787935130000-normalize-company-domain-names.command';
import { AddBlocklistScopeFieldCommand } from 'src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787933689056-add-blocklist-scope-field.command';
+import { AddCalendarEventRelationsViewFieldCommand } from 'src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787982276903-add-calendar-event-relations-view-field.command';
import { EnableEditLayoutAcrossAppCommand } from 'src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787906715270-enable-edit-layout-across-app.command';
import { BackfillLinkedTimelineActivityHappensAtCommand } from 'src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787914663665-backfill-linked-timeline-activity-happens-at.command';
import { ConfigureTimelineActivityHappensAtCommand } from 'src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787918663365-configure-timeline-activity-happens-at.command';
@@ -31,6 +32,7 @@ import { WorkspaceMigrationModule } from 'src/engine/workspace-manager/workspace
providers: [
NormalizeCompanyDomainNamesCommand,
AddBlocklistScopeFieldCommand,
+ AddCalendarEventRelationsViewFieldCommand,
EnableEditLayoutAcrossAppCommand,
BackfillLinkedTimelineActivityHappensAtCommand,
ConfigureTimelineActivityHappensAtCommand,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787982276903-add-calendar-event-relations-view-field.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787982276903-add-calendar-event-relations-view-field.command.ts
new file mode 100644
index 00000000000..37d0ee20b97
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787982276903-add-calendar-event-relations-view-field.command.ts
@@ -0,0 +1,148 @@
+import { Command } from 'nest-commander';
+
+import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
+import { isDefined } from 'twenty-shared/utils';
+
+import { ProvisionedWorkspaceCommandRunner } from 'src/database/commands/command-runners/provisioned-workspace.command-runner';
+import { WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';
+import { type RunOnWorkspaceArgs } from 'src/database/commands/command-runners/workspace.command-runner';
+import { getStandardFlatEntitiesToCreateOrThrow } from 'src/database/commands/upgrade-version-command/2-10/utils/get-standard-flat-entities-to-create-or-throw.util';
+import { ApplicationService } from 'src/engine/core-modules/application/application.service';
+import { RegisteredWorkspaceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-workspace-command.decorator';
+import { type FlatViewField } from 'src/engine/metadata-modules/flat-view-field/types/flat-view-field.type';
+import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { WorkspaceMigrationBuilderException } from 'src/engine/workspace-manager/workspace-migration/exceptions/workspace-migration-builder-exception';
+import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
+import { WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';
+
+const CALENDAR_EVENT_RECORD_PAGE_FIELDS_VIEW_UNIVERSAL_IDENTIFIER =
+ STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields
+ .universalIdentifier;
+
+const CALENDAR_EVENT_RELATIONS_VIEW_FIELD_UNIVERSAL_IDENTIFIER =
+ STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields.viewFields
+ .calendarEventTargets.universalIdentifier;
+
+const CALENDAR_EVENT_TARGETS_FIELD_UNIVERSAL_IDENTIFIER =
+ STANDARD_OBJECTS.calendarEvent.fields.calendarEventTargets
+ .universalIdentifier;
+
+@RegisteredWorkspaceCommand('2.38.0', 1787982276903)
+@Command({
+ name: 'upgrade:2-38:add-calendar-event-relations-view-field',
+ description:
+ 'Add the Relations field to the CalendarEvent record page fields view in existing workspaces',
+})
+export class AddCalendarEventRelationsViewFieldCommand extends ProvisionedWorkspaceCommandRunner {
+ constructor(
+ protected readonly workspaceIteratorService: WorkspaceIteratorService,
+ private readonly applicationService: ApplicationService,
+ private readonly workspaceCacheService: WorkspaceCacheService,
+ private readonly workspaceMigrationValidateBuildAndRunService: WorkspaceMigrationValidateBuildAndRunService,
+ ) {
+ super(workspaceIteratorService);
+ }
+
+ override async runOnWorkspace({
+ workspaceId,
+ options,
+ }: RunOnWorkspaceArgs): Promise<void> {
+ const isDryRun = options.dryRun ?? false;
+
+ const { twentyStandardFlatApplication } =
+ await this.applicationService.findWorkspaceTwentyStandardAndCustomApplicationOrThrow(
+ { workspaceId },
+ );
+
+ const { flatFieldMetadataMaps, flatViewMaps, flatViewFieldMaps } =
+ await this.workspaceCacheService.getOrRecompute(workspaceId, [
+ 'flatFieldMetadataMaps',
+ 'flatViewMaps',
+ 'flatViewFieldMaps',
+ ]);
+
+ const existingView =
+ flatViewMaps.byUniversalIdentifier[
+ CALENDAR_EVENT_RECORD_PAGE_FIELDS_VIEW_UNIVERSAL_IDENTIFIER
+ ];
+
+ if (!isDefined(existingView)) {
+ this.logger.log(
+ `CalendarEvent record page fields view does not exist for workspace ${workspaceId}, skipping`,
+ );
+
+ return;
+ }
+
+ const hasCalendarEventTargetsField = isDefined(
+ flatFieldMetadataMaps.byUniversalIdentifier[
+ CALENDAR_EVENT_TARGETS_FIELD_UNIVERSAL_IDENTIFIER
+ ],
+ );
+
+ if (!hasCalendarEventTargetsField) {
+ this.logger.log(
+ `calendarEvent.calendarEventTargets does not exist for workspace ${workspaceId}, skipping`,
+ );
+
+ return;
+ }
+
+ const { allFlatEntityMaps: standardAllFlatEntityMaps } =
+ computeTwentyStandardApplicationAllFlatEntityMaps({
+ now: new Date().toISOString(),
+ workspaceId,
+ twentyStandardApplicationId: twentyStandardFlatApplication.id,
+ });
+
+ const viewFieldsToCreate =
+ getStandardFlatEntitiesToCreateOrThrow<FlatViewField>({
+ standardFlatEntityMaps: standardAllFlatEntityMaps.flatViewFieldMaps,
+ existingFlatEntityMaps: flatViewFieldMaps,
+ universalIdentifiers: [
+ CALENDAR_EVENT_RELATIONS_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
+ ],
+ });
+
+ if (viewFieldsToCreate.length === 0) {
+ this.logger.log(
+ `CalendarEvent record page already shows Relations for workspace ${workspaceId}, skipping`,
+ );
+
+ return;
+ }
+
+ this.logger.log(
+ `${isDryRun ? '[DRY RUN] ' : ''}Adding the CalendarEvent Relations view field for workspace ${workspaceId}`,
+ );
+
+ if (isDryRun) {
+ return;
+ }
+
+ const validateAndBuildResult =
+ await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(
+ {
+ isSystemBuild: true,
+ applicationUniversalIdentifier:
+ twentyStandardFlatApplication.universalIdentifier,
+ workspaceId,
+ allFlatEntityOperationByMetadataName: {
+ viewField: {
+ flatEntityToCreate: viewFieldsToCreate,
+ flatEntityToDelete: [],
+ flatEntityToUpdate: [],
+ },
+ },
+ },
+ );
+
+ if (validateAndBuildResult.status === 'fail') {
+ throw new WorkspaceMigrationBuilderException(validateAndBuildResult);
+ }
+
+ this.logger.log(
+ `Added the CalendarEvent Relations view field for workspace ${workspaceId}`,
+ );
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/__tests__/2-38-workspace-command-1787982276903-add-calendar-event-relations-view-field.command.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/__tests__/2-38-workspace-command-1787982276903-add-calendar-event-relations-view-field.command.spec.ts
new file mode 100644
index 00000000000..981531481c6
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-38/__tests__/2-38-workspace-command-1787982276903-add-calendar-event-relations-view-field.command.spec.ts
@@ -0,0 +1,193 @@
+import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
+
+import { type WorkspaceIteratorService } from 'src/database/commands/command-runners/workspace-iterator.service';
+import { AddCalendarEventRelationsViewFieldCommand } from 'src/database/commands/upgrade-version-command/2-38/2-38-workspace-command-1787982276903-add-calendar-event-relations-view-field.command';
+import { type ApplicationService } from 'src/engine/core-modules/application/application.service';
+import { type WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { WorkspaceMigrationBuilderException } from 'src/engine/workspace-manager/workspace-migration/exceptions/workspace-migration-builder-exception';
+import { computeTwentyStandardApplicationAllFlatEntityMaps } from 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant';
+import { type WorkspaceMigrationValidateBuildAndRunService } from 'src/engine/workspace-manager/workspace-migration/services/workspace-migration-validate-build-and-run-service';
+
+jest.mock(
+ 'src/engine/workspace-manager/twenty-standard-application/utils/twenty-standard-application-all-flat-entity-maps.constant',
+);
+
+const computeTwentyStandardApplicationAllFlatEntityMapsMock =
+ computeTwentyStandardApplicationAllFlatEntityMaps as jest.Mock;
+
+const WORKSPACE_ID = '20202020-0000-0000-0000-000000000001';
+const VIEW_ID = '20202020-0000-0000-0000-000000000002';
+const STANDARD_APPLICATION = {
+ id: '20202020-0000-0000-0000-0000000000aa',
+ universalIdentifier: '20202020-0000-0000-0000-0000000000bb',
+};
+
+const CALENDAR_EVENT_RECORD_PAGE_FIELDS_VIEW_UNIVERSAL_IDENTIFIER =
+ STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields
+ .universalIdentifier;
+const RELATIONS_VIEW_FIELD_UNIVERSAL_IDENTIFIER =
+ STANDARD_OBJECTS.calendarEvent.views.calendarEventRecordPageFields.viewFields
+ .calendarEventTargets.universalIdentifier;
+const CALENDAR_EVENT_TARGETS_FIELD_UNIVERSAL_IDENTIFIER =
+ STANDARD_OBJECTS.calendarEvent.fields.calendarEventTargets
+ .universalIdentifier;
+
+const buildByUniversalIdentifierMap = <
+ T extends { universalIdentifier: string },
+>(
+ flatEntities: T[],
+) => ({
+ byUniversalIdentifier: Object.fromEntries(
+ flatEntities.map((flatEntity) => [
+ flatEntity.universalIdentifier,
+ flatEntity,
+ ]),
+ ),
+});
+
+describe('AddCalendarEventRelationsViewFieldCommand', () => {
+ let command: AddCalendarEventRelationsViewFieldCommand;
+ let getOrRecomputeMock: jest.Mock;
+ let validateBuildAndRunWorkspaceMigrationMock: jest.Mock;
+
+ beforeEach(() => {
+ jest.clearAllMocks();
+
+ getOrRecomputeMock = jest.fn();
+ validateBuildAndRunWorkspaceMigrationMock = jest
+ .fn()
+ .mockResolvedValue({ status: 'success' });
+
+ computeTwentyStandardApplicationAllFlatEntityMapsMock.mockReturnValue({
+ allFlatEntityMaps: {
+ flatViewFieldMaps: buildByUniversalIdentifierMap([
+ { universalIdentifier: RELATIONS_VIEW_FIELD_UNIVERSAL_IDENTIFIER },
+ ]),
+ },
+ });
+
+ command = new AddCalendarEventRelationsViewFieldCommand(
+ {} as WorkspaceIteratorService,
+ {
+ findWorkspaceTwentyStandardAndCustomApplicationOrThrow: jest
+ .fn()
+ .mockResolvedValue({
+ twentyStandardFlatApplication: STANDARD_APPLICATION,
+ }),
+ } as unknown as ApplicationService,
+ {
+ getOrRecompute: getOrRecomputeMock,
+ } as unknown as WorkspaceCacheService,
+ {
+ validateBuildAndRunLegacyWorkspaceMigration:
+ validateBuildAndRunWorkspaceMigrationMock,
+ } as unknown as WorkspaceMigrationValidateBuildAndRunService,
+ );
+ });
+
+ const runOnWorkspace = (dryRun = false) =>
+ command.runOnWorkspace({
+ workspaceId: WORKSPACE_ID,
+ options: { dryRun },
+ index: 0,
+ total: 1,
+ });
+
+ const mockWorkspaceCache = ({
+ viewExists = true,
+ targetsFieldExists = true,
+ viewFields = [],
+ }: {
+ viewExists?: boolean;
+ targetsFieldExists?: boolean;
+ viewFields?: { universalIdentifier: string }[];
+ }) => {
+ getOrRecomputeMock.mockResolvedValue({
+ flatFieldMetadataMaps: buildByUniversalIdentifierMap(
+ targetsFieldExists
+ ? [
+ {
+ universalIdentifier:
+ CALENDAR_EVENT_TARGETS_FIELD_UNIVERSAL_IDENTIFIER,
+ },
+ ]
+ : [],
+ ),
+ flatViewMaps: buildByUniversalIdentifierMap(
+ viewExists
+ ? [
+ {
+ id: VIEW_ID,
+ universalIdentifier:
+ CALENDAR_EVENT_RECORD_PAGE_FIELDS_VIEW_UNIVERSAL_IDENTIFIER,
+ },
+ ]
+ : [],
+ ),
+ flatViewFieldMaps: buildByUniversalIdentifierMap(viewFields),
+ });
+ };
+
+ it('creates the Relations view field', async () => {
+ mockWorkspaceCache({});
+
+ await runOnWorkspace();
+
+ const [payload] = validateBuildAndRunWorkspaceMigrationMock.mock.calls[0];
+
+ expect(
+ payload.allFlatEntityOperationByMetadataName.viewField.flatEntityToCreate,
+ ).toEqual([
+ expect.objectContaining({
+ universalIdentifier: RELATIONS_VIEW_FIELD_UNIVERSAL_IDENTIFIER,
+ }),
+ ]);
+ });
+
+ it('is idempotent when the Relations view field already exists', async () => {
+ mockWorkspaceCache({
+ viewFields: [
+ { universalIdentifier: RELATIONS_VIEW_FIELD_UNIVERSAL_IDENTIFIER },
+ ],
+ });
+
+ await runOnWorkspace();
+
+ expect(validateBuildAndRunWorkspaceMigrationMock).not.toHaveBeenCalled();
+ });
+
+ it('skips workspaces without a Calendar Event record page fields view', async () => {
+ mockWorkspaceCache({ viewExists: false });
+
+ await runOnWorkspace();
+
+ expect(validateBuildAndRunWorkspaceMigrationMock).not.toHaveBeenCalled();
+ });
+
+ it('skips workspaces where calendarEventTargets does not exist yet', async () => {
+ mockWorkspaceCache({ targetsFieldExists: false });
+
+ await runOnWorkspace();
+
+ expect(validateBuildAndRunWorkspaceMigrationMock).not.toHaveBeenCalled();
+ });
+
+ it('throws a workspace migration builder exception when the migration fails', async () => {
+ mockWorkspaceCache({});
+ validateBuildAndRunWorkspaceMigrationMock.mockResolvedValue({
+ status: 'fail',
+ });
+
+ await expect(runOnWorkspace()).rejects.toBeInstanceOf(
+ WorkspaceMigrationBuilderException,
+ );
+ });
+
+ it('does not write metadata in dry-run mode', async () => {
+ mockWorkspaceCache({});
+
+ await runOnWorkspace(true);
+
+ expect(validateBuildAndRunWorkspaceMigrationMock).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap
index b5c40a4952a..bb705cec31e 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap
@@ -351,7 +351,7 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"id": "00000000-0000-0000-0000-000000000123",
},
},
- "id": "00000000-0000-0000-0000-000000000166",
+ "id": "00000000-0000-0000-0000-000000000167",
"views": {
"allCalendarEvents": {
"id": "00000000-0000-0000-0000-000000000150",
@@ -385,21 +385,24 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"viewGroups": {},
},
"calendarEventRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000165",
+ "id": "00000000-0000-0000-0000-000000000166",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000163",
+ "id": "00000000-0000-0000-0000-000000000164",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000164",
+ "id": "00000000-0000-0000-0000-000000000165",
},
},
"viewFields": {
+ "calendarEventTargets": {
+ "id": "00000000-0000-0000-0000-000000000159",
+ },
"conferenceLink": {
"id": "00000000-0000-0000-0000-000000000156",
},
"conferenceSolution": {
- "id": "00000000-0000-0000-0000-000000000162",
+ "id": "00000000-0000-0000-0000-000000000163",
},
"description": {
"id": "00000000-0000-0000-0000-000000000158",
@@ -408,13 +411,13 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"id": "00000000-0000-0000-0000-000000000153",
},
"externalCreatedAt": {
- "id": "00000000-0000-0000-0000-000000000159",
+ "id": "00000000-0000-0000-0000-000000000160",
},
"externalUpdatedAt": {
- "id": "00000000-0000-0000-0000-000000000160",
+ "id": "00000000-0000-0000-0000-000000000161",
},
"iCalUid": {
- "id": "00000000-0000-0000-0000-000000000161",
+ "id": "00000000-0000-0000-0000-000000000162",
},
"isCanceled": {
"id": "00000000-0000-0000-0000-000000000155",
@@ -563,172 +566,172 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"calendarEventTarget": {
"fields": {
"calendarEvent": {
- "id": "00000000-0000-0000-0000-000000000175",
+ "id": "00000000-0000-0000-0000-000000000176",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000168",
+ "id": "00000000-0000-0000-0000-000000000169",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000171",
+ "id": "00000000-0000-0000-0000-000000000172",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000170",
+ "id": "00000000-0000-0000-0000-000000000171",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000167",
+ "id": "00000000-0000-0000-0000-000000000168",
},
"isAutomaticallyAssigned": {
- "id": "00000000-0000-0000-0000-000000000176",
+ "id": "00000000-0000-0000-0000-000000000177",
},
"isManuallyAssigned": {
- "id": "00000000-0000-0000-0000-000000000177",
+ "id": "00000000-0000-0000-0000-000000000178",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000173",
+ "id": "00000000-0000-0000-0000-000000000174",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000174",
+ "id": "00000000-0000-0000-0000-000000000175",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000179",
+ "id": "00000000-0000-0000-0000-000000000180",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000180",
+ "id": "00000000-0000-0000-0000-000000000181",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000178",
+ "id": "00000000-0000-0000-0000-000000000179",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000169",
+ "id": "00000000-0000-0000-0000-000000000170",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000172",
+ "id": "00000000-0000-0000-0000-000000000173",
},
},
- "id": "00000000-0000-0000-0000-000000000181",
+ "id": "00000000-0000-0000-0000-000000000182",
"views": {},
},
"callRecording": {
"fields": {
"applicationId": {
- "id": "00000000-0000-0000-0000-000000000193",
+ "id": "00000000-0000-0000-0000-000000000194",
},
"audio": {
- "id": "00000000-0000-0000-0000-000000000199",
+ "id": "00000000-0000-0000-0000-000000000200",
},
"calendarEvent": {
- "id": "00000000-0000-0000-0000-000000000202",
+ "id": "00000000-0000-0000-0000-000000000203",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000183",
+ "id": "00000000-0000-0000-0000-000000000184",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000186",
+ "id": "00000000-0000-0000-0000-000000000187",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000185",
+ "id": "00000000-0000-0000-0000-000000000186",
},
"endedAt": {
- "id": "00000000-0000-0000-0000-000000000197",
+ "id": "00000000-0000-0000-0000-000000000198",
},
"externalBotId": {
- "id": "00000000-0000-0000-0000-000000000194",
+ "id": "00000000-0000-0000-0000-000000000195",
},
"externalRecordingId": {
- "id": "00000000-0000-0000-0000-000000000195",
+ "id": "00000000-0000-0000-0000-000000000196",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000182",
+ "id": "00000000-0000-0000-0000-000000000183",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000188",
+ "id": "00000000-0000-0000-0000-000000000189",
},
"recordingRequestStatus": {
- "id": "00000000-0000-0000-0000-000000000192",
+ "id": "00000000-0000-0000-0000-000000000193",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000189",
+ "id": "00000000-0000-0000-0000-000000000190",
},
"startedAt": {
- "id": "00000000-0000-0000-0000-000000000196",
+ "id": "00000000-0000-0000-0000-000000000197",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000191",
+ "id": "00000000-0000-0000-0000-000000000192",
},
"summary": {
- "id": "00000000-0000-0000-0000-000000000201",
+ "id": "00000000-0000-0000-0000-000000000202",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000190",
+ "id": "00000000-0000-0000-0000-000000000191",
},
"transcript": {
- "id": "00000000-0000-0000-0000-000000000200",
+ "id": "00000000-0000-0000-0000-000000000201",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000184",
+ "id": "00000000-0000-0000-0000-000000000185",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000187",
+ "id": "00000000-0000-0000-0000-000000000188",
},
"video": {
- "id": "00000000-0000-0000-0000-000000000198",
+ "id": "00000000-0000-0000-0000-000000000199",
},
},
- "id": "00000000-0000-0000-0000-000000000219",
+ "id": "00000000-0000-0000-0000-000000000220",
"views": {
"allCallRecordings": {
- "id": "00000000-0000-0000-0000-000000000207",
+ "id": "00000000-0000-0000-0000-000000000208",
"viewFieldGroups": {},
"viewFields": {
"recordingRequestStatus": {
- "id": "00000000-0000-0000-0000-000000000204",
+ "id": "00000000-0000-0000-0000-000000000205",
},
"startedAt": {
- "id": "00000000-0000-0000-0000-000000000206",
+ "id": "00000000-0000-0000-0000-000000000207",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000203",
+ "id": "00000000-0000-0000-0000-000000000204",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000205",
+ "id": "00000000-0000-0000-0000-000000000206",
},
},
"viewGroups": {},
},
"callRecordingRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000218",
+ "id": "00000000-0000-0000-0000-000000000219",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000217",
+ "id": "00000000-0000-0000-0000-000000000218",
},
},
"viewFields": {
"audio": {
- "id": "00000000-0000-0000-0000-000000000214",
+ "id": "00000000-0000-0000-0000-000000000215",
},
"endedAt": {
- "id": "00000000-0000-0000-0000-000000000212",
+ "id": "00000000-0000-0000-0000-000000000213",
},
"recordingRequestStatus": {
- "id": "00000000-0000-0000-0000-000000000210",
+ "id": "00000000-0000-0000-0000-000000000211",
},
"startedAt": {
- "id": "00000000-0000-0000-0000-000000000211",
+ "id": "00000000-0000-0000-0000-000000000212",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000209",
+ "id": "00000000-0000-0000-0000-000000000210",
},
"summary": {
- "id": "00000000-0000-0000-0000-000000000216",
+ "id": "00000000-0000-0000-0000-000000000217",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000208",
+ "id": "00000000-0000-0000-0000-000000000209",
},
"transcript": {
- "id": "00000000-0000-0000-0000-000000000215",
+ "id": "00000000-0000-0000-0000-000000000216",
},
"video": {
- "id": "00000000-0000-0000-0000-000000000213",
+ "id": "00000000-0000-0000-0000-000000000214",
},
},
"viewGroups": {},
@@ -738,163 +741,163 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"company": {
"fields": {
"accountOwner": {
- "id": "00000000-0000-0000-0000-000000000234",
+ "id": "00000000-0000-0000-0000-000000000235",
},
"address": {
- "id": "00000000-0000-0000-0000-000000000230",
+ "id": "00000000-0000-0000-0000-000000000231",
},
"annualRevenue": {
- "id": "00000000-0000-0000-0000-000000000232",
+ "id": "00000000-0000-0000-0000-000000000233",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000240",
+ "id": "00000000-0000-0000-0000-000000000241",
},
"calendarEventTargets": {
- "id": "00000000-0000-0000-0000-000000000237",
+ "id": "00000000-0000-0000-0000-000000000238",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000221",
+ "id": "00000000-0000-0000-0000-000000000222",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000224",
+ "id": "00000000-0000-0000-0000-000000000225",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000223",
+ "id": "00000000-0000-0000-0000-000000000224",
},
"domainName": {
- "id": "00000000-0000-0000-0000-000000000229",
+ "id": "00000000-0000-0000-0000-000000000230",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000220",
+ "id": "00000000-0000-0000-0000-000000000221",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000231",
+ "id": "00000000-0000-0000-0000-000000000232",
},
"messageThreadTargets": {
- "id": "00000000-0000-0000-0000-000000000238",
+ "id": "00000000-0000-0000-0000-000000000239",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000228",
+ "id": "00000000-0000-0000-0000-000000000229",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000236",
+ "id": "00000000-0000-0000-0000-000000000237",
},
"opportunities": {
- "id": "00000000-0000-0000-0000-000000000239",
+ "id": "00000000-0000-0000-0000-000000000240",
},
"people": {
- "id": "00000000-0000-0000-0000-000000000233",
+ "id": "00000000-0000-0000-0000-000000000234",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000226",
+ "id": "00000000-0000-0000-0000-000000000227",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000227",
+ "id": "00000000-0000-0000-0000-000000000228",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000235",
+ "id": "00000000-0000-0000-0000-000000000236",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000241",
+ "id": "00000000-0000-0000-0000-000000000242",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000222",
+ "id": "00000000-0000-0000-0000-000000000223",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000225",
+ "id": "00000000-0000-0000-0000-000000000226",
},
},
- "id": "00000000-0000-0000-0000-000000000270",
+ "id": "00000000-0000-0000-0000-000000000271",
"views": {
"allCompanies": {
- "id": "00000000-0000-0000-0000-000000000249",
+ "id": "00000000-0000-0000-0000-000000000250",
"viewFieldGroups": {},
"viewFields": {
"accountOwner": {
- "id": "00000000-0000-0000-0000-000000000245",
+ "id": "00000000-0000-0000-0000-000000000246",
},
"address": {
- "id": "00000000-0000-0000-0000-000000000248",
+ "id": "00000000-0000-0000-0000-000000000249",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000246",
+ "id": "00000000-0000-0000-0000-000000000247",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000244",
+ "id": "00000000-0000-0000-0000-000000000245",
},
"domainName": {
- "id": "00000000-0000-0000-0000-000000000243",
+ "id": "00000000-0000-0000-0000-000000000244",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000247",
+ "id": "00000000-0000-0000-0000-000000000248",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000242",
+ "id": "00000000-0000-0000-0000-000000000243",
},
},
"viewGroups": {},
},
"companyRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000269",
+ "id": "00000000-0000-0000-0000-000000000270",
"viewFieldGroups": {
"business": {
- "id": "00000000-0000-0000-0000-000000000266",
+ "id": "00000000-0000-0000-0000-000000000267",
},
"contact": {
- "id": "00000000-0000-0000-0000-000000000267",
+ "id": "00000000-0000-0000-0000-000000000268",
},
"general": {
- "id": "00000000-0000-0000-0000-000000000265",
+ "id": "00000000-0000-0000-0000-000000000266",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000268",
+ "id": "00000000-0000-0000-0000-000000000269",
},
},
"viewFields": {
"accountOwner": {
- "id": "00000000-0000-0000-0000-000000000251",
+ "id": "00000000-0000-0000-0000-000000000252",
},
"address": {
- "id": "00000000-0000-0000-0000-000000000254",
+ "id": "00000000-0000-0000-0000-000000000255",
},
"annualRevenue": {
- "id": "00000000-0000-0000-0000-000000000252",
+ "id": "00000000-0000-0000-0000-000000000253",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000263",
+ "id": "00000000-0000-0000-0000-000000000264",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000255",
+ "id": "00000000-0000-0000-0000-000000000256",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000256",
+ "id": "00000000-0000-0000-0000-000000000257",
},
"domainName": {
- "id": "00000000-0000-0000-0000-000000000250",
+ "id": "00000000-0000-0000-0000-000000000251",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000253",
+ "id": "00000000-0000-0000-0000-000000000254",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000261",
+ "id": "00000000-0000-0000-0000-000000000262",
},
"opportunities": {
- "id": "00000000-0000-0000-0000-000000000262",
+ "id": "00000000-0000-0000-0000-000000000263",
},
"people": {
- "id": "00000000-0000-0000-0000-000000000259",
+ "id": "00000000-0000-0000-0000-000000000260",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000260",
+ "id": "00000000-0000-0000-0000-000000000261",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000264",
+ "id": "00000000-0000-0000-0000-000000000265",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000257",
+ "id": "00000000-0000-0000-0000-000000000258",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000258",
+ "id": "00000000-0000-0000-0000-000000000259",
},
},
"viewGroups": {},
@@ -904,59 +907,59 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"dashboard": {
"fields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000282",
+ "id": "00000000-0000-0000-0000-000000000283",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000272",
+ "id": "00000000-0000-0000-0000-000000000273",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000275",
+ "id": "00000000-0000-0000-0000-000000000276",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000274",
+ "id": "00000000-0000-0000-0000-000000000275",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000271",
+ "id": "00000000-0000-0000-0000-000000000272",
},
"pageLayoutId": {
- "id": "00000000-0000-0000-0000-000000000280",
+ "id": "00000000-0000-0000-0000-000000000281",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000277",
+ "id": "00000000-0000-0000-0000-000000000278",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000278",
+ "id": "00000000-0000-0000-0000-000000000279",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000281",
+ "id": "00000000-0000-0000-0000-000000000282",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000279",
+ "id": "00000000-0000-0000-0000-000000000280",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000273",
+ "id": "00000000-0000-0000-0000-000000000274",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000276",
+ "id": "00000000-0000-0000-0000-000000000277",
},
},
- "id": "00000000-0000-0000-0000-000000000288",
+ "id": "00000000-0000-0000-0000-000000000289",
"views": {
"allDashboards": {
- "id": "00000000-0000-0000-0000-000000000287",
+ "id": "00000000-0000-0000-0000-000000000288",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000285",
+ "id": "00000000-0000-0000-0000-000000000286",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000284",
+ "id": "00000000-0000-0000-0000-000000000285",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000283",
+ "id": "00000000-0000-0000-0000-000000000284",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000286",
+ "id": "00000000-0000-0000-0000-000000000287",
},
},
"viewGroups": {},
@@ -966,86 +969,86 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"message": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000484",
+ "id": "00000000-0000-0000-0000-000000000485",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000487",
+ "id": "00000000-0000-0000-0000-000000000488",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000486",
+ "id": "00000000-0000-0000-0000-000000000487",
},
"deliveryStatus": {
- "id": "00000000-0000-0000-0000-000000000499",
+ "id": "00000000-0000-0000-0000-000000000500",
},
"headerMessageId": {
- "id": "00000000-0000-0000-0000-000000000491",
+ "id": "00000000-0000-0000-0000-000000000492",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000483",
+ "id": "00000000-0000-0000-0000-000000000484",
},
"isDraft": {
- "id": "00000000-0000-0000-0000-000000000500",
+ "id": "00000000-0000-0000-0000-000000000501",
},
"messageCampaign": {
- "id": "00000000-0000-0000-0000-000000000498",
+ "id": "00000000-0000-0000-0000-000000000499",
},
"messageChannelMessageAssociations": {
- "id": "00000000-0000-0000-0000-000000000497",
+ "id": "00000000-0000-0000-0000-000000000498",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000496",
+ "id": "00000000-0000-0000-0000-000000000497",
},
"messageThread": {
- "id": "00000000-0000-0000-0000-000000000492",
+ "id": "00000000-0000-0000-0000-000000000493",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000489",
+ "id": "00000000-0000-0000-0000-000000000490",
},
"receivedAt": {
- "id": "00000000-0000-0000-0000-000000000495",
+ "id": "00000000-0000-0000-0000-000000000496",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000490",
+ "id": "00000000-0000-0000-0000-000000000491",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000493",
+ "id": "00000000-0000-0000-0000-000000000494",
},
"text": {
- "id": "00000000-0000-0000-0000-000000000494",
+ "id": "00000000-0000-0000-0000-000000000495",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000485",
+ "id": "00000000-0000-0000-0000-000000000486",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000488",
+ "id": "00000000-0000-0000-0000-000000000489",
},
},
- "id": "00000000-0000-0000-0000-000000000509",
+ "id": "00000000-0000-0000-0000-000000000510",
"views": {
"allMessages": {
- "id": "00000000-0000-0000-0000-000000000508",
+ "id": "00000000-0000-0000-0000-000000000509",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000507",
+ "id": "00000000-0000-0000-0000-000000000508",
},
"headerMessageId": {
- "id": "00000000-0000-0000-0000-000000000505",
+ "id": "00000000-0000-0000-0000-000000000506",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000503",
+ "id": "00000000-0000-0000-0000-000000000504",
},
"messageThread": {
- "id": "00000000-0000-0000-0000-000000000502",
+ "id": "00000000-0000-0000-0000-000000000503",
},
"receivedAt": {
- "id": "00000000-0000-0000-0000-000000000504",
+ "id": "00000000-0000-0000-0000-000000000505",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000501",
+ "id": "00000000-0000-0000-0000-000000000502",
},
"text": {
- "id": "00000000-0000-0000-0000-000000000506",
+ "id": "00000000-0000-0000-0000-000000000507",
},
},
"viewGroups": {},
@@ -1055,145 +1058,145 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageCampaign": {
"fields": {
"bodyTemplate": {
- "id": "00000000-0000-0000-0000-000000000299",
+ "id": "00000000-0000-0000-0000-000000000300",
},
"bouncedCount": {
- "id": "00000000-0000-0000-0000-000000000305",
+ "id": "00000000-0000-0000-0000-000000000306",
},
"complainedCount": {
- "id": "00000000-0000-0000-0000-000000000306",
+ "id": "00000000-0000-0000-0000-000000000307",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000290",
+ "id": "00000000-0000-0000-0000-000000000291",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000293",
+ "id": "00000000-0000-0000-0000-000000000294",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000292",
+ "id": "00000000-0000-0000-0000-000000000293",
},
"failedCount": {
- "id": "00000000-0000-0000-0000-000000000304",
+ "id": "00000000-0000-0000-0000-000000000305",
},
"fromAddress": {
- "id": "00000000-0000-0000-0000-000000000300",
+ "id": "00000000-0000-0000-0000-000000000301",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000289",
+ "id": "00000000-0000-0000-0000-000000000290",
},
"list": {
- "id": "00000000-0000-0000-0000-000000000308",
+ "id": "00000000-0000-0000-0000-000000000309",
},
"messages": {
- "id": "00000000-0000-0000-0000-000000000310",
+ "id": "00000000-0000-0000-0000-000000000311",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000297",
+ "id": "00000000-0000-0000-0000-000000000298",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000295",
+ "id": "00000000-0000-0000-0000-000000000296",
},
"recipients": {
- "id": "00000000-0000-0000-0000-000000000311",
+ "id": "00000000-0000-0000-0000-000000000312",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000296",
+ "id": "00000000-0000-0000-0000-000000000297",
},
"sentAt": {
- "id": "00000000-0000-0000-0000-000000000302",
+ "id": "00000000-0000-0000-0000-000000000303",
},
"sentCount": {
- "id": "00000000-0000-0000-0000-000000000303",
+ "id": "00000000-0000-0000-0000-000000000304",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000301",
+ "id": "00000000-0000-0000-0000-000000000302",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000298",
+ "id": "00000000-0000-0000-0000-000000000299",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000309",
+ "id": "00000000-0000-0000-0000-000000000310",
},
"unsubscribeTopicId": {
- "id": "00000000-0000-0000-0000-000000000307",
+ "id": "00000000-0000-0000-0000-000000000308",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000291",
+ "id": "00000000-0000-0000-0000-000000000292",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000294",
+ "id": "00000000-0000-0000-0000-000000000295",
},
},
- "id": "00000000-0000-0000-0000-000000000333",
+ "id": "00000000-0000-0000-0000-000000000334",
"views": {
"allMessageCampaigns": {
- "id": "00000000-0000-0000-0000-000000000324",
+ "id": "00000000-0000-0000-0000-000000000325",
"viewFieldGroups": {},
"viewFields": {
"bouncedCount": {
- "id": "00000000-0000-0000-0000-000000000320",
+ "id": "00000000-0000-0000-0000-000000000321",
},
"complainedCount": {
- "id": "00000000-0000-0000-0000-000000000321",
+ "id": "00000000-0000-0000-0000-000000000322",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000323",
+ "id": "00000000-0000-0000-0000-000000000324",
},
"failedCount": {
- "id": "00000000-0000-0000-0000-000000000319",
+ "id": "00000000-0000-0000-0000-000000000320",
},
"fromAddress": {
- "id": "00000000-0000-0000-0000-000000000316",
+ "id": "00000000-0000-0000-0000-000000000317",
},
"list": {
- "id": "00000000-0000-0000-0000-000000000315",
+ "id": "00000000-0000-0000-0000-000000000316",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000312",
+ "id": "00000000-0000-0000-0000-000000000313",
},
"recipients": {
- "id": "00000000-0000-0000-0000-000000000322",
+ "id": "00000000-0000-0000-0000-000000000323",
},
"sentAt": {
- "id": "00000000-0000-0000-0000-000000000317",
+ "id": "00000000-0000-0000-0000-000000000318",
},
"sentCount": {
- "id": "00000000-0000-0000-0000-000000000318",
+ "id": "00000000-0000-0000-0000-000000000319",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000314",
+ "id": "00000000-0000-0000-0000-000000000315",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000313",
+ "id": "00000000-0000-0000-0000-000000000314",
},
},
"viewGroups": {},
},
"messageCampaignRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000332",
+ "id": "00000000-0000-0000-0000-000000000333",
"viewFieldGroups": {
"stats": {
- "id": "00000000-0000-0000-0000-000000000331",
+ "id": "00000000-0000-0000-0000-000000000332",
},
},
"viewFields": {
"bouncedCount": {
- "id": "00000000-0000-0000-0000-000000000329",
+ "id": "00000000-0000-0000-0000-000000000330",
},
"complainedCount": {
- "id": "00000000-0000-0000-0000-000000000330",
+ "id": "00000000-0000-0000-0000-000000000331",
},
"failedCount": {
- "id": "00000000-0000-0000-0000-000000000328",
+ "id": "00000000-0000-0000-0000-000000000329",
},
"sentAt": {
- "id": "00000000-0000-0000-0000-000000000326",
+ "id": "00000000-0000-0000-0000-000000000327",
},
"sentCount": {
- "id": "00000000-0000-0000-0000-000000000327",
+ "id": "00000000-0000-0000-0000-000000000328",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000325",
+ "id": "00000000-0000-0000-0000-000000000326",
},
},
"viewGroups": {},
@@ -1203,103 +1206,103 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageChannelMessageAssociation": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000364",
+ "id": "00000000-0000-0000-0000-000000000365",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000367",
+ "id": "00000000-0000-0000-0000-000000000368",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000366",
+ "id": "00000000-0000-0000-0000-000000000367",
},
"direction": {
- "id": "00000000-0000-0000-0000-000000000376",
+ "id": "00000000-0000-0000-0000-000000000377",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000363",
+ "id": "00000000-0000-0000-0000-000000000364",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000372",
+ "id": "00000000-0000-0000-0000-000000000373",
},
"messageChannelId": {
- "id": "00000000-0000-0000-0000-000000000371",
+ "id": "00000000-0000-0000-0000-000000000372",
},
"messageExternalId": {
- "id": "00000000-0000-0000-0000-000000000373",
+ "id": "00000000-0000-0000-0000-000000000374",
},
"messageFolders": {
- "id": "00000000-0000-0000-0000-000000000377",
+ "id": "00000000-0000-0000-0000-000000000378",
},
"messageThread": {
- "id": "00000000-0000-0000-0000-000000000374",
+ "id": "00000000-0000-0000-0000-000000000375",
},
"messageThreadExternalId": {
- "id": "00000000-0000-0000-0000-000000000375",
+ "id": "00000000-0000-0000-0000-000000000376",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000369",
+ "id": "00000000-0000-0000-0000-000000000370",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000370",
+ "id": "00000000-0000-0000-0000-000000000371",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000365",
+ "id": "00000000-0000-0000-0000-000000000366",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000368",
+ "id": "00000000-0000-0000-0000-000000000369",
},
},
- "id": "00000000-0000-0000-0000-000000000393",
+ "id": "00000000-0000-0000-0000-000000000394",
"views": {
"allMessageChannelMessageAssociations": {
- "id": "00000000-0000-0000-0000-000000000383",
+ "id": "00000000-0000-0000-0000-000000000384",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000382",
+ "id": "00000000-0000-0000-0000-000000000383",
},
"direction": {
- "id": "00000000-0000-0000-0000-000000000381",
+ "id": "00000000-0000-0000-0000-000000000382",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000379",
+ "id": "00000000-0000-0000-0000-000000000380",
},
"messageChannelId": {
- "id": "00000000-0000-0000-0000-000000000378",
+ "id": "00000000-0000-0000-0000-000000000379",
},
"messageExternalId": {
- "id": "00000000-0000-0000-0000-000000000380",
+ "id": "00000000-0000-0000-0000-000000000381",
},
},
"viewGroups": {},
},
"messageChannelMessageAssociationRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000392",
+ "id": "00000000-0000-0000-0000-000000000393",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000390",
+ "id": "00000000-0000-0000-0000-000000000391",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000391",
+ "id": "00000000-0000-0000-0000-000000000392",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000388",
+ "id": "00000000-0000-0000-0000-000000000389",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000389",
+ "id": "00000000-0000-0000-0000-000000000390",
},
"direction": {
- "id": "00000000-0000-0000-0000-000000000387",
+ "id": "00000000-0000-0000-0000-000000000388",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000385",
+ "id": "00000000-0000-0000-0000-000000000386",
},
"messageChannelId": {
- "id": "00000000-0000-0000-0000-000000000384",
+ "id": "00000000-0000-0000-0000-000000000385",
},
"messageExternalId": {
- "id": "00000000-0000-0000-0000-000000000386",
+ "id": "00000000-0000-0000-0000-000000000387",
},
},
"viewGroups": {},
@@ -1309,76 +1312,76 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageChannelMessageAssociationMessageFolder": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000395",
+ "id": "00000000-0000-0000-0000-000000000396",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000398",
+ "id": "00000000-0000-0000-0000-000000000399",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000397",
+ "id": "00000000-0000-0000-0000-000000000398",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000394",
+ "id": "00000000-0000-0000-0000-000000000395",
},
"messageChannelMessageAssociation": {
- "id": "00000000-0000-0000-0000-000000000402",
+ "id": "00000000-0000-0000-0000-000000000403",
},
"messageFolderId": {
- "id": "00000000-0000-0000-0000-000000000403",
+ "id": "00000000-0000-0000-0000-000000000404",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000400",
+ "id": "00000000-0000-0000-0000-000000000401",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000401",
+ "id": "00000000-0000-0000-0000-000000000402",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000396",
+ "id": "00000000-0000-0000-0000-000000000397",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000399",
+ "id": "00000000-0000-0000-0000-000000000400",
},
},
- "id": "00000000-0000-0000-0000-000000000415",
+ "id": "00000000-0000-0000-0000-000000000416",
"views": {
"allMessageChannelMessageAssociationMessageFolders": {
- "id": "00000000-0000-0000-0000-000000000407",
+ "id": "00000000-0000-0000-0000-000000000408",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000406",
+ "id": "00000000-0000-0000-0000-000000000407",
},
"messageChannelMessageAssociation": {
- "id": "00000000-0000-0000-0000-000000000404",
+ "id": "00000000-0000-0000-0000-000000000405",
},
"messageFolderId": {
- "id": "00000000-0000-0000-0000-000000000405",
+ "id": "00000000-0000-0000-0000-000000000406",
},
},
"viewGroups": {},
},
"messageChannelMessageAssociationMessageFolderRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000414",
+ "id": "00000000-0000-0000-0000-000000000415",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000412",
+ "id": "00000000-0000-0000-0000-000000000413",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000413",
+ "id": "00000000-0000-0000-0000-000000000414",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000410",
+ "id": "00000000-0000-0000-0000-000000000411",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000411",
+ "id": "00000000-0000-0000-0000-000000000412",
},
"messageChannelMessageAssociation": {
- "id": "00000000-0000-0000-0000-000000000408",
+ "id": "00000000-0000-0000-0000-000000000409",
},
"messageFolderId": {
- "id": "00000000-0000-0000-0000-000000000409",
+ "id": "00000000-0000-0000-0000-000000000410",
},
},
"viewGroups": {},
@@ -1388,59 +1391,59 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageList": {
"fields": {
"campaigns": {
- "id": "00000000-0000-0000-0000-000000000344",
+ "id": "00000000-0000-0000-0000-000000000345",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000335",
+ "id": "00000000-0000-0000-0000-000000000336",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000338",
+ "id": "00000000-0000-0000-0000-000000000339",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000337",
+ "id": "00000000-0000-0000-0000-000000000338",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000334",
+ "id": "00000000-0000-0000-0000-000000000335",
},
"members": {
- "id": "00000000-0000-0000-0000-000000000343",
+ "id": "00000000-0000-0000-0000-000000000344",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000342",
+ "id": "00000000-0000-0000-0000-000000000343",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000340",
+ "id": "00000000-0000-0000-0000-000000000341",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000341",
+ "id": "00000000-0000-0000-0000-000000000342",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000345",
+ "id": "00000000-0000-0000-0000-000000000346",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000336",
+ "id": "00000000-0000-0000-0000-000000000337",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000339",
+ "id": "00000000-0000-0000-0000-000000000340",
},
},
- "id": "00000000-0000-0000-0000-000000000351",
+ "id": "00000000-0000-0000-0000-000000000352",
"views": {
"allMessageLists": {
- "id": "00000000-0000-0000-0000-000000000350",
+ "id": "00000000-0000-0000-0000-000000000351",
"viewFieldGroups": {},
"viewFields": {
"campaigns": {
- "id": "00000000-0000-0000-0000-000000000348",
+ "id": "00000000-0000-0000-0000-000000000349",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000349",
+ "id": "00000000-0000-0000-0000-000000000350",
},
"members": {
- "id": "00000000-0000-0000-0000-000000000347",
+ "id": "00000000-0000-0000-0000-000000000348",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000346",
+ "id": "00000000-0000-0000-0000-000000000347",
},
},
"viewGroups": {},
@@ -1450,148 +1453,148 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageListMember": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000353",
+ "id": "00000000-0000-0000-0000-000000000354",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000356",
+ "id": "00000000-0000-0000-0000-000000000357",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000355",
+ "id": "00000000-0000-0000-0000-000000000356",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000352",
+ "id": "00000000-0000-0000-0000-000000000353",
},
"list": {
- "id": "00000000-0000-0000-0000-000000000361",
+ "id": "00000000-0000-0000-0000-000000000362",
},
"person": {
- "id": "00000000-0000-0000-0000-000000000360",
+ "id": "00000000-0000-0000-0000-000000000361",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000358",
+ "id": "00000000-0000-0000-0000-000000000359",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000359",
+ "id": "00000000-0000-0000-0000-000000000360",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000354",
+ "id": "00000000-0000-0000-0000-000000000355",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000357",
+ "id": "00000000-0000-0000-0000-000000000358",
},
},
- "id": "00000000-0000-0000-0000-000000000362",
+ "id": "00000000-0000-0000-0000-000000000363",
"views": undefined,
},
"messageParticipant": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000417",
+ "id": "00000000-0000-0000-0000-000000000418",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000420",
+ "id": "00000000-0000-0000-0000-000000000421",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000419",
+ "id": "00000000-0000-0000-0000-000000000420",
},
"displayName": {
- "id": "00000000-0000-0000-0000-000000000427",
+ "id": "00000000-0000-0000-0000-000000000428",
},
"handle": {
- "id": "00000000-0000-0000-0000-000000000426",
+ "id": "00000000-0000-0000-0000-000000000427",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000416",
+ "id": "00000000-0000-0000-0000-000000000417",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000424",
+ "id": "00000000-0000-0000-0000-000000000425",
},
"messageCampaign": {
- "id": "00000000-0000-0000-0000-000000000430",
+ "id": "00000000-0000-0000-0000-000000000431",
},
"person": {
- "id": "00000000-0000-0000-0000-000000000428",
+ "id": "00000000-0000-0000-0000-000000000429",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000422",
+ "id": "00000000-0000-0000-0000-000000000423",
},
"role": {
- "id": "00000000-0000-0000-0000-000000000425",
+ "id": "00000000-0000-0000-0000-000000000426",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000423",
+ "id": "00000000-0000-0000-0000-000000000424",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000418",
+ "id": "00000000-0000-0000-0000-000000000419",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000421",
+ "id": "00000000-0000-0000-0000-000000000422",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000429",
+ "id": "00000000-0000-0000-0000-000000000430",
},
},
- "id": "00000000-0000-0000-0000-000000000449",
+ "id": "00000000-0000-0000-0000-000000000450",
"views": {
"allMessageParticipants": {
- "id": "00000000-0000-0000-0000-000000000438",
+ "id": "00000000-0000-0000-0000-000000000439",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000437",
+ "id": "00000000-0000-0000-0000-000000000438",
},
"displayName": {
- "id": "00000000-0000-0000-0000-000000000434",
+ "id": "00000000-0000-0000-0000-000000000435",
},
"handle": {
- "id": "00000000-0000-0000-0000-000000000433",
+ "id": "00000000-0000-0000-0000-000000000434",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000431",
+ "id": "00000000-0000-0000-0000-000000000432",
},
"person": {
- "id": "00000000-0000-0000-0000-000000000435",
+ "id": "00000000-0000-0000-0000-000000000436",
},
"role": {
- "id": "00000000-0000-0000-0000-000000000432",
+ "id": "00000000-0000-0000-0000-000000000433",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000436",
+ "id": "00000000-0000-0000-0000-000000000437",
},
},
"viewGroups": {},
},
"messageParticipantRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000448",
+ "id": "00000000-0000-0000-0000-000000000449",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000446",
+ "id": "00000000-0000-0000-0000-000000000447",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000447",
+ "id": "00000000-0000-0000-0000-000000000448",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000444",
+ "id": "00000000-0000-0000-0000-000000000445",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000445",
+ "id": "00000000-0000-0000-0000-000000000446",
},
"displayName": {
- "id": "00000000-0000-0000-0000-000000000441",
+ "id": "00000000-0000-0000-0000-000000000442",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000439",
+ "id": "00000000-0000-0000-0000-000000000440",
},
"person": {
- "id": "00000000-0000-0000-0000-000000000442",
+ "id": "00000000-0000-0000-0000-000000000443",
},
"role": {
- "id": "00000000-0000-0000-0000-000000000440",
+ "id": "00000000-0000-0000-0000-000000000441",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000443",
+ "id": "00000000-0000-0000-0000-000000000444",
},
},
"viewGroups": {},
@@ -1601,59 +1604,59 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageThread": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000451",
+ "id": "00000000-0000-0000-0000-000000000452",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000454",
+ "id": "00000000-0000-0000-0000-000000000455",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000453",
+ "id": "00000000-0000-0000-0000-000000000454",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000450",
+ "id": "00000000-0000-0000-0000-000000000451",
},
"messageChannelMessageAssociations": {
- "id": "00000000-0000-0000-0000-000000000459",
+ "id": "00000000-0000-0000-0000-000000000460",
},
"messageThreadTargets": {
- "id": "00000000-0000-0000-0000-000000000461",
+ "id": "00000000-0000-0000-0000-000000000462",
},
"messages": {
- "id": "00000000-0000-0000-0000-000000000458",
+ "id": "00000000-0000-0000-0000-000000000459",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000456",
+ "id": "00000000-0000-0000-0000-000000000457",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000457",
+ "id": "00000000-0000-0000-0000-000000000458",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000460",
+ "id": "00000000-0000-0000-0000-000000000461",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000452",
+ "id": "00000000-0000-0000-0000-000000000453",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000455",
+ "id": "00000000-0000-0000-0000-000000000456",
},
},
- "id": "00000000-0000-0000-0000-000000000467",
+ "id": "00000000-0000-0000-0000-000000000468",
"views": {
"allMessageThreads": {
- "id": "00000000-0000-0000-0000-000000000466",
+ "id": "00000000-0000-0000-0000-000000000467",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000465",
+ "id": "00000000-0000-0000-0000-000000000466",
},
"messages": {
- "id": "00000000-0000-0000-0000-000000000463",
+ "id": "00000000-0000-0000-0000-000000000464",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000462",
+ "id": "00000000-0000-0000-0000-000000000463",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000464",
+ "id": "00000000-0000-0000-0000-000000000465",
},
},
"viewGroups": {},
@@ -1663,151 +1666,151 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageThreadTarget": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000469",
+ "id": "00000000-0000-0000-0000-000000000470",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000472",
+ "id": "00000000-0000-0000-0000-000000000473",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000471",
+ "id": "00000000-0000-0000-0000-000000000472",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000468",
+ "id": "00000000-0000-0000-0000-000000000469",
},
"isAutomaticallyAssigned": {
- "id": "00000000-0000-0000-0000-000000000477",
+ "id": "00000000-0000-0000-0000-000000000478",
},
"isManuallyAssigned": {
- "id": "00000000-0000-0000-0000-000000000478",
+ "id": "00000000-0000-0000-0000-000000000479",
},
"messageThread": {
- "id": "00000000-0000-0000-0000-000000000476",
+ "id": "00000000-0000-0000-0000-000000000477",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000474",
+ "id": "00000000-0000-0000-0000-000000000475",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000475",
+ "id": "00000000-0000-0000-0000-000000000476",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000480",
+ "id": "00000000-0000-0000-0000-000000000481",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000481",
+ "id": "00000000-0000-0000-0000-000000000482",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000479",
+ "id": "00000000-0000-0000-0000-000000000480",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000470",
+ "id": "00000000-0000-0000-0000-000000000471",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000473",
+ "id": "00000000-0000-0000-0000-000000000474",
},
},
- "id": "00000000-0000-0000-0000-000000000482",
+ "id": "00000000-0000-0000-0000-000000000483",
"views": {},
},
"note": {
"fields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000521",
+ "id": "00000000-0000-0000-0000-000000000522",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000519",
+ "id": "00000000-0000-0000-0000-000000000520",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000511",
+ "id": "00000000-0000-0000-0000-000000000512",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000514",
+ "id": "00000000-0000-0000-0000-000000000515",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000513",
+ "id": "00000000-0000-0000-0000-000000000514",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000510",
+ "id": "00000000-0000-0000-0000-000000000511",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000520",
+ "id": "00000000-0000-0000-0000-000000000521",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000516",
+ "id": "00000000-0000-0000-0000-000000000517",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000517",
+ "id": "00000000-0000-0000-0000-000000000518",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000522",
+ "id": "00000000-0000-0000-0000-000000000523",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000518",
+ "id": "00000000-0000-0000-0000-000000000519",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000512",
+ "id": "00000000-0000-0000-0000-000000000513",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000515",
+ "id": "00000000-0000-0000-0000-000000000516",
},
},
- "id": "00000000-0000-0000-0000-000000000540",
+ "id": "00000000-0000-0000-0000-000000000541",
"views": {
"allNotes": {
- "id": "00000000-0000-0000-0000-000000000528",
+ "id": "00000000-0000-0000-0000-000000000529",
"viewFieldGroups": {},
"viewFields": {
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000525",
+ "id": "00000000-0000-0000-0000-000000000526",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000527",
+ "id": "00000000-0000-0000-0000-000000000528",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000526",
+ "id": "00000000-0000-0000-0000-000000000527",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000524",
+ "id": "00000000-0000-0000-0000-000000000525",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000523",
+ "id": "00000000-0000-0000-0000-000000000524",
},
},
"viewGroups": {},
},
"noteRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000539",
+ "id": "00000000-0000-0000-0000-000000000540",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000537",
+ "id": "00000000-0000-0000-0000-000000000538",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000538",
+ "id": "00000000-0000-0000-0000-000000000539",
},
},
"viewFields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000535",
+ "id": "00000000-0000-0000-0000-000000000536",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000532",
+ "id": "00000000-0000-0000-0000-000000000533",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000529",
+ "id": "00000000-0000-0000-0000-000000000530",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000530",
+ "id": "00000000-0000-0000-0000-000000000531",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000531",
+ "id": "00000000-0000-0000-0000-000000000532",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000536",
+ "id": "00000000-0000-0000-0000-000000000537",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000533",
+ "id": "00000000-0000-0000-0000-000000000534",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000534",
+ "id": "00000000-0000-0000-0000-000000000535",
},
},
"viewGroups": {},
@@ -1817,62 +1820,62 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"noteTarget": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000542",
+ "id": "00000000-0000-0000-0000-000000000543",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000545",
+ "id": "00000000-0000-0000-0000-000000000546",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000544",
+ "id": "00000000-0000-0000-0000-000000000545",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000541",
+ "id": "00000000-0000-0000-0000-000000000542",
},
"note": {
- "id": "00000000-0000-0000-0000-000000000549",
+ "id": "00000000-0000-0000-0000-000000000550",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000547",
+ "id": "00000000-0000-0000-0000-000000000548",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000548",
+ "id": "00000000-0000-0000-0000-000000000549",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000551",
+ "id": "00000000-0000-0000-0000-000000000552",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000552",
+ "id": "00000000-0000-0000-0000-000000000553",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000550",
+ "id": "00000000-0000-0000-0000-000000000551",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000543",
+ "id": "00000000-0000-0000-0000-000000000544",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000546",
+ "id": "00000000-0000-0000-0000-000000000547",
},
},
- "id": "00000000-0000-0000-0000-000000000559",
+ "id": "00000000-0000-0000-0000-000000000560",
"views": {
"allNoteTargets": {
- "id": "00000000-0000-0000-0000-000000000558",
+ "id": "00000000-0000-0000-0000-000000000559",
"viewFieldGroups": {},
"viewFields": {
"id": {
- "id": "00000000-0000-0000-0000-000000000553",
+ "id": "00000000-0000-0000-0000-000000000554",
},
"note": {
- "id": "00000000-0000-0000-0000-000000000554",
+ "id": "00000000-0000-0000-0000-000000000555",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000556",
+ "id": "00000000-0000-0000-0000-000000000557",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000557",
+ "id": "00000000-0000-0000-0000-000000000558",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000555",
+ "id": "00000000-0000-0000-0000-000000000556",
},
},
"viewGroups": {},
@@ -1882,192 +1885,192 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"opportunity": {
"fields": {
"amount": {
- "id": "00000000-0000-0000-0000-000000000569",
+ "id": "00000000-0000-0000-0000-000000000570",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000579",
+ "id": "00000000-0000-0000-0000-000000000580",
},
"calendarEventTargets": {
- "id": "00000000-0000-0000-0000-000000000577",
+ "id": "00000000-0000-0000-0000-000000000578",
},
"closeDate": {
- "id": "00000000-0000-0000-0000-000000000570",
+ "id": "00000000-0000-0000-0000-000000000571",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000573",
+ "id": "00000000-0000-0000-0000-000000000574",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000561",
+ "id": "00000000-0000-0000-0000-000000000562",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000564",
+ "id": "00000000-0000-0000-0000-000000000565",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000563",
+ "id": "00000000-0000-0000-0000-000000000564",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000560",
+ "id": "00000000-0000-0000-0000-000000000561",
},
"messageThreadTargets": {
- "id": "00000000-0000-0000-0000-000000000578",
+ "id": "00000000-0000-0000-0000-000000000579",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000568",
+ "id": "00000000-0000-0000-0000-000000000569",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000576",
+ "id": "00000000-0000-0000-0000-000000000577",
},
"owner": {
- "id": "00000000-0000-0000-0000-000000000574",
+ "id": "00000000-0000-0000-0000-000000000575",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000572",
+ "id": "00000000-0000-0000-0000-000000000573",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000566",
+ "id": "00000000-0000-0000-0000-000000000567",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000567",
+ "id": "00000000-0000-0000-0000-000000000568",
},
"stage": {
- "id": "00000000-0000-0000-0000-000000000571",
+ "id": "00000000-0000-0000-0000-000000000572",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000575",
+ "id": "00000000-0000-0000-0000-000000000576",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000580",
+ "id": "00000000-0000-0000-0000-000000000581",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000562",
+ "id": "00000000-0000-0000-0000-000000000563",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000565",
+ "id": "00000000-0000-0000-0000-000000000566",
},
},
- "id": "00000000-0000-0000-0000-000000000618",
+ "id": "00000000-0000-0000-0000-000000000619",
"views": {
"allOpportunities": {
- "id": "00000000-0000-0000-0000-000000000587",
+ "id": "00000000-0000-0000-0000-000000000588",
"viewFieldGroups": {},
"viewFields": {
"amount": {
- "id": "00000000-0000-0000-0000-000000000582",
+ "id": "00000000-0000-0000-0000-000000000583",
},
"closeDate": {
- "id": "00000000-0000-0000-0000-000000000584",
+ "id": "00000000-0000-0000-0000-000000000585",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000585",
+ "id": "00000000-0000-0000-0000-000000000586",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000583",
+ "id": "00000000-0000-0000-0000-000000000584",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000581",
+ "id": "00000000-0000-0000-0000-000000000582",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000586",
+ "id": "00000000-0000-0000-0000-000000000587",
},
},
"viewGroups": {},
},
"byStage": {
- "id": "00000000-0000-0000-0000-000000000599",
+ "id": "00000000-0000-0000-0000-000000000600",
"viewFieldGroups": {},
"viewFields": {
"amount": {
- "id": "00000000-0000-0000-0000-000000000589",
+ "id": "00000000-0000-0000-0000-000000000590",
},
"closeDate": {
- "id": "00000000-0000-0000-0000-000000000591",
+ "id": "00000000-0000-0000-0000-000000000592",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000592",
+ "id": "00000000-0000-0000-0000-000000000593",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000590",
+ "id": "00000000-0000-0000-0000-000000000591",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000588",
+ "id": "00000000-0000-0000-0000-000000000589",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000593",
+ "id": "00000000-0000-0000-0000-000000000594",
},
},
"viewGroups": {
"customer": {
- "id": "00000000-0000-0000-0000-000000000598",
+ "id": "00000000-0000-0000-0000-000000000599",
},
"meeting": {
- "id": "00000000-0000-0000-0000-000000000596",
+ "id": "00000000-0000-0000-0000-000000000597",
},
"new": {
- "id": "00000000-0000-0000-0000-000000000594",
+ "id": "00000000-0000-0000-0000-000000000595",
},
"proposal": {
- "id": "00000000-0000-0000-0000-000000000597",
+ "id": "00000000-0000-0000-0000-000000000598",
},
"screening": {
- "id": "00000000-0000-0000-0000-000000000595",
+ "id": "00000000-0000-0000-0000-000000000596",
},
},
},
"opportunityRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000617",
+ "id": "00000000-0000-0000-0000-000000000618",
"viewFieldGroups": {
"deal": {
- "id": "00000000-0000-0000-0000-000000000614",
+ "id": "00000000-0000-0000-0000-000000000615",
},
"relations": {
- "id": "00000000-0000-0000-0000-000000000615",
+ "id": "00000000-0000-0000-0000-000000000616",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000616",
+ "id": "00000000-0000-0000-0000-000000000617",
},
},
"viewFields": {
"amount": {
- "id": "00000000-0000-0000-0000-000000000600",
+ "id": "00000000-0000-0000-0000-000000000601",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000612",
+ "id": "00000000-0000-0000-0000-000000000613",
},
"closeDate": {
- "id": "00000000-0000-0000-0000-000000000601",
+ "id": "00000000-0000-0000-0000-000000000602",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000603",
+ "id": "00000000-0000-0000-0000-000000000604",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000606",
+ "id": "00000000-0000-0000-0000-000000000607",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000607",
+ "id": "00000000-0000-0000-0000-000000000608",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000611",
+ "id": "00000000-0000-0000-0000-000000000612",
},
"owner": {
- "id": "00000000-0000-0000-0000-000000000605",
+ "id": "00000000-0000-0000-0000-000000000606",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000604",
+ "id": "00000000-0000-0000-0000-000000000605",
},
"stage": {
- "id": "00000000-0000-0000-0000-000000000602",
+ "id": "00000000-0000-0000-0000-000000000603",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000610",
+ "id": "00000000-0000-0000-0000-000000000611",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000613",
+ "id": "00000000-0000-0000-0000-000000000614",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000608",
+ "id": "00000000-0000-0000-0000-000000000609",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000609",
+ "id": "00000000-0000-0000-0000-000000000610",
},
},
"viewGroups": {},
@@ -2077,187 +2080,187 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"person": {
"fields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000640",
+ "id": "00000000-0000-0000-0000-000000000641",
},
"avatarFile": {
- "id": "00000000-0000-0000-0000-000000000633",
+ "id": "00000000-0000-0000-0000-000000000634",
},
"avatarUrl": {
- "id": "00000000-0000-0000-0000-000000000632",
+ "id": "00000000-0000-0000-0000-000000000633",
},
"calendarEventParticipants": {
- "id": "00000000-0000-0000-0000-000000000642",
+ "id": "00000000-0000-0000-0000-000000000643",
},
"calendarEventTargets": {
- "id": "00000000-0000-0000-0000-000000000638",
+ "id": "00000000-0000-0000-0000-000000000639",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000634",
+ "id": "00000000-0000-0000-0000-000000000635",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000620",
+ "id": "00000000-0000-0000-0000-000000000621",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000623",
+ "id": "00000000-0000-0000-0000-000000000624",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000622",
+ "id": "00000000-0000-0000-0000-000000000623",
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000628",
+ "id": "00000000-0000-0000-0000-000000000629",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000619",
+ "id": "00000000-0000-0000-0000-000000000620",
},
"jobTitle": {
- "id": "00000000-0000-0000-0000-000000000630",
+ "id": "00000000-0000-0000-0000-000000000631",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000629",
+ "id": "00000000-0000-0000-0000-000000000630",
},
"listMemberships": {
- "id": "00000000-0000-0000-0000-000000000644",
+ "id": "00000000-0000-0000-0000-000000000645",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000641",
+ "id": "00000000-0000-0000-0000-000000000642",
},
"messageThreadTargets": {
- "id": "00000000-0000-0000-0000-000000000639",
+ "id": "00000000-0000-0000-0000-000000000640",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000627",
+ "id": "00000000-0000-0000-0000-000000000628",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000637",
+ "id": "00000000-0000-0000-0000-000000000638",
},
"phones": {
- "id": "00000000-0000-0000-0000-000000000631",
+ "id": "00000000-0000-0000-0000-000000000632",
},
"pointOfContactForOpportunities": {
- "id": "00000000-0000-0000-0000-000000000635",
+ "id": "00000000-0000-0000-0000-000000000636",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000625",
+ "id": "00000000-0000-0000-0000-000000000626",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000626",
+ "id": "00000000-0000-0000-0000-000000000627",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000636",
+ "id": "00000000-0000-0000-0000-000000000637",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000643",
+ "id": "00000000-0000-0000-0000-000000000644",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000621",
+ "id": "00000000-0000-0000-0000-000000000622",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000624",
+ "id": "00000000-0000-0000-0000-000000000625",
},
},
- "id": "00000000-0000-0000-0000-000000000677",
+ "id": "00000000-0000-0000-0000-000000000678",
"views": {
"allPeople": {
- "id": "00000000-0000-0000-0000-000000000653",
+ "id": "00000000-0000-0000-0000-000000000654",
"viewFieldGroups": {},
"viewFields": {
"company": {
- "id": "00000000-0000-0000-0000-000000000648",
+ "id": "00000000-0000-0000-0000-000000000649",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000650",
+ "id": "00000000-0000-0000-0000-000000000651",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000647",
+ "id": "00000000-0000-0000-0000-000000000648",
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000646",
+ "id": "00000000-0000-0000-0000-000000000647",
},
"jobTitle": {
- "id": "00000000-0000-0000-0000-000000000651",
+ "id": "00000000-0000-0000-0000-000000000652",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000652",
+ "id": "00000000-0000-0000-0000-000000000653",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000645",
+ "id": "00000000-0000-0000-0000-000000000646",
},
"phones": {
- "id": "00000000-0000-0000-0000-000000000649",
+ "id": "00000000-0000-0000-0000-000000000650",
},
},
"viewGroups": {},
},
"personRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000676",
+ "id": "00000000-0000-0000-0000-000000000677",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000672",
+ "id": "00000000-0000-0000-0000-000000000673",
},
"social": {
- "id": "00000000-0000-0000-0000-000000000674",
+ "id": "00000000-0000-0000-0000-000000000675",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000675",
+ "id": "00000000-0000-0000-0000-000000000676",
},
"work": {
- "id": "00000000-0000-0000-0000-000000000673",
+ "id": "00000000-0000-0000-0000-000000000674",
},
},
"viewFields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000668",
+ "id": "00000000-0000-0000-0000-000000000669",
},
"avatarFile": {
- "id": "00000000-0000-0000-0000-000000000664",
+ "id": "00000000-0000-0000-0000-000000000665",
},
"avatarUrl": {
- "id": "00000000-0000-0000-0000-000000000659",
+ "id": "00000000-0000-0000-0000-000000000660",
},
"calendarEventParticipants": {
- "id": "00000000-0000-0000-0000-000000000670",
+ "id": "00000000-0000-0000-0000-000000000671",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000656",
+ "id": "00000000-0000-0000-0000-000000000657",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000660",
+ "id": "00000000-0000-0000-0000-000000000661",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000661",
+ "id": "00000000-0000-0000-0000-000000000662",
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000654",
+ "id": "00000000-0000-0000-0000-000000000655",
},
"jobTitle": {
- "id": "00000000-0000-0000-0000-000000000657",
+ "id": "00000000-0000-0000-0000-000000000658",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000658",
+ "id": "00000000-0000-0000-0000-000000000659",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000669",
+ "id": "00000000-0000-0000-0000-000000000670",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000667",
+ "id": "00000000-0000-0000-0000-000000000668",
},
"phones": {
- "id": "00000000-0000-0000-0000-000000000655",
+ "id": "00000000-0000-0000-0000-000000000656",
},
"pointOfContactForOpportunities": {
- "id": "00000000-0000-0000-0000-000000000665",
+ "id": "00000000-0000-0000-0000-000000000666",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000666",
+ "id": "00000000-0000-0000-0000-000000000667",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000671",
+ "id": "00000000-0000-0000-0000-000000000672",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000662",
+ "id": "00000000-0000-0000-0000-000000000663",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000663",
+ "id": "00000000-0000-0000-0000-000000000664",
},
},
"viewGroups": {},
@@ -2267,203 +2270,203 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"task": {
"fields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000692",
+ "id": "00000000-0000-0000-0000-000000000693",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000691",
+ "id": "00000000-0000-0000-0000-000000000692",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000687",
+ "id": "00000000-0000-0000-0000-000000000688",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000679",
+ "id": "00000000-0000-0000-0000-000000000680",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000682",
+ "id": "00000000-0000-0000-0000-000000000683",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000681",
+ "id": "00000000-0000-0000-0000-000000000682",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000688",
+ "id": "00000000-0000-0000-0000-000000000689",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000678",
+ "id": "00000000-0000-0000-0000-000000000679",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000684",
+ "id": "00000000-0000-0000-0000-000000000685",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000685",
+ "id": "00000000-0000-0000-0000-000000000686",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000689",
+ "id": "00000000-0000-0000-0000-000000000690",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000690",
+ "id": "00000000-0000-0000-0000-000000000691",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000693",
+ "id": "00000000-0000-0000-0000-000000000694",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000686",
+ "id": "00000000-0000-0000-0000-000000000687",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000680",
+ "id": "00000000-0000-0000-0000-000000000681",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000683",
+ "id": "00000000-0000-0000-0000-000000000684",
},
},
- "id": "00000000-0000-0000-0000-000000000738",
+ "id": "00000000-0000-0000-0000-000000000739",
"views": {
"allTasks": {
- "id": "00000000-0000-0000-0000-000000000702",
+ "id": "00000000-0000-0000-0000-000000000703",
"viewFieldGroups": {},
"viewFields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000699",
+ "id": "00000000-0000-0000-0000-000000000700",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000700",
+ "id": "00000000-0000-0000-0000-000000000701",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000701",
+ "id": "00000000-0000-0000-0000-000000000702",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000697",
+ "id": "00000000-0000-0000-0000-000000000698",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000698",
+ "id": "00000000-0000-0000-0000-000000000699",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000695",
+ "id": "00000000-0000-0000-0000-000000000696",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000696",
+ "id": "00000000-0000-0000-0000-000000000697",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000694",
+ "id": "00000000-0000-0000-0000-000000000695",
},
},
"viewGroups": {},
},
"assignedToMe": {
- "id": "00000000-0000-0000-0000-000000000714",
+ "id": "00000000-0000-0000-0000-000000000715",
"viewFieldGroups": {},
"viewFields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000707",
+ "id": "00000000-0000-0000-0000-000000000708",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000708",
+ "id": "00000000-0000-0000-0000-000000000709",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000709",
+ "id": "00000000-0000-0000-0000-000000000710",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000705",
+ "id": "00000000-0000-0000-0000-000000000706",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000706",
+ "id": "00000000-0000-0000-0000-000000000707",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000704",
+ "id": "00000000-0000-0000-0000-000000000705",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000703",
+ "id": "00000000-0000-0000-0000-000000000704",
},
},
"viewGroups": {
"done": {
- "id": "00000000-0000-0000-0000-000000000712",
+ "id": "00000000-0000-0000-0000-000000000713",
},
"empty": {
- "id": "00000000-0000-0000-0000-000000000713",
+ "id": "00000000-0000-0000-0000-000000000714",
},
"inProgress": {
- "id": "00000000-0000-0000-0000-000000000711",
+ "id": "00000000-0000-0000-0000-000000000712",
},
"todo": {
- "id": "00000000-0000-0000-0000-000000000710",
+ "id": "00000000-0000-0000-0000-000000000711",
},
},
},
"byStatus": {
- "id": "00000000-0000-0000-0000-000000000723",
+ "id": "00000000-0000-0000-0000-000000000724",
"viewFieldGroups": {},
"viewFields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000718",
+ "id": "00000000-0000-0000-0000-000000000719",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000719",
+ "id": "00000000-0000-0000-0000-000000000720",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000717",
+ "id": "00000000-0000-0000-0000-000000000718",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000716",
+ "id": "00000000-0000-0000-0000-000000000717",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000715",
+ "id": "00000000-0000-0000-0000-000000000716",
},
},
"viewGroups": {
"done": {
- "id": "00000000-0000-0000-0000-000000000722",
+ "id": "00000000-0000-0000-0000-000000000723",
},
"inProgress": {
- "id": "00000000-0000-0000-0000-000000000721",
+ "id": "00000000-0000-0000-0000-000000000722",
},
"todo": {
- "id": "00000000-0000-0000-0000-000000000720",
+ "id": "00000000-0000-0000-0000-000000000721",
},
},
},
"taskRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000737",
+ "id": "00000000-0000-0000-0000-000000000738",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000735",
+ "id": "00000000-0000-0000-0000-000000000736",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000736",
+ "id": "00000000-0000-0000-0000-000000000737",
},
},
"viewFields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000726",
+ "id": "00000000-0000-0000-0000-000000000727",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000733",
+ "id": "00000000-0000-0000-0000-000000000734",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000730",
+ "id": "00000000-0000-0000-0000-000000000731",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000727",
+ "id": "00000000-0000-0000-0000-000000000728",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000728",
+ "id": "00000000-0000-0000-0000-000000000729",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000724",
+ "id": "00000000-0000-0000-0000-000000000725",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000725",
+ "id": "00000000-0000-0000-0000-000000000726",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000729",
+ "id": "00000000-0000-0000-0000-000000000730",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000734",
+ "id": "00000000-0000-0000-0000-000000000735",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000731",
+ "id": "00000000-0000-0000-0000-000000000732",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000732",
+ "id": "00000000-0000-0000-0000-000000000733",
},
},
"viewGroups": {},
@@ -2473,62 +2476,62 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"taskTarget": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000740",
+ "id": "00000000-0000-0000-0000-000000000741",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000743",
+ "id": "00000000-0000-0000-0000-000000000744",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000742",
+ "id": "00000000-0000-0000-0000-000000000743",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000739",
+ "id": "00000000-0000-0000-0000-000000000740",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000745",
+ "id": "00000000-0000-0000-0000-000000000746",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000746",
+ "id": "00000000-0000-0000-0000-000000000747",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000749",
+ "id": "00000000-0000-0000-0000-000000000750",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000750",
+ "id": "00000000-0000-0000-0000-000000000751",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000748",
+ "id": "00000000-0000-0000-0000-000000000749",
},
"task": {
- "id": "00000000-0000-0000-0000-000000000747",
+ "id": "00000000-0000-0000-0000-000000000748",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000741",
+ "id": "00000000-0000-0000-0000-000000000742",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000744",
+ "id": "00000000-0000-0000-0000-000000000745",
},
},
- "id": "00000000-0000-0000-0000-000000000757",
+ "id": "00000000-0000-0000-0000-000000000758",
"views": {
"allTaskTargets": {
- "id": "00000000-0000-0000-0000-000000000756",
+ "id": "00000000-0000-0000-0000-000000000757",
"viewFieldGroups": {},
"viewFields": {
"id": {
- "id": "00000000-0000-0000-0000-000000000751",
+ "id": "00000000-0000-0000-0000-000000000752",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000754",
+ "id": "00000000-0000-0000-0000-000000000755",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000755",
+ "id": "00000000-0000-0000-0000-000000000756",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000753",
+ "id": "00000000-0000-0000-0000-000000000754",
},
"task": {
- "id": "00000000-0000-0000-0000-000000000752",
+ "id": "00000000-0000-0000-0000-000000000753",
},
},
"viewGroups": {},
@@ -2538,128 +2541,128 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"timelineActivity": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000759",
+ "id": "00000000-0000-0000-0000-000000000760",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000762",
+ "id": "00000000-0000-0000-0000-000000000763",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000761",
+ "id": "00000000-0000-0000-0000-000000000762",
},
"happensAt": {
- "id": "00000000-0000-0000-0000-000000000768",
+ "id": "00000000-0000-0000-0000-000000000769",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000758",
+ "id": "00000000-0000-0000-0000-000000000759",
},
"linkedObjectMetadataId": {
- "id": "00000000-0000-0000-0000-000000000784",
+ "id": "00000000-0000-0000-0000-000000000785",
},
"linkedRecordCachedName": {
- "id": "00000000-0000-0000-0000-000000000782",
+ "id": "00000000-0000-0000-0000-000000000783",
},
"linkedRecordId": {
- "id": "00000000-0000-0000-0000-000000000783",
+ "id": "00000000-0000-0000-0000-000000000784",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000764",
+ "id": "00000000-0000-0000-0000-000000000765",
},
"properties": {
- "id": "00000000-0000-0000-0000-000000000769",
+ "id": "00000000-0000-0000-0000-000000000770",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000765",
+ "id": "00000000-0000-0000-0000-000000000766",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000772",
+ "id": "00000000-0000-0000-0000-000000000773",
},
"targetDashboard": {
- "id": "00000000-0000-0000-0000-000000000779",
+ "id": "00000000-0000-0000-0000-000000000780",
},
"targetMessageCampaign": {
- "id": "00000000-0000-0000-0000-000000000781",
+ "id": "00000000-0000-0000-0000-000000000782",
},
"targetMessageList": {
- "id": "00000000-0000-0000-0000-000000000780",
+ "id": "00000000-0000-0000-0000-000000000781",
},
"targetNote": {
- "id": "00000000-0000-0000-0000-000000000775",
+ "id": "00000000-0000-0000-0000-000000000776",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000773",
+ "id": "00000000-0000-0000-0000-000000000774",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000771",
+ "id": "00000000-0000-0000-0000-000000000772",
},
"targetTask": {
- "id": "00000000-0000-0000-0000-000000000774",
+ "id": "00000000-0000-0000-0000-000000000775",
},
"targetWorkflow": {
- "id": "00000000-0000-0000-0000-000000000776",
+ "id": "00000000-0000-0000-0000-000000000777",
},
"targetWorkflowRun": {
- "id": "00000000-0000-0000-0000-000000000778",
+ "id": "00000000-0000-0000-0000-000000000779",
},
"targetWorkflowVersion": {
- "id": "00000000-0000-0000-0000-000000000777",
+ "id": "00000000-0000-0000-0000-000000000778",
},
"timelineActivityTypeId": {
- "id": "00000000-0000-0000-0000-000000000766",
+ "id": "00000000-0000-0000-0000-000000000767",
},
"timelineActivityTypeSnapshot": {
- "id": "00000000-0000-0000-0000-000000000767",
+ "id": "00000000-0000-0000-0000-000000000768",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000760",
+ "id": "00000000-0000-0000-0000-000000000761",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000763",
+ "id": "00000000-0000-0000-0000-000000000764",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000770",
+ "id": "00000000-0000-0000-0000-000000000771",
},
},
- "id": "00000000-0000-0000-0000-000000000798",
+ "id": "00000000-0000-0000-0000-000000000799",
"views": {
"allTimelineActivities": {
- "id": "00000000-0000-0000-0000-000000000797",
+ "id": "00000000-0000-0000-0000-000000000798",
"viewFieldGroups": {},
"viewFields": {
"happensAt": {
- "id": "00000000-0000-0000-0000-000000000786",
+ "id": "00000000-0000-0000-0000-000000000787",
},
"linkedRecordCachedName": {
- "id": "00000000-0000-0000-0000-000000000785",
+ "id": "00000000-0000-0000-0000-000000000786",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000789",
+ "id": "00000000-0000-0000-0000-000000000790",
},
"targetDashboard": {
- "id": "00000000-0000-0000-0000-000000000796",
+ "id": "00000000-0000-0000-0000-000000000797",
},
"targetNote": {
- "id": "00000000-0000-0000-0000-000000000792",
+ "id": "00000000-0000-0000-0000-000000000793",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000790",
+ "id": "00000000-0000-0000-0000-000000000791",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000788",
+ "id": "00000000-0000-0000-0000-000000000789",
},
"targetTask": {
- "id": "00000000-0000-0000-0000-000000000791",
+ "id": "00000000-0000-0000-0000-000000000792",
},
"targetWorkflow": {
- "id": "00000000-0000-0000-0000-000000000793",
+ "id": "00000000-0000-0000-0000-000000000794",
},
"targetWorkflowRun": {
- "id": "00000000-0000-0000-0000-000000000795",
+ "id": "00000000-0000-0000-0000-000000000796",
},
"targetWorkflowVersion": {
- "id": "00000000-0000-0000-0000-000000000794",
+ "id": "00000000-0000-0000-0000-000000000795",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000787",
+ "id": "00000000-0000-0000-0000-000000000788",
},
},
"viewGroups": {},
@@ -2669,80 +2672,80 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workflow": {
"fields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000815",
+ "id": "00000000-0000-0000-0000-000000000816",
},
"automatedTriggers": {
- "id": "00000000-0000-0000-0000-000000000813",
+ "id": "00000000-0000-0000-0000-000000000814",
},
"coreWorkflowId": {
- "id": "00000000-0000-0000-0000-000000000809",
+ "id": "00000000-0000-0000-0000-000000000810",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000800",
+ "id": "00000000-0000-0000-0000-000000000801",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000803",
+ "id": "00000000-0000-0000-0000-000000000804",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000802",
+ "id": "00000000-0000-0000-0000-000000000803",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000799",
+ "id": "00000000-0000-0000-0000-000000000800",
},
"lastPublishedVersionId": {
- "id": "00000000-0000-0000-0000-000000000808",
+ "id": "00000000-0000-0000-0000-000000000809",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000807",
+ "id": "00000000-0000-0000-0000-000000000808",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000805",
+ "id": "00000000-0000-0000-0000-000000000806",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000812",
+ "id": "00000000-0000-0000-0000-000000000813",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000806",
+ "id": "00000000-0000-0000-0000-000000000807",
},
"statuses": {
- "id": "00000000-0000-0000-0000-000000000810",
+ "id": "00000000-0000-0000-0000-000000000811",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000814",
+ "id": "00000000-0000-0000-0000-000000000815",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000801",
+ "id": "00000000-0000-0000-0000-000000000802",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000804",
+ "id": "00000000-0000-0000-0000-000000000805",
},
"versions": {
- "id": "00000000-0000-0000-0000-000000000811",
+ "id": "00000000-0000-0000-0000-000000000812",
},
},
- "id": "00000000-0000-0000-0000-000000000823",
+ "id": "00000000-0000-0000-0000-000000000824",
"views": {
"allWorkflows": {
- "id": "00000000-0000-0000-0000-000000000822",
+ "id": "00000000-0000-0000-0000-000000000823",
"viewFieldGroups": {},
"viewFields": {
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000819",
+ "id": "00000000-0000-0000-0000-000000000820",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000816",
+ "id": "00000000-0000-0000-0000-000000000817",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000821",
+ "id": "00000000-0000-0000-0000-000000000822",
},
"statuses": {
- "id": "00000000-0000-0000-0000-000000000817",
+ "id": "00000000-0000-0000-0000-000000000818",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000818",
+ "id": "00000000-0000-0000-0000-000000000819",
},
"versions": {
- "id": "00000000-0000-0000-0000-000000000820",
+ "id": "00000000-0000-0000-0000-000000000821",
},
},
"viewGroups": {},
@@ -2752,79 +2755,79 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workflowAutomatedTrigger": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000825",
+ "id": "00000000-0000-0000-0000-000000000826",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000828",
+ "id": "00000000-0000-0000-0000-000000000829",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000827",
+ "id": "00000000-0000-0000-0000-000000000828",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000824",
+ "id": "00000000-0000-0000-0000-000000000825",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000830",
+ "id": "00000000-0000-0000-0000-000000000831",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000831",
+ "id": "00000000-0000-0000-0000-000000000832",
},
"settings": {
- "id": "00000000-0000-0000-0000-000000000833",
+ "id": "00000000-0000-0000-0000-000000000834",
},
"type": {
- "id": "00000000-0000-0000-0000-000000000832",
+ "id": "00000000-0000-0000-0000-000000000833",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000826",
+ "id": "00000000-0000-0000-0000-000000000827",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000829",
+ "id": "00000000-0000-0000-0000-000000000830",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000834",
+ "id": "00000000-0000-0000-0000-000000000835",
},
},
- "id": "00000000-0000-0000-0000-000000000846",
+ "id": "00000000-0000-0000-0000-000000000847",
"views": {
"allWorkflowAutomatedTriggers": {
- "id": "00000000-0000-0000-0000-000000000838",
+ "id": "00000000-0000-0000-0000-000000000839",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000837",
+ "id": "00000000-0000-0000-0000-000000000838",
},
"type": {
- "id": "00000000-0000-0000-0000-000000000835",
+ "id": "00000000-0000-0000-0000-000000000836",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000836",
+ "id": "00000000-0000-0000-0000-000000000837",
},
},
"viewGroups": {},
},
"workflowAutomatedTriggerRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000845",
+ "id": "00000000-0000-0000-0000-000000000846",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000843",
+ "id": "00000000-0000-0000-0000-000000000844",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000844",
+ "id": "00000000-0000-0000-0000-000000000845",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000841",
+ "id": "00000000-0000-0000-0000-000000000842",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000842",
+ "id": "00000000-0000-0000-0000-000000000843",
},
"type": {
- "id": "00000000-0000-0000-0000-000000000839",
+ "id": "00000000-0000-0000-0000-000000000840",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000840",
+ "id": "00000000-0000-0000-0000-000000000841",
},
},
"viewGroups": {},
@@ -2834,130 +2837,130 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workflowRun": {
"fields": {
"coreWorkflowId": {
- "id": "00000000-0000-0000-0000-000000000864",
+ "id": "00000000-0000-0000-0000-000000000865",
},
"coreWorkflowVersionId": {
- "id": "00000000-0000-0000-0000-000000000865",
+ "id": "00000000-0000-0000-0000-000000000866",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000848",
+ "id": "00000000-0000-0000-0000-000000000849",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000851",
+ "id": "00000000-0000-0000-0000-000000000852",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000850",
+ "id": "00000000-0000-0000-0000-000000000851",
},
"endedAt": {
- "id": "00000000-0000-0000-0000-000000000860",
+ "id": "00000000-0000-0000-0000-000000000861",
},
"enqueuedAt": {
- "id": "00000000-0000-0000-0000-000000000858",
+ "id": "00000000-0000-0000-0000-000000000859",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000847",
+ "id": "00000000-0000-0000-0000-000000000848",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000855",
+ "id": "00000000-0000-0000-0000-000000000856",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000853",
+ "id": "00000000-0000-0000-0000-000000000854",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000854",
+ "id": "00000000-0000-0000-0000-000000000855",
},
"startedAt": {
- "id": "00000000-0000-0000-0000-000000000859",
+ "id": "00000000-0000-0000-0000-000000000860",
},
"state": {
- "id": "00000000-0000-0000-0000-000000000862",
+ "id": "00000000-0000-0000-0000-000000000863",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000861",
+ "id": "00000000-0000-0000-0000-000000000862",
},
"stepLogs": {
- "id": "00000000-0000-0000-0000-000000000863",
+ "id": "00000000-0000-0000-0000-000000000864",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000866",
+ "id": "00000000-0000-0000-0000-000000000867",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000849",
+ "id": "00000000-0000-0000-0000-000000000850",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000852",
+ "id": "00000000-0000-0000-0000-000000000853",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000857",
+ "id": "00000000-0000-0000-0000-000000000858",
},
"workflowVersion": {
- "id": "00000000-0000-0000-0000-000000000856",
+ "id": "00000000-0000-0000-0000-000000000857",
},
},
- "id": "00000000-0000-0000-0000-000000000886",
+ "id": "00000000-0000-0000-0000-000000000887",
"views": {
"allWorkflowRuns": {
- "id": "00000000-0000-0000-0000-000000000870",
+ "id": "00000000-0000-0000-0000-000000000871",
"viewFieldGroups": {},
"viewFields": {
"name": {
- "id": "00000000-0000-0000-0000-000000000867",
+ "id": "00000000-0000-0000-0000-000000000868",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000869",
+ "id": "00000000-0000-0000-0000-000000000870",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000868",
+ "id": "00000000-0000-0000-0000-000000000869",
},
},
"viewGroups": {},
},
"workflowRunRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000885",
+ "id": "00000000-0000-0000-0000-000000000886",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000883",
+ "id": "00000000-0000-0000-0000-000000000884",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000884",
+ "id": "00000000-0000-0000-0000-000000000885",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000876",
+ "id": "00000000-0000-0000-0000-000000000877",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000877",
+ "id": "00000000-0000-0000-0000-000000000878",
},
"endedAt": {
- "id": "00000000-0000-0000-0000-000000000875",
+ "id": "00000000-0000-0000-0000-000000000876",
},
"enqueuedAt": {
- "id": "00000000-0000-0000-0000-000000000878",
+ "id": "00000000-0000-0000-0000-000000000879",
},
"startedAt": {
- "id": "00000000-0000-0000-0000-000000000874",
+ "id": "00000000-0000-0000-0000-000000000875",
},
"state": {
- "id": "00000000-0000-0000-0000-000000000879",
+ "id": "00000000-0000-0000-0000-000000000880",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000871",
+ "id": "00000000-0000-0000-0000-000000000872",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000882",
+ "id": "00000000-0000-0000-0000-000000000883",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000880",
+ "id": "00000000-0000-0000-0000-000000000881",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000881",
+ "id": "00000000-0000-0000-0000-000000000882",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000872",
+ "id": "00000000-0000-0000-0000-000000000873",
},
"workflowVersion": {
- "id": "00000000-0000-0000-0000-000000000873",
+ "id": "00000000-0000-0000-0000-000000000874",
},
},
"viewGroups": {},
@@ -2967,118 +2970,118 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workflowVersion": {
"fields": {
"coreWorkflowVersionId": {
- "id": "00000000-0000-0000-0000-000000000901",
+ "id": "00000000-0000-0000-0000-000000000902",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000888",
+ "id": "00000000-0000-0000-0000-000000000889",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000891",
+ "id": "00000000-0000-0000-0000-000000000892",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000890",
+ "id": "00000000-0000-0000-0000-000000000891",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000887",
+ "id": "00000000-0000-0000-0000-000000000888",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000895",
+ "id": "00000000-0000-0000-0000-000000000896",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000893",
+ "id": "00000000-0000-0000-0000-000000000894",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000899",
+ "id": "00000000-0000-0000-0000-000000000900",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000894",
+ "id": "00000000-0000-0000-0000-000000000895",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000898",
+ "id": "00000000-0000-0000-0000-000000000899",
},
"steps": {
- "id": "00000000-0000-0000-0000-000000000900",
+ "id": "00000000-0000-0000-0000-000000000901",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000902",
+ "id": "00000000-0000-0000-0000-000000000903",
},
"trigger": {
- "id": "00000000-0000-0000-0000-000000000897",
+ "id": "00000000-0000-0000-0000-000000000898",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000889",
+ "id": "00000000-0000-0000-0000-000000000890",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000892",
+ "id": "00000000-0000-0000-0000-000000000893",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000896",
+ "id": "00000000-0000-0000-0000-000000000897",
},
},
- "id": "00000000-0000-0000-0000-000000000922",
+ "id": "00000000-0000-0000-0000-000000000923",
"views": {
"allWorkflowVersions": {
- "id": "00000000-0000-0000-0000-000000000908",
+ "id": "00000000-0000-0000-0000-000000000909",
"viewFieldGroups": {},
"viewFields": {
"name": {
- "id": "00000000-0000-0000-0000-000000000903",
+ "id": "00000000-0000-0000-0000-000000000904",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000907",
+ "id": "00000000-0000-0000-0000-000000000908",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000905",
+ "id": "00000000-0000-0000-0000-000000000906",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000906",
+ "id": "00000000-0000-0000-0000-000000000907",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000904",
+ "id": "00000000-0000-0000-0000-000000000905",
},
},
"viewGroups": {},
},
"workflowVersionRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000921",
+ "id": "00000000-0000-0000-0000-000000000922",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000919",
+ "id": "00000000-0000-0000-0000-000000000920",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000920",
+ "id": "00000000-0000-0000-0000-000000000921",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000912",
+ "id": "00000000-0000-0000-0000-000000000913",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000914",
+ "id": "00000000-0000-0000-0000-000000000915",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000917",
+ "id": "00000000-0000-0000-0000-000000000918",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000909",
+ "id": "00000000-0000-0000-0000-000000000910",
},
"steps": {
- "id": "00000000-0000-0000-0000-000000000913",
+ "id": "00000000-0000-0000-0000-000000000914",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000918",
+ "id": "00000000-0000-0000-0000-000000000919",
},
"trigger": {
- "id": "00000000-0000-0000-0000-000000000911",
+ "id": "00000000-0000-0000-0000-000000000912",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000915",
+ "id": "00000000-0000-0000-0000-000000000916",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000916",
+ "id": "00000000-0000-0000-0000-000000000917",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000910",
+ "id": "00000000-0000-0000-0000-000000000911",
},
},
"viewGroups": {},
@@ -3088,110 +3091,110 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workspaceMember": {
"fields": {
"accountOwnerForCompanies": {
- "id": "00000000-0000-0000-0000-000000000942",
+ "id": "00000000-0000-0000-0000-000000000943",
},
"assignedTasks": {
- "id": "00000000-0000-0000-0000-000000000940",
+ "id": "00000000-0000-0000-0000-000000000941",
},
"avatarUrl": {
- "id": "00000000-0000-0000-0000-000000000936",
+ "id": "00000000-0000-0000-0000-000000000937",
},
"blocklist": {
- "id": "00000000-0000-0000-0000-000000000944",
+ "id": "00000000-0000-0000-0000-000000000945",
},
"calendarEventParticipants": {
- "id": "00000000-0000-0000-0000-000000000945",
+ "id": "00000000-0000-0000-0000-000000000946",
},
"calendarStartDay": {
- "id": "00000000-0000-0000-0000-000000000950",
+ "id": "00000000-0000-0000-0000-000000000951",
},
"colorScheme": {
- "id": "00000000-0000-0000-0000-000000000932",
+ "id": "00000000-0000-0000-0000-000000000933",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000924",
+ "id": "00000000-0000-0000-0000-000000000925",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000927",
+ "id": "00000000-0000-0000-0000-000000000928",
},
"dateFormat": {
- "id": "00000000-0000-0000-0000-000000000948",
+ "id": "00000000-0000-0000-0000-000000000949",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000926",
+ "id": "00000000-0000-0000-0000-000000000927",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000923",
+ "id": "00000000-0000-0000-0000-000000000924",
},
"jobTitle": {
- "id": "00000000-0000-0000-0000-000000000938",
+ "id": "00000000-0000-0000-0000-000000000939",
},
"locale": {
- "id": "00000000-0000-0000-0000-000000000935",
+ "id": "00000000-0000-0000-0000-000000000936",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000943",
+ "id": "00000000-0000-0000-0000-000000000944",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000931",
+ "id": "00000000-0000-0000-0000-000000000932",
},
"numberFormat": {
- "id": "00000000-0000-0000-0000-000000000951",
+ "id": "00000000-0000-0000-0000-000000000952",
},
"openRecordIn": {
- "id": "00000000-0000-0000-0000-000000000934",
+ "id": "00000000-0000-0000-0000-000000000935",
},
"ownedOpportunities": {
- "id": "00000000-0000-0000-0000-000000000941",
+ "id": "00000000-0000-0000-0000-000000000942",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000929",
+ "id": "00000000-0000-0000-0000-000000000930",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000930",
+ "id": "00000000-0000-0000-0000-000000000931",
},
"timeFormat": {
- "id": "00000000-0000-0000-0000-000000000949",
+ "id": "00000000-0000-0000-0000-000000000950",
},
"timeZone": {
- "id": "00000000-0000-0000-0000-000000000947",
+ "id": "00000000-0000-0000-0000-000000000948",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000946",
+ "id": "00000000-0000-0000-0000-000000000947",
},
"uiScale": {
- "id": "00000000-0000-0000-0000-000000000933",
+ "id": "00000000-0000-0000-0000-000000000934",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000925",
+ "id": "00000000-0000-0000-0000-000000000926",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000928",
+ "id": "00000000-0000-0000-0000-000000000929",
},
"userEmail": {
- "id": "00000000-0000-0000-0000-000000000937",
+ "id": "00000000-0000-0000-0000-000000000938",
},
"userId": {
- "id": "00000000-0000-0000-0000-000000000939",
+ "id": "00000000-0000-0000-0000-000000000940",
},
},
- "id": "00000000-0000-0000-0000-000000000957",
+ "id": "00000000-0000-0000-0000-000000000958",
"views": {
"allWorkspaceMembers": {
- "id": "00000000-0000-0000-0000-000000000956",
+ "id": "00000000-0000-0000-0000-000000000957",
"viewFieldGroups": {},
"viewFields": {
"assignedTasks": {
- "id": "00000000-0000-0000-0000-000000000955",
+ "id": "00000000-0000-0000-0000-000000000956",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000953",
+ "id": "00000000-0000-0000-0000-000000000954",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000952",
+ "id": "00000000-0000-0000-0000-000000000953",
},
"ownedOpportunities": {
- "id": "00000000-0000-0000-0000-000000000954",
+ "id": "00000000-0000-0000-0000-000000000955",
},
},
"viewGroups": {},
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
index de044c7fc19..2a664203151 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/compute-calendar-event-standard-metadata.spec.ts
@@ -45,7 +45,7 @@ describe('CalendarEvent standard metadata build', () => {
(viewField) => viewField.fieldMetadataUniversalIdentifier,
);
- expect(viewFieldFieldUniversalIdentifiers).toHaveLength(12);
+ expect(viewFieldFieldUniversalIdentifiers).toHaveLength(13);
expect(viewFieldFieldUniversalIdentifiers).toEqual(
expect.arrayContaining([
STANDARD_OBJECTS.calendarEvent.fields.title.universalIdentifier,
@@ -57,6 +57,8 @@ describe('CalendarEvent standard metadata build', () => {
.universalIdentifier,
STANDARD_OBJECTS.calendarEvent.fields.location.universalIdentifier,
STANDARD_OBJECTS.calendarEvent.fields.description.universalIdentifier,
+ STANDARD_OBJECTS.calendarEvent.fields.calendarEventTargets
+ .universalIdentifier,
STANDARD_OBJECTS.calendarEvent.fields.externalCreatedAt
.universalIdentifier,
STANDARD_OBJECTS.calendarEvent.fields.externalUpdatedAt
@@ -87,6 +89,8 @@ describe('CalendarEvent standard metadata build', () => {
STANDARD_OBJECTS.calendarEvent.fields.conferenceLink.universalIdentifier,
STANDARD_OBJECTS.calendarEvent.fields.location.universalIdentifier,
STANDARD_OBJECTS.calendarEvent.fields.description.universalIdentifier,
+ STANDARD_OBJECTS.calendarEvent.fields.calendarEventTargets
+ .universalIdentifier,
]);
expect(
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-calendar-event-view-fields.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-calendar-event-view-fields.util.ts
index 36911f811c0..e63faaba6eb 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-calendar-event-view-fields.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/view-field/compute-standard-calendar-event-view-fields.util.ts
@@ -214,6 +214,20 @@ export const computeStandardCalendarEventViewFields = (
viewFieldGroupName: 'general',
},
}),
+ calendarEventRecordPageFieldsCalendarEventTargets:
+ createStandardViewFieldFlatMetadata({
+ ...args,
+ objectName: 'calendarEvent',
+ context: {
+ viewName: 'calendarEventRecordPageFields',
+ viewFieldName: 'calendarEventTargets',
+ fieldName: 'calendarEventTargets',
+ position: 8,
+ isVisible: true,
+ size: 200,
+ viewFieldGroupName: 'general',
+ },
+ }),
calendarEventRecordPageFieldsExternalCreatedAt:
createStandardViewFieldFlatMetadata({
...args,
diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/dtos/create-calendar-event-output.dto.ts b/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/dtos/create-calendar-event-output.dto.ts
index 056bef4f798..7563d907504 100644
--- a/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/dtos/create-calendar-event-output.dto.ts
+++ b/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/dtos/create-calendar-event-output.dto.ts
@@ -9,6 +9,11 @@ export class CreateCalendarEventOutputDTO {
@Field(() => String, { nullable: true })
iCalUid?: string;
+ // Absent when the event reached the provider but persistence failed; the next
+ // sync then recovers the record, so callers must handle it being unset.
+ @Field(() => String, { nullable: true })
+ calendarEventId?: string;
+
@Field(() => String, { nullable: true })
conferenceLink?: string;
diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/resolvers/create-calendar-event.resolver.ts b/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/resolvers/create-calendar-event.resolver.ts
index f7a57c58ba0..3d3666a141e 100644
--- a/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/resolvers/create-calendar-event.resolver.ts
+++ b/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/resolvers/create-calendar-event.resolver.ts
@@ -82,16 +82,18 @@ export class CreateCalendarEventResolver {
result.data,
);
- await this.createCalendarEventService.persistCalendarEvent(
- createdEvent,
- result.data,
- workspace.id,
- );
+ const calendarEventId =
+ await this.createCalendarEventService.persistCalendarEvent(
+ createdEvent,
+ result.data,
+ workspace.id,
+ );
return {
success: true,
iCalUid: createdEvent.iCalUid || undefined,
conferenceLink: createdEvent.conferenceLinkUrl || undefined,
+ calendarEventId: calendarEventId ?? undefined,
};
} catch (error) {
if (error instanceof ForbiddenException) {
diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/services/create-calendar-event.service.ts b/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/services/create-calendar-event.service.ts
index 88371e4f0cc..71652806aec 100644
--- a/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/services/create-calendar-event.service.ts
+++ b/packages/twenty-server/src/modules/calendar/calendar-event-creation-manager/services/create-calendar-event.service.ts
@@ -58,18 +58,23 @@ export class CreateCalendarEventService {
createdEvent: FetchedCalendarEvent,
data: ComposedCalendarEvent,
workspaceId: string,
- ): Promise<void> {
+ ): Promise<string | null> {
try {
- await this.calendarSaveEventsService.saveCalendarEventsAndEnqueueContactCreationJob(
- [createdEvent],
- data.calendarChannel,
- data.connectedAccount,
- workspaceId,
- );
+ const { calendarEventIds } =
+ await this.calendarSaveEventsService.saveCalendarEventsAndEnqueueContactCreationJob(
+ [createdEvent],
+ data.calendarChannel,
+ data.connectedAccount,
+ workspaceId,
+ );
+
+ return calendarEventIds[0] ?? null;
} catch (persistenceError) {
this.logger.warn(
`Failed to persist created calendar event (sync will recover): ${persistenceError}`,
);
+
+ return null;
}
}
}
diff --git a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-save-events.service.ts b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-save-events.service.ts
index 8cc21f4a69e..37cb19d59c5 100644
--- a/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-save-events.service.ts
+++ b/packages/twenty-server/src/modules/calendar/calendar-event-import-manager/services/calendar-save-events.service.ts
@@ -25,7 +25,7 @@ export class CalendarSaveEventsService {
calendarChannel: CalendarChannelEntity,
connectedAccount: ConnectedAccountEntity,
workspaceId: string,
- ): Promise<void> {
+ ): Promise<{ calendarEventIds: string[] }> {
const authContext = buildSystemAuthContext(workspaceId);
const { savedParticipantIds, calendarEventIds } =
@@ -146,5 +146,7 @@ export class CalendarSaveEventsService {
workspaceId,
},
);
+
+ return { calendarEventIds };
}
}
diff --git a/packages/twenty-shared/src/metadata/__tests__/__snapshots__/standardObjectUniversalIdentifiers.test.ts.snap b/packages/twenty-shared/src/metadata/__tests__/__snapshots__/standardObjectUniversalIdentifiers.test.ts.snap
index 4531bf0f244..0ffd1f74f12 100644
--- a/packages/twenty-shared/src/metadata/__tests__/__snapshots__/standardObjectUniversalIdentifiers.test.ts.snap
+++ b/packages/twenty-shared/src/metadata/__tests__/__snapshots__/standardObjectUniversalIdentifiers.test.ts.snap
@@ -427,6 +427,9 @@ exports[`STANDARD_OBJECTS universal identifiers should never change without an e
},
},
"viewFields": {
+ "calendarEventTargets": {
+ "universalIdentifier": "ccfb6671-0211-56d6-a5bc-d91c1f0cb5bc",
+ },
"conferenceLink": {
"universalIdentifier": "a4520a9a-427d-5fca-af4b-9b7fc83be97a",
},
diff --git a/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts b/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
index 9597e4fad7e..7a73ef3c2cd 100644
--- a/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
+++ b/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
@@ -227,6 +227,7 @@ export const STANDARD_OBJECTS = {
'conferenceLink',
'location',
'description',
+ 'calendarEventTargets',
'externalCreatedAt',
'externalUpdatedAt',
'iCalUid',