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 { HelmetProvider } from 'react-helmet-async';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
import { MemoryRouter } from 'react-router-dom';
|
||||||
import type { Meta, StoryObj } from '@storybook/react';
|
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 { App } from '~/App';
|
||||||
import { FullHeightStorybookLayout } from '~/testing/FullHeightStorybookLayout';
|
import { FullHeightStorybookLayout } from '~/testing/FullHeightStorybookLayout';
|
||||||
import { graphqlMocks } from '~/testing/graphqlMocks';
|
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> = {
|
const meta: Meta<typeof App> = {
|
||||||
title: 'App/App',
|
title: 'App/App',
|
||||||
component: App,
|
component: App,
|
||||||
decorators: [
|
decorators: [
|
||||||
(Story) => (
|
(Story) => (
|
||||||
<MemoryRouter>
|
<ClientConfigProvider>
|
||||||
<FullHeightStorybookLayout>
|
<UserProvider>
|
||||||
<MockedAuth>
|
<MemoryRouter>
|
||||||
<HelmetProvider>
|
<FullHeightStorybookLayout>
|
||||||
<Story />
|
<HelmetProvider>
|
||||||
</HelmetProvider>
|
<Story />
|
||||||
</MockedAuth>
|
</HelmetProvider>
|
||||||
</FullHeightStorybookLayout>
|
</FullHeightStorybookLayout>
|
||||||
</MemoryRouter>
|
</MemoryRouter>
|
||||||
|
</UserProvider>
|
||||||
|
</ClientConfigProvider>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
parameters: {
|
parameters: {
|
||||||
|
|||||||
@ -36,6 +36,10 @@ export type Activity = {
|
|||||||
title?: Maybe<Scalars['String']>;
|
title?: Maybe<Scalars['String']>;
|
||||||
type: ActivityType;
|
type: ActivityType;
|
||||||
updatedAt: Scalars['DateTime'];
|
updatedAt: Scalars['DateTime'];
|
||||||
|
workspaceMemberAssignee?: Maybe<WorkspaceMember>;
|
||||||
|
workspaceMemberAssigneeId?: Maybe<Scalars['String']>;
|
||||||
|
workspaceMemberAuthor?: Maybe<WorkspaceMember>;
|
||||||
|
workspaceMemberAuthorId?: Maybe<Scalars['String']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ActivityCreateInput = {
|
export type ActivityCreateInput = {
|
||||||
@ -53,6 +57,8 @@ export type ActivityCreateInput = {
|
|||||||
title?: InputMaybe<Scalars['String']>;
|
title?: InputMaybe<Scalars['String']>;
|
||||||
type?: InputMaybe<ActivityType>;
|
type?: InputMaybe<ActivityType>;
|
||||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||||
|
workspaceMemberAssignee?: InputMaybe<WorkspaceMemberCreateNestedOneWithoutAssignedActivitiesInput>;
|
||||||
|
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberCreateNestedOneWithoutAuthoredActivitiesInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ActivityCreateNestedOneWithoutActivityTargetsInput = {
|
export type ActivityCreateNestedOneWithoutActivityTargetsInput = {
|
||||||
@ -90,6 +96,10 @@ export type ActivityOrderByWithRelationInput = {
|
|||||||
title?: InputMaybe<SortOrder>;
|
title?: InputMaybe<SortOrder>;
|
||||||
type?: InputMaybe<SortOrder>;
|
type?: InputMaybe<SortOrder>;
|
||||||
updatedAt?: InputMaybe<SortOrder>;
|
updatedAt?: InputMaybe<SortOrder>;
|
||||||
|
workspaceMemberAssignee?: InputMaybe<WorkspaceMemberOrderByWithRelationInput>;
|
||||||
|
workspaceMemberAssigneeId?: InputMaybe<SortOrder>;
|
||||||
|
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberOrderByWithRelationInput>;
|
||||||
|
workspaceMemberAuthorId?: InputMaybe<SortOrder>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ActivityRelationFilter = {
|
export type ActivityRelationFilter = {
|
||||||
@ -110,7 +120,9 @@ export enum ActivityScalarFieldEnum {
|
|||||||
Title = 'title',
|
Title = 'title',
|
||||||
Type = 'type',
|
Type = 'type',
|
||||||
UpdatedAt = 'updatedAt',
|
UpdatedAt = 'updatedAt',
|
||||||
WorkspaceId = 'workspaceId'
|
WorkspaceId = 'workspaceId',
|
||||||
|
WorkspaceMemberAssigneeId = 'workspaceMemberAssigneeId',
|
||||||
|
WorkspaceMemberAuthorId = 'workspaceMemberAuthorId'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ActivityTarget = {
|
export type ActivityTarget = {
|
||||||
@ -358,6 +370,8 @@ export type ActivityUpdateInput = {
|
|||||||
title?: InputMaybe<Scalars['String']>;
|
title?: InputMaybe<Scalars['String']>;
|
||||||
type?: InputMaybe<ActivityType>;
|
type?: InputMaybe<ActivityType>;
|
||||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||||
|
workspaceMemberAssignee?: InputMaybe<WorkspaceMemberUpdateOneWithoutAssignedActivitiesNestedInput>;
|
||||||
|
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberUpdateOneWithoutAuthoredActivitiesNestedInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ActivityUpdateManyWithoutAssigneeNestedInput = {
|
export type ActivityUpdateManyWithoutAssigneeNestedInput = {
|
||||||
@ -372,6 +386,18 @@ export type ActivityUpdateManyWithoutAuthorNestedInput = {
|
|||||||
set?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
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 = {
|
export type ActivityUpdateManyWithoutWorkspaceNestedInput = {
|
||||||
connect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
connect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||||
disconnect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
disconnect?: InputMaybe<Array<ActivityWhereUniqueInput>>;
|
||||||
@ -398,6 +424,10 @@ export type ActivityWhereInput = {
|
|||||||
title?: InputMaybe<StringNullableFilter>;
|
title?: InputMaybe<StringNullableFilter>;
|
||||||
type?: InputMaybe<EnumActivityTypeFilter>;
|
type?: InputMaybe<EnumActivityTypeFilter>;
|
||||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||||
|
workspaceMemberAssignee?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||||
|
workspaceMemberAssigneeId?: InputMaybe<StringNullableFilter>;
|
||||||
|
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||||
|
workspaceMemberAuthorId?: InputMaybe<StringNullableFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ActivityWhereUniqueInput = {
|
export type ActivityWhereUniqueInput = {
|
||||||
@ -428,6 +458,8 @@ export type Attachment = {
|
|||||||
type: AttachmentType;
|
type: AttachmentType;
|
||||||
updatedAt: Scalars['DateTime'];
|
updatedAt: Scalars['DateTime'];
|
||||||
workspace: Workspace;
|
workspace: Workspace;
|
||||||
|
workspaceMemberAuthor?: Maybe<WorkspaceMember>;
|
||||||
|
workspaceMemberAuthorId?: Maybe<Scalars['String']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AttachmentCreateNestedManyWithoutActivityInput = {
|
export type AttachmentCreateNestedManyWithoutActivityInput = {
|
||||||
@ -466,6 +498,12 @@ export type AttachmentUpdateManyWithoutAuthorNestedInput = {
|
|||||||
set?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
set?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type AttachmentUpdateManyWithoutWorkspaceMemberAuthorNestedInput = {
|
||||||
|
connect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||||
|
disconnect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||||
|
set?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||||
|
};
|
||||||
|
|
||||||
export type AttachmentUpdateManyWithoutWorkspaceNestedInput = {
|
export type AttachmentUpdateManyWithoutWorkspaceNestedInput = {
|
||||||
connect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
connect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||||
disconnect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
disconnect?: InputMaybe<Array<AttachmentWhereUniqueInput>>;
|
||||||
@ -486,6 +524,8 @@ export type AttachmentWhereInput = {
|
|||||||
name?: InputMaybe<StringFilter>;
|
name?: InputMaybe<StringFilter>;
|
||||||
type?: InputMaybe<EnumAttachmentTypeFilter>;
|
type?: InputMaybe<EnumAttachmentTypeFilter>;
|
||||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||||
|
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||||
|
workspaceMemberAuthorId?: InputMaybe<StringNullableFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AttachmentWhereUniqueInput = {
|
export type AttachmentWhereUniqueInput = {
|
||||||
@ -547,6 +587,8 @@ export type Comment = {
|
|||||||
createdAt: Scalars['DateTime'];
|
createdAt: Scalars['DateTime'];
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID'];
|
||||||
updatedAt: Scalars['DateTime'];
|
updatedAt: Scalars['DateTime'];
|
||||||
|
workspaceMemberAuthor?: Maybe<WorkspaceMember>;
|
||||||
|
workspaceMemberAuthorId?: Maybe<Scalars['String']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CommentCreateInput = {
|
export type CommentCreateInput = {
|
||||||
@ -557,6 +599,7 @@ export type CommentCreateInput = {
|
|||||||
createdAt?: InputMaybe<Scalars['DateTime']>;
|
createdAt?: InputMaybe<Scalars['DateTime']>;
|
||||||
id?: InputMaybe<Scalars['String']>;
|
id?: InputMaybe<Scalars['String']>;
|
||||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||||
|
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberCreateNestedOneWithoutCommentsInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CommentCreateNestedManyWithoutActivityInput = {
|
export type CommentCreateNestedManyWithoutActivityInput = {
|
||||||
@ -585,6 +628,12 @@ export type CommentUpdateManyWithoutAuthorNestedInput = {
|
|||||||
set?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
set?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type CommentUpdateManyWithoutWorkspaceMemberAuthorNestedInput = {
|
||||||
|
connect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||||
|
disconnect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||||
|
set?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||||
|
};
|
||||||
|
|
||||||
export type CommentUpdateManyWithoutWorkspaceNestedInput = {
|
export type CommentUpdateManyWithoutWorkspaceNestedInput = {
|
||||||
connect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
connect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||||
disconnect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
disconnect?: InputMaybe<Array<CommentWhereUniqueInput>>;
|
||||||
@ -604,6 +653,8 @@ export type CommentWhereInput = {
|
|||||||
createdAt?: InputMaybe<DateTimeFilter>;
|
createdAt?: InputMaybe<DateTimeFilter>;
|
||||||
id?: InputMaybe<StringFilter>;
|
id?: InputMaybe<StringFilter>;
|
||||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||||
|
workspaceMemberAuthor?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||||
|
workspaceMemberAuthorId?: InputMaybe<StringNullableFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CommentWhereUniqueInput = {
|
export type CommentWhereUniqueInput = {
|
||||||
@ -631,6 +682,8 @@ export type Company = {
|
|||||||
name: Scalars['String'];
|
name: Scalars['String'];
|
||||||
people?: Maybe<Array<Person>>;
|
people?: Maybe<Array<Person>>;
|
||||||
updatedAt: Scalars['DateTime'];
|
updatedAt: Scalars['DateTime'];
|
||||||
|
workspaceMemberAccountOwner?: Maybe<WorkspaceMember>;
|
||||||
|
workspaceMemberAccountOwnerId?: Maybe<Scalars['String']>;
|
||||||
xUrl?: Maybe<Scalars['String']>;
|
xUrl?: Maybe<Scalars['String']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -650,6 +703,7 @@ export type CompanyCreateInput = {
|
|||||||
name: Scalars['String'];
|
name: Scalars['String'];
|
||||||
people?: InputMaybe<PersonCreateNestedManyWithoutCompanyInput>;
|
people?: InputMaybe<PersonCreateNestedManyWithoutCompanyInput>;
|
||||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||||
|
workspaceMemberAccountOwner?: InputMaybe<WorkspaceMemberCreateNestedOneWithoutCompaniesInput>;
|
||||||
xUrl?: InputMaybe<Scalars['String']>;
|
xUrl?: InputMaybe<Scalars['String']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -665,6 +719,7 @@ export type CompanyCreateManyInput = {
|
|||||||
linkedinUrl?: InputMaybe<Scalars['String']>;
|
linkedinUrl?: InputMaybe<Scalars['String']>;
|
||||||
name: Scalars['String'];
|
name: Scalars['String'];
|
||||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||||
|
workspaceMemberAccountOwnerId?: InputMaybe<Scalars['String']>;
|
||||||
xUrl?: InputMaybe<Scalars['String']>;
|
xUrl?: InputMaybe<Scalars['String']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -707,6 +762,8 @@ export type CompanyOrderByWithRelationInput = {
|
|||||||
name?: InputMaybe<SortOrder>;
|
name?: InputMaybe<SortOrder>;
|
||||||
people?: InputMaybe<PersonOrderByRelationAggregateInput>;
|
people?: InputMaybe<PersonOrderByRelationAggregateInput>;
|
||||||
updatedAt?: InputMaybe<SortOrder>;
|
updatedAt?: InputMaybe<SortOrder>;
|
||||||
|
workspaceMemberAccountOwner?: InputMaybe<WorkspaceMemberOrderByWithRelationInput>;
|
||||||
|
workspaceMemberAccountOwnerId?: InputMaybe<SortOrder>;
|
||||||
xUrl?: InputMaybe<SortOrder>;
|
xUrl?: InputMaybe<SortOrder>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -729,6 +786,7 @@ export enum CompanyScalarFieldEnum {
|
|||||||
Name = 'name',
|
Name = 'name',
|
||||||
UpdatedAt = 'updatedAt',
|
UpdatedAt = 'updatedAt',
|
||||||
WorkspaceId = 'workspaceId',
|
WorkspaceId = 'workspaceId',
|
||||||
|
WorkspaceMemberAccountOwnerId = 'workspaceMemberAccountOwnerId',
|
||||||
XUrl = 'xUrl'
|
XUrl = 'xUrl'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -748,6 +806,7 @@ export type CompanyUpdateInput = {
|
|||||||
name?: InputMaybe<Scalars['String']>;
|
name?: InputMaybe<Scalars['String']>;
|
||||||
people?: InputMaybe<PersonUpdateManyWithoutCompanyNestedInput>;
|
people?: InputMaybe<PersonUpdateManyWithoutCompanyNestedInput>;
|
||||||
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
updatedAt?: InputMaybe<Scalars['DateTime']>;
|
||||||
|
workspaceMemberAccountOwner?: InputMaybe<WorkspaceMemberUpdateOneWithoutCompaniesNestedInput>;
|
||||||
xUrl?: InputMaybe<Scalars['String']>;
|
xUrl?: InputMaybe<Scalars['String']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -757,6 +816,12 @@ export type CompanyUpdateManyWithoutAccountOwnerNestedInput = {
|
|||||||
set?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
set?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type CompanyUpdateManyWithoutWorkspaceMemberAccountOwnerNestedInput = {
|
||||||
|
connect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||||
|
disconnect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||||
|
set?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||||
|
};
|
||||||
|
|
||||||
export type CompanyUpdateManyWithoutWorkspaceNestedInput = {
|
export type CompanyUpdateManyWithoutWorkspaceNestedInput = {
|
||||||
connect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
connect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||||
disconnect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
disconnect?: InputMaybe<Array<CompanyWhereUniqueInput>>;
|
||||||
@ -793,6 +858,8 @@ export type CompanyWhereInput = {
|
|||||||
name?: InputMaybe<StringFilter>;
|
name?: InputMaybe<StringFilter>;
|
||||||
people?: InputMaybe<PersonListRelationFilter>;
|
people?: InputMaybe<PersonListRelationFilter>;
|
||||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||||
|
workspaceMemberAccountOwner?: InputMaybe<WorkspaceMemberRelationFilter>;
|
||||||
|
workspaceMemberAccountOwnerId?: InputMaybe<StringNullableFilter>;
|
||||||
xUrl?: InputMaybe<StringNullableFilter>;
|
xUrl?: InputMaybe<StringNullableFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -921,6 +988,12 @@ export type FavoriteUpdateManyWithoutPersonNestedInput = {
|
|||||||
set?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
set?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type FavoriteUpdateManyWithoutWorkspaceMemberNestedInput = {
|
||||||
|
connect?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
||||||
|
disconnect?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
||||||
|
set?: InputMaybe<Array<FavoriteWhereUniqueInput>>;
|
||||||
|
};
|
||||||
|
|
||||||
export type FavoriteWhereInput = {
|
export type FavoriteWhereInput = {
|
||||||
AND?: InputMaybe<Array<FavoriteWhereInput>>;
|
AND?: InputMaybe<Array<FavoriteWhereInput>>;
|
||||||
NOT?: InputMaybe<Array<FavoriteWhereInput>>;
|
NOT?: InputMaybe<Array<FavoriteWhereInput>>;
|
||||||
@ -988,6 +1061,7 @@ export type LoginToken = {
|
|||||||
|
|
||||||
export type Mutation = {
|
export type Mutation = {
|
||||||
__typename?: 'Mutation';
|
__typename?: 'Mutation';
|
||||||
|
UpdateOneWorkspaceMember: WorkspaceMember;
|
||||||
allowImpersonation: WorkspaceMember;
|
allowImpersonation: WorkspaceMember;
|
||||||
challenge: LoginToken;
|
challenge: LoginToken;
|
||||||
createEvent: Analytics;
|
createEvent: Analytics;
|
||||||
@ -1044,6 +1118,12 @@ export type Mutation = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export type MutationUpdateOneWorkspaceMemberArgs = {
|
||||||
|
data: WorkspaceMemberUpdateInput;
|
||||||
|
where: WorkspaceMemberWhereUniqueInput;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
export type MutationAllowImpersonationArgs = {
|
export type MutationAllowImpersonationArgs = {
|
||||||
allowImpersonation: Scalars['Boolean'];
|
allowImpersonation: Scalars['Boolean'];
|
||||||
};
|
};
|
||||||
@ -2334,6 +2414,7 @@ export enum UserScalarFieldEnum {
|
|||||||
|
|
||||||
export type UserSettings = {
|
export type UserSettings = {
|
||||||
__typename?: 'UserSettings';
|
__typename?: 'UserSettings';
|
||||||
|
WorkspaceMember?: Maybe<Array<WorkspaceMember>>;
|
||||||
colorScheme: ColorScheme;
|
colorScheme: ColorScheme;
|
||||||
createdAt: Scalars['DateTime'];
|
createdAt: Scalars['DateTime'];
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID'];
|
||||||
@ -2343,6 +2424,7 @@ export type UserSettings = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type UserSettingsOrderByWithRelationInput = {
|
export type UserSettingsOrderByWithRelationInput = {
|
||||||
|
WorkspaceMember?: InputMaybe<WorkspaceMemberOrderByRelationAggregateInput>;
|
||||||
colorScheme?: InputMaybe<SortOrder>;
|
colorScheme?: InputMaybe<SortOrder>;
|
||||||
createdAt?: InputMaybe<SortOrder>;
|
createdAt?: InputMaybe<SortOrder>;
|
||||||
id?: InputMaybe<SortOrder>;
|
id?: InputMaybe<SortOrder>;
|
||||||
@ -2360,7 +2442,13 @@ export type UserSettingsUpdateOneRequiredWithoutUserNestedInput = {
|
|||||||
update?: InputMaybe<UserSettingsUpdateWithoutUserInput>;
|
update?: InputMaybe<UserSettingsUpdateWithoutUserInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type UserSettingsUpdateOneWithoutWorkspaceMemberNestedInput = {
|
||||||
|
connect?: InputMaybe<UserSettingsWhereUniqueInput>;
|
||||||
|
disconnect?: InputMaybe<Scalars['Boolean']>;
|
||||||
|
};
|
||||||
|
|
||||||
export type UserSettingsUpdateWithoutUserInput = {
|
export type UserSettingsUpdateWithoutUserInput = {
|
||||||
|
WorkspaceMember?: InputMaybe<WorkspaceMemberUpdateManyWithoutSettingsNestedInput>;
|
||||||
colorScheme?: InputMaybe<ColorScheme>;
|
colorScheme?: InputMaybe<ColorScheme>;
|
||||||
createdAt?: InputMaybe<Scalars['DateTime']>;
|
createdAt?: InputMaybe<Scalars['DateTime']>;
|
||||||
id?: InputMaybe<Scalars['String']>;
|
id?: InputMaybe<Scalars['String']>;
|
||||||
@ -2372,6 +2460,7 @@ export type UserSettingsWhereInput = {
|
|||||||
AND?: InputMaybe<Array<UserSettingsWhereInput>>;
|
AND?: InputMaybe<Array<UserSettingsWhereInput>>;
|
||||||
NOT?: InputMaybe<Array<UserSettingsWhereInput>>;
|
NOT?: InputMaybe<Array<UserSettingsWhereInput>>;
|
||||||
OR?: InputMaybe<Array<UserSettingsWhereInput>>;
|
OR?: InputMaybe<Array<UserSettingsWhereInput>>;
|
||||||
|
WorkspaceMember?: InputMaybe<WorkspaceMemberListRelationFilter>;
|
||||||
colorScheme?: InputMaybe<EnumColorSchemeFilter>;
|
colorScheme?: InputMaybe<EnumColorSchemeFilter>;
|
||||||
createdAt?: InputMaybe<DateTimeFilter>;
|
createdAt?: InputMaybe<DateTimeFilter>;
|
||||||
id?: InputMaybe<StringFilter>;
|
id?: InputMaybe<StringFilter>;
|
||||||
@ -2380,6 +2469,10 @@ export type UserSettingsWhereInput = {
|
|||||||
user?: InputMaybe<UserRelationFilter>;
|
user?: InputMaybe<UserRelationFilter>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type UserSettingsWhereUniqueInput = {
|
||||||
|
id?: InputMaybe<Scalars['String']>;
|
||||||
|
};
|
||||||
|
|
||||||
export type UserUpdateInput = {
|
export type UserUpdateInput = {
|
||||||
assignedActivities?: InputMaybe<ActivityUpdateManyWithoutAssigneeNestedInput>;
|
assignedActivities?: InputMaybe<ActivityUpdateManyWithoutAssigneeNestedInput>;
|
||||||
authoredActivities?: InputMaybe<ActivityUpdateManyWithoutAuthorNestedInput>;
|
authoredActivities?: InputMaybe<ActivityUpdateManyWithoutAuthorNestedInput>;
|
||||||
@ -2407,6 +2500,10 @@ export type UserUpdateOneRequiredWithoutAuthoredActivitiesNestedInput = {
|
|||||||
connect?: InputMaybe<UserWhereUniqueInput>;
|
connect?: InputMaybe<UserWhereUniqueInput>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type UserUpdateOneRequiredWithoutWorkspaceMemberNestedInput = {
|
||||||
|
connect?: InputMaybe<UserWhereUniqueInput>;
|
||||||
|
};
|
||||||
|
|
||||||
export type UserUpdateOneWithoutAssignedActivitiesNestedInput = {
|
export type UserUpdateOneWithoutAssignedActivitiesNestedInput = {
|
||||||
connect?: InputMaybe<UserWhereUniqueInput>;
|
connect?: InputMaybe<UserWhereUniqueInput>;
|
||||||
disconnect?: InputMaybe<Scalars['Boolean']>;
|
disconnect?: InputMaybe<Scalars['Boolean']>;
|
||||||
@ -2904,48 +3001,137 @@ export type WorkspaceMember = {
|
|||||||
__typename?: 'WorkspaceMember';
|
__typename?: 'WorkspaceMember';
|
||||||
Favorite?: Maybe<Array<Favorite>>;
|
Favorite?: Maybe<Array<Favorite>>;
|
||||||
allowImpersonation: Scalars['Boolean'];
|
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'];
|
createdAt: Scalars['DateTime'];
|
||||||
id: Scalars['ID'];
|
id: Scalars['ID'];
|
||||||
|
settings?: Maybe<UserSettings>;
|
||||||
|
settingsId?: Maybe<Scalars['String']>;
|
||||||
updatedAt: Scalars['DateTime'];
|
updatedAt: Scalars['DateTime'];
|
||||||
user: User;
|
user: User;
|
||||||
userId: Scalars['String'];
|
userId: Scalars['String'];
|
||||||
workspace: Workspace;
|
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 = {
|
export type WorkspaceMemberOrderByWithRelationInput = {
|
||||||
Favorite?: InputMaybe<FavoriteOrderByRelationAggregateInput>;
|
Favorite?: InputMaybe<FavoriteOrderByRelationAggregateInput>;
|
||||||
allowImpersonation?: InputMaybe<SortOrder>;
|
allowImpersonation?: InputMaybe<SortOrder>;
|
||||||
|
assignedActivities?: InputMaybe<ActivityOrderByRelationAggregateInput>;
|
||||||
|
authoredActivities?: InputMaybe<ActivityOrderByRelationAggregateInput>;
|
||||||
|
authoredAttachments?: InputMaybe<AttachmentOrderByRelationAggregateInput>;
|
||||||
|
comments?: InputMaybe<CommentOrderByRelationAggregateInput>;
|
||||||
|
companies?: InputMaybe<CompanyOrderByRelationAggregateInput>;
|
||||||
createdAt?: InputMaybe<SortOrder>;
|
createdAt?: InputMaybe<SortOrder>;
|
||||||
id?: InputMaybe<SortOrder>;
|
id?: InputMaybe<SortOrder>;
|
||||||
|
settings?: InputMaybe<UserSettingsOrderByWithRelationInput>;
|
||||||
|
settingsId?: InputMaybe<SortOrder>;
|
||||||
updatedAt?: InputMaybe<SortOrder>;
|
updatedAt?: InputMaybe<SortOrder>;
|
||||||
user?: InputMaybe<UserOrderByWithRelationInput>;
|
user?: InputMaybe<UserOrderByWithRelationInput>;
|
||||||
userId?: InputMaybe<SortOrder>;
|
userId?: InputMaybe<SortOrder>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type WorkspaceMemberRelationFilter = {
|
||||||
|
is?: InputMaybe<WorkspaceMemberWhereInput>;
|
||||||
|
isNot?: InputMaybe<WorkspaceMemberWhereInput>;
|
||||||
|
};
|
||||||
|
|
||||||
export enum WorkspaceMemberScalarFieldEnum {
|
export enum WorkspaceMemberScalarFieldEnum {
|
||||||
AllowImpersonation = 'allowImpersonation',
|
AllowImpersonation = 'allowImpersonation',
|
||||||
CreatedAt = 'createdAt',
|
CreatedAt = 'createdAt',
|
||||||
DeletedAt = 'deletedAt',
|
DeletedAt = 'deletedAt',
|
||||||
Id = 'id',
|
Id = 'id',
|
||||||
|
SettingsId = 'settingsId',
|
||||||
UpdatedAt = 'updatedAt',
|
UpdatedAt = 'updatedAt',
|
||||||
UserId = 'userId',
|
UserId = 'userId',
|
||||||
WorkspaceId = 'workspaceId'
|
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 = {
|
export type WorkspaceMemberUpdateManyWithoutWorkspaceNestedInput = {
|
||||||
connect?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
connect?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
||||||
disconnect?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
disconnect?: InputMaybe<Array<WorkspaceMemberWhereUniqueInput>>;
|
||||||
set?: 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 = {
|
export type WorkspaceMemberWhereInput = {
|
||||||
AND?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
AND?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
||||||
Favorite?: InputMaybe<FavoriteListRelationFilter>;
|
Favorite?: InputMaybe<FavoriteListRelationFilter>;
|
||||||
NOT?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
NOT?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
||||||
OR?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
OR?: InputMaybe<Array<WorkspaceMemberWhereInput>>;
|
||||||
allowImpersonation?: InputMaybe<BoolFilter>;
|
allowImpersonation?: InputMaybe<BoolFilter>;
|
||||||
|
assignedActivities?: InputMaybe<ActivityListRelationFilter>;
|
||||||
|
authoredActivities?: InputMaybe<ActivityListRelationFilter>;
|
||||||
|
authoredAttachments?: InputMaybe<AttachmentListRelationFilter>;
|
||||||
|
comments?: InputMaybe<CommentListRelationFilter>;
|
||||||
|
companies?: InputMaybe<CompanyListRelationFilter>;
|
||||||
createdAt?: InputMaybe<DateTimeFilter>;
|
createdAt?: InputMaybe<DateTimeFilter>;
|
||||||
id?: InputMaybe<StringFilter>;
|
id?: InputMaybe<StringFilter>;
|
||||||
|
settings?: InputMaybe<UserSettingsRelationFilter>;
|
||||||
|
settingsId?: InputMaybe<StringNullableFilter>;
|
||||||
updatedAt?: InputMaybe<DateTimeFilter>;
|
updatedAt?: InputMaybe<DateTimeFilter>;
|
||||||
user?: InputMaybe<UserRelationFilter>;
|
user?: InputMaybe<UserRelationFilter>;
|
||||||
userId?: InputMaybe<StringFilter>;
|
userId?: InputMaybe<StringFilter>;
|
||||||
@ -3072,7 +3258,7 @@ export type CreateEventMutationVariables = Exact<{
|
|||||||
|
|
||||||
export type CreateEventMutation = { __typename?: 'Mutation', createEvent: { __typename?: 'Analytics', success: boolean } };
|
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<{
|
export type ChallengeMutationVariables = Exact<{
|
||||||
email: Scalars['String'];
|
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<{
|
export type RenewTokenMutationVariables = Exact<{
|
||||||
refreshToken: Scalars['String'];
|
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<{
|
export type CheckUserExistsQueryVariables = Exact<{
|
||||||
email: Scalars['String'];
|
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 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<{
|
export type DeleteManyCompaniesMutationVariables = Exact<{
|
||||||
ids?: InputMaybe<Array<Scalars['String']> | Scalars['String']>;
|
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<{
|
export type UpdateOneCompanyMutationVariables = Exact<{
|
||||||
where: CompanyWhereUniqueInput;
|
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<{
|
export type GetCompaniesQueryVariables = Exact<{
|
||||||
orderBy?: InputMaybe<Array<CompanyOrderByWithRelationInput> | CompanyOrderByWithRelationInput>;
|
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<{
|
export type SearchPeopleQueryVariables = Exact<{
|
||||||
where?: InputMaybe<PersonWhereInput>;
|
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 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; }>;
|
export type GetUsersQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
@ -3598,6 +3784,14 @@ export type UploadWorkspaceLogoMutationVariables = Exact<{
|
|||||||
|
|
||||||
export type UploadWorkspaceLogoMutation = { __typename?: 'Mutation', uploadWorkspaceLogo: string };
|
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<{
|
export type GetWorkspaceFromInviteHashQueryVariables = Exact<{
|
||||||
inviteHash: Scalars['String'];
|
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 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 } }> };
|
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
|
logo
|
||||||
inviteHash
|
inviteHash
|
||||||
}
|
}
|
||||||
|
assignedActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredAttachments {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
type
|
||||||
|
}
|
||||||
|
settings {
|
||||||
|
id
|
||||||
|
colorScheme
|
||||||
|
locale
|
||||||
|
}
|
||||||
|
companies {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
domainName
|
||||||
|
}
|
||||||
|
comments {
|
||||||
|
id
|
||||||
|
body
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settings {
|
settings {
|
||||||
id
|
id
|
||||||
@ -3724,6 +3947,7 @@ export const CompanyFieldsFragmentFragmentDoc = gql`
|
|||||||
idealCustomerProfile
|
idealCustomerProfile
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
_activityCount
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
export const PersonFieldsFragmentFragmentDoc = gql`
|
export const PersonFieldsFragmentFragmentDoc = gql`
|
||||||
@ -6138,6 +6362,33 @@ export const UpdateUserDocument = gql`
|
|||||||
logo
|
logo
|
||||||
inviteHash
|
inviteHash
|
||||||
}
|
}
|
||||||
|
assignedActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredAttachments {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
type
|
||||||
|
}
|
||||||
|
settings {
|
||||||
|
id
|
||||||
|
colorScheme
|
||||||
|
locale
|
||||||
|
}
|
||||||
|
companies {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
domainName
|
||||||
|
}
|
||||||
|
comments {
|
||||||
|
id
|
||||||
|
body
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settings {
|
settings {
|
||||||
id
|
id
|
||||||
@ -6194,6 +6445,33 @@ export const GetCurrentUserDocument = gql`
|
|||||||
logo
|
logo
|
||||||
inviteHash
|
inviteHash
|
||||||
}
|
}
|
||||||
|
assignedActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredAttachments {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
type
|
||||||
|
}
|
||||||
|
settings {
|
||||||
|
id
|
||||||
|
colorScheme
|
||||||
|
locale
|
||||||
|
}
|
||||||
|
companies {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
domainName
|
||||||
|
}
|
||||||
|
comments {
|
||||||
|
id
|
||||||
|
body
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settings {
|
settings {
|
||||||
id
|
id
|
||||||
@ -6965,6 +7243,75 @@ export function useUploadWorkspaceLogoMutation(baseOptions?: Apollo.MutationHook
|
|||||||
export type UploadWorkspaceLogoMutationHookResult = ReturnType<typeof useUploadWorkspaceLogoMutation>;
|
export type UploadWorkspaceLogoMutationHookResult = ReturnType<typeof useUploadWorkspaceLogoMutation>;
|
||||||
export type UploadWorkspaceLogoMutationResult = Apollo.MutationResult<UploadWorkspaceLogoMutation>;
|
export type UploadWorkspaceLogoMutationResult = Apollo.MutationResult<UploadWorkspaceLogoMutation>;
|
||||||
export type UploadWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions<UploadWorkspaceLogoMutation, UploadWorkspaceLogoMutationVariables>;
|
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`
|
export const GetWorkspaceFromInviteHashDocument = gql`
|
||||||
query GetWorkspaceFromInviteHash($inviteHash: String!) {
|
query GetWorkspaceFromInviteHash($inviteHash: String!) {
|
||||||
findWorkspaceFromInviteHash(inviteHash: $inviteHash) {
|
findWorkspaceFromInviteHash(inviteHash: $inviteHash) {
|
||||||
@ -7003,8 +7350,8 @@ export type GetWorkspaceFromInviteHashQueryHookResult = ReturnType<typeof useGet
|
|||||||
export type GetWorkspaceFromInviteHashLazyQueryHookResult = ReturnType<typeof useGetWorkspaceFromInviteHashLazyQuery>;
|
export type GetWorkspaceFromInviteHashLazyQueryHookResult = ReturnType<typeof useGetWorkspaceFromInviteHashLazyQuery>;
|
||||||
export type GetWorkspaceFromInviteHashQueryResult = Apollo.QueryResult<GetWorkspaceFromInviteHashQuery, GetWorkspaceFromInviteHashQueryVariables>;
|
export type GetWorkspaceFromInviteHashQueryResult = Apollo.QueryResult<GetWorkspaceFromInviteHashQuery, GetWorkspaceFromInviteHashQueryVariables>;
|
||||||
export const GetWorkspaceMembersDocument = gql`
|
export const GetWorkspaceMembersDocument = gql`
|
||||||
query GetWorkspaceMembers {
|
query GetWorkspaceMembers($where: WorkspaceMemberWhereInput) {
|
||||||
workspaceMembers: findManyWorkspaceMember {
|
workspaceMembers: findManyWorkspaceMember(where: $where) {
|
||||||
id
|
id
|
||||||
user {
|
user {
|
||||||
id
|
id
|
||||||
@ -7030,6 +7377,7 @@ export const GetWorkspaceMembersDocument = gql`
|
|||||||
* @example
|
* @example
|
||||||
* const { data, loading, error } = useGetWorkspaceMembersQuery({
|
* const { data, loading, error } = useGetWorkspaceMembersQuery({
|
||||||
* variables: {
|
* 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 { useRecoilScopedState } from '@/ui/utilities/recoil-scope/hooks/useRecoilScopedState';
|
||||||
import {
|
import {
|
||||||
Activity,
|
Activity,
|
||||||
|
useGetWorkspaceMembersLazyQuery,
|
||||||
User,
|
User,
|
||||||
useSearchUserQuery,
|
useSearchUserQuery,
|
||||||
useUpdateActivityMutation,
|
useUpdateActivityMutation,
|
||||||
@ -38,6 +39,7 @@ export function ActivityAssigneePicker({
|
|||||||
relationPickerSearchFilterScopedState,
|
relationPickerSearchFilterScopedState,
|
||||||
);
|
);
|
||||||
const [updateActivity] = useUpdateActivityMutation();
|
const [updateActivity] = useUpdateActivityMutation();
|
||||||
|
const [getWorkspaceMember] = useGetWorkspaceMembersLazyQuery();
|
||||||
|
|
||||||
const users = useFilteredSearchEntityQuery({
|
const users = useFilteredSearchEntityQuery({
|
||||||
queryHook: useSearchUserQuery,
|
queryHook: useSearchUserQuery,
|
||||||
@ -66,15 +68,28 @@ export function ActivityAssigneePicker({
|
|||||||
fragment: ACTIVITY_UPDATE_FRAGMENT,
|
fragment: ACTIVITY_UPDATE_FRAGMENT,
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleEntitySelected(
|
async function handleEntitySelected(
|
||||||
selectedUser: UserForSelect | null | undefined,
|
selectedUser: UserForSelect | null | undefined,
|
||||||
) {
|
) {
|
||||||
if (selectedUser) {
|
if (selectedUser) {
|
||||||
|
const workspaceMemberAssignee = (
|
||||||
|
await getWorkspaceMember({
|
||||||
|
variables: {
|
||||||
|
where: {
|
||||||
|
userId: { equals: selectedUser.id },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
).data?.workspaceMembers?.[0];
|
||||||
|
|
||||||
updateActivity({
|
updateActivity({
|
||||||
variables: {
|
variables: {
|
||||||
where: { id: activity.id },
|
where: { id: activity.id },
|
||||||
data: {
|
data: {
|
||||||
assignee: { connect: { id: selectedUser.id } },
|
assignee: { connect: { id: selectedUser.id } },
|
||||||
|
workspaceMemberAssignee: {
|
||||||
|
connect: { id: workspaceMemberAssignee?.id },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
optimisticResponse: {
|
optimisticResponse: {
|
||||||
|
|||||||
@ -48,7 +48,13 @@ export function useOpenCreateActivityDrawer() {
|
|||||||
createdAt: now,
|
createdAt: now,
|
||||||
updatedAt: now,
|
updatedAt: now,
|
||||||
author: { connect: { id: currentUser?.id ?? '' } },
|
author: { connect: { id: currentUser?.id ?? '' } },
|
||||||
|
workspaceMemberAuthor: {
|
||||||
|
connect: { id: currentUser?.workspaceMember?.id ?? '' },
|
||||||
|
},
|
||||||
assignee: { connect: { id: assigneeId ?? currentUser?.id ?? '' } },
|
assignee: { connect: { id: assigneeId ?? currentUser?.id ?? '' } },
|
||||||
|
workspaceMemberAssignee: {
|
||||||
|
connect: { id: currentUser?.workspaceMember?.id ?? '' },
|
||||||
|
},
|
||||||
type: type,
|
type: type,
|
||||||
activityTargets: {
|
activityTargets: {
|
||||||
createMany: {
|
createMany: {
|
||||||
|
|||||||
@ -20,6 +20,33 @@ export const USER_QUERY_FRAGMENT = gql`
|
|||||||
logo
|
logo
|
||||||
inviteHash
|
inviteHash
|
||||||
}
|
}
|
||||||
|
assignedActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredAttachments {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
type
|
||||||
|
}
|
||||||
|
settings {
|
||||||
|
id
|
||||||
|
colorScheme
|
||||||
|
locale
|
||||||
|
}
|
||||||
|
companies {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
domainName
|
||||||
|
}
|
||||||
|
comments {
|
||||||
|
id
|
||||||
|
body
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settings {
|
settings {
|
||||||
id
|
id
|
||||||
|
|||||||
@ -60,7 +60,21 @@ export function useAuth() {
|
|||||||
throw new Error('No verify result');
|
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);
|
setTokenPair(verifyResult.data?.verify.tokens);
|
||||||
|
|
||||||
return verifyResult.data?.verify;
|
return verifyResult.data?.verify;
|
||||||
|
|||||||
@ -1,8 +1,32 @@
|
|||||||
import { atom } from 'recoil';
|
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>({
|
export const currentUserState = atom<CurrentUser | null>({
|
||||||
key: 'currentUserState',
|
key: 'currentUserState',
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import { useTableViews } from '@/views/hooks/useTableViews';
|
|||||||
import {
|
import {
|
||||||
UpdateOneCompanyMutationVariables,
|
UpdateOneCompanyMutationVariables,
|
||||||
useGetCompaniesQuery,
|
useGetCompaniesQuery,
|
||||||
|
useGetWorkspaceMembersLazyQuery,
|
||||||
useUpdateOneCompanyMutation,
|
useUpdateOneCompanyMutation,
|
||||||
} from '~/generated/graphql';
|
} from '~/generated/graphql';
|
||||||
import { companiesFilters } from '~/pages/companies/companies-filters';
|
import { companiesFilters } from '~/pages/companies/companies-filters';
|
||||||
@ -33,6 +34,7 @@ export function CompanyTable() {
|
|||||||
const [updateEntityMutation] = useUpdateOneCompanyMutation();
|
const [updateEntityMutation] = useUpdateOneCompanyMutation();
|
||||||
const upsertEntityTableItem = useUpsertEntityTableItem();
|
const upsertEntityTableItem = useUpsertEntityTableItem();
|
||||||
|
|
||||||
|
const [getWorkspaceMember] = useGetWorkspaceMembersLazyQuery();
|
||||||
const { createView, deleteView, submitCurrentView, updateView } =
|
const { createView, deleteView, submitCurrentView, updateView } =
|
||||||
useTableViews({
|
useTableViews({
|
||||||
objectId: 'company',
|
objectId: 'company',
|
||||||
@ -44,6 +46,40 @@ export function CompanyTable() {
|
|||||||
const { setContextMenuEntries } = useCompanyTableContextMenuEntries();
|
const { setContextMenuEntries } = useCompanyTableContextMenuEntries();
|
||||||
const { setActionBarEntries } = useCompanyTableActionBarEntries();
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<EntityTableEffect
|
<EntityTableEffect
|
||||||
@ -75,17 +111,7 @@ export function CompanyTable() {
|
|||||||
variables,
|
variables,
|
||||||
}: {
|
}: {
|
||||||
variables: UpdateOneCompanyMutationVariables;
|
variables: UpdateOneCompanyMutationVariables;
|
||||||
}) =>
|
}) => updateCompany(variables)}
|
||||||
updateEntityMutation({
|
|
||||||
variables,
|
|
||||||
onCompleted: (data) => {
|
|
||||||
if (!data.updateOneCompany) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
upsertEntityTableItem(data.updateOneCompany);
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
</ViewBarContext.Provider>
|
</ViewBarContext.Provider>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -2,20 +2,36 @@ import { useCallback } from 'react';
|
|||||||
import { useRecoilState } from 'recoil';
|
import { useRecoilState } from 'recoil';
|
||||||
|
|
||||||
import { currentUserState } from '@/auth/states/currentUserState';
|
import { currentUserState } from '@/auth/states/currentUserState';
|
||||||
import { ColorScheme, useUpdateUserMutation } from '~/generated/graphql';
|
import {
|
||||||
|
ColorScheme,
|
||||||
|
useUpdateOneWorkspaceMemberMutation,
|
||||||
|
useUpdateUserMutation,
|
||||||
|
} from '~/generated/graphql';
|
||||||
|
|
||||||
export function useColorScheme() {
|
export function useColorScheme() {
|
||||||
const [currentUser, setCurrentUser] = useRecoilState(currentUserState);
|
const [currentUser, setCurrentUser] = useRecoilState(currentUserState);
|
||||||
|
|
||||||
const [updateUser] = useUpdateUserMutation();
|
const [updateUser] = useUpdateUserMutation();
|
||||||
|
const [updateWorkspaceMember] = useUpdateOneWorkspaceMemberMutation();
|
||||||
|
|
||||||
const colorScheme = !currentUser?.settings?.colorScheme
|
const colorScheme =
|
||||||
? ColorScheme.System
|
!currentUser?.workspaceMember.settings?.colorScheme &&
|
||||||
: currentUser.settings.colorScheme;
|
!currentUser?.settings?.colorScheme
|
||||||
|
? ColorScheme.System
|
||||||
|
: currentUser.workspaceMember.settings?.colorScheme ??
|
||||||
|
currentUser.settings.colorScheme;
|
||||||
|
|
||||||
const setColorScheme = useCallback(
|
const setColorScheme = useCallback(
|
||||||
async (value: ColorScheme) => {
|
async (value: ColorScheme) => {
|
||||||
try {
|
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({
|
const result = await updateUser({
|
||||||
variables: {
|
variables: {
|
||||||
where: {
|
where: {
|
||||||
@ -29,13 +45,14 @@ export function useColorScheme() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
optimisticResponse:
|
optimisticResponse: currentUser
|
||||||
currentUser && currentUser.settings
|
? {
|
||||||
? {
|
__typename: 'Mutation',
|
||||||
__typename: 'Mutation',
|
updateUser: {
|
||||||
updateUser: {
|
__typename: 'User',
|
||||||
__typename: 'User',
|
...currentUser,
|
||||||
...currentUser,
|
workspaceMember: {
|
||||||
|
...currentUser.workspaceMember,
|
||||||
settings: {
|
settings: {
|
||||||
__typename: 'UserSettings',
|
__typename: 'UserSettings',
|
||||||
id: currentUser.settings.id,
|
id: currentUser.settings.id,
|
||||||
@ -43,15 +60,34 @@ export function useColorScheme() {
|
|||||||
locale: currentUser.settings.locale,
|
locale: currentUser.settings.locale,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
settings: {
|
||||||
: undefined,
|
__typename: 'UserSettings',
|
||||||
|
id: currentUser.settings.id,
|
||||||
|
colorScheme: value,
|
||||||
|
locale: currentUser.settings.locale,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
update: (_cache, { data }) => {
|
update: (_cache, { data }) => {
|
||||||
if (data?.updateUser && currentUser) {
|
if (
|
||||||
|
data?.updateUser.workspaceMember?.settings?.colorScheme &&
|
||||||
|
currentUser
|
||||||
|
) {
|
||||||
setCurrentUser({
|
setCurrentUser({
|
||||||
...currentUser,
|
...currentUser,
|
||||||
|
workspaceMember: {
|
||||||
|
...currentUser.workspaceMember,
|
||||||
|
settings: {
|
||||||
|
...currentUser.workspaceMember.settings,
|
||||||
|
colorScheme:
|
||||||
|
data.updateUser.workspaceMember.settings.colorScheme,
|
||||||
|
},
|
||||||
|
},
|
||||||
settings: {
|
settings: {
|
||||||
...currentUser.settings,
|
...currentUser.settings,
|
||||||
colorScheme: data?.updateUser.settings.colorScheme,
|
colorScheme:
|
||||||
|
data.updateUser.workspaceMember.settings.colorScheme,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -63,7 +99,7 @@ export function useColorScheme() {
|
|||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
},
|
},
|
||||||
[currentUser, updateUser, setCurrentUser],
|
[updateWorkspaceMember, currentUser, updateUser, setCurrentUser],
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -14,8 +14,14 @@ export function UserProvider({ children }: React.PropsWithChildren) {
|
|||||||
if (!loading) {
|
if (!loading) {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
if (data?.currentUser) {
|
if (data?.currentUser?.workspaceMember?.settings) {
|
||||||
setCurrentUser(data?.currentUser);
|
setCurrentUser({
|
||||||
|
...data.currentUser,
|
||||||
|
workspaceMember: {
|
||||||
|
...data.currentUser.workspaceMember,
|
||||||
|
settings: data.currentUser.workspaceMember.settings,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, [setCurrentUser, data, isLoading, loading]);
|
}, [setCurrentUser, data, isLoading, loading]);
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,33 @@ export const UPDATE_USER = gql`
|
|||||||
logo
|
logo
|
||||||
inviteHash
|
inviteHash
|
||||||
}
|
}
|
||||||
|
assignedActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredAttachments {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
type
|
||||||
|
}
|
||||||
|
settings {
|
||||||
|
id
|
||||||
|
colorScheme
|
||||||
|
locale
|
||||||
|
}
|
||||||
|
companies {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
domainName
|
||||||
|
}
|
||||||
|
comments {
|
||||||
|
id
|
||||||
|
body
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settings {
|
settings {
|
||||||
id
|
id
|
||||||
|
|||||||
@ -20,6 +20,33 @@ export const GET_CURRENT_USER = gql`
|
|||||||
logo
|
logo
|
||||||
inviteHash
|
inviteHash
|
||||||
}
|
}
|
||||||
|
assignedActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredActivities {
|
||||||
|
id
|
||||||
|
title
|
||||||
|
}
|
||||||
|
authoredAttachments {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
type
|
||||||
|
}
|
||||||
|
settings {
|
||||||
|
id
|
||||||
|
colorScheme
|
||||||
|
locale
|
||||||
|
}
|
||||||
|
companies {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
domainName
|
||||||
|
}
|
||||||
|
comments {
|
||||||
|
id
|
||||||
|
body
|
||||||
|
}
|
||||||
}
|
}
|
||||||
settings {
|
settings {
|
||||||
id
|
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';
|
import { gql } from '@apollo/client';
|
||||||
|
|
||||||
export const GET_WORKSPACE_MEMBERS = gql`
|
export const GET_WORKSPACE_MEMBERS = gql`
|
||||||
query GetWorkspaceMembers {
|
query GetWorkspaceMembers($where: WorkspaceMemberWhereInput) {
|
||||||
workspaceMembers: findManyWorkspaceMember {
|
workspaceMembers: findManyWorkspaceMember(where: $where) {
|
||||||
id
|
id
|
||||||
user {
|
user {
|
||||||
id
|
id
|
||||||
|
|||||||
@ -38,7 +38,22 @@ export function ImpersonateEffect() {
|
|||||||
throw new Error('No impersonate result');
|
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);
|
setTokenPair(impersonateResult.data?.impersonate.tokens);
|
||||||
|
|
||||||
return impersonateResult.data?.impersonate;
|
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 =
|
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=';
|
'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',
|
inviteHash: 'twenty.com-invite-hash',
|
||||||
logo: workspaceLogoUrl,
|
logo: workspaceLogoUrl,
|
||||||
},
|
},
|
||||||
|
settings: {
|
||||||
|
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||||
|
__typename: 'UserSettings',
|
||||||
|
locale: 'en',
|
||||||
|
colorScheme: ColorScheme.System,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||||
@ -59,6 +97,12 @@ export const mockedUsersData: Array<MockedUser> = [
|
|||||||
inviteHash: 'twenty.com-invite-hash',
|
inviteHash: 'twenty.com-invite-hash',
|
||||||
logo: workspaceLogoUrl,
|
logo: workspaceLogoUrl,
|
||||||
},
|
},
|
||||||
|
settings: {
|
||||||
|
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||||
|
__typename: 'UserSettings',
|
||||||
|
locale: 'en',
|
||||||
|
colorScheme: ColorScheme.System,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdt7a',
|
id: '7dfbc3f7-6e5e-4128-957e-8d86808cdt7a',
|
||||||
@ -92,6 +136,12 @@ export const mockedOnboardingUsersData: Array<MockedUser> = [
|
|||||||
inviteHash: 'twenty.com-invite-hash-1',
|
inviteHash: 'twenty.com-invite-hash-1',
|
||||||
logo: '',
|
logo: '',
|
||||||
},
|
},
|
||||||
|
settings: {
|
||||||
|
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||||
|
__typename: 'UserSettings',
|
||||||
|
locale: 'en',
|
||||||
|
colorScheme: ColorScheme.System,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||||
@ -122,6 +172,12 @@ export const mockedOnboardingUsersData: Array<MockedUser> = [
|
|||||||
inviteHash: 'twenty.com-invite-hash-2',
|
inviteHash: 'twenty.com-invite-hash-2',
|
||||||
logo: '',
|
logo: '',
|
||||||
},
|
},
|
||||||
|
settings: {
|
||||||
|
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||||
|
__typename: 'UserSettings',
|
||||||
|
locale: 'en',
|
||||||
|
colorScheme: ColorScheme.System,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
id: '7dfbc3f7-6e5e-4128-957e-8d86808cde9y',
|
||||||
|
|||||||
@ -78,6 +78,10 @@ export class AbilityFactory {
|
|||||||
can(AbilityAction.Read, 'WorkspaceMember', { workspaceId: workspace.id });
|
can(AbilityAction.Read, 'WorkspaceMember', { workspaceId: workspace.id });
|
||||||
can(AbilityAction.Delete, 'WorkspaceMember', { workspaceId: workspace.id });
|
can(AbilityAction.Delete, 'WorkspaceMember', { workspaceId: workspace.id });
|
||||||
cannot(AbilityAction.Delete, 'WorkspaceMember', { userId: user.id });
|
cannot(AbilityAction.Delete, 'WorkspaceMember', { userId: user.id });
|
||||||
|
can(AbilityAction.Update, 'WorkspaceMember', {
|
||||||
|
userId: user.id,
|
||||||
|
workspaceId: workspace.id,
|
||||||
|
});
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
can(AbilityAction.Read, 'Company', { workspaceId: workspace.id });
|
can(AbilityAction.Read, 'Company', { workspaceId: workspace.id });
|
||||||
|
|||||||
@ -89,11 +89,6 @@ export class AuthService {
|
|||||||
email: signUpInput.email,
|
email: signUpInput.email,
|
||||||
passwordHash,
|
passwordHash,
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
settings: {
|
|
||||||
create: {
|
|
||||||
locale: 'en',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as Prisma.UserCreateArgs,
|
} as Prisma.UserCreateArgs,
|
||||||
workspace.id,
|
workspace.id,
|
||||||
@ -105,11 +100,6 @@ export class AuthService {
|
|||||||
email: signUpInput.email,
|
email: signUpInput.email,
|
||||||
passwordHash,
|
passwordHash,
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
settings: {
|
|
||||||
create: {
|
|
||||||
locale: 'en',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
} as Prisma.UserCreateArgs);
|
} as Prisma.UserCreateArgs);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,6 +67,12 @@ export class UserService {
|
|||||||
|
|
||||||
assert(workspace, 'workspace is missing', BadRequestException);
|
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
|
// Create user
|
||||||
const user = await this.prismaService.client.user.upsert({
|
const user = await this.prismaService.client.user.upsert({
|
||||||
where: {
|
where: {
|
||||||
@ -74,12 +80,14 @@ export class UserService {
|
|||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
...(args.data as Prisma.UserCreateInput),
|
...(args.data as Prisma.UserCreateInput),
|
||||||
|
settings,
|
||||||
|
|
||||||
workspaceMember: {
|
workspaceMember: {
|
||||||
create: {
|
create: {
|
||||||
workspace: {
|
workspace: {
|
||||||
connect: { id: workspace.id },
|
connect: { id: workspace.id },
|
||||||
},
|
},
|
||||||
|
settings,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { Args, Query, Resolver, Mutation } from '@nestjs/graphql';
|
|||||||
import { UseGuards } from '@nestjs/common';
|
import { UseGuards } from '@nestjs/common';
|
||||||
|
|
||||||
import { accessibleBy } from '@casl/prisma';
|
import { accessibleBy } from '@casl/prisma';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
|
||||||
import { WorkspaceMember } from 'src/core/@generated/workspace-member/workspace-member.model';
|
import { WorkspaceMember } from 'src/core/@generated/workspace-member/workspace-member.model';
|
||||||
import { AbilityGuard } from 'src/guards/ability.guard';
|
import { AbilityGuard } from 'src/guards/ability.guard';
|
||||||
@ -9,6 +10,7 @@ import { CheckAbilities } from 'src/decorators/check-abilities.decorator';
|
|||||||
import {
|
import {
|
||||||
DeleteWorkspaceMemberAbilityHandler,
|
DeleteWorkspaceMemberAbilityHandler,
|
||||||
ReadWorkspaceMemberAbilityHandler,
|
ReadWorkspaceMemberAbilityHandler,
|
||||||
|
UpdateWorkspaceMemberAbilityHandler,
|
||||||
} from 'src/ability/handlers/workspace-member.ability-handler';
|
} from 'src/ability/handlers/workspace-member.ability-handler';
|
||||||
import { FindManyWorkspaceMemberArgs } from 'src/core/@generated/workspace-member/find-many-workspace-member.args';
|
import { FindManyWorkspaceMemberArgs } from 'src/core/@generated/workspace-member/find-many-workspace-member.args';
|
||||||
import { UserAbility } from 'src/decorators/user-ability.decorator';
|
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 { JwtAuthGuard } from 'src/guards/jwt.auth.guard';
|
||||||
import { AuthUser } from 'src/decorators/auth-user.decorator';
|
import { AuthUser } from 'src/decorators/auth-user.decorator';
|
||||||
import { User } from 'src/core/@generated/user/user.model';
|
import { User } from 'src/core/@generated/user/user.model';
|
||||||
|
import { UpdateOneWorkspaceMemberArgs } from 'src/core/@generated/workspace-member/update-one-workspace-member.args';
|
||||||
|
|
||||||
@UseGuards(JwtAuthGuard)
|
@UseGuards(JwtAuthGuard)
|
||||||
@Resolver(() => WorkspaceMember)
|
@Resolver(() => WorkspaceMember)
|
||||||
@ -81,4 +84,19 @@ export class WorkspaceMemberResolver {
|
|||||||
select: prismaSelect.value,
|
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()
|
/// @Validator.IsString()
|
||||||
locale String
|
locale String
|
||||||
|
|
||||||
user User?
|
user User?
|
||||||
|
WorkspaceMember WorkspaceMember[]
|
||||||
|
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
@ -210,6 +211,15 @@ model WorkspaceMember {
|
|||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
Favorite Favorite[]
|
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")
|
@@map("workspace_members")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,13 +252,15 @@ model Company {
|
|||||||
/// @Validator.IsOptional()
|
/// @Validator.IsOptional()
|
||||||
employees Int?
|
employees Int?
|
||||||
|
|
||||||
people Person[]
|
people Person[]
|
||||||
accountOwner User? @relation(fields: [accountOwnerId], references: [id], onDelete: SetNull)
|
accountOwner User? @relation(fields: [accountOwnerId], references: [id], onDelete: SetNull)
|
||||||
accountOwnerId String?
|
accountOwnerId String?
|
||||||
|
workspaceMemberAccountOwner WorkspaceMember? @relation(fields: [workspaceMemberAccountOwnerId], references: [id], onDelete: SetNull)
|
||||||
|
workspaceMemberAccountOwnerId String?
|
||||||
/// @TypeGraphQL.omit(input: true, output: true)
|
/// @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)
|
/// @TypeGraphQL.omit(input: true, output: true)
|
||||||
workspaceId String
|
workspaceId String
|
||||||
|
|
||||||
/// @TypeGraphQL.omit(input: true, output: true)
|
/// @TypeGraphQL.omit(input: true, output: true)
|
||||||
deletedAt DateTime?
|
deletedAt DateTime?
|
||||||
@ -358,12 +370,20 @@ model Activity {
|
|||||||
attachments Attachment[]
|
attachments Attachment[]
|
||||||
author User @relation(fields: [authorId], references: [id], name: "authoredActivities", onDelete: Cascade)
|
author User @relation(fields: [authorId], references: [id], name: "authoredActivities", onDelete: Cascade)
|
||||||
authorId String
|
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)
|
/// @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)
|
/// @TypeGraphQL.omit(input: true, output: true)
|
||||||
workspaceId String
|
workspaceId String
|
||||||
|
|
||||||
/// @TypeGraphQL.omit(input: true, output: true)
|
/// @TypeGraphQL.omit(input: true, output: true)
|
||||||
deletedAt DateTime?
|
deletedAt DateTime?
|
||||||
@ -381,8 +401,12 @@ model Comment {
|
|||||||
/// @Validator.IsString()
|
/// @Validator.IsString()
|
||||||
body String
|
body String
|
||||||
|
|
||||||
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
|
||||||
authorId String
|
authorId String
|
||||||
|
|
||||||
|
workspaceMemberAuthor WorkspaceMember? @relation(fields: [workspaceMemberAuthorId], references: [id], onDelete: Cascade)
|
||||||
|
workspaceMemberAuthorId String?
|
||||||
|
|
||||||
activity Activity? @relation(fields: [activityId], references: [id], onDelete: Cascade)
|
activity Activity? @relation(fields: [activityId], references: [id], onDelete: Cascade)
|
||||||
activityId String?
|
activityId String?
|
||||||
commentThreadId String?
|
commentThreadId String?
|
||||||
@ -550,8 +574,12 @@ model Attachment {
|
|||||||
/// @TypeGraphQL.omit(input: true, output: true)
|
/// @TypeGraphQL.omit(input: true, output: true)
|
||||||
workspaceId String
|
workspaceId String
|
||||||
|
|
||||||
author User @relation(fields: [authorId], references: [id], name: "authoredAttachments", onDelete: Cascade)
|
author User @relation(fields: [authorId], references: [id], name: "authoredAttachments", onDelete: Cascade)
|
||||||
authorId String
|
authorId String
|
||||||
|
|
||||||
|
workspaceMemberAuthor WorkspaceMember? @relation(fields: [workspaceMemberAuthorId], references: [id], name: "authoredAttachments", onDelete: Cascade)
|
||||||
|
workspaceMemberAuthorId String?
|
||||||
|
|
||||||
activity Activity @relation(fields: [activityId], references: [id], onDelete: Cascade)
|
activity Activity @relation(fields: [activityId], references: [id], onDelete: Cascade)
|
||||||
activityId String
|
activityId String
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,13 @@
|
|||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
export const seedUsers = async (prisma: PrismaClient) => {
|
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({
|
await prisma.user.upsert({
|
||||||
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfc102' },
|
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfc102' },
|
||||||
update: {},
|
update: {},
|
||||||
@ -11,11 +19,7 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
|||||||
locale: 'en',
|
locale: 'en',
|
||||||
passwordHash:
|
passwordHash:
|
||||||
'$2b$10$66d.6DuQExxnrfI9rMqOg.U1XIYpagr6Lv05uoWLYbYmtK0HDIvS6', // Applecar2025
|
'$2b$10$66d.6DuQExxnrfI9rMqOg.U1XIYpagr6Lv05uoWLYbYmtK0HDIvS6', // Applecar2025
|
||||||
settings: {
|
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-9dcb1084c109',
|
||||||
create: {
|
|
||||||
locale: 'en',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
avatarUrl: null,
|
avatarUrl: null,
|
||||||
workspaceMember: {
|
workspaceMember: {
|
||||||
connectOrCreate: {
|
connectOrCreate: {
|
||||||
@ -24,12 +28,21 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
|||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
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({
|
await prisma.user.upsert({
|
||||||
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408' },
|
where: { id: 'twenty-ge256b39-3ec3-4fe3-8997-b76aa0bfa408' },
|
||||||
update: {},
|
update: {},
|
||||||
@ -39,21 +52,26 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
|||||||
lastName: 'Ive',
|
lastName: 'Ive',
|
||||||
email: 'jony.ive@apple.dev',
|
email: 'jony.ive@apple.dev',
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
settings: {
|
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-2c4a2035a215',
|
||||||
create: {
|
|
||||||
locale: 'en',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
avatarUrl: null,
|
avatarUrl: null,
|
||||||
workspaceMember: {
|
workspaceMember: {
|
||||||
create: {
|
create: {
|
||||||
id: 'twenty-7ef9d213-1c25-4d02-bf35-6aeccf7ea419',
|
id: 'twenty-7ef9d213-1c25-4d02-bf35-6aeccf7ea419',
|
||||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-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({
|
await prisma.user.upsert({
|
||||||
where: { id: 'twenty-gk256b39-3ec3-4fe3-8997-b76aa0bfa408' },
|
where: { id: 'twenty-gk256b39-3ec3-4fe3-8997-b76aa0bfa408' },
|
||||||
update: {},
|
update: {},
|
||||||
@ -63,21 +81,26 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
|||||||
lastName: 'Schiler',
|
lastName: 'Schiler',
|
||||||
email: 'phil.schiler@apple.dev',
|
email: 'phil.schiler@apple.dev',
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
settings: {
|
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-8e1f2097b328',
|
||||||
create: {
|
|
||||||
locale: 'en',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
avatarUrl: null,
|
avatarUrl: null,
|
||||||
workspaceMember: {
|
workspaceMember: {
|
||||||
create: {
|
create: {
|
||||||
id: 'twenty-7ed9d213-1c25-4d02-bf35-6aeccf7ea419',
|
id: 'twenty-7ed9d213-1c25-4d02-bf35-6aeccf7ea419',
|
||||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-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({
|
await prisma.user.upsert({
|
||||||
where: { id: 'twenty-dev-gk256b39-3ec3-4fe3-8997-b76aa0boa408' },
|
where: { id: 'twenty-dev-gk256b39-3ec3-4fe3-8997-b76aa0boa408' },
|
||||||
update: {},
|
update: {},
|
||||||
@ -87,15 +110,12 @@ export const seedUsers = async (prisma: PrismaClient) => {
|
|||||||
lastName: 'Bochet',
|
lastName: 'Bochet',
|
||||||
email: 'charles@twenty.dev',
|
email: 'charles@twenty.dev',
|
||||||
locale: 'en',
|
locale: 'en',
|
||||||
settings: {
|
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-5e2d1049c430',
|
||||||
create: {
|
|
||||||
locale: 'en',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
workspaceMember: {
|
workspaceMember: {
|
||||||
create: {
|
create: {
|
||||||
id: 'twenty-dev-7ed9d213-1c25-4d02-bf35-6aeccf7oa419',
|
id: 'twenty-dev-7ed9d213-1c25-4d02-bf35-6aeccf7oa419',
|
||||||
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
|
workspaceId: 'twenty-dev-7ed9d212-1c25-4d02-bf25-6aeccf7ea420',
|
||||||
|
settingsId: 'twenty-ge256b39-3ec3-4fe3-8997-5e2d1049c430',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user