4506 change field labels and field type for calendarevent object metadata to match figma (#4679)

* update calendarEvent labels and description to match Figma

* modify conferenceUri to conferenceLink with LINK type

* update format-google-calendar-event.util to match new conferenceLink

* update CalendarEventDetails since overriding the fields is no longer needed

* fix mock metadata

* generate new uuid for field conferenceLink
This commit is contained in:
bosiraphael
2024-03-27 15:17:45 +01:00
committed by GitHub
parent 2ffe519478
commit 416eb1eafd
14 changed files with 179 additions and 55 deletions

View File

@ -175,6 +175,12 @@ export type CreateRelationInput = {
toObjectMetadataId: Scalars['String']['input']; toObjectMetadataId: Scalars['String']['input'];
}; };
export type CreateRemoteServerInput = {
foreignDataWrapperOptions: Scalars['JSON']['input'];
foreignDataWrapperType: Scalars['String']['input'];
userMappingOptions?: InputMaybe<Scalars['JSON']['input']>;
};
export type CursorPaging = { export type CursorPaging = {
/** Paginate after opaque cursor */ /** Paginate after opaque cursor */
after?: InputMaybe<Scalars['ConnectionCursor']['input']>; after?: InputMaybe<Scalars['ConnectionCursor']['input']>;
@ -315,6 +321,12 @@ export type InvalidatePassword = {
success: Scalars['Boolean']['output']; success: Scalars['Boolean']['output'];
}; };
export type LinkMetadata = {
__typename?: 'LinkMetadata';
label: Scalars['String']['output'];
url: Scalars['String']['output'];
};
export type LoginToken = { export type LoginToken = {
__typename?: 'LoginToken'; __typename?: 'LoginToken';
loginToken: AuthToken; loginToken: AuthToken;
@ -329,10 +341,12 @@ export type Mutation = {
createOneObject: Object; createOneObject: Object;
createOneRefreshToken: RefreshToken; createOneRefreshToken: RefreshToken;
createOneRelation: Relation; createOneRelation: Relation;
createOneRemoteServer: RemoteServer;
deleteCurrentWorkspace: Workspace; deleteCurrentWorkspace: Workspace;
deleteOneField: FieldDeleteResponse; deleteOneField: FieldDeleteResponse;
deleteOneObject: Object; deleteOneObject: Object;
deleteOneRelation: RelationDeleteResponse; deleteOneRelation: RelationDeleteResponse;
deleteOneRemoteServer: RemoteServer;
deleteUser: User; deleteUser: User;
emailPasswordResetLink: EmailPasswordResetLink; emailPasswordResetLink: EmailPasswordResetLink;
generateApiKeyToken: ApiKeyToken; generateApiKeyToken: ApiKeyToken;
@ -392,6 +406,11 @@ export type MutationCreateOneRelationArgs = {
}; };
export type MutationCreateOneRemoteServerArgs = {
input: CreateRemoteServerInput;
};
export type MutationDeleteOneFieldArgs = { export type MutationDeleteOneFieldArgs = {
input: DeleteOneFieldInput; input: DeleteOneFieldInput;
}; };
@ -407,6 +426,11 @@ export type MutationDeleteOneRelationArgs = {
}; };
export type MutationDeleteOneRemoteServerArgs = {
input: RemoteServerIdInput;
};
export type MutationEmailPasswordResetLinkArgs = { export type MutationEmailPasswordResetLinkArgs = {
email: Scalars['String']['input']; email: Scalars['String']['input'];
}; };
@ -545,6 +569,9 @@ export type Query = {
currentWorkspace: Workspace; currentWorkspace: Workspace;
field: Field; field: Field;
fields: FieldConnection; fields: FieldConnection;
findAvailableRemoteTablesByServerId: Array<RemoteTable>;
findManyRemoteServersByType: Array<RemoteServer>;
findOneRemoteServerById: RemoteServer;
findWorkspaceFromInviteHash: Workspace; findWorkspaceFromInviteHash: Workspace;
getProductPrices: ProductPricesEntity; getProductPrices: ProductPricesEntity;
getTimelineCalendarEventsFromCompanyId: TimelineCalendarEventsWithTotal; getTimelineCalendarEventsFromCompanyId: TimelineCalendarEventsWithTotal;
@ -585,6 +612,21 @@ export type QueryFieldsArgs = {
}; };
export type QueryFindAvailableRemoteTablesByServerIdArgs = {
input: RemoteServerIdInput;
};
export type QueryFindManyRemoteServersByTypeArgs = {
input: RemoteServerTypeInput;
};
export type QueryFindOneRemoteServerByIdArgs = {
input: RemoteServerIdInput;
};
export type QueryFindWorkspaceFromInviteHashArgs = { export type QueryFindWorkspaceFromInviteHashArgs = {
inviteHash: Scalars['String']['input']; inviteHash: Scalars['String']['input'];
}; };
@ -708,6 +750,38 @@ export enum RelationMetadataType {
OneToOne = 'ONE_TO_ONE' OneToOne = 'ONE_TO_ONE'
} }
export type RemoteServer = {
__typename?: 'RemoteServer';
createdAt: Scalars['DateTime']['output'];
foreignDataWrapperId: Scalars['ID']['output'];
foreignDataWrapperOptions?: Maybe<Scalars['JSON']['output']>;
foreignDataWrapperType: Scalars['String']['output'];
id: Scalars['ID']['output'];
updatedAt: Scalars['DateTime']['output'];
};
export type RemoteServerIdInput = {
/** The id of the record. */
id: Scalars['ID']['input'];
};
export type RemoteServerTypeInput = {
foreignDataWrapperType: Scalars['String']['input'];
};
export type RemoteTable = {
__typename?: 'RemoteTable';
name: Scalars['String']['output'];
schema: Scalars['String']['output'];
status: RemoteTableStatus;
};
/** Status of the table */
export enum RemoteTableStatus {
NotSynced = 'NOT_SYNCED',
Synced = 'SYNCED'
}
export type Sentry = { export type Sentry = {
__typename?: 'Sentry'; __typename?: 'Sentry';
dsn?: Maybe<Scalars['String']['output']>; dsn?: Maybe<Scalars['String']['output']>;
@ -745,8 +819,8 @@ export type Telemetry = {
export type TimelineCalendarEvent = { export type TimelineCalendarEvent = {
__typename?: 'TimelineCalendarEvent'; __typename?: 'TimelineCalendarEvent';
attendees: Array<TimelineCalendarEventAttendee>; attendees: Array<TimelineCalendarEventAttendee>;
conferenceLink: LinkMetadata;
conferenceSolution: Scalars['String']['output']; conferenceSolution: Scalars['String']['output'];
conferenceUri: Scalars['String']['output'];
description: Scalars['String']['output']; description: Scalars['String']['output'];
endsAt: Scalars['DateTime']['output']; endsAt: Scalars['DateTime']['output'];
id: Scalars['ID']['output']; id: Scalars['ID']['output'];

View File

@ -235,6 +235,12 @@ export type InvalidatePassword = {
success: Scalars['Boolean']; success: Scalars['Boolean'];
}; };
export type LinkMetadata = {
__typename?: 'LinkMetadata';
label: Scalars['String'];
url: Scalars['String'];
};
export type LoginToken = { export type LoginToken = {
__typename?: 'LoginToken'; __typename?: 'LoginToken';
loginToken: AuthToken; loginToken: AuthToken;
@ -547,6 +553,29 @@ export enum RelationMetadataType {
OneToOne = 'ONE_TO_ONE' OneToOne = 'ONE_TO_ONE'
} }
export type RemoteServer = {
__typename?: 'RemoteServer';
createdAt: Scalars['DateTime'];
foreignDataWrapperId: Scalars['ID'];
foreignDataWrapperOptions?: Maybe<Scalars['JSON']>;
foreignDataWrapperType: Scalars['String'];
id: Scalars['ID'];
updatedAt: Scalars['DateTime'];
};
export type RemoteTable = {
__typename?: 'RemoteTable';
name: Scalars['String'];
schema: Scalars['String'];
status: RemoteTableStatus;
};
/** Status of the table */
export enum RemoteTableStatus {
NotSynced = 'NOT_SYNCED',
Synced = 'SYNCED'
}
export type Sentry = { export type Sentry = {
__typename?: 'Sentry'; __typename?: 'Sentry';
dsn?: Maybe<Scalars['String']>; dsn?: Maybe<Scalars['String']>;
@ -584,8 +613,8 @@ export type Telemetry = {
export type TimelineCalendarEvent = { export type TimelineCalendarEvent = {
__typename?: 'TimelineCalendarEvent'; __typename?: 'TimelineCalendarEvent';
attendees: Array<TimelineCalendarEventAttendee>; attendees: Array<TimelineCalendarEventAttendee>;
conferenceLink: LinkMetadata;
conferenceSolution: Scalars['String']; conferenceSolution: Scalars['String'];
conferenceUri: Scalars['String'];
description: Scalars['String']; description: Scalars['String'];
endsAt: Scalars['DateTime']; endsAt: Scalars['DateTime'];
id: Scalars['ID']; id: Scalars['ID'];
@ -878,9 +907,9 @@ export type RelationEdge = {
export type AttendeeFragmentFragment = { __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }; export type AttendeeFragmentFragment = { __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
export type CalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }; export type CalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
export type TimelineCalendarEventsWithTotalFragmentFragment = { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> }; export type TimelineCalendarEventsWithTotalFragmentFragment = { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> };
export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{ export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{
companyId: Scalars['ID']; companyId: Scalars['ID'];
@ -889,7 +918,7 @@ export type GetTimelineCalendarEventsFromCompanyIdQueryVariables = Exact<{
}>; }>;
export type GetTimelineCalendarEventsFromCompanyIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromCompanyId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } }; export type GetTimelineCalendarEventsFromCompanyIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromCompanyId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{ export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{
personId: Scalars['ID']; personId: Scalars['ID'];
@ -898,7 +927,7 @@ export type GetTimelineCalendarEventsFromPersonIdQueryVariables = Exact<{
}>; }>;
export type GetTimelineCalendarEventsFromPersonIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromPersonId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } }; export type GetTimelineCalendarEventsFromPersonIdQuery = { __typename?: 'Query', getTimelineCalendarEventsFromPersonId: { __typename?: 'TimelineCalendarEventsWithTotal', totalNumberOfCalendarEvents: number, timelineCalendarEvents: Array<{ __typename?: 'TimelineCalendarEvent', id: string, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: TimelineCalendarEventVisibility, attendees: Array<{ __typename?: 'TimelineCalendarEventAttendee', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> }> } };
export type ParticipantFragmentFragment = { __typename?: 'TimelineThreadParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }; export type ParticipantFragmentFragment = { __typename?: 'TimelineThreadParticipant', personId?: string | null, workspaceMemberId?: string | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
@ -1145,6 +1174,7 @@ export const CalendarEventFragmentFragmentDoc = gql`
startsAt startsAt
endsAt endsAt
isFullDay isFullDay
visibility
attendees { attendees {
...AttendeeFragment ...AttendeeFragment
} }

View File

@ -6,8 +6,6 @@ import { useObjectMetadataItemOnly } from '@/object-metadata/hooks/useObjectMeta
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular'; import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
import { formatFieldMetadataItemAsFieldDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsFieldDefinition'; import { formatFieldMetadataItemAsFieldDefinition } from '@/object-metadata/utils/formatFieldMetadataItemAsFieldDefinition';
import { FieldContext } from '@/object-record/record-field/contexts/FieldContext'; import { FieldContext } from '@/object-record/record-field/contexts/FieldContext';
import { FieldDefinition } from '@/object-record/record-field/types/FieldDefinition';
import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';
import { RecordInlineCell } from '@/object-record/record-inline-cell/components/RecordInlineCell'; import { RecordInlineCell } from '@/object-record/record-inline-cell/components/RecordInlineCell';
import { PropertyBox } from '@/object-record/record-inline-cell/property-box/components/PropertyBox'; import { PropertyBox } from '@/object-record/record-inline-cell/property-box/components/PropertyBox';
import { import {
@ -77,18 +75,14 @@ export const CalendarEventDetails = ({
objectNameSingular: CoreObjectNameSingular.CalendarEvent, objectNameSingular: CoreObjectNameSingular.CalendarEvent,
}); });
const fieldsToDisplay: Partial< const fieldsToDisplay = [
Record< 'startsAt',
keyof CalendarEvent, 'endsAt',
Partial<Pick<FieldDefinition<FieldMetadata>, 'label'>> 'conferenceLink',
> 'location',
> = { 'description',
startsAt: { label: 'Start Date' }, ];
endsAt: { label: 'End Date' },
conferenceUri: { label: 'Meet link' },
location: {},
description: {},
};
const fieldsByName = mapArrayToObject( const fieldsByName = mapArrayToObject(
objectMetadataItem.fields, objectMetadataItem.fields,
({ name }) => name, ({ name }) => name,
@ -116,7 +110,7 @@ export const CalendarEventDetails = ({
</StyledCreatedAt> </StyledCreatedAt>
</StyledHeader> </StyledHeader>
<StyledFields> <StyledFields>
{Object.entries(fieldsToDisplay).map(([fieldName, fieldOverride]) => ( {fieldsToDisplay.map((fieldName) => (
<StyledPropertyBox key={fieldName}> <StyledPropertyBox key={fieldName}>
<FieldContext.Provider <FieldContext.Provider
value={{ value={{
@ -125,10 +119,7 @@ export const CalendarEventDetails = ({
recoilScopeId: `${calendarEvent.id}-${fieldName}`, recoilScopeId: `${calendarEvent.id}-${fieldName}`,
isLabelIdentifier: false, isLabelIdentifier: false,
fieldDefinition: formatFieldMetadataItemAsFieldDefinition({ fieldDefinition: formatFieldMetadataItemAsFieldDefinition({
field: { field: fieldsByName[fieldName],
...fieldsByName[fieldName],
...fieldOverride,
},
objectMetadataItem, objectMetadataItem,
showLabel: true, showLabel: true,
labelWidth: 72, labelWidth: 72,

View File

@ -1,6 +1,9 @@
// TODO: use backend CalendarEvent type when ready // TODO: use backend CalendarEvent type when ready
export type CalendarEvent = { export type CalendarEvent = {
conferenceUri?: string; conferenceLink?: {
label: string;
url: string;
};
description?: string; description?: string;
endsAt?: string; endsAt?: string;
externalCreatedAt: string; externalCreatedAt: string;

View File

@ -69,7 +69,10 @@ export const SettingsAccountsCalendars = () => {
isFullDay: false, isFullDay: false,
startsAt: exampleStartDate.toISOString(), startsAt: exampleStartDate.toISOString(),
conferenceSolution: '', conferenceSolution: '',
conferenceUri: '', conferenceLink: {
label: '',
url: '',
},
description: '', description: '',
isCanceled: false, isCanceled: false,
location: '', location: '',

View File

@ -1240,19 +1240,20 @@ const mockedCalendarEventsMetadata = {
node: { node: {
__typename: 'field', __typename: 'field',
id: '071d3b2a-9168-45bb-9a83-e840eb707d14', id: '071d3b2a-9168-45bb-9a83-e840eb707d14',
type: 'TEXT', type: FieldMetadataType.Link,
name: 'conferenceUri', name: 'conferenceLink',
label: 'Conference URI', label: 'Conference Link',
description: 'Conference URI', description: 'Conference Link',
icon: 'IconLink', icon: 'IconLink',
isCustom: false, isCustom: false,
isActive: true, isActive: true,
isSystem: true, isSystem: true,
isNullable: false, isNullable: true,
createdAt: '2024-03-15T13:39:09.965Z', createdAt: '2024-03-15T13:39:09.965Z',
updatedAt: '2024-03-15T13:39:09.965Z', updatedAt: '2024-03-15T13:39:09.965Z',
defaultValue: { defaultValue: {
value: '', label: 'https://zoom.us',
value: 'https://zoom.us',
}, },
options: null, options: null,
fromRelationMetadata: null, fromRelationMetadata: null,

View File

@ -22,7 +22,8 @@ export const seedCalendarEvents = async (
'location', 'location',
'iCalUID', 'iCalUID',
'conferenceSolution', 'conferenceSolution',
'conferenceUri', 'conferenceLinkLabel',
'conferenceLinkUrl',
'recurringEventExternalId', 'recurringEventExternalId',
]) ])
.orIgnore() .orIgnore()
@ -40,7 +41,8 @@ export const seedCalendarEvents = async (
location: 'Seattle', location: 'Seattle',
iCalUID: 'event1@calendar.com', iCalUID: 'event1@calendar.com',
conferenceSolution: 'Zoom', conferenceSolution: 'Zoom',
conferenceUri: 'https://zoom.us/j/1234567890', conferenceLinkLabel: 'https://zoom.us/j/1234567890',
conferenceLinkUrl: 'https://zoom.us/j/1234567890',
recurringEventExternalId: 'recurring1', recurringEventExternalId: 'recurring1',
}, },
]) ])

View File

@ -12,6 +12,15 @@ registerEnumType(TimelineCalendarEventVisibility, {
description: 'Visibility of the calendar event', description: 'Visibility of the calendar event',
}); });
@ObjectType('LinkMetadata')
export class LinkMetadata {
@Field()
label: string;
@Field()
url: string;
}
@ObjectType('TimelineCalendarEvent') @ObjectType('TimelineCalendarEvent')
export class TimelineCalendarEvent { export class TimelineCalendarEvent {
@Field(() => ID) @Field(() => ID)
@ -41,8 +50,8 @@ export class TimelineCalendarEvent {
@Field() @Field()
conferenceSolution: string; conferenceSolution: string;
@Field() @Field(() => LinkMetadata)
conferenceUri: string; conferenceLink: LinkMetadata;
@Field(() => [TimelineCalendarEventAttendee]) @Field(() => [TimelineCalendarEventAttendee])
attendees: TimelineCalendarEventAttendee[]; attendees: TimelineCalendarEventAttendee[];

View File

@ -214,7 +214,8 @@ export class TimelineCalendarEventService {
event.description = ''; event.description = '';
event.location = ''; event.location = '';
event.conferenceSolution = ''; event.conferenceSolution = '';
event.conferenceUri = ''; event.conferenceLink.label = '';
event.conferenceLink.url = '';
} }
}); });

View File

@ -94,7 +94,7 @@ export const calendarEventStandardFieldIds = {
location: '20202020-641a-4ffe-960d-c3c186d95b17', location: '20202020-641a-4ffe-960d-c3c186d95b17',
iCalUID: '20202020-f24b-45f4-b6a3-d2f9fcb98714', iCalUID: '20202020-f24b-45f4-b6a3-d2f9fcb98714',
conferenceSolution: '20202020-1c3f-4b5a-b526-5411a82179eb', conferenceSolution: '20202020-1c3f-4b5a-b526-5411a82179eb',
conferenceUri: '20202020-0fc5-490a-871a-2df8a45ab46c', conferenceLink: '20202020-35da-43ef-9ca0-e936e9dc237b',
recurringEventExternalId: '20202020-4b96-43d0-8156-4c7a9717635c', recurringEventExternalId: '20202020-4b96-43d0-8156-4c7a9717635c',
calendarChannelEventAssociations: '20202020-bdf8-4572-a2cc-ecbb6bcc3a02', calendarChannelEventAssociations: '20202020-bdf8-4572-a2cc-ecbb6bcc3a02',
eventAttendees: '20202020-e07e-4ccb-88f5-6f3d00458eec', eventAttendees: '20202020-e07e-4ccb-88f5-6f3d00458eec',

View File

@ -136,12 +136,13 @@ export class CalendarEventRepository {
location: 'text', location: 'text',
iCalUID: 'text', iCalUID: 'text',
conferenceSolution: 'text', conferenceSolution: 'text',
conferenceUri: 'text', conferenceLinkLabel: 'text',
conferenceLinkUrl: 'text',
recurringEventExternalId: 'text', recurringEventExternalId: 'text',
}); });
await this.workspaceDataSourceService.executeRawQuery( await this.workspaceDataSourceService.executeRawQuery(
`INSERT INTO ${dataSourceSchema}."calendarEvent" ("id", "title", "isCanceled", "isFullDay", "startsAt", "endsAt", "externalCreatedAt", "externalUpdatedAt", "description", "location", "iCalUID", "conferenceSolution", "conferenceUri", "recurringEventExternalId") VALUES ${valuesString}`, `INSERT INTO ${dataSourceSchema}."calendarEvent" ("id", "title", "isCanceled", "isFullDay", "startsAt", "endsAt", "externalCreatedAt", "externalUpdatedAt", "description", "location", "iCalUID", "conferenceSolution", "conferenceLinkLabel", "conferenceLinkUrl", "recurringEventExternalId") VALUES ${valuesString}`,
flattenedValues, flattenedValues,
workspaceId, workspaceId,
transactionManager, transactionManager,
@ -173,7 +174,8 @@ export class CalendarEventRepository {
location: 'text', location: 'text',
iCalUID: 'text', iCalUID: 'text',
conferenceSolution: 'text', conferenceSolution: 'text',
conferenceUri: 'text', conferenceLinkLabel: 'text',
conferenceLinkUrl: 'text',
recurringEventExternalId: 'text', recurringEventExternalId: 'text',
}); });
@ -189,10 +191,11 @@ export class CalendarEventRepository {
"description" = "newData"."description", "description" = "newData"."description",
"location" = "newData"."location", "location" = "newData"."location",
"conferenceSolution" = "newData"."conferenceSolution", "conferenceSolution" = "newData"."conferenceSolution",
"conferenceUri" = "newData"."conferenceUri", "conferenceLinkLabel" = "newData"."conferenceLinkLabel",
"conferenceLinkUrl" = "newData"."conferenceLinkUrl",
"recurringEventExternalId" = "newData"."recurringEventExternalId" "recurringEventExternalId" = "newData"."recurringEventExternalId"
FROM (VALUES ${valuesString}) FROM (VALUES ${valuesString})
AS "newData"("title", "isCanceled", "isFullDay", "startsAt", "endsAt", "externalCreatedAt", "externalUpdatedAt", "description", "location", "iCalUID", "conferenceSolution", "conferenceUri", "recurringEventExternalId") AS "newData"("title", "isCanceled", "isFullDay", "startsAt", "endsAt", "externalCreatedAt", "externalUpdatedAt", "description", "location", "iCalUID", "conferenceSolution", "conferenceLinkLabel", "conferenceLinkUrl", "recurringEventExternalId")
WHERE "calendarEvent"."iCalUID" = "newData"."iCalUID"`, WHERE "calendarEvent"."iCalUID" = "newData"."iCalUID"`,
flattenedValues, flattenedValues,
workspaceId, workspaceId,

View File

@ -15,6 +15,7 @@ import { CalendarEventAttendeeObjectMetadata } from 'src/modules/calendar/standa
import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator'; import { IsNullable } from 'src/engine/workspace-manager/workspace-sync-metadata/decorators/is-nullable.decorator';
import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids'; import { standardObjectIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { calendarEventStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids'; import { calendarEventStandardFieldIds } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { LinkMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/link.composite-type';
@ObjectMetadata({ @ObjectMetadata({
standardId: standardObjectIds.calendarEvent, standardId: standardObjectIds.calendarEvent,
@ -59,8 +60,8 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata {
@FieldMetadata({ @FieldMetadata({
standardId: calendarEventStandardFieldIds.startsAt, standardId: calendarEventStandardFieldIds.startsAt,
type: FieldMetadataType.DATE_TIME, type: FieldMetadataType.DATE_TIME,
label: 'Start DateTime', label: 'Start Date',
description: 'Start DateTime', description: 'Start Date',
icon: 'IconCalendarClock', icon: 'IconCalendarClock',
}) })
@IsNullable() @IsNullable()
@ -69,8 +70,8 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata {
@FieldMetadata({ @FieldMetadata({
standardId: calendarEventStandardFieldIds.endsAt, standardId: calendarEventStandardFieldIds.endsAt,
type: FieldMetadataType.DATE_TIME, type: FieldMetadataType.DATE_TIME,
label: 'End DateTime', label: 'End Date',
description: 'End DateTime', description: 'End Date',
icon: 'IconCalendarClock', icon: 'IconCalendarClock',
}) })
@IsNullable() @IsNullable()
@ -133,13 +134,14 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata {
conferenceSolution: string; conferenceSolution: string;
@FieldMetadata({ @FieldMetadata({
standardId: calendarEventStandardFieldIds.conferenceUri, standardId: calendarEventStandardFieldIds.conferenceLink,
type: FieldMetadataType.TEXT, type: FieldMetadataType.LINK,
label: 'Conference URI', label: 'Meet Link',
description: 'Conference URI', description: 'Meet Link',
icon: 'IconLink', icon: 'IconLink',
}) })
conferenceUri: string; @IsNullable()
conferenceLink: LinkMetadata;
@FieldMetadata({ @FieldMetadata({
standardId: calendarEventStandardFieldIds.recurringEventExternalId, standardId: calendarEventStandardFieldIds.recurringEventExternalId,

View File

@ -9,7 +9,11 @@ export type CalendarEvent = Omit<
| 'calendarChannelEventAssociations' | 'calendarChannelEventAssociations'
| 'calendarEventAttendees' | 'calendarEventAttendees'
| 'eventAttendees' | 'eventAttendees'
>; | 'conferenceLink'
> & {
conferenceLinkLabel: string;
conferenceLinkUrl: string;
};
export type CalendarEventAttendee = Omit< export type CalendarEventAttendee = Omit<
ObjectRecord<CalendarEventAttendeeObjectMetadata>, ObjectRecord<CalendarEventAttendeeObjectMetadata>,

View File

@ -37,7 +37,8 @@ export const formatGoogleCalendarEvent = (
iCalUID: event.iCalUID ?? '', iCalUID: event.iCalUID ?? '',
conferenceSolution: conferenceSolution:
event.conferenceData?.conferenceSolution?.key?.type ?? '', event.conferenceData?.conferenceSolution?.key?.type ?? '',
conferenceUri: event.conferenceData?.entryPoints?.[0]?.uri ?? '', conferenceLinkLabel: event.conferenceData?.entryPoints?.[0]?.uri ?? '',
conferenceLinkUrl: event.conferenceData?.entryPoints?.[0]?.uri ?? '',
recurringEventExternalId: event.recurringEventId ?? '', recurringEventExternalId: event.recurringEventId ?? '',
attendees: attendees:
event.attendees?.map((attendee) => ({ event.attendees?.map((attendee) => ({