Skip to content

The open alternative to Salesforce, designed for AI.

Feature/filter and sort board (#725)

Emilien Chauvet6301bc2fbfce
diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx
index 9c64512583e..9ebf6e2aae3 100644
--- a/front/src/generated/graphql.tsx
+++ b/front/src/generated/graphql.tsx
@@ -3372,57 +3372,6 @@ export type WorkspaceUpdateInput = {
workspaceMember?: InputMaybe<WorkspaceMemberUpdateManyWithoutWorkspaceNestedInput>;
};
-export type CreateEventMutationVariables = Exact<{
- type: Scalars['String'];
- data: Scalars['JSON'];
-}>;
-
-
-export type CreateEventMutation = { __typename?: 'Mutation', createEvent: { __typename?: 'Analytics', success: boolean } };
-
-export type CheckUserExistsQueryVariables = Exact<{
- email: Scalars['String'];
-}>;
-
-
-export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __typename?: 'UserExists', exists: boolean } };
-
-export type ChallengeMutationVariables = Exact<{
- email: Scalars['String'];
- password: Scalars['String'];
-}>;
-
-
-export type ChallengeMutation = { __typename?: 'Mutation', challenge: { __typename?: 'LoginToken', loginToken: { __typename?: 'AuthToken', expiresAt: string, token: string } } };
-
-export type SignUpMutationVariables = Exact<{
- email: Scalars['String'];
- password: Scalars['String'];
- workspaceInviteHash?: InputMaybe<Scalars['String']>;
-}>;
-
-
-export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'LoginToken', loginToken: { __typename?: 'AuthToken', expiresAt: string, token: string } } };
-
-export type VerifyMutationVariables = Exact<{
- loginToken: Scalars['String'];
-}>;
-
-
-export type VerifyMutation = { __typename?: 'Mutation', verify: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null } } | null }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
-
-export type RenewTokenMutationVariables = Exact<{
- refreshToken: Scalars['String'];
-}>;
-
-
-export type RenewTokenMutation = { __typename?: 'Mutation', renewToken: { __typename?: 'AuthTokens', tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', expiresAt: string, token: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
-
-export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>;
-
-
-export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', demoMode: boolean, debugMode: boolean, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean }, telemetry: { __typename?: 'Telemetry', enabled: boolean, anonymizationEnabled: boolean } } };
-
export type CreateCommentMutationVariables = Exact<{
commentId: Scalars['String'];
commentText: Scalars['String'];
@@ -3498,6 +3447,57 @@ export type UpdateCommentThreadMutationVariables = Exact<{
export type UpdateCommentThreadMutation = { __typename?: 'Mutation', updateOneCommentThread: { __typename?: 'CommentThread', id: string, body?: string | null, title?: string | null, type: ActivityType } };
+export type CreateEventMutationVariables = Exact<{
+ type: Scalars['String'];
+ data: Scalars['JSON'];
+}>;
+
+
+export type CreateEventMutation = { __typename?: 'Mutation', createEvent: { __typename?: 'Analytics', success: boolean } };
+
+export type CheckUserExistsQueryVariables = Exact<{
+ email: Scalars['String'];
+}>;
+
+
+export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __typename?: 'UserExists', exists: boolean } };
+
+export type ChallengeMutationVariables = Exact<{
+ email: Scalars['String'];
+ password: Scalars['String'];
+}>;
+
+
+export type ChallengeMutation = { __typename?: 'Mutation', challenge: { __typename?: 'LoginToken', loginToken: { __typename?: 'AuthToken', expiresAt: string, token: string } } };
+
+export type SignUpMutationVariables = Exact<{
+ email: Scalars['String'];
+ password: Scalars['String'];
+ workspaceInviteHash?: InputMaybe<Scalars['String']>;
+}>;
+
+
+export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'LoginToken', loginToken: { __typename?: 'AuthToken', expiresAt: string, token: string } } };
+
+export type VerifyMutationVariables = Exact<{
+ loginToken: Scalars['String'];
+}>;
+
+
+export type VerifyMutation = { __typename?: 'Mutation', verify: { __typename?: 'Verify', user: { __typename?: 'User', id: string, email: string, displayName: string, firstName?: string | null, lastName?: string | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: string, workspace: { __typename?: 'Workspace', id: string, domainName?: string | null, displayName?: string | null, logo?: string | null } } | null }, tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
+
+export type RenewTokenMutationVariables = Exact<{
+ refreshToken: Scalars['String'];
+}>;
+
+
+export type RenewTokenMutation = { __typename?: 'Mutation', renewToken: { __typename?: 'AuthTokens', tokens: { __typename?: 'AuthTokenPair', accessToken: { __typename?: 'AuthToken', expiresAt: string, token: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
+
+export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>;
+
+
+export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', demoMode: boolean, debugMode: boolean, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean }, telemetry: { __typename?: 'Telemetry', enabled: boolean, anonymizationEnabled: boolean } } };
+
export type GetCompaniesQueryVariables = Exact<{
orderBy?: InputMaybe<Array<CompanyOrderByWithRelationInput> | CompanyOrderByWithRelationInput>;
where?: InputMaybe<CompanyWhereInput>;
@@ -3649,14 +3649,15 @@ export type GetPipelinesQueryVariables = Exact<{
}>;
-export type GetPipelinesQuery = { __typename?: 'Query', findManyPipeline: Array<{ __typename?: 'Pipeline', id: string, name: string, pipelineProgressableType: PipelineProgressableType, pipelineStages?: Array<{ __typename?: 'PipelineStage', id: string, name: string, color: string, index?: number | null, pipelineProgresses?: Array<{ __typename?: 'PipelineProgress', id: string }> | null }> | null }> };
+export type GetPipelinesQuery = { __typename?: 'Query', findManyPipeline: Array<{ __typename?: 'Pipeline', id: string, name: string, pipelineProgressableType: PipelineProgressableType, pipelineStages?: Array<{ __typename?: 'PipelineStage', id: string, name: string, color: string, index?: number | null }> | null }> };
export type GetPipelineProgressQueryVariables = Exact<{
where?: InputMaybe<PipelineProgressWhereInput>;
+ orderBy?: InputMaybe<Array<PipelineProgressOrderByWithRelationInput> | PipelineProgressOrderByWithRelationInput>;
}>;
-export type GetPipelineProgressQuery = { __typename?: 'Query', findManyPipelineProgress: Array<{ __typename?: 'PipelineProgress', id: string, progressableType: PipelineProgressableType, progressableId: string, amount?: number | null, closeDate?: string | null }> };
+export type GetPipelineProgressQuery = { __typename?: 'Query', findManyPipelineProgress: Array<{ __typename?: 'PipelineProgress', id: string, pipelineStageId: string, progressableType: PipelineProgressableType, progressableId: string, amount?: number | null, closeDate?: string | null }> };
export type UpdateOnePipelineProgressMutationVariables = Exact<{
id?: InputMaybe<Scalars['String']>;
@@ -3797,706 +3798,706 @@ export type RemoveWorkspaceMemberMutationVariables = Exact<{
export type RemoveWorkspaceMemberMutation = { __typename?: 'Mutation', deleteWorkspaceMember: { __typename?: 'WorkspaceMember', id: string } };
-export const CreateEventDocument = gql`
- mutation CreateEvent($type: String!, $data: JSON!) {
- createEvent(type: $type, data: $data) {
- success
+export const CreateCommentDocument = gql`
+ mutation CreateComment($commentId: String!, $commentText: String!, $authorId: String!, $commentThreadId: String!, $createdAt: DateTime!) {
+ createOneComment(
+ data: {id: $commentId, createdAt: $createdAt, body: $commentText, author: {connect: {id: $authorId}}, commentThread: {connect: {id: $commentThreadId}}}
+ ) {
+ id
+ createdAt
+ body
+ author {
+ id
+ displayName
+ firstName
+ lastName
+ avatarUrl
+ }
+ commentThreadId
}
}
`;
-export type CreateEventMutationFn = Apollo.MutationFunction<CreateEventMutation, CreateEventMutationVariables>;
+export type CreateCommentMutationFn = Apollo.MutationFunction<CreateCommentMutation, CreateCommentMutationVariables>;
/**
- * __useCreateEventMutation__
+ * __useCreateCommentMutation__
*
- * To run a mutation, you first call `useCreateEventMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useCreateEventMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useCreateCommentMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useCreateCommentMutation` 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 [createEventMutation, { data, loading, error }] = useCreateEventMutation({
+ * const [createCommentMutation, { data, loading, error }] = useCreateCommentMutation({
* variables: {
- * type: // value for 'type'
- * data: // value for 'data'
+ * commentId: // value for 'commentId'
+ * commentText: // value for 'commentText'
+ * authorId: // value for 'authorId'
+ * commentThreadId: // value for 'commentThreadId'
+ * createdAt: // value for 'createdAt'
* },
* });
*/
-export function useCreateEventMutation(baseOptions?: Apollo.MutationHookOptions<CreateEventMutation, CreateEventMutationVariables>) {
+export function useCreateCommentMutation(baseOptions?: Apollo.MutationHookOptions<CreateCommentMutation, CreateCommentMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<CreateEventMutation, CreateEventMutationVariables>(CreateEventDocument, options);
+ return Apollo.useMutation<CreateCommentMutation, CreateCommentMutationVariables>(CreateCommentDocument, options);
}
-export type CreateEventMutationHookResult = ReturnType<typeof useCreateEventMutation>;
-export type CreateEventMutationResult = Apollo.MutationResult<CreateEventMutation>;
-export type CreateEventMutationOptions = Apollo.BaseMutationOptions<CreateEventMutation, CreateEventMutationVariables>;
-export const CheckUserExistsDocument = gql`
- query CheckUserExists($email: String!) {
- checkUserExists(email: $email) {
- exists
- }
-}
- `;
-
-/**
- * __useCheckUserExistsQuery__
- *
- * To run a query within a React component, call `useCheckUserExistsQuery` and pass it any options that fit your needs.
- * When your component renders, `useCheckUserExistsQuery` returns an object from Apollo Client that contains loading, error, and data properties
- * you can use to render your UI.
- *
- * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
- *
- * @example
- * const { data, loading, error } = useCheckUserExistsQuery({
- * variables: {
- * email: // value for 'email'
- * },
- * });
- */
-export function useCheckUserExistsQuery(baseOptions: Apollo.QueryHookOptions<CheckUserExistsQuery, CheckUserExistsQueryVariables>) {
- const options = {...defaultOptions, ...baseOptions}
- return Apollo.useQuery<CheckUserExistsQuery, CheckUserExistsQueryVariables>(CheckUserExistsDocument, options);
+export type CreateCommentMutationHookResult = ReturnType<typeof useCreateCommentMutation>;
+export type CreateCommentMutationResult = Apollo.MutationResult<CreateCommentMutation>;
+export type CreateCommentMutationOptions = Apollo.BaseMutationOptions<CreateCommentMutation, CreateCommentMutationVariables>;
+export const CreateCommentThreadDocument = gql`
+ mutation CreateCommentThread($commentThreadId: String!, $body: String, $title: String, $type: ActivityType!, $authorId: String!, $createdAt: DateTime!, $commentThreadTargetArray: [CommentThreadTargetCreateManyCommentThreadInput!]!) {
+ createOneCommentThread(
+ data: {id: $commentThreadId, createdAt: $createdAt, updatedAt: $createdAt, author: {connect: {id: $authorId}}, body: $body, title: $title, type: $type, commentThreadTargets: {createMany: {data: $commentThreadTargetArray, skipDuplicates: true}}}
+ ) {
+ id
+ createdAt
+ updatedAt
+ authorId
+ type
+ commentThreadTargets {
+ id
+ createdAt
+ updatedAt
+ commentThreadId
+ commentableType
+ commentableId
+ }
+ comments {
+ id
+ createdAt
+ updatedAt
+ body
+ author {
+ id
}
-export function useCheckUserExistsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CheckUserExistsQuery, CheckUserExistsQueryVariables>) {
- const options = {...defaultOptions, ...baseOptions}
- return Apollo.useLazyQuery<CheckUserExistsQuery, CheckUserExistsQueryVariables>(CheckUserExistsDocument, options);
- }
-export type CheckUserExistsQueryHookResult = ReturnType<typeof useCheckUserExistsQuery>;
-export type CheckUserExistsLazyQueryHookResult = ReturnType<typeof useCheckUserExistsLazyQuery>;
-export type CheckUserExistsQueryResult = Apollo.QueryResult<CheckUserExistsQuery, CheckUserExistsQueryVariables>;
-export const ChallengeDocument = gql`
- mutation Challenge($email: String!, $password: String!) {
- challenge(email: $email, password: $password) {
- loginToken {
- expiresAt
- token
}
}
}
`;
-export type ChallengeMutationFn = Apollo.MutationFunction<ChallengeMutation, ChallengeMutationVariables>;
+export type CreateCommentThreadMutationFn = Apollo.MutationFunction<CreateCommentThreadMutation, CreateCommentThreadMutationVariables>;
/**
- * __useChallengeMutation__
+ * __useCreateCommentThreadMutation__
*
- * To run a mutation, you first call `useChallengeMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useChallengeMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useCreateCommentThreadMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useCreateCommentThreadMutation` 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 [challengeMutation, { data, loading, error }] = useChallengeMutation({
+ * const [createCommentThreadMutation, { data, loading, error }] = useCreateCommentThreadMutation({
* variables: {
- * email: // value for 'email'
- * password: // value for 'password'
+ * commentThreadId: // value for 'commentThreadId'
+ * body: // value for 'body'
+ * title: // value for 'title'
+ * type: // value for 'type'
+ * authorId: // value for 'authorId'
+ * createdAt: // value for 'createdAt'
+ * commentThreadTargetArray: // value for 'commentThreadTargetArray'
* },
* });
*/
-export function useChallengeMutation(baseOptions?: Apollo.MutationHookOptions<ChallengeMutation, ChallengeMutationVariables>) {
+export function useCreateCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<CreateCommentThreadMutation, CreateCommentThreadMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<ChallengeMutation, ChallengeMutationVariables>(ChallengeDocument, options);
+ return Apollo.useMutation<CreateCommentThreadMutation, CreateCommentThreadMutationVariables>(CreateCommentThreadDocument, options);
}
-export type ChallengeMutationHookResult = ReturnType<typeof useChallengeMutation>;
-export type ChallengeMutationResult = Apollo.MutationResult<ChallengeMutation>;
-export type ChallengeMutationOptions = Apollo.BaseMutationOptions<ChallengeMutation, ChallengeMutationVariables>;
-export const SignUpDocument = gql`
- mutation SignUp($email: String!, $password: String!, $workspaceInviteHash: String) {
- signUp(
- email: $email
- password: $password
- workspaceInviteHash: $workspaceInviteHash
+export type CreateCommentThreadMutationHookResult = ReturnType<typeof useCreateCommentThreadMutation>;
+export type CreateCommentThreadMutationResult = Apollo.MutationResult<CreateCommentThreadMutation>;
+export type CreateCommentThreadMutationOptions = Apollo.BaseMutationOptions<CreateCommentThreadMutation, CreateCommentThreadMutationVariables>;
+export const GetCommentThreadsByTargetsDocument = gql`
+ query GetCommentThreadsByTargets($commentThreadTargetIds: [String!]!, $orderBy: [CommentThreadOrderByWithRelationInput!]) {
+ findManyCommentThreads(
+ orderBy: $orderBy
+ where: {commentThreadTargets: {some: {commentableId: {in: $commentThreadTargetIds}}}}
) {
- loginToken {
- expiresAt
- token
+ id
+ createdAt
+ title
+ body
+ type
+ author {
+ id
+ firstName
+ lastName
+ }
+ comments {
+ id
+ body
+ createdAt
+ updatedAt
+ author {
+ id
+ displayName
+ firstName
+ lastName
+ avatarUrl
+ }
+ }
+ commentThreadTargets {
+ id
+ commentableId
+ commentableType
}
}
}
`;
-export type SignUpMutationFn = Apollo.MutationFunction<SignUpMutation, SignUpMutationVariables>;
/**
- * __useSignUpMutation__
+ * __useGetCommentThreadsByTargetsQuery__
*
- * To run a mutation, you first call `useSignUpMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useSignUpMutation` 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
+ * To run a query within a React component, call `useGetCommentThreadsByTargetsQuery` and pass it any options that fit your needs.
+ * When your component renders, `useGetCommentThreadsByTargetsQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
*
- * @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;
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
- * const [signUpMutation, { data, loading, error }] = useSignUpMutation({
+ * const { data, loading, error } = useGetCommentThreadsByTargetsQuery({
* variables: {
- * email: // value for 'email'
- * password: // value for 'password'
- * workspaceInviteHash: // value for 'workspaceInviteHash'
+ * commentThreadTargetIds: // value for 'commentThreadTargetIds'
+ * orderBy: // value for 'orderBy'
* },
* });
*/
-export function useSignUpMutation(baseOptions?: Apollo.MutationHookOptions<SignUpMutation, SignUpMutationVariables>) {
+export function useGetCommentThreadsByTargetsQuery(baseOptions: Apollo.QueryHookOptions<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<SignUpMutation, SignUpMutationVariables>(SignUpDocument, options);
+ return Apollo.useQuery<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>(GetCommentThreadsByTargetsDocument, options);
}
-export type SignUpMutationHookResult = ReturnType<typeof useSignUpMutation>;
-export type SignUpMutationResult = Apollo.MutationResult<SignUpMutation>;
-export type SignUpMutationOptions = Apollo.BaseMutationOptions<SignUpMutation, SignUpMutationVariables>;
-export const VerifyDocument = gql`
- mutation Verify($loginToken: String!) {
- verify(loginToken: $loginToken) {
- user {
+export function useGetCommentThreadsByTargetsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>(GetCommentThreadsByTargetsDocument, options);
+ }
+export type GetCommentThreadsByTargetsQueryHookResult = ReturnType<typeof useGetCommentThreadsByTargetsQuery>;
+export type GetCommentThreadsByTargetsLazyQueryHookResult = ReturnType<typeof useGetCommentThreadsByTargetsLazyQuery>;
+export type GetCommentThreadsByTargetsQueryResult = Apollo.QueryResult<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>;
+export const GetCommentThreadDocument = gql`
+ query GetCommentThread($commentThreadId: String!) {
+ findManyCommentThreads(where: {id: {equals: $commentThreadId}}) {
+ id
+ createdAt
+ body
+ title
+ type
+ author {
id
- email
- displayName
firstName
lastName
- workspaceMember {
+ }
+ comments {
+ id
+ body
+ createdAt
+ updatedAt
+ author {
id
- workspace {
- id
- domainName
- displayName
- logo
- }
+ displayName
+ firstName
+ lastName
+ avatarUrl
}
}
- tokens {
- accessToken {
- token
- expiresAt
- }
- refreshToken {
- token
- expiresAt
- }
+ commentThreadTargets {
+ id
+ commentableId
+ commentableType
}
}
}
`;
-export type VerifyMutationFn = Apollo.MutationFunction<VerifyMutation, VerifyMutationVariables>;
/**
- * __useVerifyMutation__
+ * __useGetCommentThreadQuery__
*
- * To run a mutation, you first call `useVerifyMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useVerifyMutation` 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
+ * To run a query within a React component, call `useGetCommentThreadQuery` and pass it any options that fit your needs.
+ * When your component renders, `useGetCommentThreadQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
*
- * @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;
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
- * const [verifyMutation, { data, loading, error }] = useVerifyMutation({
+ * const { data, loading, error } = useGetCommentThreadQuery({
* variables: {
- * loginToken: // value for 'loginToken'
+ * commentThreadId: // value for 'commentThreadId'
* },
* });
*/
-export function useVerifyMutation(baseOptions?: Apollo.MutationHookOptions<VerifyMutation, VerifyMutationVariables>) {
+export function useGetCommentThreadQuery(baseOptions: Apollo.QueryHookOptions<GetCommentThreadQuery, GetCommentThreadQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<VerifyMutation, VerifyMutationVariables>(VerifyDocument, options);
- }
-export type VerifyMutationHookResult = ReturnType<typeof useVerifyMutation>;
-export type VerifyMutationResult = Apollo.MutationResult<VerifyMutation>;
-export type VerifyMutationOptions = Apollo.BaseMutationOptions<VerifyMutation, VerifyMutationVariables>;
-export const RenewTokenDocument = gql`
- mutation RenewToken($refreshToken: String!) {
- renewToken(refreshToken: $refreshToken) {
- tokens {
- accessToken {
- expiresAt
- token
- }
- refreshToken {
- token
- expiresAt
+ return Apollo.useQuery<GetCommentThreadQuery, GetCommentThreadQueryVariables>(GetCommentThreadDocument, options);
}
+export function useGetCommentThreadLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCommentThreadQuery, GetCommentThreadQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<GetCommentThreadQuery, GetCommentThreadQueryVariables>(GetCommentThreadDocument, options);
+ }
+export type GetCommentThreadQueryHookResult = ReturnType<typeof useGetCommentThreadQuery>;
+export type GetCommentThreadLazyQueryHookResult = ReturnType<typeof useGetCommentThreadLazyQuery>;
+export type GetCommentThreadQueryResult = Apollo.QueryResult<GetCommentThreadQuery, GetCommentThreadQueryVariables>;
+export const AddCommentThreadTargetOnCommentThreadDocument = gql`
+ mutation AddCommentThreadTargetOnCommentThread($commentThreadId: String!, $commentThreadTargetCreationDate: DateTime!, $commentThreadTargetId: String!, $commentableEntityId: String!, $commentableEntityType: CommentableType!) {
+ updateOneCommentThread(
+ where: {id: $commentThreadId}
+ data: {commentThreadTargets: {connectOrCreate: {create: {id: $commentThreadTargetId, createdAt: $commentThreadTargetCreationDate, commentableType: $commentableEntityType, commentableId: $commentableEntityId}, where: {id: $commentThreadTargetId}}}}
+ ) {
+ id
+ createdAt
+ updatedAt
+ commentThreadTargets {
+ id
+ createdAt
+ updatedAt
+ commentableType
+ commentableId
}
}
}
`;
-export type RenewTokenMutationFn = Apollo.MutationFunction<RenewTokenMutation, RenewTokenMutationVariables>;
+export type AddCommentThreadTargetOnCommentThreadMutationFn = Apollo.MutationFunction<AddCommentThreadTargetOnCommentThreadMutation, AddCommentThreadTargetOnCommentThreadMutationVariables>;
/**
- * __useRenewTokenMutation__
+ * __useAddCommentThreadTargetOnCommentThreadMutation__
*
- * To run a mutation, you first call `useRenewTokenMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useRenewTokenMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useAddCommentThreadTargetOnCommentThreadMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useAddCommentThreadTargetOnCommentThreadMutation` 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 [renewTokenMutation, { data, loading, error }] = useRenewTokenMutation({
+ * const [addCommentThreadTargetOnCommentThreadMutation, { data, loading, error }] = useAddCommentThreadTargetOnCommentThreadMutation({
* variables: {
- * refreshToken: // value for 'refreshToken'
+ * commentThreadId: // value for 'commentThreadId'
+ * commentThreadTargetCreationDate: // value for 'commentThreadTargetCreationDate'
+ * commentThreadTargetId: // value for 'commentThreadTargetId'
+ * commentableEntityId: // value for 'commentableEntityId'
+ * commentableEntityType: // value for 'commentableEntityType'
* },
* });
*/
-export function useRenewTokenMutation(baseOptions?: Apollo.MutationHookOptions<RenewTokenMutation, RenewTokenMutationVariables>) {
+export function useAddCommentThreadTargetOnCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<AddCommentThreadTargetOnCommentThreadMutation, AddCommentThreadTargetOnCommentThreadMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<RenewTokenMutation, RenewTokenMutationVariables>(RenewTokenDocument, options);
+ return Apollo.useMutation<AddCommentThreadTargetOnCommentThreadMutation, AddCommentThreadTargetOnCommentThreadMutationVariables>(AddCommentThreadTargetOnCommentThreadDocument, options);
}
-export type RenewTokenMutationHookResult = ReturnType<typeof useRenewTokenMutation>;
-export type RenewTokenMutationResult = Apollo.MutationResult<RenewTokenMutation>;
-export type RenewTokenMutationOptions = Apollo.BaseMutationOptions<RenewTokenMutation, RenewTokenMutationVariables>;
-export const GetClientConfigDocument = gql`
- query GetClientConfig {
- clientConfig {
- authProviders {
- google
- password
- }
- demoMode
- debugMode
- telemetry {
- enabled
- anonymizationEnabled
+export type AddCommentThreadTargetOnCommentThreadMutationHookResult = ReturnType<typeof useAddCommentThreadTargetOnCommentThreadMutation>;
+export type AddCommentThreadTargetOnCommentThreadMutationResult = Apollo.MutationResult<AddCommentThreadTargetOnCommentThreadMutation>;
+export type AddCommentThreadTargetOnCommentThreadMutationOptions = Apollo.BaseMutationOptions<AddCommentThreadTargetOnCommentThreadMutation, AddCommentThreadTargetOnCommentThreadMutationVariables>;
+export const RemoveCommentThreadTargetOnCommentThreadDocument = gql`
+ mutation RemoveCommentThreadTargetOnCommentThread($commentThreadId: String!, $commentThreadTargetId: String!) {
+ updateOneCommentThread(
+ where: {id: $commentThreadId}
+ data: {commentThreadTargets: {delete: {id: $commentThreadTargetId}}}
+ ) {
+ id
+ createdAt
+ updatedAt
+ commentThreadTargets {
+ id
+ createdAt
+ updatedAt
+ commentableType
+ commentableId
}
}
}
`;
+export type RemoveCommentThreadTargetOnCommentThreadMutationFn = Apollo.MutationFunction<RemoveCommentThreadTargetOnCommentThreadMutation, RemoveCommentThreadTargetOnCommentThreadMutationVariables>;
/**
- * __useGetClientConfigQuery__
+ * __useRemoveCommentThreadTargetOnCommentThreadMutation__
*
- * To run a query within a React component, call `useGetClientConfigQuery` and pass it any options that fit your needs.
- * When your component renders, `useGetClientConfigQuery` returns an object from Apollo Client that contains loading, error, and data properties
- * you can use to render your UI.
+ * To run a mutation, you first call `useRemoveCommentThreadTargetOnCommentThreadMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useRemoveCommentThreadTargetOnCommentThreadMutation` 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 query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
+ * @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 { data, loading, error } = useGetClientConfigQuery({
+ * const [removeCommentThreadTargetOnCommentThreadMutation, { data, loading, error }] = useRemoveCommentThreadTargetOnCommentThreadMutation({
* variables: {
+ * commentThreadId: // value for 'commentThreadId'
+ * commentThreadTargetId: // value for 'commentThreadTargetId'
* },
* });
*/
-export function useGetClientConfigQuery(baseOptions?: Apollo.QueryHookOptions<GetClientConfigQuery, GetClientConfigQueryVariables>) {
+export function useRemoveCommentThreadTargetOnCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<RemoveCommentThreadTargetOnCommentThreadMutation, RemoveCommentThreadTargetOnCommentThreadMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useQuery<GetClientConfigQuery, GetClientConfigQueryVariables>(GetClientConfigDocument, options);
+ return Apollo.useMutation<RemoveCommentThreadTargetOnCommentThreadMutation, RemoveCommentThreadTargetOnCommentThreadMutationVariables>(RemoveCommentThreadTargetOnCommentThreadDocument, options);
}
-export function useGetClientConfigLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetClientConfigQuery, GetClientConfigQueryVariables>) {
- const options = {...defaultOptions, ...baseOptions}
- return Apollo.useLazyQuery<GetClientConfigQuery, GetClientConfigQueryVariables>(GetClientConfigDocument, options);
- }
-export type GetClientConfigQueryHookResult = ReturnType<typeof useGetClientConfigQuery>;
-export type GetClientConfigLazyQueryHookResult = ReturnType<typeof useGetClientConfigLazyQuery>;
-export type GetClientConfigQueryResult = Apollo.QueryResult<GetClientConfigQuery, GetClientConfigQueryVariables>;
-export const CreateCommentDocument = gql`
- mutation CreateComment($commentId: String!, $commentText: String!, $authorId: String!, $commentThreadId: String!, $createdAt: DateTime!) {
- createOneComment(
- data: {id: $commentId, createdAt: $createdAt, body: $commentText, author: {connect: {id: $authorId}}, commentThread: {connect: {id: $commentThreadId}}}
- ) {
- id
- createdAt
- body
- author {
- id
- displayName
- firstName
- lastName
- avatarUrl
- }
- commentThreadId
+export type RemoveCommentThreadTargetOnCommentThreadMutationHookResult = ReturnType<typeof useRemoveCommentThreadTargetOnCommentThreadMutation>;
+export type RemoveCommentThreadTargetOnCommentThreadMutationResult = Apollo.MutationResult<RemoveCommentThreadTargetOnCommentThreadMutation>;
+export type RemoveCommentThreadTargetOnCommentThreadMutationOptions = Apollo.BaseMutationOptions<RemoveCommentThreadTargetOnCommentThreadMutation, RemoveCommentThreadTargetOnCommentThreadMutationVariables>;
+export const DeleteCommentThreadDocument = gql`
+ mutation DeleteCommentThread($commentThreadId: String!) {
+ deleteManyCommentThreads(where: {id: {equals: $commentThreadId}}) {
+ count
}
}
`;
-export type CreateCommentMutationFn = Apollo.MutationFunction<CreateCommentMutation, CreateCommentMutationVariables>;
+export type DeleteCommentThreadMutationFn = Apollo.MutationFunction<DeleteCommentThreadMutation, DeleteCommentThreadMutationVariables>;
/**
- * __useCreateCommentMutation__
+ * __useDeleteCommentThreadMutation__
*
- * To run a mutation, you first call `useCreateCommentMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useCreateCommentMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useDeleteCommentThreadMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useDeleteCommentThreadMutation` 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 [createCommentMutation, { data, loading, error }] = useCreateCommentMutation({
+ * const [deleteCommentThreadMutation, { data, loading, error }] = useDeleteCommentThreadMutation({
* variables: {
- * commentId: // value for 'commentId'
- * commentText: // value for 'commentText'
- * authorId: // value for 'authorId'
* commentThreadId: // value for 'commentThreadId'
- * createdAt: // value for 'createdAt'
* },
* });
*/
-export function useCreateCommentMutation(baseOptions?: Apollo.MutationHookOptions<CreateCommentMutation, CreateCommentMutationVariables>) {
+export function useDeleteCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<DeleteCommentThreadMutation, DeleteCommentThreadMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<CreateCommentMutation, CreateCommentMutationVariables>(CreateCommentDocument, options);
+ return Apollo.useMutation<DeleteCommentThreadMutation, DeleteCommentThreadMutationVariables>(DeleteCommentThreadDocument, options);
}
-export type CreateCommentMutationHookResult = ReturnType<typeof useCreateCommentMutation>;
-export type CreateCommentMutationResult = Apollo.MutationResult<CreateCommentMutation>;
-export type CreateCommentMutationOptions = Apollo.BaseMutationOptions<CreateCommentMutation, CreateCommentMutationVariables>;
-export const CreateCommentThreadDocument = gql`
- mutation CreateCommentThread($commentThreadId: String!, $body: String, $title: String, $type: ActivityType!, $authorId: String!, $createdAt: DateTime!, $commentThreadTargetArray: [CommentThreadTargetCreateManyCommentThreadInput!]!) {
- createOneCommentThread(
- data: {id: $commentThreadId, createdAt: $createdAt, updatedAt: $createdAt, author: {connect: {id: $authorId}}, body: $body, title: $title, type: $type, commentThreadTargets: {createMany: {data: $commentThreadTargetArray, skipDuplicates: true}}}
+export type DeleteCommentThreadMutationHookResult = ReturnType<typeof useDeleteCommentThreadMutation>;
+export type DeleteCommentThreadMutationResult = Apollo.MutationResult<DeleteCommentThreadMutation>;
+export type DeleteCommentThreadMutationOptions = Apollo.BaseMutationOptions<DeleteCommentThreadMutation, DeleteCommentThreadMutationVariables>;
+export const UpdateCommentThreadDocument = gql`
+ mutation UpdateCommentThread($id: String!, $body: String, $title: String, $type: ActivityType) {
+ updateOneCommentThread(
+ where: {id: $id}
+ data: {body: {set: $body}, title: {set: $title}, type: {set: $type}}
) {
id
- createdAt
- updatedAt
- authorId
+ body
+ title
type
- commentThreadTargets {
- id
- createdAt
- updatedAt
- commentThreadId
- commentableType
- commentableId
- }
- comments {
- id
- createdAt
- updatedAt
- body
- author {
- id
- }
- }
}
}
`;
-export type CreateCommentThreadMutationFn = Apollo.MutationFunction<CreateCommentThreadMutation, CreateCommentThreadMutationVariables>;
+export type UpdateCommentThreadMutationFn = Apollo.MutationFunction<UpdateCommentThreadMutation, UpdateCommentThreadMutationVariables>;
/**
- * __useCreateCommentThreadMutation__
+ * __useUpdateCommentThreadMutation__
*
- * To run a mutation, you first call `useCreateCommentThreadMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useCreateCommentThreadMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useUpdateCommentThreadMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useUpdateCommentThreadMutation` 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 [createCommentThreadMutation, { data, loading, error }] = useCreateCommentThreadMutation({
+ * const [updateCommentThreadMutation, { data, loading, error }] = useUpdateCommentThreadMutation({
* variables: {
- * commentThreadId: // value for 'commentThreadId'
+ * id: // value for 'id'
* body: // value for 'body'
* title: // value for 'title'
* type: // value for 'type'
- * authorId: // value for 'authorId'
- * createdAt: // value for 'createdAt'
- * commentThreadTargetArray: // value for 'commentThreadTargetArray'
* },
* });
*/
-export function useCreateCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<CreateCommentThreadMutation, CreateCommentThreadMutationVariables>) {
+export function useUpdateCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<UpdateCommentThreadMutation, UpdateCommentThreadMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<CreateCommentThreadMutation, CreateCommentThreadMutationVariables>(CreateCommentThreadDocument, options);
+ return Apollo.useMutation<UpdateCommentThreadMutation, UpdateCommentThreadMutationVariables>(UpdateCommentThreadDocument, options);
}
-export type CreateCommentThreadMutationHookResult = ReturnType<typeof useCreateCommentThreadMutation>;
-export type CreateCommentThreadMutationResult = Apollo.MutationResult<CreateCommentThreadMutation>;
-export type CreateCommentThreadMutationOptions = Apollo.BaseMutationOptions<CreateCommentThreadMutation, CreateCommentThreadMutationVariables>;
-export const GetCommentThreadsByTargetsDocument = gql`
- query GetCommentThreadsByTargets($commentThreadTargetIds: [String!]!, $orderBy: [CommentThreadOrderByWithRelationInput!]) {
- findManyCommentThreads(
- orderBy: $orderBy
- where: {commentThreadTargets: {some: {commentableId: {in: $commentThreadTargetIds}}}}
- ) {
- id
- createdAt
- title
- body
- type
- author {
- id
- firstName
- lastName
- }
- comments {
- id
- body
- createdAt
- updatedAt
- author {
- id
- displayName
- firstName
- lastName
- avatarUrl
+export type UpdateCommentThreadMutationHookResult = ReturnType<typeof useUpdateCommentThreadMutation>;
+export type UpdateCommentThreadMutationResult = Apollo.MutationResult<UpdateCommentThreadMutation>;
+export type UpdateCommentThreadMutationOptions = Apollo.BaseMutationOptions<UpdateCommentThreadMutation, UpdateCommentThreadMutationVariables>;
+export const CreateEventDocument = gql`
+ mutation CreateEvent($type: String!, $data: JSON!) {
+ createEvent(type: $type, data: $data) {
+ success
+ }
+}
+ `;
+export type CreateEventMutationFn = Apollo.MutationFunction<CreateEventMutation, CreateEventMutationVariables>;
+
+/**
+ * __useCreateEventMutation__
+ *
+ * To run a mutation, you first call `useCreateEventMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useCreateEventMutation` 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 [createEventMutation, { data, loading, error }] = useCreateEventMutation({
+ * variables: {
+ * type: // value for 'type'
+ * data: // value for 'data'
+ * },
+ * });
+ */
+export function useCreateEventMutation(baseOptions?: Apollo.MutationHookOptions<CreateEventMutation, CreateEventMutationVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useMutation<CreateEventMutation, CreateEventMutationVariables>(CreateEventDocument, options);
}
- }
- commentThreadTargets {
- id
- commentableId
- commentableType
- }
+export type CreateEventMutationHookResult = ReturnType<typeof useCreateEventMutation>;
+export type CreateEventMutationResult = Apollo.MutationResult<CreateEventMutation>;
+export type CreateEventMutationOptions = Apollo.BaseMutationOptions<CreateEventMutation, CreateEventMutationVariables>;
+export const CheckUserExistsDocument = gql`
+ query CheckUserExists($email: String!) {
+ checkUserExists(email: $email) {
+ exists
}
}
`;
/**
- * __useGetCommentThreadsByTargetsQuery__
+ * __useCheckUserExistsQuery__
*
- * To run a query within a React component, call `useGetCommentThreadsByTargetsQuery` and pass it any options that fit your needs.
- * When your component renders, `useGetCommentThreadsByTargetsQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * To run a query within a React component, call `useCheckUserExistsQuery` and pass it any options that fit your needs.
+ * When your component renders, `useCheckUserExistsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
- * const { data, loading, error } = useGetCommentThreadsByTargetsQuery({
+ * const { data, loading, error } = useCheckUserExistsQuery({
* variables: {
- * commentThreadTargetIds: // value for 'commentThreadTargetIds'
- * orderBy: // value for 'orderBy'
+ * email: // value for 'email'
* },
* });
*/
-export function useGetCommentThreadsByTargetsQuery(baseOptions: Apollo.QueryHookOptions<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>) {
+export function useCheckUserExistsQuery(baseOptions: Apollo.QueryHookOptions<CheckUserExistsQuery, CheckUserExistsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useQuery<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>(GetCommentThreadsByTargetsDocument, options);
- }
-export function useGetCommentThreadsByTargetsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>) {
- const options = {...defaultOptions, ...baseOptions}
- return Apollo.useLazyQuery<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>(GetCommentThreadsByTargetsDocument, options);
- }
-export type GetCommentThreadsByTargetsQueryHookResult = ReturnType<typeof useGetCommentThreadsByTargetsQuery>;
-export type GetCommentThreadsByTargetsLazyQueryHookResult = ReturnType<typeof useGetCommentThreadsByTargetsLazyQuery>;
-export type GetCommentThreadsByTargetsQueryResult = Apollo.QueryResult<GetCommentThreadsByTargetsQuery, GetCommentThreadsByTargetsQueryVariables>;
-export const GetCommentThreadDocument = gql`
- query GetCommentThread($commentThreadId: String!) {
- findManyCommentThreads(where: {id: {equals: $commentThreadId}}) {
- id
- createdAt
- body
- title
- type
- author {
- id
- firstName
- lastName
- }
- comments {
- id
- body
- createdAt
- updatedAt
- author {
- id
- displayName
- firstName
- lastName
- avatarUrl
+ return Apollo.useQuery<CheckUserExistsQuery, CheckUserExistsQueryVariables>(CheckUserExistsDocument, options);
}
- }
- commentThreadTargets {
- id
- commentableId
- commentableType
+export function useCheckUserExistsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<CheckUserExistsQuery, CheckUserExistsQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<CheckUserExistsQuery, CheckUserExistsQueryVariables>(CheckUserExistsDocument, options);
+ }
+export type CheckUserExistsQueryHookResult = ReturnType<typeof useCheckUserExistsQuery>;
+export type CheckUserExistsLazyQueryHookResult = ReturnType<typeof useCheckUserExistsLazyQuery>;
+export type CheckUserExistsQueryResult = Apollo.QueryResult<CheckUserExistsQuery, CheckUserExistsQueryVariables>;
+export const ChallengeDocument = gql`
+ mutation Challenge($email: String!, $password: String!) {
+ challenge(email: $email, password: $password) {
+ loginToken {
+ expiresAt
+ token
}
}
}
`;
+export type ChallengeMutationFn = Apollo.MutationFunction<ChallengeMutation, ChallengeMutationVariables>;
/**
- * __useGetCommentThreadQuery__
+ * __useChallengeMutation__
*
- * To run a query within a React component, call `useGetCommentThreadQuery` and pass it any options that fit your needs.
- * When your component renders, `useGetCommentThreadQuery` returns an object from Apollo Client that contains loading, error, and data properties
- * you can use to render your UI.
+ * To run a mutation, you first call `useChallengeMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useChallengeMutation` 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 query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
+ * @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 { data, loading, error } = useGetCommentThreadQuery({
+ * const [challengeMutation, { data, loading, error }] = useChallengeMutation({
* variables: {
- * commentThreadId: // value for 'commentThreadId'
+ * email: // value for 'email'
+ * password: // value for 'password'
* },
* });
*/
-export function useGetCommentThreadQuery(baseOptions: Apollo.QueryHookOptions<GetCommentThreadQuery, GetCommentThreadQueryVariables>) {
+export function useChallengeMutation(baseOptions?: Apollo.MutationHookOptions<ChallengeMutation, ChallengeMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useQuery<GetCommentThreadQuery, GetCommentThreadQueryVariables>(GetCommentThreadDocument, options);
+ return Apollo.useMutation<ChallengeMutation, ChallengeMutationVariables>(ChallengeDocument, options);
}
-export function useGetCommentThreadLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCommentThreadQuery, GetCommentThreadQueryVariables>) {
- const options = {...defaultOptions, ...baseOptions}
- return Apollo.useLazyQuery<GetCommentThreadQuery, GetCommentThreadQueryVariables>(GetCommentThreadDocument, options);
- }
-export type GetCommentThreadQueryHookResult = ReturnType<typeof useGetCommentThreadQuery>;
-export type GetCommentThreadLazyQueryHookResult = ReturnType<typeof useGetCommentThreadLazyQuery>;
-export type GetCommentThreadQueryResult = Apollo.QueryResult<GetCommentThreadQuery, GetCommentThreadQueryVariables>;
-export const AddCommentThreadTargetOnCommentThreadDocument = gql`
- mutation AddCommentThreadTargetOnCommentThread($commentThreadId: String!, $commentThreadTargetCreationDate: DateTime!, $commentThreadTargetId: String!, $commentableEntityId: String!, $commentableEntityType: CommentableType!) {
- updateOneCommentThread(
- where: {id: $commentThreadId}
- data: {commentThreadTargets: {connectOrCreate: {create: {id: $commentThreadTargetId, createdAt: $commentThreadTargetCreationDate, commentableType: $commentableEntityType, commentableId: $commentableEntityId}, where: {id: $commentThreadTargetId}}}}
+export type ChallengeMutationHookResult = ReturnType<typeof useChallengeMutation>;
+export type ChallengeMutationResult = Apollo.MutationResult<ChallengeMutation>;
+export type ChallengeMutationOptions = Apollo.BaseMutationOptions<ChallengeMutation, ChallengeMutationVariables>;
+export const SignUpDocument = gql`
+ mutation SignUp($email: String!, $password: String!, $workspaceInviteHash: String) {
+ signUp(
+ email: $email
+ password: $password
+ workspaceInviteHash: $workspaceInviteHash
) {
- id
- createdAt
- updatedAt
- commentThreadTargets {
- id
- createdAt
- updatedAt
- commentableType
- commentableId
+ loginToken {
+ expiresAt
+ token
}
}
}
`;
-export type AddCommentThreadTargetOnCommentThreadMutationFn = Apollo.MutationFunction<AddCommentThreadTargetOnCommentThreadMutation, AddCommentThreadTargetOnCommentThreadMutationVariables>;
+export type SignUpMutationFn = Apollo.MutationFunction<SignUpMutation, SignUpMutationVariables>;
/**
- * __useAddCommentThreadTargetOnCommentThreadMutation__
+ * __useSignUpMutation__
*
- * To run a mutation, you first call `useAddCommentThreadTargetOnCommentThreadMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useAddCommentThreadTargetOnCommentThreadMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useSignUpMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useSignUpMutation` 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 [addCommentThreadTargetOnCommentThreadMutation, { data, loading, error }] = useAddCommentThreadTargetOnCommentThreadMutation({
+ * const [signUpMutation, { data, loading, error }] = useSignUpMutation({
* variables: {
- * commentThreadId: // value for 'commentThreadId'
- * commentThreadTargetCreationDate: // value for 'commentThreadTargetCreationDate'
- * commentThreadTargetId: // value for 'commentThreadTargetId'
- * commentableEntityId: // value for 'commentableEntityId'
- * commentableEntityType: // value for 'commentableEntityType'
+ * email: // value for 'email'
+ * password: // value for 'password'
+ * workspaceInviteHash: // value for 'workspaceInviteHash'
* },
* });
*/
-export function useAddCommentThreadTargetOnCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<AddCommentThreadTargetOnCommentThreadMutation, AddCommentThreadTargetOnCommentThreadMutationVariables>) {
+export function useSignUpMutation(baseOptions?: Apollo.MutationHookOptions<SignUpMutation, SignUpMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<AddCommentThreadTargetOnCommentThreadMutation, AddCommentThreadTargetOnCommentThreadMutationVariables>(AddCommentThreadTargetOnCommentThreadDocument, options);
+ return Apollo.useMutation<SignUpMutation, SignUpMutationVariables>(SignUpDocument, options);
}
-export type AddCommentThreadTargetOnCommentThreadMutationHookResult = ReturnType<typeof useAddCommentThreadTargetOnCommentThreadMutation>;
-export type AddCommentThreadTargetOnCommentThreadMutationResult = Apollo.MutationResult<AddCommentThreadTargetOnCommentThreadMutation>;
-export type AddCommentThreadTargetOnCommentThreadMutationOptions = Apollo.BaseMutationOptions<AddCommentThreadTargetOnCommentThreadMutation, AddCommentThreadTargetOnCommentThreadMutationVariables>;
-export const RemoveCommentThreadTargetOnCommentThreadDocument = gql`
- mutation RemoveCommentThreadTargetOnCommentThread($commentThreadId: String!, $commentThreadTargetId: String!) {
- updateOneCommentThread(
- where: {id: $commentThreadId}
- data: {commentThreadTargets: {delete: {id: $commentThreadTargetId}}}
- ) {
- id
- createdAt
- updatedAt
- commentThreadTargets {
+export type SignUpMutationHookResult = ReturnType<typeof useSignUpMutation>;
+export type SignUpMutationResult = Apollo.MutationResult<SignUpMutation>;
+export type SignUpMutationOptions = Apollo.BaseMutationOptions<SignUpMutation, SignUpMutationVariables>;
+export const VerifyDocument = gql`
+ mutation Verify($loginToken: String!) {
+ verify(loginToken: $loginToken) {
+ user {
id
- createdAt
- updatedAt
- commentableType
- commentableId
+ email
+ displayName
+ firstName
+ lastName
+ workspaceMember {
+ id
+ workspace {
+ id
+ domainName
+ displayName
+ logo
+ }
+ }
+ }
+ tokens {
+ accessToken {
+ token
+ expiresAt
+ }
+ refreshToken {
+ token
+ expiresAt
+ }
}
}
}
`;
-export type RemoveCommentThreadTargetOnCommentThreadMutationFn = Apollo.MutationFunction<RemoveCommentThreadTargetOnCommentThreadMutation, RemoveCommentThreadTargetOnCommentThreadMutationVariables>;
+export type VerifyMutationFn = Apollo.MutationFunction<VerifyMutation, VerifyMutationVariables>;
/**
- * __useRemoveCommentThreadTargetOnCommentThreadMutation__
+ * __useVerifyMutation__
*
- * To run a mutation, you first call `useRemoveCommentThreadTargetOnCommentThreadMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useRemoveCommentThreadTargetOnCommentThreadMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useVerifyMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useVerifyMutation` 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 [removeCommentThreadTargetOnCommentThreadMutation, { data, loading, error }] = useRemoveCommentThreadTargetOnCommentThreadMutation({
+ * const [verifyMutation, { data, loading, error }] = useVerifyMutation({
* variables: {
- * commentThreadId: // value for 'commentThreadId'
- * commentThreadTargetId: // value for 'commentThreadTargetId'
+ * loginToken: // value for 'loginToken'
* },
* });
*/
-export function useRemoveCommentThreadTargetOnCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<RemoveCommentThreadTargetOnCommentThreadMutation, RemoveCommentThreadTargetOnCommentThreadMutationVariables>) {
+export function useVerifyMutation(baseOptions?: Apollo.MutationHookOptions<VerifyMutation, VerifyMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<RemoveCommentThreadTargetOnCommentThreadMutation, RemoveCommentThreadTargetOnCommentThreadMutationVariables>(RemoveCommentThreadTargetOnCommentThreadDocument, options);
+ return Apollo.useMutation<VerifyMutation, VerifyMutationVariables>(VerifyDocument, options);
}
-export type RemoveCommentThreadTargetOnCommentThreadMutationHookResult = ReturnType<typeof useRemoveCommentThreadTargetOnCommentThreadMutation>;
-export type RemoveCommentThreadTargetOnCommentThreadMutationResult = Apollo.MutationResult<RemoveCommentThreadTargetOnCommentThreadMutation>;
-export type RemoveCommentThreadTargetOnCommentThreadMutationOptions = Apollo.BaseMutationOptions<RemoveCommentThreadTargetOnCommentThreadMutation, RemoveCommentThreadTargetOnCommentThreadMutationVariables>;
-export const DeleteCommentThreadDocument = gql`
- mutation DeleteCommentThread($commentThreadId: String!) {
- deleteManyCommentThreads(where: {id: {equals: $commentThreadId}}) {
- count
+export type VerifyMutationHookResult = ReturnType<typeof useVerifyMutation>;
+export type VerifyMutationResult = Apollo.MutationResult<VerifyMutation>;
+export type VerifyMutationOptions = Apollo.BaseMutationOptions<VerifyMutation, VerifyMutationVariables>;
+export const RenewTokenDocument = gql`
+ mutation RenewToken($refreshToken: String!) {
+ renewToken(refreshToken: $refreshToken) {
+ tokens {
+ accessToken {
+ expiresAt
+ token
+ }
+ refreshToken {
+ token
+ expiresAt
+ }
+ }
}
}
`;
-export type DeleteCommentThreadMutationFn = Apollo.MutationFunction<DeleteCommentThreadMutation, DeleteCommentThreadMutationVariables>;
+export type RenewTokenMutationFn = Apollo.MutationFunction<RenewTokenMutation, RenewTokenMutationVariables>;
/**
- * __useDeleteCommentThreadMutation__
+ * __useRenewTokenMutation__
*
- * To run a mutation, you first call `useDeleteCommentThreadMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useDeleteCommentThreadMutation` returns a tuple that includes:
+ * To run a mutation, you first call `useRenewTokenMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useRenewTokenMutation` 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 [deleteCommentThreadMutation, { data, loading, error }] = useDeleteCommentThreadMutation({
+ * const [renewTokenMutation, { data, loading, error }] = useRenewTokenMutation({
* variables: {
- * commentThreadId: // value for 'commentThreadId'
+ * refreshToken: // value for 'refreshToken'
* },
* });
*/
-export function useDeleteCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<DeleteCommentThreadMutation, DeleteCommentThreadMutationVariables>) {
+export function useRenewTokenMutation(baseOptions?: Apollo.MutationHookOptions<RenewTokenMutation, RenewTokenMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<DeleteCommentThreadMutation, DeleteCommentThreadMutationVariables>(DeleteCommentThreadDocument, options);
+ return Apollo.useMutation<RenewTokenMutation, RenewTokenMutationVariables>(RenewTokenDocument, options);
}
-export type DeleteCommentThreadMutationHookResult = ReturnType<typeof useDeleteCommentThreadMutation>;
-export type DeleteCommentThreadMutationResult = Apollo.MutationResult<DeleteCommentThreadMutation>;
-export type DeleteCommentThreadMutationOptions = Apollo.BaseMutationOptions<DeleteCommentThreadMutation, DeleteCommentThreadMutationVariables>;
-export const UpdateCommentThreadDocument = gql`
- mutation UpdateCommentThread($id: String!, $body: String, $title: String, $type: ActivityType) {
- updateOneCommentThread(
- where: {id: $id}
- data: {body: {set: $body}, title: {set: $title}, type: {set: $type}}
- ) {
- id
- body
- title
- type
+export type RenewTokenMutationHookResult = ReturnType<typeof useRenewTokenMutation>;
+export type RenewTokenMutationResult = Apollo.MutationResult<RenewTokenMutation>;
+export type RenewTokenMutationOptions = Apollo.BaseMutationOptions<RenewTokenMutation, RenewTokenMutationVariables>;
+export const GetClientConfigDocument = gql`
+ query GetClientConfig {
+ clientConfig {
+ authProviders {
+ google
+ password
+ }
+ demoMode
+ debugMode
+ telemetry {
+ enabled
+ anonymizationEnabled
+ }
}
}
`;
-export type UpdateCommentThreadMutationFn = Apollo.MutationFunction<UpdateCommentThreadMutation, UpdateCommentThreadMutationVariables>;
/**
- * __useUpdateCommentThreadMutation__
+ * __useGetClientConfigQuery__
*
- * To run a mutation, you first call `useUpdateCommentThreadMutation` within a React component and pass it any options that fit your needs.
- * When your component renders, `useUpdateCommentThreadMutation` 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
+ * To run a query within a React component, call `useGetClientConfigQuery` and pass it any options that fit your needs.
+ * When your component renders, `useGetClientConfigQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
*
- * @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;
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
- * const [updateCommentThreadMutation, { data, loading, error }] = useUpdateCommentThreadMutation({
+ * const { data, loading, error } = useGetClientConfigQuery({
* variables: {
- * id: // value for 'id'
- * body: // value for 'body'
- * title: // value for 'title'
- * type: // value for 'type'
* },
* });
*/
-export function useUpdateCommentThreadMutation(baseOptions?: Apollo.MutationHookOptions<UpdateCommentThreadMutation, UpdateCommentThreadMutationVariables>) {
+export function useGetClientConfigQuery(baseOptions?: Apollo.QueryHookOptions<GetClientConfigQuery, GetClientConfigQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
- return Apollo.useMutation<UpdateCommentThreadMutation, UpdateCommentThreadMutationVariables>(UpdateCommentThreadDocument, options);
+ return Apollo.useQuery<GetClientConfigQuery, GetClientConfigQueryVariables>(GetClientConfigDocument, options);
}
-export type UpdateCommentThreadMutationHookResult = ReturnType<typeof useUpdateCommentThreadMutation>;
-export type UpdateCommentThreadMutationResult = Apollo.MutationResult<UpdateCommentThreadMutation>;
-export type UpdateCommentThreadMutationOptions = Apollo.BaseMutationOptions<UpdateCommentThreadMutation, UpdateCommentThreadMutationVariables>;
+export function useGetClientConfigLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetClientConfigQuery, GetClientConfigQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<GetClientConfigQuery, GetClientConfigQueryVariables>(GetClientConfigDocument, options);
+ }
+export type GetClientConfigQueryHookResult = ReturnType<typeof useGetClientConfigQuery>;
+export type GetClientConfigLazyQueryHookResult = ReturnType<typeof useGetClientConfigLazyQuery>;
+export type GetClientConfigQueryResult = Apollo.QueryResult<GetClientConfigQuery, GetClientConfigQueryVariables>;
export const GetCompaniesDocument = gql`
query GetCompanies($orderBy: [CompanyOrderByWithRelationInput!], $where: CompanyWhereInput) {
companies: findManyCompany(orderBy: $orderBy, where: $where) {
@@ -5227,9 +5228,6 @@ export const GetPipelinesDocument = gql`
name
color
index
- pipelineProgresses {
- id
- }
}
}
}
@@ -5263,9 +5261,10 @@ export type GetPipelinesQueryHookResult = ReturnType<typeof useGetPipelinesQuery
export type GetPipelinesLazyQueryHookResult = ReturnType<typeof useGetPipelinesLazyQuery>;
export type GetPipelinesQueryResult = Apollo.QueryResult<GetPipelinesQuery, GetPipelinesQueryVariables>;
export const GetPipelineProgressDocument = gql`
- query GetPipelineProgress($where: PipelineProgressWhereInput) {
- findManyPipelineProgress(where: $where, orderBy: {createdAt: asc}) {
+ query GetPipelineProgress($where: PipelineProgressWhereInput, $orderBy: [PipelineProgressOrderByWithRelationInput!]) {
+ findManyPipelineProgress(where: $where, orderBy: $orderBy) {
id
+ pipelineStageId
progressableType
progressableId
amount
@@ -5287,6 +5286,7 @@ export const GetPipelineProgressDocument = gql`
* const { data, loading, error } = useGetPipelineProgressQuery({
* variables: {
* where: // value for 'where'
+ * orderBy: // value for 'orderBy'
* },
* });
*/
diff --git a/front/src/modules/companies/__stories__/Board.stories.tsx b/front/src/modules/companies/__stories__/Board.stories.tsx
index 59de69c8464..bb2e68406a8 100644
--- a/front/src/modules/companies/__stories__/Board.stories.tsx
+++ b/front/src/modules/companies/__stories__/Board.stories.tsx
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from '@storybook/react';
-import { companyBoardOptions } from '@/companies/components/companyBoardOptions';
import { EntityBoard } from '@/pipeline/components/EntityBoard';
+import { opportunitiesBoardOptions } from '~/pages/opportunities/opportunitiesBoardOptions';
import { BoardDecorator } from '~/testing/decorators';
import { graphqlMocks } from '~/testing/graphqlMocks';
import { getRenderWrapperForComponent } from '~/testing/renderWrappers';
@@ -17,7 +17,12 @@ type Story = StoryObj<typeof EntityBoard>;
export const OneColumnBoard: Story = {
render: getRenderWrapperForComponent(
- <EntityBoard boardOptions={companyBoardOptions} />,
+ <EntityBoard
+ boardOptions={opportunitiesBoardOptions}
+ updateSorts={() => {
+ return;
+ }}
+ />,
),
parameters: {
msw: graphqlMocks,
diff --git a/front/src/modules/companies/__stories__/mock-data.ts b/front/src/modules/companies/__stories__/mock-data.ts
index 748e9e58ae6..f5cbb620466 100644
--- a/front/src/modules/companies/__stories__/mock-data.ts
+++ b/front/src/modules/companies/__stories__/mock-data.ts
@@ -9,10 +9,6 @@ export const pipeline = {
name: 'New',
index: 0,
color: '#B76796',
- pipelineProgresses: [
- { id: 'fe256b39-3ec3-4fe7-8998-b76aa0bfb600' },
- { id: '4a886c90-f4f2-4984-8222-882ebbb905d6' },
- ],
},
{
id: 'pipeline-stage-2',
diff --git a/front/src/modules/companies/components/CompanyBoardCard.tsx b/front/src/modules/companies/components/CompanyBoardCard.tsx
index 2aa42c33458..4ab220cc3e6 100644
--- a/front/src/modules/companies/components/CompanyBoardCard.tsx
+++ b/front/src/modules/companies/components/CompanyBoardCard.tsx
@@ -5,7 +5,7 @@ import styled from '@emotion/styled';
import { useRecoilState } from 'recoil';
import { companyProgressesFamilyState } from '@/companies/states/companyProgressesFamilyState';
-import { GET_PIPELINES } from '@/pipeline/queries';
+import { GET_PIPELINE_PROGRESS, GET_PIPELINES } from '@/pipeline/queries';
import { BoardCardContext } from '@/pipeline/states/BoardCardContext';
import { pipelineProgressIdScopedState } from '@/pipeline/states/pipelineProgressIdScopedState';
import { selectedBoardCardsState } from '@/pipeline/states/selectedBoardCardsState';
@@ -108,7 +108,10 @@ export function CompanyBoardCard() {
amount: pipelineProgress.amount,
closeDate: pipelineProgress.closeDate || null,
},
- refetchQueries: [getOperationName(GET_PIPELINES) ?? ''],
+ refetchQueries: [
+ getOperationName(GET_PIPELINE_PROGRESS) ?? '',
+ getOperationName(GET_PIPELINES) ?? '',
+ ],
});
},
[updatePipelineProgress],
diff --git a/front/src/modules/companies/components/FilterDropdownCompanySearchSelect.tsx b/front/src/modules/companies/components/FilterDropdownCompanySearchSelect.tsx
index b1c0361d664..661fb16cf93 100644
--- a/front/src/modules/companies/components/FilterDropdownCompanySearchSelect.tsx
+++ b/front/src/modules/companies/components/FilterDropdownCompanySearchSelect.tsx
@@ -1,21 +1,26 @@
+import { Context } from 'react';
+
import { FilterDropdownEntitySearchSelect } from '@/ui/filter-n-sort/components/FilterDropdownEntitySearchSelect';
import { filterDropdownSearchInputScopedState } from '@/ui/filter-n-sort/states/filterDropdownSearchInputScopedState';
import { filterDropdownSelectedEntityIdScopedState } from '@/ui/filter-n-sort/states/filterDropdownSelectedEntityIdScopedState';
import { useRecoilScopedState } from '@/ui/recoil-scope/hooks/useRecoilScopedState';
import { useRecoilScopedValue } from '@/ui/recoil-scope/hooks/useRecoilScopedValue';
-import { TableContext } from '@/ui/table/states/TableContext';
import { useFilteredSearchCompanyQuery } from '../queries';
-export function FilterDropdownCompanySearchSelect() {
+export function FilterDropdownCompanySearchSelect({
+ context,
+}: {
+ context: Context<string | null>;
+}) {
const filterDropdownSearchInput = useRecoilScopedValue(
filterDropdownSearchInputScopedState,
- TableContext,
+ context,
);
const [filterDropdownSelectedEntityId] = useRecoilScopedState(
filterDropdownSelectedEntityIdScopedState,
- TableContext,
+ context,
);
const usersForSelect = useFilteredSearchCompanyQuery({
@@ -28,7 +33,7 @@ export function FilterDropdownCompanySearchSelect() {
return (
<FilterDropdownEntitySearchSelect
entitiesForSelect={usersForSelect}
- context={TableContext}
+ context={context}
/>
);
}
diff --git a/front/src/modules/companies/components/HookCompanyBoard.tsx b/front/src/modules/companies/components/HooksCompanyBoard.tsx
similarity index 64%
rename from front/src/modules/companies/components/HookCompanyBoard.tsx
rename to front/src/modules/companies/components/HooksCompanyBoard.tsx
index 8f8d3da2789..9a9dca61b15 100644
--- a/front/src/modules/companies/components/HookCompanyBoard.tsx
+++ b/front/src/modules/companies/components/HooksCompanyBoard.tsx
@@ -1,6 +1,7 @@
-import { useEffect } from 'react';
+import { useEffect, useMemo } from 'react';
import { useRecoilCallback, useRecoilState } from 'recoil';
+import { useInitializeCompanyBoardFilters } from '@/companies/hooks/useInitializeCompanyBoardFilters';
import { companyProgressesFamilyState } from '@/companies/states/companyProgressesFamilyState';
import {
CompanyForBoard,
@@ -11,15 +12,30 @@ import { boardState } from '@/pipeline/states/boardState';
import { currentPipelineState } from '@/pipeline/states/currentPipelineState';
import { isBoardLoadedState } from '@/pipeline/states/isBoardLoadedState';
import { BoardPipelineStageColumn } from '@/ui/board/components/Board';
+import { filtersScopedState } from '@/ui/filter-n-sort/states/filtersScopedState';
+import { FilterDefinition } from '@/ui/filter-n-sort/types/FilterDefinition';
+import { turnFilterIntoWhereClause } from '@/ui/filter-n-sort/utils/turnFilterIntoWhereClause';
+import { useRecoilScopedValue } from '@/ui/recoil-scope/hooks/useRecoilScopedValue';
+import { PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By } from '~/generated/graphql';
import {
Pipeline,
- PipelineStage,
useGetCompaniesQuery,
useGetPipelineProgressQuery,
useGetPipelinesQuery,
} from '~/generated/graphql';
-export function HookCompanyBoard() {
+import { CompanyBoardContext } from '../states/CompanyBoardContext';
+
+export function HooksCompanyBoard({
+ availableFilters,
+ orderBy,
+}: {
+ availableFilters: FilterDefinition[];
+ orderBy: PipelineProgresses_Order_By[];
+}) {
+ useInitializeCompanyBoardFilters({
+ availableFilters,
+ });
const [currentPipeline, setCurrentPipeline] =
useRecoilState(currentPipelineState);
@@ -44,29 +60,47 @@ export function HookCompanyBoard() {
title: pipelineStage.name,
colorCode: pipelineStage.color,
index: pipelineStage.index || 0,
- pipelineProgressIds:
- pipelineStage.pipelineProgresses?.map(
- (item) => item.id as string,
- ) || [],
+ pipelineProgressIds: [],
})) || [];
setBoard(initialBoard);
- setIsBoardLoaded(true);
},
});
- const pipelineProgressIds = currentPipeline?.pipelineStages
- ?.map((pipelineStage: PipelineStage) =>
- (
- pipelineStage.pipelineProgresses?.map((item) => item.id as string) || []
- ).flat(),
- )
+ const pipelineStageIds = currentPipeline?.pipelineStages
+ ?.map((pipelineStage) => pipelineStage.id)
.flat();
+ const filters = useRecoilScopedValue(filtersScopedState, CompanyBoardContext);
+
+ const whereFilters = useMemo(() => {
+ return {
+ AND: [
+ { pipelineStageId: { in: pipelineStageIds } },
+ ...filters.map(turnFilterIntoWhereClause),
+ ],
+ };
+ }, [filters, pipelineStageIds]) as any;
+
const pipelineProgressesQuery = useGetPipelineProgressQuery({
variables: {
- where: {
- id: { in: pipelineProgressIds },
- },
+ where: whereFilters,
+ orderBy,
+ },
+ onCompleted: (data) => {
+ const pipelineProgresses = data?.findManyPipelineProgress || [];
+ setBoard((board) =>
+ board?.map((boardPipelineStage) => ({
+ ...boardPipelineStage,
+ pipelineProgressIds: pipelineProgresses
+ .filter(
+ (pipelineProgress) =>
+ pipelineProgress.pipelineStageId ===
+ boardPipelineStage.pipelineStageId,
+ )
+ .map((pipelineProgress) => pipelineProgress.id),
+ })),
+ );
+ setIsBoardLoaded(true);
},
});
diff --git a/front/src/modules/companies/components/NewCompanyProgressButton.tsx b/front/src/modules/companies/components/NewCompanyProgressButton.tsx
index 65f74f9be71..7b974960b1b 100644
--- a/front/src/modules/companies/components/NewCompanyProgressButton.tsx
+++ b/front/src/modules/companies/components/NewCompanyProgressButton.tsx
@@ -3,7 +3,7 @@ import { getOperationName } from '@apollo/client/utilities';
import { useRecoilState } from 'recoil';
import { v4 as uuidv4 } from 'uuid';
-import { GET_PIPELINES } from '@/pipeline/queries';
+import { GET_PIPELINE_PROGRESS, GET_PIPELINES } from '@/pipeline/queries';
import { BoardColumnContext } from '@/pipeline/states/BoardColumnContext';
import { boardState } from '@/pipeline/states/boardState';
import { currentPipelineState } from '@/pipeline/states/currentPipelineState';
@@ -37,7 +37,10 @@ export function NewCompanyProgressButton() {
} = usePreviousHotkeyScope();
const [createOnePipelineProgress] = useCreateOnePipelineProgressMutation({
- refetchQueries: [getOperationName(GET_PIPELINES) ?? ''],
+ refetchQueries: [
+ getOperationName(GET_PIPELINE_PROGRESS) ?? '',
+ getOperationName(GET_PIPELINES) ?? '',
+ ],
});
const handleEntitySelect = useCallback(
diff --git a/front/src/modules/companies/hooks/useInitializeCompanyBoardFilters.ts b/front/src/modules/companies/hooks/useInitializeCompanyBoardFilters.ts
new file mode 100644
index 00000000000..8660b01a338
--- /dev/null
+++ b/front/src/modules/companies/hooks/useInitializeCompanyBoardFilters.ts
@@ -0,0 +1,21 @@
+import { useEffect } from 'react';
+
+import { CompanyBoardContext } from '@/companies/states/CompanyBoardContext';
+import { availableFiltersScopedState } from '@/ui/filter-n-sort/states/availableFiltersScopedState';
+import { FilterDefinition } from '@/ui/filter-n-sort/types/FilterDefinition';
+import { useRecoilScopedState } from '@/ui/recoil-scope/hooks/useRecoilScopedState';
+
+export function useInitializeCompanyBoardFilters({
+ availableFilters,
+}: {
+ availableFilters: FilterDefinition[];
+}) {
+ const [, setAvailableFilters] = useRecoilScopedState(
+ availableFiltersScopedState,
+ CompanyBoardContext,
+ );
+
+ useEffect(() => {
+ setAvailableFilters(availableFilters);
+ }, [setAvailableFilters, availableFilters]);
+}
diff --git a/front/src/modules/pipeline/components/EntityBoard.tsx b/front/src/modules/pipeline/components/EntityBoard.tsx
index 56e672f4ef3..cc00ed90ad7 100644
--- a/front/src/modules/pipeline/components/EntityBoard.tsx
+++ b/front/src/modules/pipeline/components/EntityBoard.tsx
@@ -1,10 +1,18 @@
import { useCallback } from 'react';
+import { getOperationName } from '@apollo/client/utilities';
+import { useTheme } from '@emotion/react';
+import styled from '@emotion/styled';
import { DragDropContext, OnDragEndResponder } from '@hello-pangea/dnd'; // Atlassian dnd does not support StrictMode from RN 18, so we use a fork @hello-pangea/dnd https://github.com/atlassian/react-beautiful-dnd/issues/2350
+import { IconList } from '@tabler/icons-react';
import { useRecoilState } from 'recoil';
+import { CompanyBoardContext } from '@/companies/states/CompanyBoardContext';
+import { BoardHeader } from '@/ui/board/components/BoardHeader';
+import { SelectedSortType } from '@/ui/filter-n-sort/types/interface';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
import {
PipelineProgress,
+ PipelineProgressOrderByWithRelationInput,
PipelineStage,
useUpdateOnePipelineProgressStageMutation,
} from '~/generated/graphql';
@@ -13,14 +21,31 @@ import {
getOptimisticlyUpdatedBoard,
StyledBoard,
} from '../../ui/board/components/Board';
+import { GET_PIPELINE_PROGRESS } from '../queries';
import { BoardColumnContext } from '../states/BoardColumnContext';
import { boardState } from '../states/boardState';
import { BoardOptions } from '../types/BoardOptions';
import { EntityBoardColumn } from './EntityBoardColumn';
-export function EntityBoard({ boardOptions }: { boardOptions: BoardOptions }) {
+const StyledBoardWithHeader = styled.div`
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ width: 100%;
+`;
+
+export function EntityBoard({
+ boardOptions,
+ updateSorts,
+}: {
+ boardOptions: BoardOptions;
+ updateSorts: (
+ sorts: Array<SelectedSortType<PipelineProgressOrderByWithRelationInput>>,
+ ) => void;
+}) {
const [board, setBoard] = useRecoilState(boardState);
+ const theme = useTheme();
const [updatePipelineProgressStage] =
useUpdateOnePipelineProgressStageMutation();
@@ -34,6 +59,7 @@ export function EntityBoard({ boardOptions }: { boardOptions: BoardOptions }) {
id: pipelineProgressId,
pipelineStageId,
},
+ refetchQueries: [getOperationName(GET_PIPELINE_PROGRESS) ?? ''],
});
},
[updatePipelineProgressStage],
@@ -69,18 +95,27 @@ export function EntityBoard({ boardOptions }: { boardOptions: BoardOptions }) {
: [];
return (board?.length ?? 0) > 0 ? (
- <StyledBoard>
- <DragDropContext onDragEnd={onDragEnd}>
- {sortedBoard.map((column) => (
- <RecoilScope
- SpecificContext={BoardColumnContext}
- key={column.pipelineStageId}
- >
- <EntityBoardColumn boardOptions={boardOptions} column={column} />
- </RecoilScope>
- ))}
- </DragDropContext>
- </StyledBoard>
+ <StyledBoardWithHeader>
+ <BoardHeader
+ viewName="All opportunities"
+ viewIcon={<IconList size={theme.icon.size.md} />}
+ availableSorts={boardOptions.sorts}
+ onSortsUpdate={updateSorts}
+ context={CompanyBoardContext}
+ />
+ <StyledBoard>
+ <DragDropContext onDragEnd={onDragEnd}>
+ {sortedBoard.map((column) => (
+ <RecoilScope
+ SpecificContext={BoardColumnContext}
+ key={column.pipelineStageId}
+ >
+ <EntityBoardColumn boardOptions={boardOptions} column={column} />
+ </RecoilScope>
+ ))}
+ </DragDropContext>
+ </StyledBoard>
+ </StyledBoardWithHeader>
) : (
<></>
);
diff --git a/front/src/modules/pipeline/queries/select.ts b/front/src/modules/pipeline/queries/select.ts
index 4dea0a03b67..5d64c1a38e4 100644
--- a/front/src/modules/pipeline/queries/select.ts
+++ b/front/src/modules/pipeline/queries/select.ts
@@ -1,5 +1,14 @@
import { gql } from '@apollo/client';
+import { SelectedSortType } from '@/ui/filter-n-sort/types/interface';
+import {
+ PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By,
+ SortOrder as Order_By,
+} from '~/generated/graphql';
+
+export type PipelineProgressesSelectedSortType =
+ SelectedSortType<PipelineProgresses_Order_By>;
+
export const GET_PIPELINES = gql`
query GetPipelines($where: PipelineWhereInput) {
findManyPipeline(where: $where) {
@@ -11,18 +20,19 @@ export const GET_PIPELINES = gql`
name
color
index
- pipelineProgresses {
- id
- }
}
}
}
`;
export const GET_PIPELINE_PROGRESS = gql`
- query GetPipelineProgress($where: PipelineProgressWhereInput) {
- findManyPipelineProgress(where: $where, orderBy: { createdAt: asc }) {
+ query GetPipelineProgress(
+ $where: PipelineProgressWhereInput
+ $orderBy: [PipelineProgressOrderByWithRelationInput!]
+ ) {
+ findManyPipelineProgress(where: $where, orderBy: $orderBy) {
id
+ pipelineStageId
progressableType
progressableId
amount
@@ -83,3 +93,9 @@ export const ADD_ENTITY_TO_PIPELINE = gql`
}
}
`;
+
+export const defaultPipelineProgressOrderBy: PipelineProgresses_Order_By[] = [
+ {
+ createdAt: Order_By.Asc,
+ },
+];
diff --git a/front/src/modules/pipeline/types/BoardOptions.ts b/front/src/modules/pipeline/types/BoardOptions.ts
index 8f0a978746d..fb273335e50 100644
--- a/front/src/modules/pipeline/types/BoardOptions.ts
+++ b/front/src/modules/pipeline/types/BoardOptions.ts
@@ -1,4 +1,11 @@
+import { FilterDefinitionByEntity } from '@/ui/filter-n-sort/types/FilterDefinitionByEntity';
+import { SortType } from '@/ui/filter-n-sort/types/interface';
+import { PipelineProgress } from '~/generated/graphql';
+import { PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By } from '~/generated/graphql';
+
export type BoardOptions = {
newCardComponent: React.ReactNode;
cardComponent: React.ReactNode;
+ filters: FilterDefinitionByEntity<PipelineProgress>[];
+ sorts: Array<SortType<PipelineProgresses_Order_By>>;
};
diff --git a/front/src/modules/ui/board/components/BoardHeader.tsx b/front/src/modules/ui/board/components/BoardHeader.tsx
new file mode 100644
index 00000000000..9d7aae2e712
--- /dev/null
+++ b/front/src/modules/ui/board/components/BoardHeader.tsx
@@ -0,0 +1,131 @@
+import { Context, ReactNode, useCallback, useState } from 'react';
+import styled from '@emotion/styled';
+
+import { FilterDropdownButton } from '@/ui/filter-n-sort/components/FilterDropdownButton';
+import SortAndFilterBar from '@/ui/filter-n-sort/components/SortAndFilterBar';
+import { SortDropdownButton } from '@/ui/filter-n-sort/components/SortDropdownButton';
+import { FiltersHotkeyScope } from '@/ui/filter-n-sort/types/FiltersHotkeyScope';
+import { SelectedSortType, SortType } from '@/ui/filter-n-sort/types/interface';
+
+type OwnProps<SortField> = {
+ viewName: string;
+ viewIcon?: ReactNode;
+ availableSorts?: Array<SortType<SortField>>;
+ onSortsUpdate?: (sorts: Array<SelectedSortType<SortField>>) => void;
+ context: Context<string | null>;
+};
+
+const StyledContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+`;
+
+const StyledTableHeader = styled.div`
+ align-items: center;
+ color: ${({ theme }) => theme.font.color.secondary};
+ display: flex;
+ flex-direction: row;
+ font-weight: ${({ theme }) => theme.font.weight.medium};
+ height: 40px;
+ justify-content: space-between;
+ padding-left: ${({ theme }) => theme.spacing(3)};
+ padding-right: ${({ theme }) => theme.spacing(2)};
+`;
+
+const StyledIcon = styled.div`
+ display: flex;
+ margin-left: ${({ theme }) => theme.spacing(1)};
+ margin-right: ${({ theme }) => theme.spacing(2)};
+
+ & > svg {
+ font-size: ${({ theme }) => theme.icon.size.sm};
+ }
+`;
+
+const StyledViewSection = styled.div`
+ display: flex;
+`;
+
+const StyledFilters = styled.div`
+ display: flex;
+ font-weight: ${({ theme }) => theme.font.weight.regular};
+ gap: 2px;
+`;
+
+export function BoardHeader<SortField>({
+ viewName,
+ viewIcon,
+ availableSorts,
+ onSortsUpdate,
+ context,
+}: OwnProps<SortField>) {
+ const [sorts, innerSetSorts] = useState<Array<SelectedSortType<SortField>>>(
+ [],
+ );
+
+ const sortSelect = useCallback(
+ (newSort: SelectedSortType<SortField>) => {
+ const newSorts = updateSortOrFilterByKey(sorts, newSort);
+ innerSetSorts(newSorts);
+ onSortsUpdate && onSortsUpdate(newSorts);
+ },
+ [onSortsUpdate, sorts],
+ );
+
+ const sortUnselect = useCallback(
+ (sortKey: string) => {
+ const newSorts = sorts.filter((sort) => sort.key !== sortKey);
+ innerSetSorts(newSorts);
+ onSortsUpdate && onSortsUpdate(newSorts);
+ },
+ [onSortsUpdate, sorts],
+ );
+
+ return (
+ <StyledContainer>
+ <StyledTableHeader>
+ <StyledViewSection>
+ <StyledIcon>{viewIcon}</StyledIcon>
+ {viewName}
+ </StyledViewSection>
+ <StyledFilters>
+ <FilterDropdownButton
+ context={context}
+ HotkeyScope={FiltersHotkeyScope.FilterDropdownButton}
+ />
+ <SortDropdownButton<SortField>
+ isSortSelected={sorts.length > 0}
+ availableSorts={availableSorts || []}
+ onSortSelect={sortSelect}
+ HotkeyScope={FiltersHotkeyScope.FilterDropdownButton}
+ />
+ </StyledFilters>
+ </StyledTableHeader>
+ <SortAndFilterBar
+ context={context}
+ sorts={sorts}
+ onRemoveSort={sortUnselect}
+ onCancelClick={() => {
+ innerSetSorts([]);
+ onSortsUpdate && onSortsUpdate([]);
+ }}
+ />
+ </StyledContainer>
+ );
+}
+
+function updateSortOrFilterByKey<SortOrFilter extends { key: string }>(
+ sorts: Readonly<SortOrFilter[]>,
+ newSort: SortOrFilter,
+): SortOrFilter[] {
+ const newSorts = [...sorts];
+ const existingSortIndex = sorts.findIndex((sort) => sort.key === newSort.key);
+
+ if (existingSortIndex !== -1) {
+ newSorts[existingSortIndex] = newSort;
+ } else {
+ newSorts.push(newSort);
+ }
+
+ return newSorts;
+}
diff --git a/front/src/pages/opportunities/Opportunities.tsx b/front/src/pages/opportunities/Opportunities.tsx
index b5fe95ec363..c04012ba525 100644
--- a/front/src/pages/opportunities/Opportunities.tsx
+++ b/front/src/pages/opportunities/Opportunities.tsx
@@ -1,26 +1,54 @@
+import { useCallback, useState } from 'react';
import { useTheme } from '@emotion/react';
-import { companyBoardOptions } from '@/companies/components/companyBoardOptions';
-import { HookCompanyBoard } from '@/companies/components/HookCompanyBoard';
+import { HooksCompanyBoard } from '@/companies/components/HooksCompanyBoard';
import { CompanyBoardContext } from '@/companies/states/CompanyBoardContext';
import { BoardActionBarButtonDeletePipelineProgress } from '@/pipeline/components/BoardActionBarButtonDeletePipelineProgress';
import { EntityBoard } from '@/pipeline/components/EntityBoard';
import { EntityBoardActionBar } from '@/pipeline/components/EntityBoardActionBar';
+import {
+ defaultPipelineProgressOrderBy,
+ PipelineProgressesSelectedSortType,
+} from '@/pipeline/queries';
+import { reduceSortsToOrderBy } from '@/ui/filter-n-sort/helpers';
import { IconTargetArrow } from '@/ui/icon/index';
import { WithTopBarContainer } from '@/ui/layout/components/WithTopBarContainer';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
+import { PipelineProgressOrderByWithRelationInput } from '~/generated/graphql';
+import { opportunitiesBoardOptions } from '~/pages/opportunities/opportunitiesBoardOptions';
export function Opportunities() {
const theme = useTheme();
+ const [orderBy, setOrderBy] = useState<
+ PipelineProgressOrderByWithRelationInput[]
+ >(defaultPipelineProgressOrderBy);
+
+ const updateSorts = useCallback(
+ (sorts: Array<PipelineProgressesSelectedSortType>) => {
+ setOrderBy(
+ sorts.length
+ ? reduceSortsToOrderBy(sorts)
+ : defaultPipelineProgressOrderBy,
+ );
+ },
+ [],
+ );
+
return (
<WithTopBarContainer
title="Opportunities"
icon={<IconTargetArrow size={theme.icon.size.md} />}
>
- <HookCompanyBoard />
<RecoilScope SpecificContext={CompanyBoardContext}>
- <EntityBoard boardOptions={companyBoardOptions} />
+ <HooksCompanyBoard
+ availableFilters={opportunitiesBoardOptions.filters}
+ orderBy={orderBy}
+ />
+ <EntityBoard
+ boardOptions={opportunitiesBoardOptions}
+ updateSorts={updateSorts}
+ />
<EntityBoardActionBar>
<BoardActionBarButtonDeletePipelineProgress />
</EntityBoardActionBar>
diff --git a/front/src/pages/opportunities/opportunities-filters.tsx b/front/src/pages/opportunities/opportunities-filters.tsx
new file mode 100644
index 00000000000..7874e58597b
--- /dev/null
+++ b/front/src/pages/opportunities/opportunities-filters.tsx
@@ -0,0 +1,37 @@
+import { FilterDropdownCompanySearchSelect } from '@/companies/components/FilterDropdownCompanySearchSelect';
+import { CompanyBoardContext } from '@/companies/states/CompanyBoardContext';
+import { FilterDefinitionByEntity } from '@/ui/filter-n-sort/types/FilterDefinitionByEntity';
+import {
+ IconBuildingSkyscraper,
+ IconCalendarEvent,
+ IconCurrencyDollar,
+} from '@/ui/icon/index';
+import { icon } from '@/ui/themes/icon';
+import { PipelineProgress } from '~/generated/graphql';
+
+export const opportunitiesFilters: FilterDefinitionByEntity<PipelineProgress>[] =
+ [
+ {
+ field: 'amount',
+ label: 'Amount',
+ icon: <IconCurrencyDollar size={icon.size.md} stroke={icon.stroke.sm} />,
+ type: 'number',
+ },
+ {
+ field: 'closeDate',
+ label: 'Close date',
+ icon: <IconCalendarEvent size={icon.size.md} stroke={icon.stroke.sm} />,
+ type: 'date',
+ },
+ {
+ field: 'progressableId',
+ label: 'Company',
+ icon: (
+ <IconBuildingSkyscraper size={icon.size.md} stroke={icon.stroke.sm} />
+ ),
+ type: 'entity',
+ entitySelectComponent: (
+ <FilterDropdownCompanySearchSelect context={CompanyBoardContext} />
+ ),
+ },
+ ];
diff --git a/front/src/pages/opportunities/opportunities-sorts.tsx b/front/src/pages/opportunities/opportunities-sorts.tsx
new file mode 100644
index 00000000000..cb10872c3be
--- /dev/null
+++ b/front/src/pages/opportunities/opportunities-sorts.tsx
@@ -0,0 +1,21 @@
+import { SortType } from '@/ui/filter-n-sort/types/interface';
+import { IconCalendarEvent, IconCurrencyDollar } from '@/ui/icon/index';
+import { PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By } from '~/generated/graphql';
+
+export const opportunitiesSorts = [
+ {
+ key: 'createdAt',
+ label: 'Creation',
+ icon: <IconCalendarEvent size={16} />,
+ },
+ {
+ key: 'amount',
+ label: 'Amount',
+ icon: <IconCurrencyDollar size={16} />,
+ },
+ {
+ key: 'closeDate',
+ label: 'Expected close date',
+ icon: <IconCalendarEvent size={16} />,
+ },
+] satisfies Array<SortType<PipelineProgresses_Order_By>>;
diff --git a/front/src/modules/companies/components/companyBoardOptions.tsx b/front/src/pages/opportunities/opportunitiesBoardOptions.tsx
similarity index 64%
rename from front/src/modules/companies/components/companyBoardOptions.tsx
rename to front/src/pages/opportunities/opportunitiesBoardOptions.tsx
index 68c429b4421..5f6a5aa9456 100644
--- a/front/src/modules/companies/components/companyBoardOptions.tsx
+++ b/front/src/pages/opportunities/opportunitiesBoardOptions.tsx
@@ -3,11 +3,16 @@ import { NewCompanyProgressButton } from '@/companies/components/NewCompanyProgr
import { BoardOptions } from '@/pipeline/types/BoardOptions';
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
-export const companyBoardOptions: BoardOptions = {
+import { opportunitiesFilters } from './opportunities-filters';
+import { opportunitiesSorts } from './opportunities-sorts';
+
+export const opportunitiesBoardOptions: BoardOptions = {
newCardComponent: (
<RecoilScope>
<NewCompanyProgressButton />
</RecoilScope>
),
cardComponent: <CompanyBoardCard />,
+ filters: opportunitiesFilters,
+ sorts: opportunitiesSorts,
};
diff --git a/front/src/pages/people/people-filters.tsx b/front/src/pages/people/people-filters.tsx
index eff40c70385..628e6d04d74 100644
--- a/front/src/pages/people/people-filters.tsx
+++ b/front/src/pages/people/people-filters.tsx
@@ -8,6 +8,7 @@ import {
IconPhone,
IconUser,
} from '@/ui/icon/index';
+import { TableContext } from '@/ui/table/states/TableContext';
import { icon } from '@/ui/themes/icon';
import { Person } from '~/generated/graphql';
@@ -37,7 +38,9 @@ export const peopleFilters: FilterDefinitionByEntity<Person>[] = [
<IconBuildingSkyscraper size={icon.size.md} stroke={icon.stroke.sm} />
),
type: 'entity',
- entitySelectComponent: <FilterDropdownCompanySearchSelect />,
+ entitySelectComponent: (
+ <FilterDropdownCompanySearchSelect context={TableContext} />
+ ),
},
{
field: 'phone',
diff --git a/front/src/testing/decorators.tsx b/front/src/testing/decorators.tsx
index 7cb0910450e..f46c60899a8 100644
--- a/front/src/testing/decorators.tsx
+++ b/front/src/testing/decorators.tsx
@@ -3,9 +3,9 @@ import { ApolloProvider } from '@apollo/client';
import { Decorator } from '@storybook/react';
import { RecoilRoot } from 'recoil';
-import { pipeline } from '@/companies/__stories__/mock-data';
-import { HookCompanyBoard } from '@/companies/components/HookCompanyBoard';
+import { HooksCompanyBoard } from '@/companies/components/HooksCompanyBoard';
import { CompanyBoardContext } from '@/companies/states/CompanyBoardContext';
+import { defaultPipelineProgressOrderBy } from '@/pipeline/queries';
import { BoardCardContext } from '@/pipeline/states/BoardCardContext';
import { BoardColumnContext } from '@/pipeline/states/BoardColumnContext';
import { pipelineProgressIdScopedState } from '@/pipeline/states/pipelineProgressIdScopedState';
@@ -14,6 +14,7 @@ import { useRecoilScopedState } from '@/ui/recoil-scope/hooks/useRecoilScopedSta
import { CellContext } from '@/ui/table/states/CellContext';
import { RowContext } from '@/ui/table/states/RowContext';
+import { mockedPipelineProgressData } from './mock-data/pipeline-progress';
import { ComponentStorybookLayout } from './ComponentStorybookLayout';
import { mockedClient } from './mockedClient';
@@ -41,8 +42,11 @@ export const CellPositionDecorator: Decorator = (Story) => (
export const BoardDecorator: Decorator = (Story) => (
<>
- <HookCompanyBoard />
<RecoilScope SpecificContext={CompanyBoardContext}>
+ <HooksCompanyBoard
+ availableFilters={[]}
+ orderBy={defaultPipelineProgressOrderBy}
+ />
<Story />
</RecoilScope>
</>
@@ -53,8 +57,7 @@ function HookLoadFakeBoardContextState() {
pipelineProgressIdScopedState,
BoardCardContext,
);
- const pipelineProgress =
- pipeline?.pipelineStages?.[0]?.pipelineProgresses?.[0];
+ const pipelineProgress = mockedPipelineProgressData[1];
useEffect(() => {
setPipelineProgressId(pipelineProgress?.id || '');
}, [pipelineProgress?.id, setPipelineProgressId]);
@@ -64,8 +67,11 @@ function HookLoadFakeBoardContextState() {
export const BoardCardDecorator: Decorator = (Story) => {
return (
<>
- <HookCompanyBoard />
<RecoilScope SpecificContext={CompanyBoardContext}>
+ <HooksCompanyBoard
+ availableFilters={[]}
+ orderBy={defaultPipelineProgressOrderBy}
+ />
<RecoilScope SpecificContext={BoardColumnContext}>
<RecoilScope SpecificContext={BoardCardContext}>
<HookLoadFakeBoardContextState />
diff --git a/front/src/testing/mock-data/pipeline-progress.ts b/front/src/testing/mock-data/pipeline-progress.ts
index f0f2cd0c85e..ea16ce7ce9d 100644
--- a/front/src/testing/mock-data/pipeline-progress.ts
+++ b/front/src/testing/mock-data/pipeline-progress.ts
@@ -1,8 +1,17 @@
-import { PipelineProgress, User } from '../../generated/graphql';
+import {
+ PipelineProgress,
+ PipelineProgressableType,
+ User,
+} from '../../generated/graphql';
type MockedPipelineProgress = Pick<
PipelineProgress,
- 'id' | 'amount' | 'closeDate' | 'progressableId'
+ | 'id'
+ | 'amount'
+ | 'closeDate'
+ | 'progressableId'
+ | 'pipelineStageId'
+ | 'progressableType'
> & {
accountOwner: Pick<
User,
@@ -31,13 +40,17 @@ export const mockedPipelineProgressData: Array<MockedPipelineProgress> = [
closeDate: '2021-10-01T00:00:00.000Z',
progressableId: '0',
accountOwner: accountOwner,
+ pipelineStageId: 'another-pipeline-stage-1',
+ progressableType: PipelineProgressableType.Company,
},
{
id: 'fe256b39-3ec3-4fe7-8998-b76aa0bfb600',
progressableId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
+ pipelineStageId: 'fe256b39-3ec3-4fe3-8998-b76aa0bfb600',
amount: 7,
closeDate: '2021-10-01T00:00:00.000Z',
accountOwner,
+ progressableType: PipelineProgressableType.Company,
},
{
id: '4a886c90-f4f2-4984-8222-882ebbb905d6',
@@ -45,5 +58,7 @@ export const mockedPipelineProgressData: Array<MockedPipelineProgress> = [
amount: 100,
closeDate: '2021-10-01T00:00:00.000Z',
accountOwner,
+ pipelineStageId: 'fe256b39-3ec3-4fe3-8998-b76aa0bfb600',
+ progressableType: PipelineProgressableType.Company,
},
];