diff --git a/packages/twenty-docs/images/lab/is-imap-smtp-caldav-enabled.png b/packages/twenty-docs/images/lab/is-imap-smtp-caldav-enabled.png deleted file mode 100644 index c741d352cf..0000000000 Binary files a/packages/twenty-docs/images/lab/is-imap-smtp-caldav-enabled.png and /dev/null differ diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts index 478cf3ece7..45af4653bb 100644 --- a/packages/twenty-front/src/generated-metadata/graphql.ts +++ b/packages/twenty-front/src/generated-metadata/graphql.ts @@ -1309,7 +1309,6 @@ export enum FeatureFlagKey { IS_DASHBOARD_V2_ENABLED = 'IS_DASHBOARD_V2_ENABLED', IS_EMAILING_DOMAIN_ENABLED = 'IS_EMAILING_DOMAIN_ENABLED', 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_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED', IS_POSTGRESQL_INTEGRATION_ENABLED = 'IS_POSTGRESQL_INTEGRATION_ENABLED', diff --git a/packages/twenty-front/src/generated/graphql.ts b/packages/twenty-front/src/generated/graphql.ts index d2ce952a8d..05c47b4a0d 100644 --- a/packages/twenty-front/src/generated/graphql.ts +++ b/packages/twenty-front/src/generated/graphql.ts @@ -1292,7 +1292,6 @@ export enum FeatureFlagKey { IS_DASHBOARD_V2_ENABLED = 'IS_DASHBOARD_V2_ENABLED', IS_EMAILING_DOMAIN_ENABLED = 'IS_EMAILING_DOMAIN_ENABLED', 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_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED', IS_POSTGRESQL_INTEGRATION_ENABLED = 'IS_POSTGRESQL_INTEGRATION_ENABLED', diff --git a/packages/twenty-front/src/modules/client-config/states/isImapSmtpCaldavEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isImapSmtpCaldavEnabledState.ts index 21d4efcd1f..8d6d77ea15 100644 --- a/packages/twenty-front/src/modules/client-config/states/isImapSmtpCaldavEnabledState.ts +++ b/packages/twenty-front/src/modules/client-config/states/isImapSmtpCaldavEnabledState.ts @@ -1,4 +1,5 @@ import { createState } from 'twenty-ui/utilities'; + export const isImapSmtpCaldavEnabledState = createState({ key: 'isImapSmtpCaldavEnabled', defaultValue: false, diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx index fe33325262..3b27b66d09 100644 --- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx +++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsListEmptyStateCard.tsx @@ -1,10 +1,10 @@ import { isGoogleCalendarEnabledState } from '@/client-config/states/isGoogleCalendarEnabledState'; import { isGoogleMessagingEnabledState } from '@/client-config/states/isGoogleMessagingEnabledState'; +import { isImapSmtpCaldavEnabledState } from '@/client-config/states/isImapSmtpCaldavEnabledState'; import { isMicrosoftCalendarEnabledState } from '@/client-config/states/isMicrosoftCalendarEnabledState'; import { isMicrosoftMessagingEnabledState } from '@/client-config/states/isMicrosoftMessagingEnabledState'; import { useTriggerApisOAuth } from '@/settings/accounts/hooks/useTriggerApiOAuth'; import { SettingsCard } from '@/settings/components/SettingsCard'; -import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; import { useTheme } from '@emotion/react'; import styled from '@emotion/styled'; import { useLingui } from '@lingui/react/macro'; @@ -13,7 +13,6 @@ import { ConnectedAccountProvider, SettingsPath } from 'twenty-shared/types'; import { getSettingsPath } from 'twenty-shared/utils'; import { IconAt, IconGoogle, IconMicrosoft } from 'twenty-ui/display'; import { UndecoratedLink } from 'twenty-ui/navigation'; -import { FeatureFlagKey } from '~/generated-metadata/graphql'; const StyledCardsContainer = styled.div` display: flex; @@ -40,9 +39,7 @@ export const SettingsAccountsListEmptyStateCard = () => { isMicrosoftCalendarEnabledState, ); - const isImapSmtpCaldavFeatureFlagEnabled = useIsFeatureEnabled( - FeatureFlagKey.IS_IMAP_SMTP_CALDAV_ENABLED, - ); + const isImapSmtpCaldavEnabled = useRecoilValue(isImapSmtpCaldavEnabledState); return ( @@ -62,7 +59,7 @@ export const SettingsAccountsListEmptyStateCard = () => { /> )} - {isImapSmtpCaldavFeatureFlagEnabled && ( + {isImapSmtpCaldavEnabled && ( diff --git a/packages/twenty-server/.env.example b/packages/twenty-server/.env.example index 5e2316b926..c6a47df1dc 100644 --- a/packages/twenty-server/.env.example +++ b/packages/twenty-server/.env.example @@ -15,7 +15,7 @@ FRONTEND_URL=http://localhost:3001 # REFRESH_TOKEN_EXPIRES_IN=90d # FILE_TOKEN_EXPIRES_IN=1d # MESSAGING_PROVIDER_GMAIL_ENABLED=false -# IS_IMAP_SMTP_CALDAV_ENABLED=false +# IS_IMAP_SMTP_CALDAV_ENABLED=true # CALENDAR_PROVIDER_GOOGLE_ENABLED=false # MESSAGING_PROVIDER_MICROSOFT_ENABLED=false # CALENDAR_PROVIDER_MICROSOFT_ENABLED=false diff --git a/packages/twenty-server/.env.test b/packages/twenty-server/.env.test index 842d0415c0..4be39a0226 100644 --- a/packages/twenty-server/.env.test +++ b/packages/twenty-server/.env.test @@ -12,7 +12,7 @@ FRONTEND_URL=http://localhost:3001 AUTH_GOOGLE_ENABLED=false MESSAGING_PROVIDER_GMAIL_ENABLED=false -IS_IMAP_SMTP_CALDAV_ENABLED=false +IS_IMAP_SMTP_CALDAV_ENABLED=true CALENDAR_PROVIDER_GOOGLE_ENABLED=false MESSAGING_PROVIDER_MICROSOFT_ENABLED=false CALENDAR_PROVIDER_MICROSOFT_ENABLED=false diff --git a/packages/twenty-server/src/engine/core-modules/feature-flag/constants/public-feature-flag.const.ts b/packages/twenty-server/src/engine/core-modules/feature-flag/constants/public-feature-flag.const.ts index aa79c6c289..c86c6a6e71 100644 --- a/packages/twenty-server/src/engine/core-modules/feature-flag/constants/public-feature-flag.const.ts +++ b/packages/twenty-server/src/engine/core-modules/feature-flag/constants/public-feature-flag.const.ts @@ -12,16 +12,6 @@ export type PublicFeatureFlag = { }; export const PUBLIC_FEATURE_FLAGS: PublicFeatureFlag[] = [ - { - key: FeatureFlagKey.IS_IMAP_SMTP_CALDAV_ENABLED, - metadata: { - label: 'IMAP, SMTP, CalDAV', - description: - 'Easily add email accounts from any provider that supports IMAP, send emails with SMTP (and soon, sync calendars with CalDAV)', - imagePath: - 'https://twenty.com/images/lab/is-imap-smtp-caldav-enabled.png', - }, - }, { key: FeatureFlagKey.IS_PAGE_LAYOUT_ENABLED, metadata: { diff --git a/packages/twenty-server/src/engine/core-modules/feature-flag/enums/feature-flag-key.enum.ts b/packages/twenty-server/src/engine/core-modules/feature-flag/enums/feature-flag-key.enum.ts index 7f75fb3e85..c8ba716cc0 100644 --- a/packages/twenty-server/src/engine/core-modules/feature-flag/enums/feature-flag-key.enum.ts +++ b/packages/twenty-server/src/engine/core-modules/feature-flag/enums/feature-flag-key.enum.ts @@ -6,7 +6,6 @@ export enum FeatureFlagKey { IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED', IS_AI_ENABLED = 'IS_AI_ENABLED', IS_APPLICATION_ENABLED = 'IS_APPLICATION_ENABLED', - IS_IMAP_SMTP_CALDAV_ENABLED = 'IS_IMAP_SMTP_CALDAV_ENABLED', IS_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED', IS_RECORD_PAGE_LAYOUT_ENABLED = 'IS_RECORD_PAGE_LAYOUT_ENABLED', IS_PUBLIC_DOMAIN_ENABLED = 'IS_PUBLIC_DOMAIN_ENABLED', diff --git a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/imap-smtp-caldav-connection.resolver.ts b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/imap-smtp-caldav-connection.resolver.ts index b12b219d2a..12a335ad60 100644 --- a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/imap-smtp-caldav-connection.resolver.ts +++ b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/imap-smtp-caldav-connection.resolver.ts @@ -1,10 +1,4 @@ -import { - HttpException, - HttpStatus, - UseFilters, - UseGuards, - UsePipes, -} from '@nestjs/common'; +import { UseFilters, UseGuards, UsePipes } from '@nestjs/common'; import { Args, Mutation, Query, Resolver } from '@nestjs/graphql'; import { PermissionFlagType } from 'twenty-shared/constants'; @@ -12,8 +6,6 @@ import { isDefined } from 'twenty-shared/utils'; import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars'; import { AuthGraphqlApiExceptionFilter } from 'src/engine/core-modules/auth/filters/auth-graphql-api-exception.filter'; -import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum'; -import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service'; import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe'; import { UserInputError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util'; import { ConnectedImapSmtpCaldavAccountDTO } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connected-account.dto'; @@ -36,7 +28,6 @@ export class ImapSmtpCaldavResolver { constructor( private readonly ImapSmtpCaldavConnectionService: ImapSmtpCaldavService, private readonly imapSmtpCaldavApisService: ImapSmtpCalDavAPIService, - private readonly featureFlagService: FeatureFlagService, private readonly mailConnectionValidatorService: ImapSmtpCaldavValidatorService, ) {} @@ -78,19 +69,6 @@ export class ImapSmtpCaldavResolver { @AuthWorkspace() workspace: WorkspaceEntity, @Args('id', { type: () => UUIDScalarType, nullable: true }) id?: string, ): Promise { - const isImapSmtpCaldavFeatureFlagEnabled = - await this.featureFlagService.isFeatureEnabled( - FeatureFlagKey.IS_IMAP_SMTP_CALDAV_ENABLED, - workspace.id, - ); - - if (!isImapSmtpCaldavFeatureFlagEnabled) { - throw new HttpException( - 'IMAP, SMTP, CalDAV feature is not enabled for this workspace', - HttpStatus.FORBIDDEN, - ); - } - const validatedParams = await this.validateAndTestConnectionParameters( connectionParameters, handle, diff --git a/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts b/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts index 389b9af89b..67287d1b4a 100644 --- a/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts +++ b/packages/twenty-server/src/engine/twenty-orm/entity-manager/workspace-entity-manager.spec.ts @@ -232,7 +232,6 @@ describe('WorkspaceEntityManager', () => { IS_JSON_FILTER_ENABLED: false, IS_AI_ENABLED: false, IS_APPLICATION_ENABLED: false, - IS_IMAP_SMTP_CALDAV_ENABLED: false, IS_PAGE_LAYOUT_ENABLED: false, IS_RECORD_PAGE_LAYOUT_ENABLED: false, IS_PUBLIC_DOMAIN_ENABLED: false, diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-feature-flags.util.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-feature-flags.util.ts index 56ef667cc3..396c0815a9 100644 --- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-feature-flags.util.ts +++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-feature-flags.util.ts @@ -51,11 +51,6 @@ export const seedFeatureFlags = async ({ workspaceId: workspaceId, value: true, }, - { - key: FeatureFlagKey.IS_IMAP_SMTP_CALDAV_ENABLED, - workspaceId: workspaceId, - value: true, - }, { key: FeatureFlagKey.IS_PAGE_LAYOUT_ENABLED, workspaceId: workspaceId,