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 ?? <></>;
|
||||
};
|
||||
Reference in New Issue
Block a user