Deprecate share email thread (#9319)

## Context

Following this https://github.com/twentyhq/twenty/issues/4199
This has not been fully implemented, after 5months of dead code I'm
removing the feature for the time being until we re-prioritise the
feature (unlikely during these next 6 months) to keep the codebase a bit
cleaner (no need to maintain dead features)

Feel free to reopen / revert this PR once feature is ready

## Test
locally after importing emails
This commit is contained in:
Weiko
2025-01-02 16:22:29 +01:00
committed by GitHub
parent 0dff20775b
commit 866c29e9ee
14 changed files with 54 additions and 220 deletions

View File

@ -22,7 +22,6 @@ import { seedWorkspaceFavorites } from 'src/database/typeorm-seeds/workspace/fav
import { seedMessageChannelMessageAssociation } from 'src/database/typeorm-seeds/workspace/message-channel-message-associations';
import { seedMessageChannel } from 'src/database/typeorm-seeds/workspace/message-channels';
import { seedMessageParticipant } from 'src/database/typeorm-seeds/workspace/message-participants';
import { seedMessageThreadSubscribers } from 'src/database/typeorm-seeds/workspace/message-thread-subscribers';
import { seedMessageThread } from 'src/database/typeorm-seeds/workspace/message-threads';
import { seedMessage } from 'src/database/typeorm-seeds/workspace/messages';
import { seedOpportunity } from 'src/database/typeorm-seeds/workspace/opportunities';
@ -182,12 +181,6 @@ export class DataSeedWorkspaceCommand extends CommandRunner {
dataSourceMetadata.workspaceId,
);
const isMessageThreadSubscriberEnabled =
await this.featureFlagService.isFeatureEnabled(
FeatureFlagKey.IsMessageThreadSubscriberEnabled,
dataSourceMetadata.workspaceId,
);
const isWorkflowEnabled =
await this.featureFlagService.isFeatureEnabled(
FeatureFlagKey.IsWorkflowEnabled,
@ -207,13 +200,6 @@ export class DataSeedWorkspaceCommand extends CommandRunner {
await seedMessageThread(entityManager, dataSourceMetadata.schema);
await seedConnectedAccount(entityManager, dataSourceMetadata.schema);
if (isMessageThreadSubscriberEnabled) {
await seedMessageThreadSubscribers(
entityManager,
dataSourceMetadata.schema,
);
}
await seedMessage(entityManager, dataSourceMetadata.schema);
await seedMessageChannel(entityManager, dataSourceMetadata.schema);
await seedMessageChannelMessageAssociation(

View File

@ -45,11 +45,6 @@ export const seedFeatureFlags = async (
workspaceId: workspaceId,
value: true,
},
{
key: FeatureFlagKey.IsMessageThreadSubscriberEnabled,
workspaceId: workspaceId,
value: false,
},
{
key: FeatureFlagKey.IsAnalyticsV2Enabled,
workspaceId: workspaceId,

View File

@ -7,7 +7,6 @@ export enum FeatureFlagKey {
IsFreeAccessEnabled = 'IS_FREE_ACCESS_ENABLED',
IsFunctionSettingsEnabled = 'IS_FUNCTION_SETTINGS_ENABLED',
IsWorkflowEnabled = 'IS_WORKFLOW_ENABLED',
IsMessageThreadSubscriberEnabled = 'IS_MESSAGE_THREAD_SUBSCRIBER_ENABLED',
IsSSOEnabled = 'IS_SSO_ENABLED',
IsGmailSendEmailScopeEnabled = 'IS_GMAIL_SEND_EMAIL_SCOPE_ENABLED',
IsAnalyticsV2Enabled = 'IS_ANALYTICS_V2_ENABLED',

View File

@ -12,7 +12,6 @@ import { FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/f
import { MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
import { MessageChannelWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
import { MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
import { MessageThreadSubscriberWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread-subscriber.workspace-entity';
import { MessageThreadWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread.workspace-entity';
import { MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
import { NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
@ -66,7 +65,6 @@ export const standardObjectMetadataDefinitions = [
WorkflowRunWorkspaceEntity,
WorkspaceMemberWorkspaceEntity,
MessageThreadWorkspaceEntity,
MessageThreadSubscriberWorkspaceEntity,
MessageWorkspaceEntity,
MessageChannelWorkspaceEntity,
MessageParticipantWorkspaceEntity,

View File

@ -1,59 +0,0 @@
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
import { RelationMetadataType } from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity';
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-entity.decorator';
import { WorkspaceGate } from 'src/engine/twenty-orm/decorators/workspace-gate.decorator';
import { WorkspaceIsNotAuditLogged } from 'src/engine/twenty-orm/decorators/workspace-is-not-audit-logged.decorator';
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
import { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator';
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
import { MESSAGE_THREAD_SUBSCRIBER_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { STANDARD_OBJECT_ICONS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-icons';
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { MessageThreadWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread.workspace-entity';
import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
@WorkspaceEntity({
standardId: STANDARD_OBJECT_IDS.messageThreadSubscriber,
namePlural: 'messageThreadSubscriber',
labelSingular: 'Message Thread Subscriber',
labelPlural: 'Message Threads Subscribers',
description: 'Message Thread Subscribers',
icon: STANDARD_OBJECT_ICONS.messageThreadSubscriber,
})
@WorkspaceIsNotAuditLogged()
@WorkspaceIsSystem()
@WorkspaceGate({
featureFlag: FeatureFlagKey.IsMessageThreadSubscriberEnabled,
})
export class MessageThreadSubscriberWorkspaceEntity extends BaseWorkspaceEntity {
@WorkspaceRelation({
standardId: MESSAGE_THREAD_SUBSCRIBER_STANDARD_FIELD_IDS.messageThread,
type: RelationMetadataType.MANY_TO_ONE,
label: 'Message Thread',
description: 'Message Thread',
icon: 'IconMessage',
inverseSideFieldKey: 'subscribers',
inverseSideTarget: () => MessageThreadWorkspaceEntity,
})
messageThread: Relation<MessageThreadWorkspaceEntity>;
@WorkspaceJoinColumn('messageThread')
messageThreadId: string;
@WorkspaceRelation({
standardId: MESSAGE_THREAD_SUBSCRIBER_STANDARD_FIELD_IDS.workspaceMember,
type: RelationMetadataType.MANY_TO_ONE,
label: 'Workspace Member',
description: 'Workspace Member that is part of the message thread',
icon: 'IconCircleUser',
inverseSideFieldKey: 'messageThreadSubscribers',
inverseSideTarget: () => WorkspaceMemberWorkspaceEntity,
})
workspaceMember: Relation<WorkspaceMemberWorkspaceEntity>;
@WorkspaceJoinColumn('workspaceMember')
workspaceMemberId: string;
}

View File

@ -1,13 +1,11 @@
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
import {
RelationMetadataType,
RelationOnDeleteAction,
} from 'src/engine/metadata-modules/relation-metadata/relation-metadata.entity';
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-entity.decorator';
import { WorkspaceGate } from 'src/engine/twenty-orm/decorators/workspace-gate.decorator';
import { WorkspaceIsNotAuditLogged } from 'src/engine/twenty-orm/decorators/workspace-is-not-audit-logged.decorator';
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
@ -15,7 +13,6 @@ import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-re
import { MESSAGE_THREAD_STANDARD_FIELD_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-field-ids';
import { STANDARD_OBJECT_ICONS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-icons';
import { STANDARD_OBJECT_IDS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/standard-object-ids';
import { MessageThreadSubscriberWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread-subscriber.workspace-entity';
import { MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
@WorkspaceEntity({
@ -40,18 +37,4 @@ export class MessageThreadWorkspaceEntity extends BaseWorkspaceEntity {
})
@WorkspaceIsNullable()
messages: Relation<MessageWorkspaceEntity[]>;
@WorkspaceRelation({
standardId: MESSAGE_THREAD_STANDARD_FIELD_IDS.messageThreadSubscribers,
type: RelationMetadataType.ONE_TO_MANY,
label: 'Message Thread Subscribers',
description: 'Message Thread Subscribers',
icon: 'IconMessage',
inverseSideTarget: () => MessageThreadSubscriberWorkspaceEntity,
onDelete: RelationOnDeleteAction.CASCADE,
})
@WorkspaceGate({
featureFlag: FeatureFlagKey.IsMessageThreadSubscriberEnabled,
})
subscribers: Relation<MessageThreadSubscriberWorkspaceEntity[]>;
}

View File

@ -2,7 +2,6 @@ import { registerEnumType } from '@nestjs/graphql';
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
import { SEARCH_VECTOR_FIELD } from 'src/engine/metadata-modules/constants/search-vector-field.constants';
import { FullNameMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/full-name.composite-type';
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
@ -15,7 +14,6 @@ import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity
import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-entity.decorator';
import { WorkspaceFieldIndex } from 'src/engine/twenty-orm/decorators/workspace-field-index.decorator';
import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator';
import { WorkspaceGate } from 'src/engine/twenty-orm/decorators/workspace-gate.decorator';
import { WorkspaceIsNotAuditLogged } from 'src/engine/twenty-orm/decorators/workspace-is-not-audit-logged.decorator';
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
@ -34,7 +32,6 @@ import { CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/com
import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
import { FavoriteWorkspaceEntity } from 'src/modules/favorite/standard-objects/favorite.workspace-entity';
import { MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
import { MessageThreadSubscriberWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread-subscriber.workspace-entity';
import { TaskWorkspaceEntity } from 'src/modules/task/standard-objects/task.workspace-entity';
import { AuditLogWorkspaceEntity } from 'src/modules/timeline/standard-objects/audit-log.workspace-entity';
import { TimelineActivityWorkspaceEntity } from 'src/modules/timeline/standard-objects/timeline-activity.workspace-entity';
@ -163,20 +160,6 @@ export class WorkspaceMemberWorkspaceEntity extends BaseWorkspaceEntity {
})
favorites: Relation<FavoriteWorkspaceEntity[]>;
@WorkspaceRelation({
standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.messageThreadSubscribers,
type: RelationMetadataType.ONE_TO_MANY,
label: 'Message thread subscribers',
description: 'Message thread subscribers for this workspace member',
icon: 'IconMessage',
inverseSideTarget: () => MessageThreadSubscriberWorkspaceEntity,
onDelete: RelationOnDeleteAction.CASCADE,
})
@WorkspaceGate({
featureFlag: FeatureFlagKey.IsMessageThreadSubscriberEnabled,
})
messageThreadSubscribers: Relation<MessageThreadSubscriberWorkspaceEntity[]>;
@WorkspaceRelation({
standardId: WORKSPACE_MEMBER_STANDARD_FIELD_IDS.accountOwnerForCompanies,
type: RelationMetadataType.ONE_TO_MANY,