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:
@ -32,12 +32,6 @@ export type ActivateWorkspaceInput = {
|
||||
displayName?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type ActivateWorkspaceOutput = {
|
||||
__typename?: 'ActivateWorkspaceOutput';
|
||||
loginToken: AuthToken;
|
||||
workspace: Workspace;
|
||||
};
|
||||
|
||||
export type Analytics = {
|
||||
__typename?: 'Analytics';
|
||||
/** Boolean that confirms query was dispatched */
|
||||
@ -128,6 +122,12 @@ export type Billing = {
|
||||
isBillingEnabled: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
/** The different billing plans available */
|
||||
export enum BillingPlanKey {
|
||||
Enterprise = 'ENTERPRISE',
|
||||
Pro = 'PRO'
|
||||
}
|
||||
|
||||
export type BillingSubscription = {
|
||||
__typename?: 'BillingSubscription';
|
||||
id: Scalars['UUID']['output'];
|
||||
@ -371,7 +371,7 @@ export type ExecuteServerlessFunctionInput = {
|
||||
export type FeatureFlag = {
|
||||
__typename?: 'FeatureFlag';
|
||||
id: Scalars['UUID']['output'];
|
||||
key: Scalars['String']['output'];
|
||||
key: FeatureFlagKey;
|
||||
value: Scalars['Boolean']['output'];
|
||||
workspaceId: Scalars['String']['output'];
|
||||
};
|
||||
@ -382,6 +382,28 @@ export type FeatureFlagFilter = {
|
||||
or?: InputMaybe<Array<FeatureFlagFilter>>;
|
||||
};
|
||||
|
||||
export enum FeatureFlagKey {
|
||||
IsAdvancedFiltersEnabled = 'IsAdvancedFiltersEnabled',
|
||||
IsAggregateQueryEnabled = 'IsAggregateQueryEnabled',
|
||||
IsAirtableIntegrationEnabled = 'IsAirtableIntegrationEnabled',
|
||||
IsAnalyticsV2Enabled = 'IsAnalyticsV2Enabled',
|
||||
IsCopilotEnabled = 'IsCopilotEnabled',
|
||||
IsCrmMigrationEnabled = 'IsCrmMigrationEnabled',
|
||||
IsEventObjectEnabled = 'IsEventObjectEnabled',
|
||||
IsFreeAccessEnabled = 'IsFreeAccessEnabled',
|
||||
IsFunctionSettingsEnabled = 'IsFunctionSettingsEnabled',
|
||||
IsGmailSendEmailScopeEnabled = 'IsGmailSendEmailScopeEnabled',
|
||||
IsJsonFilterEnabled = 'IsJsonFilterEnabled',
|
||||
IsMicrosoftSyncEnabled = 'IsMicrosoftSyncEnabled',
|
||||
IsPageHeaderV2Enabled = 'IsPageHeaderV2Enabled',
|
||||
IsPostgreSqlIntegrationEnabled = 'IsPostgreSQLIntegrationEnabled',
|
||||
IsSsoEnabled = 'IsSSOEnabled',
|
||||
IsStripeIntegrationEnabled = 'IsStripeIntegrationEnabled',
|
||||
IsUniqueIndexesEnabled = 'IsUniqueIndexesEnabled',
|
||||
IsViewGroupsEnabled = 'IsViewGroupsEnabled',
|
||||
IsWorkflowEnabled = 'IsWorkflowEnabled'
|
||||
}
|
||||
|
||||
export type FeatureFlagSort = {
|
||||
direction: SortDirection;
|
||||
field: FeatureFlagSortFields;
|
||||
@ -481,6 +503,12 @@ export enum IdentityProviderType {
|
||||
Saml = 'SAML'
|
||||
}
|
||||
|
||||
export type ImpersonateOutput = {
|
||||
__typename?: 'ImpersonateOutput';
|
||||
loginToken: AuthToken;
|
||||
workspace: WorkspaceSubdomainAndId;
|
||||
};
|
||||
|
||||
export type IndexConnection = {
|
||||
__typename?: 'IndexConnection';
|
||||
/** Array of edges. */
|
||||
@ -544,7 +572,7 @@ export enum MessageChannelVisibility {
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation';
|
||||
activateWorkflowVersion: Scalars['Boolean']['output'];
|
||||
activateWorkspace: ActivateWorkspaceOutput;
|
||||
activateWorkspace: Workspace;
|
||||
addUserToWorkspace: User;
|
||||
addUserToWorkspaceByInviteToken: User;
|
||||
authorizeApp: AuthorizeApp;
|
||||
@ -579,13 +607,13 @@ export type Mutation = {
|
||||
generateApiKeyToken: ApiKeyToken;
|
||||
generateTransientToken: TransientToken;
|
||||
getAuthorizationUrl: GetAuthorizationUrlOutput;
|
||||
impersonate: AuthTokens;
|
||||
impersonate: ImpersonateOutput;
|
||||
publishServerlessFunction: ServerlessFunction;
|
||||
renewToken: AuthTokens;
|
||||
resendWorkspaceInvitation: SendInvitationsOutput;
|
||||
runWorkflowVersion: WorkflowRun;
|
||||
sendInvitations: SendInvitationsOutput;
|
||||
signUp: LoginToken;
|
||||
signUp: SignUpOutput;
|
||||
skipSyncEmailOnboardingStep: OnboardingStepSuccess;
|
||||
switchWorkspace: PublicWorkspaceDataOutput;
|
||||
syncRemoteTable: RemoteTable;
|
||||
@ -645,7 +673,9 @@ export type MutationChallengeArgs = {
|
||||
|
||||
|
||||
export type MutationCheckoutSessionArgs = {
|
||||
plan?: BillingPlanKey;
|
||||
recurringInterval: SubscriptionInterval;
|
||||
requirePaymentMethod?: Scalars['Boolean']['input'];
|
||||
successUrlPath?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
@ -1368,6 +1398,12 @@ export type SetupSsoOutput = {
|
||||
type: IdentityProviderType;
|
||||
};
|
||||
|
||||
export type SignUpOutput = {
|
||||
__typename?: 'SignUpOutput';
|
||||
loginToken: AuthToken;
|
||||
workspace: WorkspaceSubdomainAndId;
|
||||
};
|
||||
|
||||
/** Sort Directions */
|
||||
export enum SortDirection {
|
||||
Asc = 'ASC',
|
||||
@ -1751,6 +1787,7 @@ export type WorkspaceEdge = {
|
||||
|
||||
export type WorkspaceInfo = {
|
||||
__typename?: 'WorkspaceInfo';
|
||||
allowImpersonation: Scalars['Boolean']['output'];
|
||||
featureFlags: Array<FeatureFlag>;
|
||||
id: Scalars['String']['output'];
|
||||
logo?: Maybe<Scalars['String']['output']>;
|
||||
@ -1804,6 +1841,12 @@ export type WorkspaceNameAndId = {
|
||||
id: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type WorkspaceSubdomainAndId = {
|
||||
__typename?: 'WorkspaceSubdomainAndId';
|
||||
id: Scalars['String']['output'];
|
||||
subdomain: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type BillingCustomer = {
|
||||
__typename?: 'billingCustomer';
|
||||
id: Scalars['UUID']['output'];
|
||||
|
||||
@ -117,7 +117,6 @@ export type Billing = {
|
||||
|
||||
/** The different billing plans available */
|
||||
export enum BillingPlanKey {
|
||||
Base = 'BASE',
|
||||
Enterprise = 'ENTERPRISE',
|
||||
Pro = 'PRO'
|
||||
}
|
||||
@ -325,7 +324,6 @@ export enum FeatureFlagKey {
|
||||
IsFunctionSettingsEnabled = 'IsFunctionSettingsEnabled',
|
||||
IsGmailSendEmailScopeEnabled = 'IsGmailSendEmailScopeEnabled',
|
||||
IsJsonFilterEnabled = 'IsJsonFilterEnabled',
|
||||
IsMessageThreadSubscriberEnabled = 'IsMessageThreadSubscriberEnabled',
|
||||
IsMicrosoftSyncEnabled = 'IsMicrosoftSyncEnabled',
|
||||
IsPageHeaderV2Enabled = 'IsPageHeaderV2Enabled',
|
||||
IsPostgreSqlIntegrationEnabled = 'IsPostgreSQLIntegrationEnabled',
|
||||
|
||||
@ -2,13 +2,7 @@ import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSi
|
||||
import { RecordGqlOperationSignatureFactory } from '@/object-record/graphql/types/RecordGqlOperationSignatureFactory';
|
||||
|
||||
export const fetchAllThreadMessagesOperationSignatureFactory: RecordGqlOperationSignatureFactory =
|
||||
({
|
||||
messageThreadId,
|
||||
isSubscribersEnabled,
|
||||
}: {
|
||||
messageThreadId: string;
|
||||
isSubscribersEnabled: boolean;
|
||||
}) => ({
|
||||
({ messageThreadId }: { messageThreadId: string }) => ({
|
||||
objectNameSingular: CoreObjectNameSingular.Message,
|
||||
variables: {
|
||||
filter: {
|
||||
@ -33,15 +27,6 @@ export const fetchAllThreadMessagesOperationSignatureFactory: RecordGqlOperation
|
||||
receivedAt: true,
|
||||
messageThread: {
|
||||
id: true,
|
||||
subscribers: isSubscribersEnabled
|
||||
? {
|
||||
workspaceMember: {
|
||||
id: true,
|
||||
name: true,
|
||||
avatarUrl: true,
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
messageParticipants: {
|
||||
id: true,
|
||||
|
||||
@ -14,9 +14,7 @@ import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
|
||||
import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState';
|
||||
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
export const useRightDrawerEmailThread = () => {
|
||||
const viewableRecordId = useRecoilValue(viewableRecordIdState);
|
||||
@ -38,14 +36,9 @@ export const useRightDrawerEmailThread = () => {
|
||||
},
|
||||
});
|
||||
|
||||
const isMessageThreadSubscribersEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IsMessageThreadSubscriberEnabled,
|
||||
);
|
||||
|
||||
const FETCH_ALL_MESSAGES_OPERATION_SIGNATURE =
|
||||
fetchAllThreadMessagesOperationSignatureFactory({
|
||||
messageThreadId: viewableRecordId,
|
||||
isSubscribersEnabled: isMessageThreadSubscribersEnabled,
|
||||
});
|
||||
|
||||
const {
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
import styled from '@emotion/styled';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { EmailThreadMembersChip } from '@/activities/emails/components/EmailThreadMembersChip';
|
||||
import { messageThreadState } from '@/ui/layout/right-drawer/states/messageThreadState';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
const StyledButtonContainer = styled.div`
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: ${({ theme }) => theme.spacing(2)};
|
||||
`;
|
||||
|
||||
export const MessageThreadSubscribersTopBar = () => {
|
||||
const isMessageThreadSubscriberEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IsMessageThreadSubscriberEnabled,
|
||||
);
|
||||
|
||||
const messageThread = useRecoilValue(messageThreadState);
|
||||
|
||||
const numberOfSubscribers = messageThread?.subscribers?.length ?? 0;
|
||||
|
||||
const shouldShowMembersChip = numberOfSubscribers > 0;
|
||||
|
||||
if (
|
||||
!isMessageThreadSubscriberEnabled ||
|
||||
!isDefined(messageThread) ||
|
||||
!shouldShowMembersChip
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<StyledButtonContainer>
|
||||
<EmailThreadMembersChip messageThread={messageThread} />
|
||||
</StyledButtonContainer>
|
||||
);
|
||||
};
|
||||
@ -9,7 +9,6 @@ import { isNewViewableRecordLoadingState } from '@/object-record/record-right-dr
|
||||
import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState';
|
||||
import { viewableRecordNameSingularState } from '@/object-record/record-right-drawer/states/viewableRecordNameSingularState';
|
||||
import { RightDrawerTopBarCloseButton } from '@/ui/layout/right-drawer/components/RightDrawerTopBarCloseButton';
|
||||
import { RightDrawerTopBarDropdownButton } from '@/ui/layout/right-drawer/components/RightDrawerTopBarDropdownButton';
|
||||
import { RightDrawerTopBarExpandButton } from '@/ui/layout/right-drawer/components/RightDrawerTopBarExpandButton';
|
||||
import { RightDrawerTopBarMinimizeButton } from '@/ui/layout/right-drawer/components/RightDrawerTopBarMinimizeButton';
|
||||
import { StyledRightDrawerTopBar } from '@/ui/layout/right-drawer/components/StyledRightDrawerTopBar';
|
||||
@ -118,7 +117,6 @@ export const RightDrawerTopBar = () => {
|
||||
</StyledMinimizeTopBarTitleContainer>
|
||||
)}
|
||||
<StyledTopBarWrapper>
|
||||
<RightDrawerTopBarDropdownButton />
|
||||
{!isMobile && !isRightDrawerMinimized && (
|
||||
<RightDrawerTopBarMinimizeButton />
|
||||
)}
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
import { MessageThreadSubscribersTopBar } from '@/activities/right-drawer/components/MessageThreadSubscribersTopBar';
|
||||
import { isRightDrawerMinimizedState } from '@/ui/layout/right-drawer/states/isRightDrawerMinimizedState';
|
||||
import { rightDrawerPageState } from '@/ui/layout/right-drawer/states/rightDrawerPageState';
|
||||
import { ComponentByRightDrawerPage } from '@/ui/layout/right-drawer/types/ComponentByRightDrawerPage';
|
||||
import { RightDrawerPages } from '@/ui/layout/right-drawer/types/RightDrawerPages';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
|
||||
const RIGHT_DRAWER_TOP_BAR_DROPDOWN_BUTTON_CONFIG: ComponentByRightDrawerPage =
|
||||
{
|
||||
[RightDrawerPages.ViewEmailThread]: <MessageThreadSubscribersTopBar />,
|
||||
};
|
||||
|
||||
export const RightDrawerTopBarDropdownButton = () => {
|
||||
const [isRightDrawerMinimized] = useRecoilState(isRightDrawerMinimizedState);
|
||||
|
||||
const [rightDrawerPage] = useRecoilState(rightDrawerPageState);
|
||||
|
||||
if (isRightDrawerMinimized || !isDefined(rightDrawerPage)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const dropdownButtonComponent =
|
||||
RIGHT_DRAWER_TOP_BAR_DROPDOWN_BUTTON_CONFIG[rightDrawerPage];
|
||||
|
||||
return dropdownButtonComponent ?? <></>;
|
||||
};
|
||||
@ -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(
|
||||
|
||||
@ -45,11 +45,6 @@ export const seedFeatureFlags = async (
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IsMessageThreadSubscriberEnabled,
|
||||
workspaceId: workspaceId,
|
||||
value: false,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IsAnalyticsV2Enabled,
|
||||
workspaceId: workspaceId,
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -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[]>;
|
||||
}
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user