Chore: Duplicate certain user fields to workspaceMember (#1514)
* Move certain user fields to workspaceMember Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Merge main Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Update the generated GraphQL Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Update hooks Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Refactor according to review Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> * Rework typing * Fix tests * Remove console logs --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: chiazokam <chiazokamecheta@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,36 +1,29 @@
|
||||
import { HelmetProvider } from 'react-helmet-async';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { currentUserState } from '@/auth/states/currentUserState';
|
||||
import { ClientConfigProvider } from '@/client-config/components/ClientConfigProvider';
|
||||
import { UserProvider } from '@/users/components/UserProvider';
|
||||
import { App } from '~/App';
|
||||
import { FullHeightStorybookLayout } from '~/testing/FullHeightStorybookLayout';
|
||||
import { graphqlMocks } from '~/testing/graphqlMocks';
|
||||
import { mockedUsersData } from '~/testing/mock-data/users';
|
||||
|
||||
const MockedAuth: React.FC<React.PropsWithChildren> = ({ children }) => {
|
||||
const [, setCurrentUser] = useRecoilState(currentUserState);
|
||||
|
||||
setCurrentUser(mockedUsersData[0]);
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
const meta: Meta<typeof App> = {
|
||||
title: 'App/App',
|
||||
component: App,
|
||||
decorators: [
|
||||
(Story) => (
|
||||
<MemoryRouter>
|
||||
<FullHeightStorybookLayout>
|
||||
<MockedAuth>
|
||||
<HelmetProvider>
|
||||
<Story />
|
||||
</HelmetProvider>
|
||||
</MockedAuth>
|
||||
</FullHeightStorybookLayout>
|
||||
</MemoryRouter>
|
||||
<ClientConfigProvider>
|
||||
<UserProvider>
|
||||
<MemoryRouter>
|
||||
<FullHeightStorybookLayout>
|
||||
<HelmetProvider>
|
||||
<Story />
|
||||
</HelmetProvider>
|
||||
</FullHeightStorybookLayout>
|
||||
</MemoryRouter>
|
||||
</UserProvider>
|
||||
</ClientConfigProvider>
|
||||
),
|
||||
],
|
||||
parameters: {
|
||||
|
||||
@ -36,6 +36,10 @@ export type Activity = {
|
||||
title?: Maybe<Scalars['String']>;
|
||||
type: ActivityType;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
workspaceMemberAssignee?: Maybe<WorkspaceMember>;
|
||||
workspaceMemberAssigneeId?: Maybe<Scalars['String']>;
|
||||
workspaceMemberAuthor?: Maybe<WorkspaceMember>;
|
||||
workspaceMemberAuthorId?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type ActivityCreateInput = {
|
||||
@ -53,6 +57,8 @@ export type ActivityCreateInput = {
|
||||
title?: InputMaybe<Scalars['String']>;
|
||||
type?: InputMaybe<ActivityType>;
|
||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||
workspaceMemberAssignee?: InputMaybe<WorkspaceMemberCreateNestedOneWithoutAssignedActivitiesInput>;
|
||||
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberCreateNestedOneWithoutAuthoredActivitiesInput>;
|
||||
};
|
||||
|
||||
export type ActivityCreateNestedOneWithoutActivityTargetsInput = {
|
||||
@ -90,6 +96,10 @@ export type ActivityOrderByWithRelationInput = {
|
||||
title?: InputMaybe<SortOrder>;
|
||||
type?: InputMaybe<SortOrder>;
|
||||
updatedAt?: InputMaybe<SortOrder>;
|
||||
workspaceMemberAssignee?: InputMaybe<WorkspaceMemberOrderByWithRelationInput>;
|
||||
workspaceMemberAssigneeId?: InputMaybe<SortOrder>;
|
||||
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberOrderByWithRelationInput>;
|
||||
workspaceMemberAuthorId?: InputMaybe<SortOrder>;
|
||||
};
|
||||
|
||||
export type ActivityRelationFilter = {
|
||||
@ -110,7 +120,9 @@ export enum ActivityScalarFieldEnum {
|
||||
Title = 'title',
|
||||
Type = 'type',
|
||||
UpdatedAt = 'updatedAt',
|
||||
WorkspaceId = 'workspaceId'
|
||||
WorkspaceId = 'workspaceId',
|
||||
WorkspaceMemberAssigneeId = 'workspaceMemberAssigneeId',
|
||||
WorkspaceMemberAuthorId = 'workspaceMemberAuthorId'
|
||||
}
|
||||
|
||||
export type ActivityTarget = {
|
||||
@ -358,6 +370,8 @@ export type ActivityUpdateInput = {
|
||||
title?: InputMaybe<Scalars['String']>;
|
||||
type?: InputMaybe<ActivityType>;
|
||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||
workspaceMemberAssignee?: InputMaybe<WorkspaceMemberUpdateOneWithoutAssignedActivitiesNestedInput>;
|
||||
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberUpdateOneWithoutAuthoredActivitiesNestedInput>;
|
||||
};
|
||||
|
||||
export type ActivityUpdateManyWithoutAssigneeNestedInput = {
|
||||
@ -372,6 +386,18 @@ export type ActivityUpdateManyWithoutAuthorNestedInput = {
|
||||
set?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type ActivityUpdateManyWithoutWorkspaceMemberAssigneeNestedInput = {
|
||||
connect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
set?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type ActivityUpdateManyWithoutWorkspaceMemberAuthorNestedInput = {
|
||||
connect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
set?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type ActivityUpdateManyWithoutWorkspaceNestedInput = {
|
||||
connect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||
@ -398,6 +424,10 @@ export type ActivityWhereInput = {
|
||||
title?: InputMaybe<StringNullableFilter>;
|
||||
type?: InputMaybe<EnumActivityTypeFilter>;
|
||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||
workspaceMemberAssignee?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||
workspaceMemberAssigneeId?: InputMaybe<StringNullableFilter>;
|
||||
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||
workspaceMemberAuthorId?: InputMaybe<StringNullableFilter>;
|
||||
};
|
||||
|
||||
export type ActivityWhereUniqueInput = {
|
||||
@ -428,6 +458,8 @@ export type Attachment = {
|
||||
type: AttachmentType;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
workspace: Workspace;
|
||||
workspaceMemberAuthor?: Maybe<WorkspaceMember>;
|
||||
workspaceMemberAuthorId?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type AttachmentCreateNestedManyWithoutActivityInput = {
|
||||
@ -466,6 +498,12 @@ export type AttachmentUpdateManyWithoutAuthorNestedInput = {
|
||||
set?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type AttachmentUpdateManyWithoutWorkspaceMemberAuthorNestedInput = {
|
||||
connect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||
set?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type AttachmentUpdateManyWithoutWorkspaceNestedInput = {
|
||||
connect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||
@ -486,6 +524,8 @@ export type AttachmentWhereInput = {
|
||||
name?: InputMaybe<StringFilter>;
|
||||
type?: InputMaybe<EnumAttachmentTypeFilter>;
|
||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||
workspaceMemberAuthorId?: InputMaybe<StringNullableFilter>;
|
||||
};
|
||||
|
||||
export type AttachmentWhereUniqueInput = {
|
||||
@ -547,6 +587,8 @@ export type Comment = {
|
||||
createdAt: Scalars['DateTime'];
|
||||
id: Scalars['ID'];
|
||||
updatedAt: Scalars['DateTime'];
|
||||
workspaceMemberAuthor?: Maybe<WorkspaceMember>;
|
||||
workspaceMemberAuthorId?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type CommentCreateInput = {
|
||||
@ -557,6 +599,7 @@ export type CommentCreateInput = {
|
||||
createdAt?: InputMaybe<Scalars['DateTime']>;
|
||||
id?: InputMaybe<Scalars['String']>;
|
||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberCreateNestedOneWithoutCommentsInput>;
|
||||
};
|
||||
|
||||
export type CommentCreateNestedManyWithoutActivityInput = {
|
||||
@ -585,6 +628,12 @@ export type CommentUpdateManyWithoutAuthorNestedInput = {
|
||||
set?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type CommentUpdateManyWithoutWorkspaceMemberAuthorNestedInput = {
|
||||
connect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||
set?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type CommentUpdateManyWithoutWorkspaceNestedInput = {
|
||||
connect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||
@ -604,6 +653,8 @@ export type CommentWhereInput = {
|
||||
createdAt?: InputMaybe<DateTimeFilter>;
|
||||
id?: InputMaybe<StringFilter>;
|
||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||
workspaceMemberAuthorId?: InputMaybe<StringNullableFilter>;
|
||||
};
|
||||
|
||||
export type CommentWhereUniqueInput = {
|
||||
@ -631,6 +682,8 @@ export type Company = {
|
||||
name: Scalars['String'];
|
||||
people?: Maybe<Array<Person>>;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
workspaceMemberAccountOwner?: Maybe<WorkspaceMember>;
|
||||
workspaceMemberAccountOwnerId?: Maybe<Scalars['String']>;
|
||||
xUrl?: Maybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
@ -650,6 +703,7 @@ export type CompanyCreateInput = {
|
||||
name: Scalars['String'];
|
||||
people?: InputMaybe<PersonCreateNestedManyWithoutCompanyInput>;
|
||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||
workspaceMemberAccountOwner?: InputMaybe<WorkspaceMemberCreateNestedOneWithoutCompaniesInput>;
|
||||
xUrl?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
@ -665,6 +719,7 @@ export type CompanyCreateManyInput = {
|
||||
linkedinUrl?: InputMaybe<Scalars['String']>;
|
||||
name: Scalars['String'];
|
||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||
workspaceMemberAccountOwnerId?: InputMaybe<Scalars['String']>;
|
||||
xUrl?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
@ -707,6 +762,8 @@ export type CompanyOrderByWithRelationInput = {
|
||||
name?: InputMaybe<SortOrder>;
|
||||
people?: InputMaybe<PersonOrderByRelationAggregateInput>;
|
||||
updatedAt?: InputMaybe<SortOrder>;
|
||||
workspaceMemberAccountOwner?: InputMaybe<WorkspaceMemberOrderByWithRelationInput>;
|
||||
workspaceMemberAccountOwnerId?: InputMaybe<SortOrder>;
|
||||
xUrl?: InputMaybe<SortOrder>;
|
||||
};
|
||||
|
||||
@ -729,6 +786,7 @@ export enum CompanyScalarFieldEnum {
|
||||
Name = 'name',
|
||||
UpdatedAt = 'updatedAt',
|
||||
WorkspaceId = 'workspaceId',
|
||||
WorkspaceMemberAccountOwnerId = 'workspaceMemberAccountOwnerId',
|
||||
XUrl = 'xUrl'
|
||||
}
|
||||
|
||||
@ -748,6 +806,7 @@ export type CompanyUpdateInput = {
|
||||
name?: InputMaybe<Scalars['String']>;
|
||||
people?: InputMaybe<PersonUpdateManyWithoutCompanyNestedInput>;
|
||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||
workspaceMemberAccountOwner?: InputMaybe<WorkspaceMemberUpdateOneWithoutCompaniesNestedInput>;
|
||||
xUrl?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
@ -757,6 +816,12 @@ export type CompanyUpdateManyWithoutAccountOwnerNestedInput = {
|
||||
set?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type CompanyUpdateManyWithoutWorkspaceMemberAccountOwnerNestedInput = {
|
||||
connect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||
set?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type CompanyUpdateManyWithoutWorkspaceNestedInput = {
|
||||
connect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||
@ -793,6 +858,8 @@ export type CompanyWhereInput = {
|
||||
name?: InputMaybe<StringFilter>;
|
||||
people?: InputMaybe<PersonListRelationFilter>;
|
||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||
workspaceMemberAccountOwner?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||
workspaceMemberAccountOwnerId?: InputMaybe<StringNullableFilter>;
|
||||
xUrl?: InputMaybe<StringNullableFilter>;
|
||||
};
|
||||
|
||||
@ -921,6 +988,12 @@ export type FavoriteUpdateManyWithoutPersonNestedInput = {
|
||||
set?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type FavoriteUpdateManyWithoutWorkspaceMemberNestedInput = {
|
||||
connect?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
||||
set?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type FavoriteWhereInput = {
|
||||
AND?: InputMaybe<Array<FavoriteWhereInput>>;
|
||||
NOT?: InputMaybe<Array<FavoriteWhereInput>>;
|
||||
@ -988,6 +1061,7 @@ export type LoginToken = {
|
||||
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation';
|
||||
UpdateOneWorkspaceMember: WorkspaceMember;
|
||||
allowImpersonation: WorkspaceMember;
|
||||
challenge: LoginToken;
|
||||
createEvent: Analytics;
|
||||
@ -1044,6 +1118,12 @@ export type Mutation = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateOneWorkspaceMemberArgs = {
|
||||
data: WorkspaceMemberUpdateInput;
|
||||
where: WorkspaceMemberWhereUniqueInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationAllowImpersonationArgs = {
|
||||
allowImpersonation: Scalars['Boolean'];
|
||||
};
|
||||
@ -2334,6 +2414,7 @@ export enum UserScalarFieldEnum {
|
||||
|
||||
export type UserSettings = {
|
||||
__typename?: 'UserSettings';
|
||||
WorkspaceMember?: Maybe<Array<WorkspaceMember>>;
|
||||
colorScheme: ColorScheme;
|
||||
createdAt: Scalars['DateTime'];
|
||||
id: Scalars['ID'];
|
||||
@ -2343,6 +2424,7 @@ export type UserSettings = {
|
||||
};
|
||||
|
||||
export type UserSettingsOrderByWithRelationInput = {
|
||||
WorkspaceMember?: InputMaybe<WorkspaceMemberOrderByRelationAggregateInput>;
|
||||
colorScheme?: InputMaybe<SortOrder>;
|
||||
createdAt?: InputMaybe<SortOrder>;
|
||||
id?: InputMaybe<SortOrder>;
|
||||
@ -2360,7 +2442,13 @@ export type UserSettingsUpdateOneRequiredWithoutUserNestedInput = {
|
||||
update?: InputMaybe<UserSettingsUpdateWithoutUserInput>;
|
||||
};
|
||||
|
||||
export type UserSettingsUpdateOneWithoutWorkspaceMemberNestedInput = {
|
||||
connect?: InputMaybe<UserSettingsWhereUniqueInput>;
|
||||
disconnect?: InputMaybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type UserSettingsUpdateWithoutUserInput = {
|
||||
WorkspaceMember?: InputMaybe<WorkspaceMemberUpdateManyWithoutSettingsNestedInput>;
|
||||
colorScheme?: InputMaybe<ColorScheme>;
|
||||
createdAt?: InputMaybe<Scalars['DateTime']>;
|
||||
id?: InputMaybe<Scalars['String']>;
|
||||
@ -2372,6 +2460,7 @@ export type UserSettingsWhereInput = {
|
||||
AND?: InputMaybe<Array<UserSettingsWhereInput>>;
|
||||
NOT?: InputMaybe<Array<UserSettingsWhereInput>>;
|
||||
OR?: InputMaybe<Array<UserSettingsWhereInput>>;
|
||||
WorkspaceMember?: InputMaybe<WorkspaceMemberListRelationFilter>;
|
||||
colorScheme?: InputMaybe<EnumColorSchemeFilter>;
|
||||
createdAt?: InputMaybe<DateTimeFilter>;
|
||||
id?: InputMaybe<StringFilter>;
|
||||
@ -2380,6 +2469,10 @@ export type UserSettingsWhereInput = {
|
||||
user?: InputMaybe<UserRelationFilter>;
|
||||
};
|
||||
|
||||
export type UserSettingsWhereUniqueInput = {
|
||||
id?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type UserUpdateInput = {
|
||||
assignedActivities?: InputMaybe<ActivityUpdateManyWithoutAssigneeNestedInput>;
|
||||
authoredActivities?: InputMaybe<ActivityUpdateManyWithoutAuthorNestedInput>;
|
||||
@ -2407,6 +2500,10 @@ export type UserUpdateOneRequiredWithoutAuthoredActivitiesNestedInput = {
|
||||
connect?: InputMaybe<UserWhereUniqueInput>;
|
||||
};
|
||||
|
||||
export type UserUpdateOneRequiredWithoutWorkspaceMemberNestedInput = {
|
||||
connect?: InputMaybe<UserWhereUniqueInput>;
|
||||
};
|
||||
|
||||
export type UserUpdateOneWithoutAssignedActivitiesNestedInput = {
|
||||
connect?: InputMaybe<UserWhereUniqueInput>;
|
||||
disconnect?: InputMaybe<Scalars['Boolean']>;
|
||||
@ -2904,48 +3001,137 @@ export type WorkspaceMember = {
|
||||
__typename?: 'WorkspaceMember';
|
||||
Favorite?: Maybe<Array<Favorite>>;
|
||||
allowImpersonation: Scalars['Boolean'];
|
||||
assignedActivities?: Maybe<Array<Activity>>;
|
||||
authoredActivities?: Maybe<Array<Activity>>;
|
||||
authoredAttachments?: Maybe<Array<Attachment>>;
|
||||
comments?: Maybe<Array<Comment>>;
|
||||
companies?: Maybe<Array<Company>>;
|
||||
createdAt: Scalars['DateTime'];
|
||||
id: Scalars['ID'];
|
||||
settings?: Maybe<UserSettings>;
|
||||
settingsId?: Maybe<Scalars['String']>;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
user: User;
|
||||
userId: Scalars['String'];
|
||||
workspace: Workspace;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberCreateNestedOneWithoutAssignedActivitiesInput = {
|
||||
connect?: InputMaybe<WorkspaceMemberWhereUniqueInput>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberCreateNestedOneWithoutAuthoredActivitiesInput = {
|
||||
connect?: InputMaybe<WorkspaceMemberWhereUniqueInput>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberCreateNestedOneWithoutCommentsInput = {
|
||||
connect?: InputMaybe<WorkspaceMemberWhereUniqueInput>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberCreateNestedOneWithoutCompaniesInput = {
|
||||
connect?: InputMaybe<WorkspaceMemberWhereUniqueInput>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberListRelationFilter = {
|
||||
every?: InputMaybe<WorkspaceMemberWhereInput>;
|
||||
none?: InputMaybe<WorkspaceMemberWhereInput>;
|
||||
some?: InputMaybe<WorkspaceMemberWhereInput>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberOrderByRelationAggregateInput = {
|
||||
_count?: InputMaybe<SortOrder>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberOrderByWithRelationInput = {
|
||||
Favorite?: InputMaybe<FavoriteOrderByRelationAggregateInput>;
|
||||
allowImpersonation?: InputMaybe<SortOrder>;
|
||||
assignedActivities?: InputMaybe<ActivityOrderByRelationAggregateInput>;
|
||||
authoredActivities?: InputMaybe<ActivityOrderByRelationAggregateInput>;
|
||||
authoredAttachments?: InputMaybe<AttachmentOrderByRelationAggregateInput>;
|
||||
comments?: InputMaybe<CommentOrderByRelationAggregateInput>;
|
||||
companies?: InputMaybe<CompanyOrderByRelationAggregateInput>;
|
||||
createdAt?: InputMaybe<SortOrder>;
|
||||
id?: InputMaybe<SortOrder>;
|
||||
settings?: InputMaybe<UserSettingsOrderByWithRelationInput>;
|
||||
settingsId?: InputMaybe<SortOrder>;
|
||||
updatedAt?: InputMaybe<SortOrder>;
|
||||
user?: InputMaybe<UserOrderByWithRelationInput>;
|
||||
userId?: InputMaybe<SortOrder>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberRelationFilter = {
|
||||
is?: InputMaybe<WorkspaceMemberWhereInput>;
|
||||
isNot?: InputMaybe<WorkspaceMemberWhereInput>;
|
||||
};
|
||||
|
||||
export enum WorkspaceMemberScalarFieldEnum {
|
||||
AllowImpersonation = 'allowImpersonation',
|
||||
CreatedAt = 'createdAt',
|
||||
DeletedAt = 'deletedAt',
|
||||
Id = 'id',
|
||||
SettingsId = 'settingsId',
|
||||
UpdatedAt = 'updatedAt',
|
||||
UserId = 'userId',
|
||||
WorkspaceId = 'workspaceId'
|
||||
}
|
||||
|
||||
export type WorkspaceMemberUpdateInput = {
|
||||
Favorite?: InputMaybe<FavoriteUpdateManyWithoutWorkspaceMemberNestedInput>;
|
||||
allowImpersonation?: InputMaybe<Scalars['Boolean']>;
|
||||
assignedActivities?: InputMaybe<ActivityUpdateManyWithoutWorkspaceMemberAssigneeNestedInput>;
|
||||
authoredActivities?: InputMaybe<ActivityUpdateManyWithoutWorkspaceMemberAuthorNestedInput>;
|
||||
authoredAttachments?: InputMaybe<AttachmentUpdateManyWithoutWorkspaceMemberAuthorNestedInput>;
|
||||
comments?: InputMaybe<CommentUpdateManyWithoutWorkspaceMemberAuthorNestedInput>;
|
||||
companies?: InputMaybe<CompanyUpdateManyWithoutWorkspaceMemberAccountOwnerNestedInput>;
|
||||
createdAt?: InputMaybe<Scalars['DateTime']>;
|
||||
id?: InputMaybe<Scalars['String']>;
|
||||
settings?: InputMaybe<UserSettingsUpdateOneWithoutWorkspaceMemberNestedInput>;
|
||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||
user?: InputMaybe<UserUpdateOneRequiredWithoutWorkspaceMemberNestedInput>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberUpdateManyWithoutSettingsNestedInput = {
|
||||
connect?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
||||
set?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberUpdateManyWithoutWorkspaceNestedInput = {
|
||||
connect?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
||||
disconnect?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
||||
set?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberUpdateOneWithoutAssignedActivitiesNestedInput = {
|
||||
connect?: InputMaybe<WorkspaceMemberWhereUniqueInput>;
|
||||
disconnect?: InputMaybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberUpdateOneWithoutAuthoredActivitiesNestedInput = {
|
||||
connect?: InputMaybe<WorkspaceMemberWhereUniqueInput>;
|
||||
disconnect?: InputMaybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberUpdateOneWithoutCompaniesNestedInput = {
|
||||
connect?: InputMaybe<WorkspaceMemberWhereUniqueInput>;
|
||||
disconnect?: InputMaybe<Scalars['Boolean']>;
|
||||
};
|
||||
|
||||
export type WorkspaceMemberWhereInput = {
|
||||
AND?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
||||
Favorite?: InputMaybe<FavoriteListRelationFilter>;
|
||||
NOT?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
||||
OR?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
||||
allowImpersonation?: InputMaybe<BoolFilter>;
|
||||
assignedActivities?: InputMaybe<ActivityListRelationFilter>;
|
||||
authoredActivities?: InputMaybe<ActivityListRelationFilter>;
|
||||
authoredAttachments?: InputMaybe<AttachmentListRelationFilter>;
|
||||
comments?: InputMaybe<CommentListRelationFilter>;
|
||||
companies?: InputMaybe<CompanyListRelationFilter>;
|
||||
createdAt?: InputMaybe<DateTimeFilter>;
|
||||
id?: InputMaybe<StringFilter>;
|
||||
settings?: InputMaybe<UserSettingsRelationFilter>;
|
||||
settingsId?: InputMaybe<StringNullableFilter>;
|
||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||
user?: InputMaybe<UserRelationFilter>;
|
||||
userId?: InputMaybe<StringFilter>;
|
||||
@ -3072,7 +3258,7 @@ export type CreateEventMutationVariables = Exact<{
|
||||
|
||||
export type CreateEventMutation = { __typename?: 'Mutation', createEvent: { __typename?: 'Analytics', success: boolean } };
|
||||
|
||||
export type UserQueryFragmentFragment = { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } };
|
||||
export type UserQueryFragmentFragment = { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null }, assignedActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredAttachments?: Array<{ __typename?: 'Attachment', id: string, name: string, type: AttachmentType }> | null, settings?: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } | null, companies?: Array<{ __typename?: 'Company', id: string, name: string, domainName: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, body: string }> | null } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } };
|
||||
|
||||
export type ChallengeMutationVariables = Exact<{
|
||||
email: Scalars['String'];
|
||||
@ -3087,7 +3273,7 @@ export type ImpersonateMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
|
||||
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null }, assignedActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredAttachments?: Array<{ __typename?: 'Attachment', id: string, name: string, type: AttachmentType }> | null, settings?: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } | null, companies?: Array<{ __typename?: 'Company', id: string, name: string, domainName: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, body: string }> | null } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
|
||||
|
||||
export type RenewTokenMutationVariables = Exact<{
|
||||
refreshToken: Scalars['String'];
|
||||
@ -3110,7 +3296,7 @@ export type VerifyMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type VerifyMutation = { __typename?: 'Mutation', verify: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
|
||||
export type VerifyMutation = { __typename?: 'Mutation', verify: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, canImpersonate: boolean, supportUserHash?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null }, assignedActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredAttachments?: Array<{ __typename?: 'Attachment', id: string, name: string, type: AttachmentType }> | null, settings?: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } | null, companies?: Array<{ __typename?: 'Company', id: string, name: string, domainName: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, body: string }> | null } | null, settings: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
|
||||
|
||||
export type CheckUserExistsQueryVariables = Exact<{
|
||||
email: Scalars['String'];
|
||||
@ -3124,7 +3310,7 @@ export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, debugMode: boolean, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean }, telemetry: { __typename?: 'Telemetry', enabled: boolean, anonymizationEnabled: boolean }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null } } };
|
||||
|
||||
export type CompanyFieldsFragmentFragment = { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, xUrl?: string | null, annualRecurringRevenue?: number | null, idealCustomerProfile: boolean, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null };
|
||||
export type CompanyFieldsFragmentFragment = { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, xUrl?: string | null, annualRecurringRevenue?: number | null, idealCustomerProfile: boolean, id: string, name: string, _activityCount: number, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null };
|
||||
|
||||
export type DeleteManyCompaniesMutationVariables = Exact<{
|
||||
ids?: InputMaybe<Array<Scalars['String']> | Scalars['String']>;
|
||||
@ -3145,7 +3331,7 @@ export type InsertOneCompanyMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type InsertOneCompanyMutation = { __typename?: 'Mutation', createOneCompany: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, xUrl?: string | null, annualRecurringRevenue?: number | null, idealCustomerProfile: boolean, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } };
|
||||
export type InsertOneCompanyMutation = { __typename?: 'Mutation', createOneCompany: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, xUrl?: string | null, annualRecurringRevenue?: number | null, idealCustomerProfile: boolean, id: string, name: string, _activityCount: number, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } };
|
||||
|
||||
export type UpdateOneCompanyMutationVariables = Exact<{
|
||||
where: CompanyWhereUniqueInput;
|
||||
@ -3153,7 +3339,7 @@ export type UpdateOneCompanyMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type UpdateOneCompanyMutation = { __typename?: 'Mutation', updateOneCompany?: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, xUrl?: string | null, annualRecurringRevenue?: number | null, idealCustomerProfile: boolean, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } | null };
|
||||
export type UpdateOneCompanyMutation = { __typename?: 'Mutation', updateOneCompany?: { __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, xUrl?: string | null, annualRecurringRevenue?: number | null, idealCustomerProfile: boolean, id: string, name: string, _activityCount: number, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null } | null };
|
||||
|
||||
export type GetCompaniesQueryVariables = Exact<{
|
||||
orderBy?: InputMaybe<Array<CompanyOrderByWithRelationInput> | CompanyOrderByWithRelationInput>;
|
||||
@ -3393,7 +3579,7 @@ export type SearchCompanyQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type SearchCompanyQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, xUrl?: string | null, annualRecurringRevenue?: number | null, idealCustomerProfile: boolean, id: string, name: string, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null }> };
|
||||
export type SearchCompanyQuery = { __typename?: 'Query', searchResults: Array<{ __typename?: 'Company', address: string, createdAt: string, domainName: string, employees?: number | null, linkedinUrl?: string | null, xUrl?: string | null, annualRecurringRevenue?: number | null, idealCustomerProfile: boolean, id: string, name: string, _activityCount: number, accountOwner?: { __typename?: 'User', id: string, email: string, displayName: string, avatarUrl?: string | null } | null }> };
|
||||
|
||||
export type SearchPeopleQueryVariables = Exact<{
|
||||
where?: InputMaybe<PersonWhereInput>;
|
||||
@ -3445,12 +3631,12 @@ export type UpdateUserMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type UpdateUserMutation = { __typename?: 'Mutation', updateUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, locale: string, colorScheme: ColorScheme } } };
|
||||
export type UpdateUserMutation = { __typename?: 'Mutation', updateUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null }, assignedActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredAttachments?: Array<{ __typename?: 'Attachment', id: string, name: string, type: AttachmentType }> | null, settings?: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } | null, companies?: Array<{ __typename?: 'Company', id: string, name: string, domainName: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, body: string }> | null } | null, settings: { __typename?: 'UserSettings', id: string, locale: string, colorScheme: ColorScheme } } };
|
||||
|
||||
export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null } } | null, settings: { __typename?: 'UserSettings', id: string, locale: string, colorScheme: ColorScheme } } };
|
||||
export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, avatarUrl?: string | null, canImpersonate: boolean, supportUserHash?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null }, assignedActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredAttachments?: Array<{ __typename?: 'Attachment', id: string, name: string, type: AttachmentType }> | null, settings?: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } | null, companies?: Array<{ __typename?: 'Company', id: string, name: string, domainName: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, body: string }> | null } | null, settings: { __typename?: 'UserSettings', id: string, locale: string, colorScheme: ColorScheme } } };
|
||||
|
||||
export type GetUsersQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
@ -3598,6 +3784,14 @@ export type UploadWorkspaceLogoMutationVariables = Exact<{
|
||||
|
||||
export type UploadWorkspaceLogoMutation = { __typename?: 'Mutation', uploadWorkspaceLogo: string };
|
||||
|
||||
export type UpdateOneWorkspaceMemberMutationVariables = Exact<{
|
||||
data: WorkspaceMemberUpdateInput;
|
||||
where: WorkspaceMemberWhereUniqueInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type UpdateOneWorkspaceMemberMutation = { __typename?: 'Mutation', UpdateOneWorkspaceMember: { __typename?: 'WorkspaceMember', id: string, allowImpersonation: boolean, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null, inviteHash?: string | null }, assignedActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredActivities?: Array<{ __typename?: 'Activity', id: string, title?: string | null }> | null, authoredAttachments?: Array<{ __typename?: 'Attachment', id: string, name: string, type: AttachmentType }> | null, settings?: { __typename?: 'UserSettings', id: string, colorScheme: ColorScheme, locale: string } | null, companies?: Array<{ __typename?: 'Company', id: string, name: string, domainName: string }> | null, comments?: Array<{ __typename?: 'Comment', id: string, body: string }> | null } };
|
||||
|
||||
export type GetWorkspaceFromInviteHashQueryVariables = Exact<{
|
||||
inviteHash: Scalars['String'];
|
||||
}>;
|
||||
@ -3605,7 +3799,9 @@ export type GetWorkspaceFromInviteHashQueryVariables = Exact<{
|
||||
|
||||
export type GetWorkspaceFromInviteHashQuery = { __typename?: 'Query', findWorkspaceFromInviteHash: { __typename?: 'Workspace', id: string, displayName?: string | null, logo?: string | null } };
|
||||
|
||||
export type GetWorkspaceMembersQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
export type GetWorkspaceMembersQueryVariables = Exact<{
|
||||
where?: InputMaybe<WorkspaceMemberWhereInput>;
|
||||
}>;
|
||||
|
||||
|
||||
export type GetWorkspaceMembersQuery = { __typename?: 'Query', workspaceMembers: Array<{ __typename?: 'WorkspaceMember', id: string, user: { __typename?: 'User', id: string, email: string, avatarUrl?: string | null, firstName?: string | null, lastName?: string | null, displayName: string } }> };
|
||||
@ -3698,6 +3894,33 @@ export const UserQueryFragmentFragmentDoc = gql`
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
settings {
|
||||
id
|
||||
@ -3724,6 +3947,7 @@ export const CompanyFieldsFragmentFragmentDoc = gql`
|
||||
idealCustomerProfile
|
||||
id
|
||||
name
|
||||
_activityCount
|
||||
}
|
||||
`;
|
||||
export const PersonFieldsFragmentFragmentDoc = gql`
|
||||
@ -6138,6 +6362,33 @@ export const UpdateUserDocument = gql`
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
settings {
|
||||
id
|
||||
@ -6194,6 +6445,33 @@ export const GetCurrentUserDocument = gql`
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
settings {
|
||||
id
|
||||
@ -6965,6 +7243,75 @@ export function useUploadWorkspaceLogoMutation(baseOptions?: Apollo.MutationHook
|
||||
export type UploadWorkspaceLogoMutationHookResult = ReturnType<typeof useUploadWorkspaceLogoMutation>;
|
||||
export type UploadWorkspaceLogoMutationResult = Apollo.MutationResult<UploadWorkspaceLogoMutation>;
|
||||
export type UploadWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions<UploadWorkspaceLogoMutation, UploadWorkspaceLogoMutationVariables>;
|
||||
export const UpdateOneWorkspaceMemberDocument = gql`
|
||||
mutation UpdateOneWorkspaceMember($data: WorkspaceMemberUpdateInput!, $where: WorkspaceMemberWhereUniqueInput!) {
|
||||
UpdateOneWorkspaceMember(data: $data, where: $where) {
|
||||
id
|
||||
allowImpersonation
|
||||
workspace {
|
||||
id
|
||||
domainName
|
||||
displayName
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
export type UpdateOneWorkspaceMemberMutationFn = Apollo.MutationFunction<UpdateOneWorkspaceMemberMutation, UpdateOneWorkspaceMemberMutationVariables>;
|
||||
|
||||
/**
|
||||
* __useUpdateOneWorkspaceMemberMutation__
|
||||
*
|
||||
* To run a mutation, you first call `useUpdateOneWorkspaceMemberMutation` within a React component and pass it any options that fit your needs.
|
||||
* When your component renders, `useUpdateOneWorkspaceMemberMutation` returns a tuple that includes:
|
||||
* - A mutate function that you can call at any time to execute the mutation
|
||||
* - An object with fields that represent the current status of the mutation's execution
|
||||
*
|
||||
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
|
||||
*
|
||||
* @example
|
||||
* const [updateOneWorkspaceMemberMutation, { data, loading, error }] = useUpdateOneWorkspaceMemberMutation({
|
||||
* variables: {
|
||||
* data: // value for 'data'
|
||||
* where: // value for 'where'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useUpdateOneWorkspaceMemberMutation(baseOptions?: Apollo.MutationHookOptions<UpdateOneWorkspaceMemberMutation, UpdateOneWorkspaceMemberMutationVariables>) {
|
||||
const options = {...defaultOptions, ...baseOptions}
|
||||
return Apollo.useMutation<UpdateOneWorkspaceMemberMutation, UpdateOneWorkspaceMemberMutationVariables>(UpdateOneWorkspaceMemberDocument, options);
|
||||
}
|
||||
export type UpdateOneWorkspaceMemberMutationHookResult = ReturnType<typeof useUpdateOneWorkspaceMemberMutation>;
|
||||
export type UpdateOneWorkspaceMemberMutationResult = Apollo.MutationResult<UpdateOneWorkspaceMemberMutation>;
|
||||
export type UpdateOneWorkspaceMemberMutationOptions = Apollo.BaseMutationOptions<UpdateOneWorkspaceMemberMutation, UpdateOneWorkspaceMemberMutationVariables>;
|
||||
export const GetWorkspaceFromInviteHashDocument = gql`
|
||||
query GetWorkspaceFromInviteHash($inviteHash: String!) {
|
||||
findWorkspaceFromInviteHash(inviteHash: $inviteHash) {
|
||||
@ -7003,8 +7350,8 @@ export type GetWorkspaceFromInviteHashQueryHookResult = ReturnType<typeof useGet
|
||||
export type GetWorkspaceFromInviteHashLazyQueryHookResult = ReturnType<typeof useGetWorkspaceFromInviteHashLazyQuery>;
|
||||
export type GetWorkspaceFromInviteHashQueryResult = Apollo.QueryResult<GetWorkspaceFromInviteHashQuery, GetWorkspaceFromInviteHashQueryVariables>;
|
||||
export const GetWorkspaceMembersDocument = gql`
|
||||
query GetWorkspaceMembers {
|
||||
workspaceMembers: findManyWorkspaceMember {
|
||||
query GetWorkspaceMembers($where: WorkspaceMemberWhereInput) {
|
||||
workspaceMembers: findManyWorkspaceMember(where: $where) {
|
||||
id
|
||||
user {
|
||||
id
|
||||
@ -7030,6 +7377,7 @@ export const GetWorkspaceMembersDocument = gql`
|
||||
* @example
|
||||
* const { data, loading, error } = useGetWorkspaceMembersQuery({
|
||||
* variables: {
|
||||
* where: // value for 'where'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
|
||||
@ -9,6 +9,7 @@ import { Entity } from '@/ui/input/relation-picker/types/EntityTypeForSelect';
|
||||
import { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState';
|
||||
import {
|
||||
Activity,
|
||||
useGetWorkspaceMembersLazyQuery,
|
||||
User,
|
||||
useSearchUserQuery,
|
||||
useUpdateActivityMutation,
|
||||
@ -38,6 +39,7 @@ export function ActivityAssigneePicker({
|
||||
relationPickerSearchFilterScopedState,
|
||||
);
|
||||
const [updateActivity] = useUpdateActivityMutation();
|
||||
const [getWorkspaceMember] = useGetWorkspaceMembersLazyQuery();
|
||||
|
||||
const users = useFilteredSearchEntityQuery({
|
||||
queryHook: useSearchUserQuery,
|
||||
@ -66,15 +68,28 @@ export function ActivityAssigneePicker({
|
||||
fragment: ACTIVITY_UPDATE_FRAGMENT,
|
||||
});
|
||||
|
||||
function handleEntitySelected(
|
||||
async function handleEntitySelected(
|
||||
selectedUser: UserForSelect | null | undefined,
|
||||
) {
|
||||
if (selectedUser) {
|
||||
const workspaceMemberAssignee = (
|
||||
await getWorkspaceMember({
|
||||
variables: {
|
||||
where: {
|
||||
userId: { equals: selectedUser.id },
|
||||
},
|
||||
},
|
||||
})
|
||||
).data?.workspaceMembers?.[0];
|
||||
|
||||
updateActivity({
|
||||
variables: {
|
||||
where: { id: activity.id },
|
||||
data: {
|
||||
assignee: { connect: { id: selectedUser.id } },
|
||||
workspaceMemberAssignee: {
|
||||
connect: { id: workspaceMemberAssignee?.id },
|
||||
},
|
||||
},
|
||||
},
|
||||
optimisticResponse: {
|
||||
|
||||
@ -48,7 +48,13 @@ export function useOpenCreateActivityDrawer() {
|
||||
createdAt: now,
|
||||
updatedAt: now,
|
||||
author: { connect: { id: currentUser?.id ?? '' } },
|
||||
workspaceMemberAuthor: {
|
||||
connect: { id: currentUser?.workspaceMember?.id ?? '' },
|
||||
},
|
||||
assignee: { connect: { id: assigneeId ?? currentUser?.id ?? '' } },
|
||||
workspaceMemberAssignee: {
|
||||
connect: { id: currentUser?.workspaceMember?.id ?? '' },
|
||||
},
|
||||
type: type,
|
||||
activityTargets: {
|
||||
createMany: {
|
||||
|
||||
@ -20,6 +20,33 @@ export const USER_QUERY_FRAGMENT = gql`
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
settings {
|
||||
id
|
||||
|
||||
@ -60,7 +60,21 @@ export function useAuth() {
|
||||
throw new Error('No verify result');
|
||||
}
|
||||
|
||||
setCurrentUser(verifyResult.data?.verify.user);
|
||||
if (!verifyResult.data?.verify.user.workspaceMember) {
|
||||
throw new Error('No workspace member');
|
||||
}
|
||||
|
||||
if (!verifyResult.data?.verify.user.workspaceMember.settings) {
|
||||
throw new Error('No settings');
|
||||
}
|
||||
|
||||
setCurrentUser({
|
||||
...verifyResult.data?.verify.user,
|
||||
workspaceMember: {
|
||||
...verifyResult.data?.verify.user.workspaceMember,
|
||||
settings: verifyResult.data?.verify.user.workspaceMember.settings,
|
||||
},
|
||||
});
|
||||
setTokenPair(verifyResult.data?.verify.tokens);
|
||||
|
||||
return verifyResult.data?.verify;
|
||||
|
||||
@ -1,8 +1,32 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
import { GetCurrentUserQuery } from '~/generated/graphql';
|
||||
import {
|
||||
User,
|
||||
UserSettings,
|
||||
Workspace,
|
||||
WorkspaceMember,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
export type CurrentUser = GetCurrentUserQuery['currentUser'];
|
||||
export type CurrentUser = Pick<
|
||||
User,
|
||||
| 'id'
|
||||
| 'email'
|
||||
| 'displayName'
|
||||
| 'firstName'
|
||||
| 'lastName'
|
||||
| 'avatarUrl'
|
||||
| 'canImpersonate'
|
||||
| 'supportUserHash'
|
||||
> & {
|
||||
workspaceMember: Pick<WorkspaceMember, 'id' | 'allowImpersonation'> & {
|
||||
workspace: Pick<
|
||||
Workspace,
|
||||
'id' | 'displayName' | 'domainName' | 'inviteHash' | 'logo'
|
||||
>;
|
||||
settings: Pick<UserSettings, 'id' | 'colorScheme' | 'locale'>;
|
||||
};
|
||||
settings: Pick<UserSettings, 'id' | 'colorScheme' | 'locale'>;
|
||||
};
|
||||
|
||||
export const currentUserState = atom<CurrentUser | null>({
|
||||
key: 'currentUserState',
|
||||
|
||||
@ -15,6 +15,7 @@ import { useTableViews } from '@/views/hooks/useTableViews';
|
||||
import {
|
||||
UpdateOneCompanyMutationVariables,
|
||||
useGetCompaniesQuery,
|
||||
useGetWorkspaceMembersLazyQuery,
|
||||
useUpdateOneCompanyMutation,
|
||||
} from '~/generated/graphql';
|
||||
import { companiesFilters } from '~/pages/companies/companies-filters';
|
||||
@ -33,6 +34,7 @@ export function CompanyTable() {
|
||||
const [updateEntityMutation] = useUpdateOneCompanyMutation();
|
||||
const upsertEntityTableItem = useUpsertEntityTableItem();
|
||||
|
||||
const [getWorkspaceMember] = useGetWorkspaceMembersLazyQuery();
|
||||
const { createView, deleteView, submitCurrentView, updateView } =
|
||||
useTableViews({
|
||||
objectId: 'company',
|
||||
@ -44,6 +46,40 @@ export function CompanyTable() {
|
||||
const { setContextMenuEntries } = useCompanyTableContextMenuEntries();
|
||||
const { setActionBarEntries } = useCompanyTableActionBarEntries();
|
||||
|
||||
async function updateCompany(variables: UpdateOneCompanyMutationVariables) {
|
||||
const workspaceMemberAccountOwner = variables.data.accountOwner
|
||||
? (
|
||||
await getWorkspaceMember({
|
||||
variables: {
|
||||
where: {
|
||||
userId: { equals: variables.data.accountOwner.connect?.id },
|
||||
},
|
||||
},
|
||||
})
|
||||
).data?.workspaceMembers?.[0]
|
||||
: undefined;
|
||||
|
||||
const data = {
|
||||
...variables.data,
|
||||
workspaceMemberAccountOwner: {
|
||||
connect: { id: workspaceMemberAccountOwner?.id },
|
||||
},
|
||||
};
|
||||
|
||||
updateEntityMutation({
|
||||
variables: {
|
||||
...variables,
|
||||
data,
|
||||
},
|
||||
onCompleted: (data) => {
|
||||
if (!data.updateOneCompany) {
|
||||
return;
|
||||
}
|
||||
upsertEntityTableItem(data.updateOneCompany);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<EntityTableEffect
|
||||
@ -75,17 +111,7 @@ export function CompanyTable() {
|
||||
variables,
|
||||
}: {
|
||||
variables: UpdateOneCompanyMutationVariables;
|
||||
}) =>
|
||||
updateEntityMutation({
|
||||
variables,
|
||||
onCompleted: (data) => {
|
||||
if (!data.updateOneCompany) {
|
||||
return;
|
||||
}
|
||||
upsertEntityTableItem(data.updateOneCompany);
|
||||
},
|
||||
})
|
||||
}
|
||||
}) => updateCompany(variables)}
|
||||
/>
|
||||
</ViewBarContext.Provider>
|
||||
</>
|
||||
|
||||
@ -2,20 +2,36 @@ import { useCallback } from 'react';
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { currentUserState } from '@/auth/states/currentUserState';
|
||||
import { ColorScheme, useUpdateUserMutation } from '~/generated/graphql';
|
||||
import {
|
||||
ColorScheme,
|
||||
useUpdateOneWorkspaceMemberMutation,
|
||||
useUpdateUserMutation,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
export function useColorScheme() {
|
||||
const [currentUser, setCurrentUser] = useRecoilState(currentUserState);
|
||||
|
||||
const [updateUser] = useUpdateUserMutation();
|
||||
const [updateWorkspaceMember] = useUpdateOneWorkspaceMemberMutation();
|
||||
|
||||
const colorScheme = !currentUser?.settings?.colorScheme
|
||||
? ColorScheme.System
|
||||
: currentUser.settings.colorScheme;
|
||||
const colorScheme =
|
||||
!currentUser?.workspaceMember.settings?.colorScheme &&
|
||||
!currentUser?.settings?.colorScheme
|
||||
? ColorScheme.System
|
||||
: currentUser.workspaceMember.settings?.colorScheme ??
|
||||
currentUser.settings.colorScheme;
|
||||
|
||||
const setColorScheme = useCallback(
|
||||
async (value: ColorScheme) => {
|
||||
try {
|
||||
// connect settings to workspace member if not already connected
|
||||
await updateWorkspaceMember({
|
||||
variables: {
|
||||
where: { id: currentUser?.workspaceMember.id },
|
||||
data: { settings: { connect: { id: currentUser?.settings.id } } },
|
||||
},
|
||||
});
|
||||
|
||||
const result = await updateUser({
|
||||
variables: {
|
||||
where: {
|
||||
@ -29,13 +45,14 @@ export function useColorScheme() {
|
||||
},
|
||||
},
|
||||
},
|
||||
optimisticResponse:
|
||||
currentUser && currentUser.settings
|
||||
? {
|
||||
__typename: 'Mutation',
|
||||
updateUser: {
|
||||
__typename: 'User',
|
||||
...currentUser,
|
||||
optimisticResponse: currentUser
|
||||
? {
|
||||
__typename: 'Mutation',
|
||||
updateUser: {
|
||||
__typename: 'User',
|
||||
...currentUser,
|
||||
workspaceMember: {
|
||||
...currentUser.workspaceMember,
|
||||
settings: {
|
||||
__typename: 'UserSettings',
|
||||
id: currentUser.settings.id,
|
||||
@ -43,15 +60,34 @@ export function useColorScheme() {
|
||||
locale: currentUser.settings.locale,
|
||||
},
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
settings: {
|
||||
__typename: 'UserSettings',
|
||||
id: currentUser.settings.id,
|
||||
colorScheme: value,
|
||||
locale: currentUser.settings.locale,
|
||||
},
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
update: (_cache, { data }) => {
|
||||
if (data?.updateUser && currentUser) {
|
||||
if (
|
||||
data?.updateUser.workspaceMember?.settings?.colorScheme &&
|
||||
currentUser
|
||||
) {
|
||||
setCurrentUser({
|
||||
...currentUser,
|
||||
workspaceMember: {
|
||||
...currentUser.workspaceMember,
|
||||
settings: {
|
||||
...currentUser.workspaceMember.settings,
|
||||
colorScheme:
|
||||
data.updateUser.workspaceMember.settings.colorScheme,
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
...currentUser.settings,
|
||||
colorScheme: data?.updateUser.settings.colorScheme,
|
||||
colorScheme:
|
||||
data.updateUser.workspaceMember.settings.colorScheme,
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -63,7 +99,7 @@ export function useColorScheme() {
|
||||
}
|
||||
} catch (err) {}
|
||||
},
|
||||
[currentUser, updateUser, setCurrentUser],
|
||||
[updateWorkspaceMember, currentUser, updateUser, setCurrentUser],
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@ -14,8 +14,14 @@ export function UserProvider({ children }: React.PropsWithChildren) {
|
||||
if (!loading) {
|
||||
setIsLoading(false);
|
||||
}
|
||||
if (data?.currentUser) {
|
||||
setCurrentUser(data?.currentUser);
|
||||
if (data?.currentUser?.workspaceMember?.settings) {
|
||||
setCurrentUser({
|
||||
...data.currentUser,
|
||||
workspaceMember: {
|
||||
...data.currentUser.workspaceMember,
|
||||
settings: data.currentUser.workspaceMember.settings,
|
||||
},
|
||||
});
|
||||
}
|
||||
}, [setCurrentUser, data, isLoading, loading]);
|
||||
|
||||
|
||||
@ -18,6 +18,33 @@ export const UPDATE_USER = gql`
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
settings {
|
||||
id
|
||||
|
||||
@ -20,6 +20,33 @@ export const GET_CURRENT_USER = gql`
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
settings {
|
||||
id
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const UPDATE_WORKSPACE_MEMBER = gql`
|
||||
mutation UpdateOneWorkspaceMember(
|
||||
$data: WorkspaceMemberUpdateInput!
|
||||
$where: WorkspaceMemberWhereUniqueInput!
|
||||
) {
|
||||
UpdateOneWorkspaceMember(data: $data, where: $where) {
|
||||
id
|
||||
allowImpersonation
|
||||
workspace {
|
||||
id
|
||||
domainName
|
||||
displayName
|
||||
logo
|
||||
inviteHash
|
||||
}
|
||||
assignedActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredActivities {
|
||||
id
|
||||
title
|
||||
}
|
||||
authoredAttachments {
|
||||
id
|
||||
name
|
||||
type
|
||||
}
|
||||
settings {
|
||||
id
|
||||
colorScheme
|
||||
locale
|
||||
}
|
||||
companies {
|
||||
id
|
||||
name
|
||||
domainName
|
||||
}
|
||||
comments {
|
||||
id
|
||||
body
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1,8 +1,8 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_WORKSPACE_MEMBERS = gql`
|
||||
query GetWorkspaceMembers {
|
||||
workspaceMembers: findManyWorkspaceMember {
|
||||
query GetWorkspaceMembers($where: WorkspaceMemberWhereInput) {
|
||||
workspaceMembers: findManyWorkspaceMember(where: $where) {
|
||||
id
|
||||
user {
|
||||
id
|
||||
|
||||
@ -38,7 +38,22 @@ export function ImpersonateEffect() {
|
||||
throw new Error('No impersonate result');
|
||||
}
|
||||
|
||||
setCurrentUser(impersonateResult.data?.impersonate.user);
|
||||
if (!impersonateResult.data?.impersonate.user.workspaceMember) {
|
||||
throw new Error('No workspace member');
|
||||
}
|
||||
|
||||
if (!impersonateResult.data?.impersonate.user.workspaceMember.settings) {
|
||||
throw new Error('No workspace member settings');
|
||||
}
|
||||
|
||||
setCurrentUser({
|
||||
...impersonateResult.data.impersonate.user,
|
||||
workspaceMember: {
|
||||
...impersonateResult.data.impersonate.user.workspaceMember,
|
||||
settings:
|
||||
impersonateResult.data.impersonate.user.workspaceMember.settings,
|
||||
},
|
||||
});
|
||||
setTokenPair(impersonateResult.data?.impersonate.tokens);
|
||||
|
||||
return impersonateResult.data?.impersonate;
|
||||
|
||||
@ -1,6 +1,38 @@
|
||||
import { ColorScheme, GetCurrentUserQuery } from '~/generated/graphql';
|
||||
import {
|
||||
ColorScheme,
|
||||
User,
|
||||
UserSettings,
|
||||
Workspace,
|
||||
WorkspaceMember,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
type MockedUser = GetCurrentUserQuery['currentUser'];
|
||||
type MockedUser = Pick<
|
||||
User,
|
||||
| 'id'
|
||||
| 'email'
|
||||
| 'displayName'
|
||||
| 'firstName'
|
||||
| 'lastName'
|
||||
| 'avatarUrl'
|
||||
| 'canImpersonate'
|
||||
| 'supportUserHash'
|
||||
| '__typename'
|
||||
> & {
|
||||
workspaceMember: Pick<
|
||||
WorkspaceMember,
|
||||
'id' | 'allowImpersonation' | '__typename'
|
||||
> & {
|
||||
workspace: Pick<
|
||||
Workspace,
|
||||
'id' | 'displayName' | 'domainName' | 'inviteHash' | 'logo' | '__typename'
|
||||
>;
|
||||
settings: Pick<
|
||||
UserSettings,
|
||||
'id' | 'colorScheme' | 'locale' | '__typename'
|
||||
>;
|
||||
};
|
||||
settings: Pick<UserSettings, 'id' | 'colorScheme' | 'locale' | '__typename'>;
|
||||
};
|
||||
|
||||
export const avatarUrl =
|
||||
'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAYABgAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABgAAAAAQAAAGAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABSgAwAEAAAAAQAAABQAAAAA/8AAEQgAFAAUAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/bAEMACwgICggHCwoJCg0MCw0RHBIRDw8RIhkaFBwpJCsqKCQnJy0yQDctMD0wJyc4TDk9Q0VISUgrNk9VTkZUQEdIRf/bAEMBDA0NEQ8RIRISIUUuJy5FRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRf/dAAQAAv/aAAwDAQACEQMRAD8Ava1q728otYY98joSCTgZrnbXWdTtrhrfVZXWLafmcAEkdgR/hVltQku9Q8+OIEBcGOT+ID0PY1ka1KH2u8ToqnPLbmIqG7u6LtbQ7RXBRec4Uck9eKXcPWsKDWVnhWSL5kYcFelSf2m3901POh8jP//QoyIAnTuKpXsY82NsksUyWPU5q/L9z8RVK++/F/uCsVsaEURwgA4HtT9x9TUcf3KfUGh//9k=';
|
||||
@ -30,6 +62,12 @@ export const mockedUsersData: Array<MockedUser> = [
|
||||
inviteHash: 'twenty.com-invite-hash',
|
||||
logo: workspaceLogoUrl,
|
||||
},
|
||||
settings: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||
__typename: 'UserSettings',
|
||||
locale: 'en',
|
||||
colorScheme: ColorScheme.System,
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||
@ -59,6 +97,12 @@ export const mockedUsersData: Array<MockedUser> = [
|
||||
inviteHash: 'twenty.com-invite-hash',
|
||||
logo: workspaceLogoUrl,
|
||||
},
|
||||
settings: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||
__typename: 'UserSettings',
|
||||
locale: 'en',
|
||||
colorScheme: ColorScheme.System,
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdt7a',
|
||||
@ -92,6 +136,12 @@ export const mockedOnboardingUsersData: Array<MockedUser> = [
|
||||
inviteHash: 'twenty.com-invite-hash-1',
|
||||
logo: '',
|
||||
},
|
||||
settings: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||
__typename: 'UserSettings',
|
||||
locale: 'en',
|
||||
colorScheme: ColorScheme.System,
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||
@ -122,6 +172,12 @@ export const mockedOnboardingUsersData: Array<MockedUser> = [
|
||||
inviteHash: 'twenty.com-invite-hash-2',
|
||||
logo: '',
|
||||
},
|
||||
settings: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||
__typename: 'UserSettings',
|
||||
locale: 'en',
|
||||
colorScheme: ColorScheme.System,
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||
|
||||
@ -78,6 +78,10 @@ export class AbilityFactory {
|
||||
can(AbilityAction.Read, 'WorkspaceMember', { workspaceId: workspace.id });
|
||||
can(AbilityAction.Delete, 'WorkspaceMember', { workspaceId: workspace.id });
|
||||
cannot(AbilityAction.Delete, 'WorkspaceMember', { userId: user.id });
|
||||
can(AbilityAction.Update, 'WorkspaceMember', {
|
||||
userId: user.id,
|
||||
workspaceId: workspace.id,
|
||||
});
|
||||
|
||||
// Company
|
||||
can(AbilityAction.Read, 'Company', { workspaceId: workspace.id });
|
||||
|
||||
@ -89,11 +89,6 @@ export class AuthService {
|
||||
email: signUpInput.email,
|
||||
passwordHash,
|
||||
locale: 'en',
|
||||
settings: {
|
||||
create: {
|
||||
locale: 'en',
|
||||
},
|
||||
},
|
||||
},
|
||||
} as Prisma.UserCreateArgs,
|
||||
workspace.id,
|
||||
@ -105,11 +100,6 @@ export class AuthService {
|
||||
email: signUpInput.email,
|
||||
passwordHash,
|
||||
locale: 'en',
|
||||
settings: {
|
||||
create: {
|
||||
locale: 'en',
|
||||
},
|
||||
},
|
||||
},
|
||||
} as Prisma.UserCreateArgs);
|
||||
}
|
||||
|
||||
@ -67,6 +67,12 @@ export class UserService {
|
||||
|
||||
assert(workspace, 'workspace is missing', BadRequestException);
|
||||
|
||||
const userSettings = await this.prismaService.client.userSettings.create({
|
||||
data: { locale: 'en' },
|
||||
});
|
||||
|
||||
const settings = { connect: { id: userSettings.id } };
|
||||
|
||||
// Create user
|
||||
const user = await this.prismaService.client.user.upsert({
|
||||
where: {
|
||||
@ -74,12 +80,14 @@ export class UserService {
|
||||
},
|
||||
create: {
|
||||
...(args.data as Prisma.UserCreateInput),
|
||||
settings,
|
||||
|
||||
workspaceMember: {
|
||||
create: {
|
||||
workspace: {
|
||||
connect: { id: workspace.id },
|
||||
},
|
||||
settings,
|
||||
},
|
||||
},
|
||||
locale: 'en',
|
||||
|
||||
@ -2,6 +2,7 @@ import { Args, Query, Resolver, Mutation } from '@nestjs/graphql';
|
||||
import { UseGuards } from '@nestjs/common';
|
||||
|
||||
import { accessibleBy } from '@casl/prisma';
|
||||
import { Prisma } from '@prisma/client';
|
||||
|
||||
import { WorkspaceMember } from 'src/core/@generated/workspace-member/workspace-member.model';
|
||||
import { AbilityGuard } from 'src/guards/ability.guard';
|
||||
@ -9,6 +10,7 @@ import { CheckAbilities } from 'src/decorators/check-abilities.decorator';
|
||||
import {
|
||||
DeleteWorkspaceMemberAbilityHandler,
|
||||
ReadWorkspaceMemberAbilityHandler,
|
||||
UpdateWorkspaceMemberAbilityHandler,
|
||||
} from 'src/ability/handlers/workspace-member.ability-handler';
|
||||
import { FindManyWorkspaceMemberArgs } from 'src/core/@generated/workspace-member/find-many-workspace-member.args';
|
||||
import { UserAbility } from 'src/decorators/user-ability.decorator';
|
||||
@ -22,6 +24,7 @@ import { DeleteOneWorkspaceMemberArgs } from 'src/core/@generated/workspace-memb
|
||||
import { JwtAuthGuard } from 'src/guards/jwt.auth.guard';
|
||||
import { AuthUser } from 'src/decorators/auth-user.decorator';
|
||||
import { User } from 'src/core/@generated/user/user.model';
|
||||
import { UpdateOneWorkspaceMemberArgs } from 'src/core/@generated/workspace-member/update-one-workspace-member.args';
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Resolver(() => WorkspaceMember)
|
||||
@ -81,4 +84,19 @@ export class WorkspaceMemberResolver {
|
||||
select: prismaSelect.value,
|
||||
});
|
||||
}
|
||||
|
||||
@Mutation(() => WorkspaceMember)
|
||||
@UseGuards(AbilityGuard)
|
||||
@CheckAbilities(UpdateWorkspaceMemberAbilityHandler)
|
||||
async UpdateOneWorkspaceMember(
|
||||
@Args() args: UpdateOneWorkspaceMemberArgs,
|
||||
@PrismaSelector({ modelName: 'WorkspaceMember' })
|
||||
prismaSelect: PrismaSelect<'WorkspaceMember'>,
|
||||
): Promise<Partial<WorkspaceMember>> {
|
||||
return this.workspaceMemberService.update({
|
||||
data: args.data,
|
||||
where: args.where,
|
||||
select: prismaSelect.value,
|
||||
} as Prisma.WorkspaceMemberUpdateArgs);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Made the column `idealCustomerProfile` on table `companies` required. This step will fail if there are existing NULL values in that column.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "activities" ADD COLUMN "workspaceMemberAssigneeId" TEXT,
|
||||
ADD COLUMN "workspaceMemberAuthorId" TEXT;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "attachments" ADD COLUMN "workspaceMemberAuthorId" TEXT;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "comments" ADD COLUMN "workspaceMemberAuthorId" TEXT;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "companies" ADD COLUMN "workspaceMemberAccountOwnerId" TEXT,
|
||||
ALTER COLUMN "idealCustomerProfile" SET NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "workspace_members" ADD COLUMN "settingsId" TEXT;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "workspace_members" ADD CONSTRAINT "workspace_members_settingsId_fkey" FOREIGN KEY ("settingsId") REFERENCES "user_settings"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "companies" ADD CONSTRAINT "companies_workspaceMemberAccountOwnerId_fkey" FOREIGN KEY ("workspaceMemberAccountOwnerId") REFERENCES "workspace_members"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "activities" ADD CONSTRAINT "activities_workspaceMemberAuthorId_fkey" FOREIGN KEY ("workspaceMemberAuthorId") REFERENCES "workspace_members"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "activities" ADD CONSTRAINT "activities_workspaceMemberAssigneeId_fkey" FOREIGN KEY ("workspaceMemberAssigneeId") REFERENCES "workspace_members"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "comments" ADD CONSTRAINT "comments_workspaceMemberAuthorId_fkey" FOREIGN KEY ("workspaceMemberAuthorId") REFERENCES "workspace_members"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "attachments" ADD CONSTRAINT "attachments_workspaceMemberAuthorId_fkey" FOREIGN KEY ("workspaceMemberAuthorId") REFERENCES "workspace_members"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@ -138,7 +138,8 @@ model UserSettings {
|
||||
/// @Validator.IsString()
|
||||
locale String
|
||||
|
||||
user User?
|
||||
user User?
|
||||
WorkspaceMember WorkspaceMember[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@ -210,6 +211,15 @@ model WorkspaceMember {
|
||||
updatedAt DateTime @updatedAt
|
||||
Favorite Favorite[]
|
||||
|
||||
authoredActivities Activity[] @relation(name: "authoredActivities")
|
||||
assignedActivities Activity[] @relation(name: "assignedActivities")
|
||||
authoredAttachments Attachment[] @relation(name: "authoredAttachments")
|
||||
settings UserSettings? @relation(fields: [settingsId], references: [id])
|
||||
settingsId String?
|
||||
|
||||
companies Company[]
|
||||
comments Comment[]
|
||||
|
||||
@@map("workspace_members")
|
||||
}
|
||||
|
||||
@ -242,13 +252,15 @@ model Company {
|
||||
/// @Validator.IsOptional()
|
||||
employees Int?
|
||||
|
||||
people Person[]
|
||||
accountOwner User? @relation(fields: [accountOwnerId], references: [id], onDelete: SetNull)
|
||||
accountOwnerId String?
|
||||
people Person[]
|
||||
accountOwner User? @relation(fields: [accountOwnerId], references: [id], onDelete: SetNull)
|
||||
accountOwnerId String?
|
||||
workspaceMemberAccountOwner WorkspaceMember? @relation(fields: [workspaceMemberAccountOwnerId], references: [id], onDelete: SetNull)
|
||||
workspaceMemberAccountOwnerId String?
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
workspace Workspace @relation(fields: [workspaceId], references: [id])
|
||||
workspace Workspace @relation(fields: [workspaceId], references: [id])
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
workspaceId String
|
||||
workspaceId String
|
||||
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
deletedAt DateTime?
|
||||
@ -358,12 +370,20 @@ model Activity {
|
||||
attachments Attachment[]
|
||||
author User @relation(fields: [authorId], references: [id], name: "authoredActivities", onDelete: Cascade)
|
||||
authorId String
|
||||
assignee User? @relation(fields: [assigneeId], references: [id], name: "assignedActivities", onDelete: SetNull)
|
||||
assigneeId String?
|
||||
|
||||
workspaceMemberAuthor WorkspaceMember? @relation(fields: [workspaceMemberAuthorId], references: [id], name: "authoredActivities", onDelete: Cascade)
|
||||
workspaceMemberAuthorId String?
|
||||
|
||||
assignee User? @relation(fields: [assigneeId], references: [id], name: "assignedActivities", onDelete: SetNull)
|
||||
assigneeId String?
|
||||
|
||||
workspaceMemberAssignee WorkspaceMember? @relation(fields: [workspaceMemberAssigneeId], references: [id], name: "assignedActivities", onDelete: SetNull)
|
||||
workspaceMemberAssigneeId String?
|
||||
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
workspace Workspace @relation(fields: [workspaceId], references: [id])
|
||||
workspace Workspace @relation(fields: [workspaceId], references: [id])
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
workspaceId String
|
||||
workspaceId String
|
||||
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
deletedAt DateTime?
|
||||
@ -381,8 +401,12 @@ model Comment {
|
||||
/// @Validator.IsString()
|
||||
body String
|
||||
|
||||
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
||||
authorId String
|
||||
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
||||
authorId String
|
||||
|
||||
workspaceMemberAuthor WorkspaceMember? @relation(fields: [workspaceMemberAuthorId], references: [id], onDelete: Cascade)
|
||||
workspaceMemberAuthorId String?
|
||||
|
||||
activity Activity? @relation(fields: [activityId], references: [id], onDelete: Cascade)
|
||||
activityId String?
|
||||
commentThreadId String?
|
||||
@ -550,8 +574,12 @@ model Attachment {
|
||||
/// @TypeGraphQL.omit(input: true, output: true)
|
||||
workspaceId String
|
||||
|
||||
author User @relation(fields: [authorId], references: [id], name: "authoredAttachments", onDelete: Cascade)
|
||||
authorId String
|
||||
author User @relation(fields: [authorId], references: [id], name: "authoredAttachments", onDelete: Cascade)
|
||||
authorId String
|
||||
|
||||
workspaceMemberAuthor WorkspaceMember? @relation(fields: [workspaceMemberAuthorId], references: [id], name: "authoredAttachments", onDelete: Cascade)
|
||||
workspaceMemberAuthorId String?
|
||||
|
||||
activity Activity @relation(fields: [activityId], references: [id], onDelete: Cascade)
|
||||
activityId String
|
||||
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
export const seedUsers = async (prisma: PrismaClient) => {
|
||||
await prisma.userSettings.upsert({
|
||||
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-9dcb1084c109' },
|
||||
update: {},
|
||||
create: {
|
||||
id: 'twenty-ge256b39-3ec3-4fe3-8997-9dcb1084c109',
|
||||
locale: 'en',
|
||||
},
|
||||
});
|
||||
await prisma.user.upsert({
|
||||
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfc102' },
|
||||
update: {},
|
||||
@ -11,11 +19,7 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
||||
locale: 'en',
|
||||
passwordHash:
|
||||
'$2b$10$66d.6DuQExxnrfI9rMqOg.U1XIYpagr6Lv05uoWLYbYmtK0HDIvS6', // Applecar2025
|
||||
settings: {
|
||||
create: {
|
||||
locale: 'en',
|
||||
},
|
||||
},
|
||||
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-9dcb1084c109',
|
||||
avatarUrl: null,
|
||||
workspaceMember: {
|
||||
connectOrCreate: {
|
||||
@ -24,12 +28,21 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
||||
},
|
||||
create: {
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-9dcb1084c109',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.userSettings.upsert({
|
||||
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-2c4a2035a215' },
|
||||
update: {},
|
||||
create: {
|
||||
id: 'twenty-ge256b39-3ec3-4fe3-8997-2c4a2035a215',
|
||||
locale: 'en',
|
||||
},
|
||||
});
|
||||
await prisma.user.upsert({
|
||||
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408' },
|
||||
update: {},
|
||||
@ -39,21 +52,26 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
||||
lastName: 'Ive',
|
||||
email: 'jony.ive@apple.dev',
|
||||
locale: 'en',
|
||||
settings: {
|
||||
create: {
|
||||
locale: 'en',
|
||||
},
|
||||
},
|
||||
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-2c4a2035a215',
|
||||
avatarUrl: null,
|
||||
workspaceMember: {
|
||||
create: {
|
||||
id: 'twenty-7ef9d213-1c25-4d02-bf35-6aeccf7ea419',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-2c4a2035a215',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.userSettings.upsert({
|
||||
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-8e1f2097b328' },
|
||||
update: {},
|
||||
create: {
|
||||
id: 'twenty-ge256b39-3ec3-4fe3-8997-8e1f2097b328',
|
||||
locale: 'en',
|
||||
},
|
||||
});
|
||||
await prisma.user.upsert({
|
||||
where: { id: 'twenty-gk256b39-3ec3-4fe3-8997-b76aa0bfa408' },
|
||||
update: {},
|
||||
@ -63,21 +81,26 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
||||
lastName: 'Schiler',
|
||||
email: 'phil.schiler@apple.dev',
|
||||
locale: 'en',
|
||||
settings: {
|
||||
create: {
|
||||
locale: 'en',
|
||||
},
|
||||
},
|
||||
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-8e1f2097b328',
|
||||
avatarUrl: null,
|
||||
workspaceMember: {
|
||||
create: {
|
||||
id: 'twenty-7ed9d213-1c25-4d02-bf35-6aeccf7ea419',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-8e1f2097b328',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await prisma.userSettings.upsert({
|
||||
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-5e2d1049c430' },
|
||||
update: {},
|
||||
create: {
|
||||
id: 'twenty-ge256b39-3ec3-4fe3-8997-5e2d1049c430',
|
||||
locale: 'en',
|
||||
},
|
||||
});
|
||||
await prisma.user.upsert({
|
||||
where: { id: 'twenty-dev-gk256b39-3ec3-4fe3-8997-b76aa0boa408' },
|
||||
update: {},
|
||||
@ -87,15 +110,12 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
||||
lastName: 'Bochet',
|
||||
email: 'charles@twenty.dev',
|
||||
locale: 'en',
|
||||
settings: {
|
||||
create: {
|
||||
locale: 'en',
|
||||
},
|
||||
},
|
||||
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-5e2d1049c430',
|
||||
workspaceMember: {
|
||||
create: {
|
||||
id: 'twenty-dev-7ed9d213-1c25-4d02-bf35-6aeccf7oa419',
|
||||
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
|
||||
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-5e2d1049c430',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user