Enforce front project structure through ESLINT (#7863)
Fixes: https://github.com/twentyhq/twenty/issues/7329
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { getTimelineThreadsFromCompanyId } from '../getTimelineThreadsFromCompanyId';
|
||||
|
||||
jest.mock('@apollo/client', () => ({
|
||||
gql: jest.fn().mockImplementation((strings) => {
|
||||
return strings.map((str: string) => str.trim()).join(' ');
|
||||
}),
|
||||
}));
|
||||
|
||||
describe('getTimelineThreadsFromCompanyId query', () => {
|
||||
test('should construct the query correctly', () => {
|
||||
expect(gql).toHaveBeenCalled();
|
||||
expect(getTimelineThreadsFromCompanyId).toBeDefined();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,16 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { getTimelineThreadsFromPersonId } from '../getTimelineThreadsFromPersonId';
|
||||
|
||||
jest.mock('@apollo/client', () => ({
|
||||
gql: jest.fn().mockImplementation((strings) => {
|
||||
return strings.map((str: string) => str.trim()).join(' ');
|
||||
}),
|
||||
}));
|
||||
|
||||
describe('getTimelineThreadsFromPersonId query', () => {
|
||||
test('should construct the query correctly', () => {
|
||||
expect(gql).toHaveBeenCalled();
|
||||
expect(getTimelineThreadsFromPersonId).toBeDefined();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,13 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const participantFragment = gql`
|
||||
fragment ParticipantFragment on TimelineThreadParticipant {
|
||||
personId
|
||||
workspaceMemberId
|
||||
firstName
|
||||
lastName
|
||||
displayName
|
||||
avatarUrl
|
||||
handle
|
||||
}
|
||||
`;
|
||||
@ -0,0 +1,23 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { participantFragment } from '@/activities/emails/graphql/queries/fragments/participantFragment';
|
||||
|
||||
export const timelineThreadFragment = gql`
|
||||
fragment TimelineThreadFragment on TimelineThread {
|
||||
id
|
||||
read
|
||||
visibility
|
||||
firstParticipant {
|
||||
...ParticipantFragment
|
||||
}
|
||||
lastTwoParticipants {
|
||||
...ParticipantFragment
|
||||
}
|
||||
lastMessageReceivedAt
|
||||
lastMessageBody
|
||||
subject
|
||||
numberOfMessagesInThread
|
||||
participantCount
|
||||
}
|
||||
${participantFragment}
|
||||
`;
|
||||
@ -0,0 +1,12 @@
|
||||
import { timelineThreadFragment } from '@/activities/emails/graphql/queries/fragments/timelineThreadFragment';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const timelineThreadWithTotalFragment = gql`
|
||||
fragment TimelineThreadsWithTotalFragment on TimelineThreadsWithTotal {
|
||||
totalNumberOfThreads
|
||||
timelineThreads {
|
||||
...TimelineThreadFragment
|
||||
}
|
||||
}
|
||||
${timelineThreadFragment}
|
||||
`;
|
||||
@ -0,0 +1,19 @@
|
||||
import { timelineThreadWithTotalFragment } from '@/activities/emails/graphql/queries/fragments/timelineThreadWithTotalFragment';
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const getTimelineThreadsFromCompanyId = gql`
|
||||
query GetTimelineThreadsFromCompanyId(
|
||||
$companyId: UUID!
|
||||
$page: Int!
|
||||
$pageSize: Int!
|
||||
) {
|
||||
getTimelineThreadsFromCompanyId(
|
||||
companyId: $companyId
|
||||
page: $page
|
||||
pageSize: $pageSize
|
||||
) {
|
||||
...TimelineThreadsWithTotalFragment
|
||||
}
|
||||
}
|
||||
${timelineThreadWithTotalFragment}
|
||||
`;
|
||||
@ -0,0 +1,20 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { timelineThreadWithTotalFragment } from '@/activities/emails/graphql/queries/fragments/timelineThreadWithTotalFragment';
|
||||
|
||||
export const getTimelineThreadsFromPersonId = gql`
|
||||
query GetTimelineThreadsFromPersonId(
|
||||
$personId: UUID!
|
||||
$page: Int!
|
||||
$pageSize: Int!
|
||||
) {
|
||||
getTimelineThreadsFromPersonId(
|
||||
personId: $personId
|
||||
page: $page
|
||||
pageSize: $pageSize
|
||||
) {
|
||||
...TimelineThreadsWithTotalFragment
|
||||
}
|
||||
}
|
||||
${timelineThreadWithTotalFragment}
|
||||
`;
|
||||
Reference in New Issue
Block a user