Remove IS_MESSAGE_FOLDER_CONTROL_ENABLED feature flag (#16183)
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
@@ -1285,7 +1285,6 @@ export enum FeatureFlagKey {
|
||||
IS_GLOBAL_WORKSPACE_DATASOURCE_ENABLED = 'IS_GLOBAL_WORKSPACE_DATASOURCE_ENABLED',
|
||||
IS_IMAP_SMTP_CALDAV_ENABLED = 'IS_IMAP_SMTP_CALDAV_ENABLED',
|
||||
IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED',
|
||||
IS_NULL_EQUIVALENCE_ENABLED = 'IS_NULL_EQUIVALENCE_ENABLED',
|
||||
IS_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED',
|
||||
IS_POSTGRESQL_INTEGRATION_ENABLED = 'IS_POSTGRESQL_INTEGRATION_ENABLED',
|
||||
|
||||
@@ -1268,7 +1268,6 @@ export enum FeatureFlagKey {
|
||||
IS_GLOBAL_WORKSPACE_DATASOURCE_ENABLED = 'IS_GLOBAL_WORKSPACE_DATASOURCE_ENABLED',
|
||||
IS_IMAP_SMTP_CALDAV_ENABLED = 'IS_IMAP_SMTP_CALDAV_ENABLED',
|
||||
IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED',
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED',
|
||||
IS_NULL_EQUIVALENCE_ENABLED = 'IS_NULL_EQUIVALENCE_ENABLED',
|
||||
IS_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED',
|
||||
IS_POSTGRESQL_INTEGRATION_ENABLED = 'IS_POSTGRESQL_INTEGRATION_ENABLED',
|
||||
|
||||
+26
-38
@@ -11,14 +11,10 @@ import { SettingsAccountsMessageAutoCreationCard } from '@/settings/accounts/com
|
||||
import { SettingsAccountsMessageFolderCard } from '@/settings/accounts/components/SettingsAccountsMessageFolderCard';
|
||||
import { SettingsAccountsMessageVisibilityCard } from '@/settings/accounts/components/SettingsAccountsMessageVisibilityCard';
|
||||
import { SettingsOptionCardContentToggle } from '@/settings/components/SettingsOptions/SettingsOptionCardContentToggle';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { H2Title, IconBriefcase, IconUsers } from 'twenty-ui/display';
|
||||
import { Card, Section } from 'twenty-ui/layout';
|
||||
import {
|
||||
FeatureFlagKey,
|
||||
type MessageChannelVisibility,
|
||||
} from '~/generated-metadata/graphql';
|
||||
import { type MessageChannelVisibility } from '~/generated-metadata/graphql';
|
||||
|
||||
type SettingsAccountsMessageChannelDetailsProps = {
|
||||
messageChannel: Pick<
|
||||
@@ -47,10 +43,6 @@ export const SettingsAccountsMessageChannelDetails = ({
|
||||
objectNameSingular: CoreObjectNameSingular.MessageChannel,
|
||||
});
|
||||
|
||||
const isFolderControlEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IS_MESSAGE_FOLDER_CONTROL_ENABLED,
|
||||
);
|
||||
|
||||
const handleVisibilityChange = (value: MessageChannelVisibility) => {
|
||||
updateOneRecord({
|
||||
idToUpdate: messageChannel.id,
|
||||
@@ -100,35 +92,31 @@ export const SettingsAccountsMessageChannelDetails = ({
|
||||
|
||||
return (
|
||||
<StyledDetailsContainer>
|
||||
{isFolderControlEnabled && messageChannel.messageFolders && (
|
||||
<>
|
||||
<Section>
|
||||
<H2Title
|
||||
title={t`Import`}
|
||||
description={t`Emails from the blocklist will be ignored. Manage blocklist on the “Accounts” setting page.`}
|
||||
/>
|
||||
<SettingsAccountsMessageFolderCard
|
||||
onChange={handleMessageFolderImportPolicyChange}
|
||||
value={messageChannel.messageFolderImportPolicy}
|
||||
/>
|
||||
</Section>
|
||||
<Section>
|
||||
<Card rounded>
|
||||
<SettingsOptionCardContentToggle
|
||||
Icon={IconUsers}
|
||||
title={t`Exclude group emails`}
|
||||
description={t`Don't sync emails from team@ support@ noreply@...`}
|
||||
checked={messageChannel.excludeGroupEmails}
|
||||
onChange={() =>
|
||||
handleIsGroupEmailExcludedToggle(
|
||||
!messageChannel.excludeGroupEmails,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Card>
|
||||
</Section>
|
||||
</>
|
||||
)}
|
||||
<Section>
|
||||
<H2Title
|
||||
title={t`Import`}
|
||||
description={t`Emails from the blocklist will be ignored. Manage blocklist on the “Accounts” setting page.`}
|
||||
/>
|
||||
<SettingsAccountsMessageFolderCard
|
||||
onChange={handleMessageFolderImportPolicyChange}
|
||||
value={messageChannel.messageFolderImportPolicy}
|
||||
/>
|
||||
</Section>
|
||||
<Section>
|
||||
<Card rounded>
|
||||
<SettingsOptionCardContentToggle
|
||||
Icon={IconUsers}
|
||||
title={t`Exclude group emails`}
|
||||
description={t`Don't sync emails from team@ support@ noreply@...`}
|
||||
checked={messageChannel.excludeGroupEmails}
|
||||
onChange={() =>
|
||||
handleIsGroupEmailExcludedToggle(
|
||||
!messageChannel.excludeGroupEmails,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Card>
|
||||
</Section>
|
||||
<Section>
|
||||
<H2Title
|
||||
title={t`Visibility`}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useState } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
|
||||
import { type CalendarChannel } from '@/accounts/types/CalendarChannel';
|
||||
import { type MessageChannel } from '@/accounts/types/MessageChannel';
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { useGenerateDepthRecordGqlFieldsFromObject } from '@/object-record/graphql/record-gql-fields/hooks/useGenerateDepthRecordGqlFieldsFromObject';
|
||||
import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
|
||||
import { settingsAccountsSelectedMessageChannelState } from '@/settings/accounts/states/settingsAccountsSelectedMessageChannelState';
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import { SettingsPath } from 'twenty-shared/types';
|
||||
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
|
||||
@@ -27,12 +30,21 @@ export const SettingsAccountsConfiguration = () => {
|
||||
const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
|
||||
const [startChannelSyncMutation, { loading: isSubmitting }] =
|
||||
useStartChannelSyncMutation();
|
||||
const setSelectedMessageChannel = useSetRecoilState(
|
||||
settingsAccountsSelectedMessageChannelState,
|
||||
);
|
||||
|
||||
const [currentStep, setCurrentStep] =
|
||||
useState<SettingsAccountsConfigurationStep>(
|
||||
SettingsAccountsConfigurationStep.Email,
|
||||
);
|
||||
|
||||
const { recordGqlFields } = useGenerateDepthRecordGqlFieldsFromObject({
|
||||
objectNameSingular: CoreObjectNameSingular.MessageChannel,
|
||||
depth: 1,
|
||||
shouldOnlyLoadRelationIdentifiers: false,
|
||||
});
|
||||
|
||||
const { records: messageChannels } = useFindManyRecords<MessageChannel>({
|
||||
objectNameSingular: CoreObjectNameSingular.MessageChannel,
|
||||
filter: {
|
||||
@@ -40,6 +52,12 @@ export const SettingsAccountsConfiguration = () => {
|
||||
eq: connectedAccountId,
|
||||
},
|
||||
},
|
||||
recordGqlFields,
|
||||
onCompleted: (data) => {
|
||||
if (isDefined(data[0])) {
|
||||
setSelectedMessageChannel(data[0]);
|
||||
}
|
||||
},
|
||||
skip: !connectedAccountId,
|
||||
});
|
||||
|
||||
|
||||
-9
@@ -22,15 +22,6 @@ export const PUBLIC_FEATURE_FLAGS: PublicFeatureFlag[] = [
|
||||
'https://twenty.com/images/lab/is-imap-smtp-caldav-enabled.png',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_MESSAGE_FOLDER_CONTROL_ENABLED,
|
||||
metadata: {
|
||||
label: 'Message Folder Control',
|
||||
description: 'Control which folders are synced',
|
||||
imagePath:
|
||||
'https://twenty.com/images/lab/is-message-folder-control-enabled.png',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_PAGE_LAYOUT_ENABLED,
|
||||
metadata: {
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ export enum FeatureFlagKey {
|
||||
IS_WORKSPACE_MIGRATION_V2_ENABLED = 'IS_WORKSPACE_MIGRATION_V2_ENABLED',
|
||||
IS_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED',
|
||||
IS_RECORD_PAGE_LAYOUT_ENABLED = 'IS_RECORD_PAGE_LAYOUT_ENABLED',
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED',
|
||||
IS_PUBLIC_DOMAIN_ENABLED = 'IS_PUBLIC_DOMAIN_ENABLED',
|
||||
IS_EMAILING_DOMAIN_ENABLED = 'IS_EMAILING_DOMAIN_ENABLED',
|
||||
IS_WORKFLOW_RUN_STOPPAGE_ENABLED = 'IS_WORKFLOW_RUN_STOPPAGE_ENABLED',
|
||||
|
||||
-2
@@ -202,7 +202,6 @@ describe('WorkspaceEntityManager', () => {
|
||||
IS_WORKSPACE_MIGRATION_V2_ENABLED: false,
|
||||
IS_PAGE_LAYOUT_ENABLED: false,
|
||||
IS_RECORD_PAGE_LAYOUT_ENABLED: false,
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED: false,
|
||||
IS_PUBLIC_DOMAIN_ENABLED: false,
|
||||
IS_EMAILING_DOMAIN_ENABLED: false,
|
||||
IS_WORKFLOW_RUN_STOPPAGE_ENABLED: false,
|
||||
@@ -230,7 +229,6 @@ describe('WorkspaceEntityManager', () => {
|
||||
IS_WORKSPACE_MIGRATION_V2_ENABLED: false,
|
||||
IS_PAGE_LAYOUT_ENABLED: false,
|
||||
IS_RECORD_PAGE_LAYOUT_ENABLED: false,
|
||||
IS_MESSAGE_FOLDER_CONTROL_ENABLED: false,
|
||||
IS_PUBLIC_DOMAIN_ENABLED: false,
|
||||
IS_EMAILING_DOMAIN_ENABLED: false,
|
||||
IS_WORKFLOW_RUN_STOPPAGE_ENABLED: false,
|
||||
|
||||
-5
@@ -92,11 +92,6 @@ export const seedFeatureFlags = async ({
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_MESSAGE_FOLDER_CONTROL_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IS_NULL_EQUIVALENCE_ENABLED,
|
||||
workspaceId: workspaceId,
|
||||
|
||||
+23
-9
@@ -1,5 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import deepEqual from 'deep-equal';
|
||||
import { ConnectedAccountProvider } from 'twenty-shared/types';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { v4 } from 'uuid';
|
||||
@@ -120,15 +122,27 @@ export class SyncMessageFoldersService {
|
||||
);
|
||||
|
||||
if (existingFolder) {
|
||||
updates.push([
|
||||
existingFolder.id,
|
||||
{
|
||||
name: folder.name,
|
||||
externalId: folder.externalId,
|
||||
isSentFolder: folder.isSentFolder,
|
||||
parentFolderId: folder.parentFolderId,
|
||||
},
|
||||
]);
|
||||
const folderSyncData = {
|
||||
name: folder.name,
|
||||
externalId: folder.externalId,
|
||||
isSentFolder: folder.isSentFolder,
|
||||
parentFolderId: isNonEmptyString(folder.parentFolderId)
|
||||
? folder.parentFolderId
|
||||
: null,
|
||||
};
|
||||
|
||||
const existingFolderData = {
|
||||
name: existingFolder.name,
|
||||
externalId: existingFolder.externalId,
|
||||
isSentFolder: existingFolder.isSentFolder,
|
||||
parentFolderId: isNonEmptyString(existingFolder.parentFolderId)
|
||||
? existingFolder.parentFolderId
|
||||
: null,
|
||||
};
|
||||
|
||||
if (!deepEqual(folderSyncData, existingFolderData)) {
|
||||
updates.push([existingFolder.id, folderSyncData]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user