feat: rename comment thread into activity (#939)
* feat: rename commentThread into activity server * feat: rename commentThread into activity front * feat: migration only create tables feat: migration only create tables * Update activities * fix: rebase partial fix * fix: all rebase problems and drop activity target alter * fix: lint * Update migration * Update migration * Fix conflicts * Fix conflicts --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import {
|
||||
Activity,
|
||||
ActivityTarget,
|
||||
ActivityType,
|
||||
Comment,
|
||||
CommentableType,
|
||||
CommentThread,
|
||||
CommentThreadTarget,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
type MockedCommentThread = Pick<
|
||||
CommentThread,
|
||||
type MockedActivity = Pick<
|
||||
Activity,
|
||||
| 'id'
|
||||
| 'createdAt'
|
||||
| 'updatedAt'
|
||||
@ -25,21 +25,21 @@ type MockedCommentThread = Pick<
|
||||
displayName: string;
|
||||
};
|
||||
comments: Array<Pick<Comment, 'body'>>;
|
||||
commentThreadTargets: Array<
|
||||
activityTargets: Array<
|
||||
Pick<
|
||||
CommentThreadTarget,
|
||||
ActivityTarget,
|
||||
| 'id'
|
||||
| '__typename'
|
||||
| 'createdAt'
|
||||
| 'updatedAt'
|
||||
| 'commentableType'
|
||||
| 'activityId'
|
||||
| 'commentableId'
|
||||
| 'commentThreadId'
|
||||
> & { commentThread: Pick<CommentThread, 'id' | 'createdAt' | 'updatedAt'> }
|
||||
| 'commentableType'
|
||||
> & { activity: Pick<Activity, 'id' | 'createdAt' | 'updatedAt'> }
|
||||
>;
|
||||
};
|
||||
|
||||
export const mockedCommentThreads: Array<MockedCommentThread> = [
|
||||
export const mockedActivities: Array<MockedActivity> = [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
@ -55,20 +55,20 @@ export const mockedCommentThreads: Array<MockedCommentThread> = [
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
comments: [],
|
||||
commentThreadTargets: [
|
||||
activityTargets: [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb300',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
commentableType: CommentableType.Company,
|
||||
commentableId: '89bb825c-171e-4bcc-9cf7-43448d6fb278', // airbnb
|
||||
commentThreadId: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
commentThread: {
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
activity: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb230',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
},
|
||||
__typename: 'CommentThreadTarget',
|
||||
__typename: 'ActivityTarget',
|
||||
},
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb301',
|
||||
@ -76,16 +76,16 @@ export const mockedCommentThreads: Array<MockedCommentThread> = [
|
||||
updatedAt: new Date().toISOString(),
|
||||
commentableType: CommentableType.Company,
|
||||
commentableId: 'b396e6b9-dc5c-4643-bcff-61b6cf7523ae', // aircall
|
||||
commentThreadId: '89bb825c-171e-4bcc-9cf7-43448d6fb231',
|
||||
commentThread: {
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb231',
|
||||
activity: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb231',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
},
|
||||
__typename: 'CommentThreadTarget',
|
||||
__typename: 'ActivityTarget',
|
||||
},
|
||||
],
|
||||
__typename: 'CommentThread',
|
||||
__typename: 'Activity',
|
||||
},
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
@ -102,20 +102,20 @@ export const mockedCommentThreads: Array<MockedCommentThread> = [
|
||||
},
|
||||
authorId: '374fe3a5-df1e-4119-afe0-2a62a2ba481e',
|
||||
comments: [],
|
||||
commentThreadTargets: [
|
||||
activityTargets: [
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
commentableType: CommentableType.Person,
|
||||
commentableId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6b', // Alexandre
|
||||
commentThreadId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
commentThread: {
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
activity: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
createdAt: '2023-04-26T10:12:42.33625+00:00',
|
||||
updatedAt: '2023-04-26T10:23:42.33625+00:00',
|
||||
},
|
||||
__typename: 'CommentThreadTarget',
|
||||
__typename: 'ActivityTarget',
|
||||
},
|
||||
{
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
@ -123,15 +123,15 @@ export const mockedCommentThreads: Array<MockedCommentThread> = [
|
||||
updatedAt: new Date().toISOString(),
|
||||
commentableType: CommentableType.Person,
|
||||
commentableId: '7dfbc3f7-6e5e-4128-957e-8d86808cdf6d', // Jean d'Eau
|
||||
commentThreadId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
commentThread: {
|
||||
activityId: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
activity: {
|
||||
id: '89bb825c-171e-4bcc-9cf7-43448d6fb278',
|
||||
createdAt: new Date().toISOString(),
|
||||
updatedAt: new Date().toISOString(),
|
||||
},
|
||||
__typename: 'CommentThreadTarget',
|
||||
__typename: 'ActivityTarget',
|
||||
},
|
||||
],
|
||||
__typename: 'CommentThread',
|
||||
__typename: 'Activity',
|
||||
},
|
||||
];
|
||||
@ -10,7 +10,7 @@ type MockedCompany = Pick<
|
||||
| 'address'
|
||||
| 'employees'
|
||||
| 'linkedinUrl'
|
||||
| '_commentThreadCount'
|
||||
| '_activityCount'
|
||||
> & {
|
||||
accountOwner: Pick<
|
||||
User,
|
||||
@ -33,7 +33,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
address: '17 rue de clignancourt',
|
||||
employees: 12,
|
||||
linkedinUrl: 'https://www.linkedin.com/company/airbnb/',
|
||||
_commentThreadCount: 1,
|
||||
_activityCount: 1,
|
||||
accountOwner: {
|
||||
email: 'charles@test.com',
|
||||
displayName: 'Charles Test',
|
||||
@ -53,7 +53,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
address: '',
|
||||
employees: 1,
|
||||
linkedinUrl: 'https://www.linkedin.com/company/aircall/',
|
||||
_commentThreadCount: 1,
|
||||
_activityCount: 1,
|
||||
accountOwner: null,
|
||||
__typename: 'Company',
|
||||
},
|
||||
@ -65,7 +65,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
address: '',
|
||||
employees: 1,
|
||||
linkedinUrl: 'https://www.linkedin.com/company/algolia/',
|
||||
_commentThreadCount: 1,
|
||||
_activityCount: 1,
|
||||
accountOwner: null,
|
||||
__typename: 'Company',
|
||||
},
|
||||
@ -77,7 +77,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
address: '',
|
||||
employees: 10,
|
||||
linkedinUrl: 'https://www.linkedin.com/company/apple/',
|
||||
_commentThreadCount: 0,
|
||||
_activityCount: 0,
|
||||
accountOwner: null,
|
||||
__typename: 'Company',
|
||||
},
|
||||
@ -89,7 +89,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
address: '10 rue de la Paix',
|
||||
employees: 1,
|
||||
linkedinUrl: 'https://www.linkedin.com/company/qonto/',
|
||||
_commentThreadCount: 2,
|
||||
_activityCount: 2,
|
||||
accountOwner: null,
|
||||
__typename: 'Company',
|
||||
},
|
||||
@ -101,7 +101,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
address: '',
|
||||
employees: 1,
|
||||
linkedinUrl: 'https://www.linkedin.com/company/facebook/',
|
||||
_commentThreadCount: 13,
|
||||
_activityCount: 13,
|
||||
accountOwner: null,
|
||||
__typename: 'Company',
|
||||
},
|
||||
@ -113,7 +113,7 @@ export const mockedCompaniesData: Array<MockedCompany> = [
|
||||
address: '',
|
||||
employees: 1,
|
||||
linkedinUrl: 'https://www.linkedin.com/company/sequoia/',
|
||||
_commentThreadCount: 1,
|
||||
_activityCount: 1,
|
||||
accountOwner: null,
|
||||
__typename: 'Company',
|
||||
},
|
||||
|
||||
@ -17,7 +17,7 @@ type MockedPerson = RequiredAndNotNull<
|
||||
| '__typename'
|
||||
| 'phone'
|
||||
| 'city'
|
||||
| '_commentThreadCount'
|
||||
| '_activityCount'
|
||||
| 'createdAt'
|
||||
> & {
|
||||
company: Pick<Company, 'id' | 'name' | 'domainName' | '__typename'>;
|
||||
@ -41,7 +41,7 @@ export const mockedPeopleData: MockedPerson[] = [
|
||||
__typename: 'Company',
|
||||
},
|
||||
phone: '06 12 34 56 78',
|
||||
_commentThreadCount: 1,
|
||||
_activityCount: 1,
|
||||
createdAt: '2023-04-20T13:20:09.158312+00:00',
|
||||
|
||||
city: 'Paris',
|
||||
@ -62,7 +62,7 @@ export const mockedPeopleData: MockedPerson[] = [
|
||||
__typename: 'Company',
|
||||
},
|
||||
phone: '06 12 34 56 78',
|
||||
_commentThreadCount: 1,
|
||||
_activityCount: 1,
|
||||
createdAt: '2023-04-20T13:20:09.158312+00:00',
|
||||
|
||||
city: 'Paris',
|
||||
@ -83,7 +83,7 @@ export const mockedPeopleData: MockedPerson[] = [
|
||||
__typename: 'Company',
|
||||
},
|
||||
phone: '06 12 34 56 78',
|
||||
_commentThreadCount: 1,
|
||||
_activityCount: 1,
|
||||
createdAt: '2023-04-20T13:20:09.158312+00:00',
|
||||
|
||||
city: 'Paris',
|
||||
@ -104,7 +104,7 @@ export const mockedPeopleData: MockedPerson[] = [
|
||||
__typename: 'Company',
|
||||
},
|
||||
phone: '06 12 34 56 78',
|
||||
_commentThreadCount: 2,
|
||||
_activityCount: 2,
|
||||
createdAt: '2023-04-20T13:20:09.158312+00:00',
|
||||
|
||||
city: 'Paris',
|
||||
|
||||
Reference in New Issue
Block a user