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:
@ -22,7 +22,8 @@ export const seedCalendarEvents = async (
|
||||
'location',
|
||||
'iCalUID',
|
||||
'conferenceSolution',
|
||||
'conferenceUri',
|
||||
'conferenceLinkLabel',
|
||||
'conferenceLinkUrl',
|
||||
'recurringEventExternalId',
|
||||
])
|
||||
.orIgnore()
|
||||
@ -40,7 +41,8 @@ export const seedCalendarEvents = async (
|
||||
location: 'Seattle',
|
||||
iCalUID: 'event1@calendar.com',
|
||||
conferenceSolution: 'Zoom',
|
||||
conferenceUri: 'https://zoom.us/j/1234567890',
|
||||
conferenceLinkLabel: 'https://zoom.us/j/1234567890',
|
||||
conferenceLinkUrl: 'https://zoom.us/j/1234567890',
|
||||
recurringEventExternalId: 'recurring1',
|
||||
},
|
||||
])
|
||||
|
||||
@ -12,6 +12,15 @@ registerEnumType(TimelineCalendarEventVisibility, {
|
||||
description: 'Visibility of the calendar event',
|
||||
});
|
||||
|
||||
@ObjectType('LinkMetadata')
|
||||
export class LinkMetadata {
|
||||
@Field()
|
||||
label: string;
|
||||
|
||||
@Field()
|
||||
url: string;
|
||||
}
|
||||
|
||||
@ObjectType('TimelineCalendarEvent')
|
||||
export class TimelineCalendarEvent {
|
||||
@Field(() => ID)
|
||||
@ -41,8 +50,8 @@ export class TimelineCalendarEvent {
|
||||
@Field()
|
||||
conferenceSolution: string;
|
||||
|
||||
@Field()
|
||||
conferenceUri: string;
|
||||
@Field(() => LinkMetadata)
|
||||
conferenceLink: LinkMetadata;
|
||||
|
||||
@Field(() => [TimelineCalendarEventAttendee])
|
||||
attendees: TimelineCalendarEventAttendee[];
|
||||
|
||||
@ -214,7 +214,8 @@ export class TimelineCalendarEventService {
|
||||
event.description = '';
|
||||
event.location = '';
|
||||
event.conferenceSolution = '';
|
||||
event.conferenceUri = '';
|
||||
event.conferenceLink.label = '';
|
||||
event.conferenceLink.url = '';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ export const calendarEventStandardFieldIds = {
|
||||
location: '20202020-641a-4ffe-960d-c3c186d95b17',
|
||||
iCalUID: '20202020-f24b-45f4-b6a3-d2f9fcb98714',
|
||||
conferenceSolution: '20202020-1c3f-4b5a-b526-5411a82179eb',
|
||||
conferenceUri: '20202020-0fc5-490a-871a-2df8a45ab46c',
|
||||
conferenceLink: '20202020-35da-43ef-9ca0-e936e9dc237b',
|
||||
recurringEventExternalId: '20202020-4b96-43d0-8156-4c7a9717635c',
|
||||
calendarChannelEventAssociations: '20202020-bdf8-4572-a2cc-ecbb6bcc3a02',
|
||||
eventAttendees: '20202020-e07e-4ccb-88f5-6f3d00458eec',
|
||||
|
||||
@ -136,12 +136,13 @@ export class CalendarEventRepository {
|
||||
location: 'text',
|
||||
iCalUID: 'text',
|
||||
conferenceSolution: 'text',
|
||||
conferenceUri: 'text',
|
||||
conferenceLinkLabel: 'text',
|
||||
conferenceLinkUrl: 'text',
|
||||
recurringEventExternalId: 'text',
|
||||
});
|
||||
|
||||
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,
|
||||
workspaceId,
|
||||
transactionManager,
|
||||
@ -173,7 +174,8 @@ export class CalendarEventRepository {
|
||||
location: 'text',
|
||||
iCalUID: 'text',
|
||||
conferenceSolution: 'text',
|
||||
conferenceUri: 'text',
|
||||
conferenceLinkLabel: 'text',
|
||||
conferenceLinkUrl: 'text',
|
||||
recurringEventExternalId: 'text',
|
||||
});
|
||||
|
||||
@ -189,10 +191,11 @@ export class CalendarEventRepository {
|
||||
"description" = "newData"."description",
|
||||
"location" = "newData"."location",
|
||||
"conferenceSolution" = "newData"."conferenceSolution",
|
||||
"conferenceUri" = "newData"."conferenceUri",
|
||||
"conferenceLinkLabel" = "newData"."conferenceLinkLabel",
|
||||
"conferenceLinkUrl" = "newData"."conferenceLinkUrl",
|
||||
"recurringEventExternalId" = "newData"."recurringEventExternalId"
|
||||
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"`,
|
||||
flattenedValues,
|
||||
workspaceId,
|
||||
|
||||
@ -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 { 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 { LinkMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/link.composite-type';
|
||||
|
||||
@ObjectMetadata({
|
||||
standardId: standardObjectIds.calendarEvent,
|
||||
@ -59,8 +60,8 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
standardId: calendarEventStandardFieldIds.startsAt,
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'Start DateTime',
|
||||
description: 'Start DateTime',
|
||||
label: 'Start Date',
|
||||
description: 'Start Date',
|
||||
icon: 'IconCalendarClock',
|
||||
})
|
||||
@IsNullable()
|
||||
@ -69,8 +70,8 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata {
|
||||
@FieldMetadata({
|
||||
standardId: calendarEventStandardFieldIds.endsAt,
|
||||
type: FieldMetadataType.DATE_TIME,
|
||||
label: 'End DateTime',
|
||||
description: 'End DateTime',
|
||||
label: 'End Date',
|
||||
description: 'End Date',
|
||||
icon: 'IconCalendarClock',
|
||||
})
|
||||
@IsNullable()
|
||||
@ -133,13 +134,14 @@ export class CalendarEventObjectMetadata extends BaseObjectMetadata {
|
||||
conferenceSolution: string;
|
||||
|
||||
@FieldMetadata({
|
||||
standardId: calendarEventStandardFieldIds.conferenceUri,
|
||||
type: FieldMetadataType.TEXT,
|
||||
label: 'Conference URI',
|
||||
description: 'Conference URI',
|
||||
standardId: calendarEventStandardFieldIds.conferenceLink,
|
||||
type: FieldMetadataType.LINK,
|
||||
label: 'Meet Link',
|
||||
description: 'Meet Link',
|
||||
icon: 'IconLink',
|
||||
})
|
||||
conferenceUri: string;
|
||||
@IsNullable()
|
||||
conferenceLink: LinkMetadata;
|
||||
|
||||
@FieldMetadata({
|
||||
standardId: calendarEventStandardFieldIds.recurringEventExternalId,
|
||||
|
||||
@ -9,7 +9,11 @@ export type CalendarEvent = Omit<
|
||||
| 'calendarChannelEventAssociations'
|
||||
| 'calendarEventAttendees'
|
||||
| 'eventAttendees'
|
||||
>;
|
||||
| 'conferenceLink'
|
||||
> & {
|
||||
conferenceLinkLabel: string;
|
||||
conferenceLinkUrl: string;
|
||||
};
|
||||
|
||||
export type CalendarEventAttendee = Omit<
|
||||
ObjectRecord<CalendarEventAttendeeObjectMetadata>,
|
||||
|
||||
@ -37,7 +37,8 @@ export const formatGoogleCalendarEvent = (
|
||||
iCalUID: event.iCalUID ?? '',
|
||||
conferenceSolution:
|
||||
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 ?? '',
|
||||
attendees:
|
||||
event.attendees?.map((attendee) => ({
|
||||
|
||||
Reference in New Issue
Block a user