Add dueDate and assignee on notes (#988)
* Add dueDate and assignee on notes * Fix tests * Fix tests
This commit is contained in:
@ -7,6 +7,7 @@ import { GET_COMPANIES } from '@/companies/queries';
|
||||
import { GET_PEOPLE, GET_PERSON, UPDATE_ONE_PERSON } from '@/people/queries';
|
||||
import { GET_PIPELINE_PROGRESS, GET_PIPELINES } from '@/pipeline/queries';
|
||||
import {
|
||||
SEARCH_ACTIVITY_QUERY,
|
||||
SEARCH_COMPANY_QUERY,
|
||||
SEARCH_PEOPLE_QUERY,
|
||||
SEARCH_USER_QUERY,
|
||||
@ -16,11 +17,13 @@ import {
|
||||
GetCompaniesQuery,
|
||||
GetPeopleQuery,
|
||||
GetPersonQuery,
|
||||
SearchActivityQuery,
|
||||
SearchCompanyQuery,
|
||||
SearchPeopleQuery,
|
||||
SearchUserQuery,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
import { mockedActivities } from './mock-data/activities';
|
||||
import { mockedCompaniesData } from './mock-data/companies';
|
||||
import { mockedPeopleData } from './mock-data/people';
|
||||
import { mockedPipelineProgressData } from './mock-data/pipeline-progress';
|
||||
@ -103,6 +106,26 @@ export const graphqlMocks = [
|
||||
}),
|
||||
);
|
||||
}),
|
||||
graphql.query(
|
||||
getOperationName(SEARCH_ACTIVITY_QUERY) ?? '',
|
||||
(req, res, ctx) => {
|
||||
const returnedMockedData = filterAndSortData<
|
||||
SearchActivityQuery['searchResults'][0]
|
||||
>(
|
||||
mockedActivities,
|
||||
req.variables.where,
|
||||
Array.isArray(req.variables.orderBy)
|
||||
? req.variables.orderBy
|
||||
: [req.variables.orderBy],
|
||||
req.variables.limit,
|
||||
);
|
||||
return res(
|
||||
ctx.data({
|
||||
searchResults: returnedMockedData,
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
graphql.query(getOperationName(GET_CURRENT_USER) ?? '', (req, res, ctx) => {
|
||||
return res(
|
||||
ctx.data({
|
||||
|
||||
@ -16,6 +16,8 @@ type MockedActivity = Pick<
|
||||
| 'body'
|
||||
| 'title'
|
||||
| 'authorId'
|
||||
| 'dueAt'
|
||||
| 'completedAt'
|
||||
> & {
|
||||
author: {
|
||||
__typename?: 'User' | undefined;
|
||||
@ -24,6 +26,13 @@ type MockedActivity = Pick<
|
||||
lastName: string;
|
||||
displayName: string;
|
||||
};
|
||||
assignee: {
|
||||
__typename?: 'User' | undefined;
|
||||
id: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
displayName: string;
|
||||
};
|
||||
comments: Array<Pick<Comment, 'body'>>;
|
||||
activityTargets: Array<
|
||||
Pick<
|
||||
@ -47,12 +56,20 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
title: 'My very first note',
|
||||
type: ActivityType.Note,
|
||||
body: null,
|
||||
dueAt: null,
|
||||
completedAt: null,
|
||||
author: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
displayName: 'Charles Test',
|
||||
},
|
||||
assignee: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
displayName: 'Charles Test',
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
comments: [],
|
||||
activityTargets: [
|
||||
@ -94,12 +111,20 @@ export const mockedActivities: Array<MockedActivity> = [
|
||||
title: 'Another note',
|
||||
body: null,
|
||||
type: ActivityType.Note,
|
||||
completedAt: null,
|
||||
dueAt: null,
|
||||
author: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
displayName: 'Charles Test',
|
||||
},
|
||||
assignee: {
|
||||
id: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
firstName: 'Charles',
|
||||
lastName: 'Test',
|
||||
displayName: 'Charles Test',
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
comments: [],
|
||||
activityTargets: [
|
||||
|
||||
Reference in New Issue
Block a user