5622 add a syncemail onboarding step (#5689)
- add sync email onboarding step - refactor calendar and email visibility enums - add a new table `keyValuePair` in `core` schema - add a new resolved boolean field `skipSyncEmail` in current user https://github.com/twentyhq/twenty/assets/29927851/de791475-5bfe-47f9-8e90-76c349fba56f
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { addDays, subHours, subMonths } from 'date-fns';
|
||||
|
||||
import { CalendarEvent } from '@/activities/calendar/types/CalendarEvent';
|
||||
import { CalendarChannelVisibility } from '~/generated/graphql';
|
||||
|
||||
export const mockedCalendarEvents: CalendarEvent[] = [
|
||||
{
|
||||
@ -9,7 +10,7 @@ export const mockedCalendarEvents: CalendarEvent[] = [
|
||||
id: '9a6b35f1-6078-415b-9540-f62671bb81d0',
|
||||
isFullDay: false,
|
||||
startsAt: addDays(new Date().setHours(10, 0), 1).toISOString(),
|
||||
visibility: 'METADATA',
|
||||
visibility: CalendarChannelVisibility.Metadata,
|
||||
calendarEventParticipants: [
|
||||
{
|
||||
id: '1',
|
||||
@ -43,7 +44,7 @@ export const mockedCalendarEvents: CalendarEvent[] = [
|
||||
isFullDay: false,
|
||||
startsAt: new Date(new Date().setHours(18, 0)).toISOString(),
|
||||
title: 'Bug solving',
|
||||
visibility: 'SHARE_EVERYTHING',
|
||||
visibility: CalendarChannelVisibility.ShareEverything,
|
||||
__typename: 'CalendarEvent',
|
||||
},
|
||||
{
|
||||
@ -53,7 +54,7 @@ export const mockedCalendarEvents: CalendarEvent[] = [
|
||||
isFullDay: false,
|
||||
startsAt: new Date(new Date().setHours(15, 15)).toISOString(),
|
||||
title: 'Onboarding Follow-Up Call',
|
||||
visibility: 'SHARE_EVERYTHING',
|
||||
visibility: CalendarChannelVisibility.ShareEverything,
|
||||
__typename: 'CalendarEvent',
|
||||
},
|
||||
{
|
||||
@ -63,7 +64,7 @@ export const mockedCalendarEvents: CalendarEvent[] = [
|
||||
isFullDay: false,
|
||||
startsAt: new Date(new Date().setHours(10, 0)).toISOString(),
|
||||
title: 'Onboarding Call',
|
||||
visibility: 'SHARE_EVERYTHING',
|
||||
visibility: CalendarChannelVisibility.ShareEverything,
|
||||
__typename: 'CalendarEvent',
|
||||
},
|
||||
{
|
||||
@ -71,7 +72,7 @@ export const mockedCalendarEvents: CalendarEvent[] = [
|
||||
id: '5a792d11-259a-4099-af51-59eb85e15d83',
|
||||
isFullDay: true,
|
||||
startsAt: subMonths(new Date().setHours(8, 0), 1).toISOString(),
|
||||
visibility: 'METADATA',
|
||||
visibility: CalendarChannelVisibility.Metadata,
|
||||
__typename: 'CalendarEvent',
|
||||
},
|
||||
{
|
||||
@ -81,7 +82,7 @@ export const mockedCalendarEvents: CalendarEvent[] = [
|
||||
isFullDay: false,
|
||||
startsAt: subMonths(new Date().setHours(14, 0), 3).toISOString(),
|
||||
title: 'Alan x Garry',
|
||||
visibility: 'SHARE_EVERYTHING',
|
||||
visibility: CalendarChannelVisibility.ShareEverything,
|
||||
__typename: 'CalendarEvent',
|
||||
},
|
||||
];
|
||||
|
||||
@ -4,6 +4,7 @@ import {
|
||||
ObjectEdge,
|
||||
ObjectMetadataItemsQuery,
|
||||
} from '~/generated-metadata/graphql';
|
||||
import { CalendarChannelVisibility, MessageChannelVisibility } from "~/generated/graphql";
|
||||
|
||||
// This file is not designed to be manually edited.
|
||||
// It's an extract from the dev seeded environment metadata call
|
||||
@ -2924,20 +2925,20 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isNullable: false,
|
||||
createdAt: '2024-04-08T12:48:49.538Z',
|
||||
updatedAt: '2024-04-08T12:48:49.538Z',
|
||||
defaultValue: "'SHARE_EVERYTHING'",
|
||||
defaultValue: `'${CalendarChannelVisibility.ShareEverything}'`,
|
||||
options: [
|
||||
{
|
||||
id: 'b60eeb97-c67b-4d01-b647-1143d58ed49f',
|
||||
color: 'green',
|
||||
label: 'Metadata',
|
||||
value: 'METADATA',
|
||||
value: CalendarChannelVisibility.Metadata,
|
||||
position: 0,
|
||||
},
|
||||
{
|
||||
id: '7064c804-deb0-4f65-b7d6-3fe4df9a474c',
|
||||
color: 'orange',
|
||||
label: 'Share Everything',
|
||||
value: 'SHARE_EVERYTHING',
|
||||
value: CalendarChannelVisibility.ShareEverything,
|
||||
position: 1,
|
||||
},
|
||||
],
|
||||
@ -7044,27 +7045,27 @@ export const mockedStandardObjectMetadataQueryResult: ObjectMetadataItemsQuery =
|
||||
isNullable: false,
|
||||
createdAt: '2024-04-08T12:48:49.538Z',
|
||||
updatedAt: '2024-04-08T12:48:49.538Z',
|
||||
defaultValue: "'share_everything'",
|
||||
defaultValue: `'${MessageChannelVisibility.ShareEverything}'`,
|
||||
options: [
|
||||
{
|
||||
id: '112e7633-0451-4f7e-bc79-f988b78fabb8',
|
||||
color: 'green',
|
||||
label: 'Metadata',
|
||||
value: 'metadata',
|
||||
value: MessageChannelVisibility.Metadata,
|
||||
position: 0,
|
||||
},
|
||||
{
|
||||
id: '148143c4-882d-4c94-b8db-ead6f4581ab1',
|
||||
color: 'blue',
|
||||
label: 'Subject',
|
||||
value: 'subject',
|
||||
value: MessageChannelVisibility.Subject,
|
||||
position: 1,
|
||||
},
|
||||
{
|
||||
id: '9bf90844-93cf-4c0a-95e9-02f7d5fa397f',
|
||||
color: 'orange',
|
||||
label: 'Share Everything',
|
||||
value: 'share_everything',
|
||||
value: MessageChannelVisibility.ShareEverything,
|
||||
position: 2,
|
||||
},
|
||||
],
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
import {
|
||||
TimelineCalendarEvent,
|
||||
TimelineCalendarEventVisibility,
|
||||
} from '~/generated-metadata/graphql';
|
||||
import { CalendarChannelVisibility } from '~/generated/graphql';
|
||||
import { TimelineCalendarEvent } from '~/generated-metadata/graphql';
|
||||
|
||||
export const mockedTimelineCalendarEvents: TimelineCalendarEvent[] = [
|
||||
{
|
||||
@ -18,7 +16,7 @@ export const mockedTimelineCalendarEvents: TimelineCalendarEvent[] = [
|
||||
},
|
||||
conferenceSolution: 'GOOGLE_MEET',
|
||||
isCanceled: false,
|
||||
visibility: TimelineCalendarEventVisibility.ShareEverything,
|
||||
visibility: CalendarChannelVisibility.ShareEverything,
|
||||
isFullDay: false,
|
||||
participants: [
|
||||
{
|
||||
@ -58,7 +56,7 @@ export const mockedTimelineCalendarEvents: TimelineCalendarEvent[] = [
|
||||
},
|
||||
conferenceSolution: 'GOOGLE_MEET',
|
||||
isCanceled: false,
|
||||
visibility: TimelineCalendarEventVisibility.Metadata,
|
||||
visibility: CalendarChannelVisibility.Metadata,
|
||||
participants: [
|
||||
{
|
||||
__typename: 'TimelineCalendarEventParticipant',
|
||||
@ -87,7 +85,7 @@ export const mockedTimelineCalendarEvents: TimelineCalendarEvent[] = [
|
||||
},
|
||||
conferenceSolution: 'GOOGLE_MEET',
|
||||
isCanceled: false,
|
||||
visibility: TimelineCalendarEventVisibility.Metadata,
|
||||
visibility: CalendarChannelVisibility.Metadata,
|
||||
participants: [
|
||||
{
|
||||
__typename: 'TimelineCalendarEventParticipant',
|
||||
|
||||
@ -10,6 +10,7 @@ type MockedUser = Pick<
|
||||
| 'canImpersonate'
|
||||
| '__typename'
|
||||
| 'supportUserHash'
|
||||
| 'state'
|
||||
> & {
|
||||
workspaceMember: WorkspaceMember | null;
|
||||
locale: string;
|
||||
@ -92,6 +93,7 @@ export const mockedUsersData: Array<MockedUser> = [
|
||||
defaultWorkspace: mockDefaultWorkspace,
|
||||
locale: 'en',
|
||||
workspaces: [{ workspace: mockDefaultWorkspace }],
|
||||
state: { skipSyncEmailOnboardingStep: true },
|
||||
},
|
||||
{
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6c',
|
||||
@ -114,6 +116,7 @@ export const mockedUsersData: Array<MockedUser> = [
|
||||
defaultWorkspace: mockDefaultWorkspace,
|
||||
locale: 'en',
|
||||
workspaces: [{ workspace: mockDefaultWorkspace }],
|
||||
state: { skipSyncEmailOnboardingStep: true },
|
||||
},
|
||||
];
|
||||
|
||||
@ -140,6 +143,7 @@ export const mockedOnboardingUsersData: Array<MockedUser> = [
|
||||
defaultWorkspace: mockDefaultWorkspace,
|
||||
locale: 'en',
|
||||
workspaces: [{ workspace: mockDefaultWorkspace }],
|
||||
state: { skipSyncEmailOnboardingStep: true },
|
||||
},
|
||||
{
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d',
|
||||
@ -155,5 +159,6 @@ export const mockedOnboardingUsersData: Array<MockedUser> = [
|
||||
},
|
||||
locale: 'en',
|
||||
workspaces: [{ workspace: mockDefaultWorkspace }],
|
||||
state: { skipSyncEmailOnboardingStep: true },
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user