The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Remove IS_LOGS_SETTINGS_SECTION_ENABLED feature flag (#28481)
martmull6cf4fb6c75f3
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphqlindex 84a24160164..c62ba1b5ca0 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql@@ -2137,7 +2137,6 @@ enum FeatureFlagKey {IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLEDIS_CONFIGURABLE_SEARCH_FIELDS_ENABLEDIS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED- IS_LOGS_SETTINGS_SECTION_ENABLEDIS_MESSAGE_CAMPAIGN_ENABLEDIS_RECORD_CREATION_FORM_ENABLEDIS_RECORD_LEVEL_SHARING_ENABLEDdiff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.tsindex e339938c921..7da39fe3f4e 100644--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts@@ -1383,7 +1383,7 @@ export interface FeatureFlag {__typename: 'FeatureFlag'}-export type FeatureFlagKey = 'IS_AI_CHAT_INBOX_ENABLED' | 'IS_APP_PREFERENCES_ENABLED' | 'IS_ASYNC_CSV_EXPORT_ENABLED' | 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' | 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' | 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' | 'IS_LOGS_SETTINGS_SECTION_ENABLED' | 'IS_MESSAGE_CAMPAIGN_ENABLED' | 'IS_RECORD_CREATION_FORM_ENABLED' | 'IS_RECORD_LEVEL_SHARING_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT'+export type FeatureFlagKey = 'IS_AI_CHAT_INBOX_ENABLED' | 'IS_APP_PREFERENCES_ENABLED' | 'IS_ASYNC_CSV_EXPORT_ENABLED' | 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' | 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' | 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' | 'IS_MESSAGE_CAMPAIGN_ENABLED' | 'IS_RECORD_CREATION_FORM_ENABLED' | 'IS_RECORD_LEVEL_SHARING_ENABLED' | 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT'export interface Field {applicationId: Scalars['UUID']@@ -11731,7 +11731,6 @@ export const enumFeatureFlagKey = {IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED: 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED' as const,IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED: 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED' as const,IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED: 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED' as const,- IS_LOGS_SETTINGS_SECTION_ENABLED: 'IS_LOGS_SETTINGS_SECTION_ENABLED' as const,IS_MESSAGE_CAMPAIGN_ENABLED: 'IS_MESSAGE_CAMPAIGN_ENABLED' as const,IS_RECORD_CREATION_FORM_ENABLED: 'IS_RECORD_CREATION_FORM_ENABLED' as const,IS_RECORD_LEVEL_SHARING_ENABLED: 'IS_RECORD_LEVEL_SHARING_ENABLED' as const,diff --git a/packages/twenty-front/src/generated-admin/graphql.ts b/packages/twenty-front/src/generated-admin/graphql.tsindex 5f69e2891bd..a8bdea6078d 100644--- a/packages/twenty-front/src/generated-admin/graphql.ts+++ b/packages/twenty-front/src/generated-admin/graphql.ts@@ -463,7 +463,6 @@ export enum FeatureFlagKey {IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED = 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED',IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED = 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED',IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED = 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED',- IS_LOGS_SETTINGS_SECTION_ENABLED = 'IS_LOGS_SETTINGS_SECTION_ENABLED',IS_MESSAGE_CAMPAIGN_ENABLED = 'IS_MESSAGE_CAMPAIGN_ENABLED',IS_RECORD_CREATION_FORM_ENABLED = 'IS_RECORD_CREATION_FORM_ENABLED',IS_RECORD_LEVEL_SHARING_ENABLED = 'IS_RECORD_LEVEL_SHARING_ENABLED',diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.tsindex 475dcfbf193..9563947c3c7 100644--- a/packages/twenty-front/src/generated-metadata/graphql.ts+++ b/packages/twenty-front/src/generated-metadata/graphql.ts@@ -2261,7 +2261,6 @@ export enum FeatureFlagKey {IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED = 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED',IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED = 'IS_CONFIGURABLE_SEARCH_FIELDS_ENABLED',IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED = 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED',- IS_LOGS_SETTINGS_SECTION_ENABLED = 'IS_LOGS_SETTINGS_SECTION_ENABLED',IS_MESSAGE_CAMPAIGN_ENABLED = 'IS_MESSAGE_CAMPAIGN_ENABLED',IS_RECORD_CREATION_FORM_ENABLED = 'IS_RECORD_CREATION_FORM_ENABLED',IS_RECORD_LEVEL_SHARING_ENABLED = 'IS_RECORD_LEVEL_SHARING_ENABLED',diff --git a/packages/twenty-front/src/modules/log-console/components/__stories__/LogConsole.stories.tsx b/packages/twenty-front/src/modules/log-console/components/__stories__/LogConsole.stories.tsxindex 8c0a9ca3d3c..a8559f43450 100644--- a/packages/twenty-front/src/modules/log-console/components/__stories__/LogConsole.stories.tsx+++ b/packages/twenty-front/src/modules/log-console/components/__stories__/LogConsole.stories.tsx@@ -39,7 +39,6 @@ import {type EventLogsQuery,type EventLogsQueryVariables,EventLogTable,- FeatureFlagKey,PermissionFlagType,} from '~/generated-metadata/graphql';import { SettingsObjects } from '~/pages/settings/data-model/SettingsObjects';@@ -71,9 +70,6 @@ const WORKSPACE_WITH_LOGS_CONSOLE = {...mockCurrentWorkspace.installedApplications,...mockedEventLogInstalledApplications,],- featureFlags: [- { key: FeatureFlagKey.IS_LOGS_SETTINGS_SECTION_ENABLED, value: true },- ],billingEntitlements: [{ key: BillingEntitlementKey.AUDIT_LOGS, value: true }],};diff --git a/packages/twenty-front/src/modules/log-console/components/__tests__/LogConsole.test.tsx b/packages/twenty-front/src/modules/log-console/components/__tests__/LogConsole.test.tsxindex cfa876cba8c..b92bca60426 100644--- a/packages/twenty-front/src/modules/log-console/components/__tests__/LogConsole.test.tsx+++ b/packages/twenty-front/src/modules/log-console/components/__tests__/LogConsole.test.tsx@@ -29,10 +29,7 @@ import {jotaiStore,resetJotaiStore,} from '@/ui/utilities/state/jotai/jotaiStore';-import {- FeatureFlagKey,- PermissionFlagType,-} from '~/generated-metadata/graphql';+import { PermissionFlagType } from '~/generated-metadata/graphql';import {mockCurrentWorkspace,mockedUserData,@@ -88,20 +85,12 @@ const LogsSwitch = () => {);};-const renderWithLogsFeatureFlag = (isLogsFeatureFlagEnabled: boolean) => {+const renderLogConsole = ({ hasSecurityPermission = true } = {}) => {resetJotaiStore();- jotaiStore.set(currentWorkspaceState.atom, {- ...mockCurrentWorkspace,- featureFlags: [- {- key: FeatureFlagKey.IS_LOGS_SETTINGS_SECTION_ENABLED,- value: isLogsFeatureFlagEnabled,- },- ],- });+ jotaiStore.set(currentWorkspaceState.atom, mockCurrentWorkspace);jotaiStore.set(currentUserWorkspaceState.atom, {...mockedUserData.currentUserWorkspace,- permissionFlags: [PermissionFlagType.SECURITY],+ permissionFlags: hasSecurityPermission ? [PermissionFlagType.SECURITY] : [],});jotaiStore.set(isClickHouseConfiguredState.atom, true);jotaiStore.set(isLogConsoleEnabledState.atom, false);@@ -133,7 +122,7 @@ describe('LogConsole', () => {});it('restores the collapsed console when its opening drag is cancelled', () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleDisplayModeState.atom, 'collapsed');@@ -155,7 +144,7 @@ describe('LogConsole', () => {it('opens a console still saved as closed by an earlier version when its bar is dragged', () => {const displayModeSavedByEarlierVersion = 'closed' as unknown as 'collapsed';- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(@@ -169,7 +158,7 @@ describe('LogConsole', () => {});it('keeps the console open in full screen when its drag is cancelled', () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleDisplayModeState.atom, 'collapsed');@@ -187,7 +176,7 @@ describe('LogConsole', () => {});it('restores the collapsed console when the cancel arrives before the drag start renders', () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleDisplayModeState.atom, 'collapsed');@@ -204,7 +193,7 @@ describe('LogConsole', () => {});it('opens a collapsed console at its saved height on a small keyboard step', () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleHeightState.atom, 450);@@ -218,7 +207,7 @@ describe('LogConsole', () => {});it('reflects live resizing without saving the console height until commit', () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleHeightState.atom, 450);@@ -237,7 +226,7 @@ describe('LogConsole', () => {});it('starts the resize range of an open console at its minimum height until a drag begins', () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleDisplayModeState.atom, 'open');@@ -253,7 +242,7 @@ describe('LogConsole', () => {});it('opens when logs is turned on', async () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();expect(screen.queryByText('Log results')).not.toBeInTheDocument();@@ -264,7 +253,7 @@ describe('LogConsole', () => {it('hides when logs is turned off', async () => {mockShouldReduceMotion = true;- renderWithLogsFeatureFlag(true);+ renderLogConsole();await userEvent.click(await screen.findByRole('button', { name: 'Logs' }));@@ -278,7 +267,7 @@ describe('LogConsole', () => {});it('has no close button, so logs is the only way to hide it', async () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();await userEvent.click(await screen.findByRole('button', { name: 'Logs' }));@@ -291,7 +280,7 @@ describe('LogConsole', () => {});it('reopens on the last selected log source', () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleActiveSourceIdState.atom, 'app-logs');@@ -305,7 +294,7 @@ describe('LogConsole', () => {});it('remembers the log source selected by the user', async () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleDisplayModeState.atom, 'open');@@ -318,7 +307,7 @@ describe('LogConsole', () => {it('turns logs on and off with Mod+J on a page that turns off modifier hotkeys', async () => {mockShouldReduceMotion = true;- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(focusStackState.atom, [SETTINGS_PAGE_FOCUS_STACK_ITEM]);});@@ -335,7 +324,7 @@ describe('LogConsole', () => {});it('turns logs off with Mod+J while the console is collapsed', async () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(isLogConsoleEnabledState.atom, true);jotaiStore.set(logConsoleDisplayModeState.atom, 'collapsed');@@ -347,7 +336,7 @@ describe('LogConsole', () => {});it('ignores Mod+J when logs are not allowed', async () => {- renderWithLogsFeatureFlag(false);+ renderLogConsole({ hasSecurityPermission: false });await userEvent.keyboard('{Control>}j{/Control}');@@ -355,7 +344,7 @@ describe('LogConsole', () => {});it('ignores Mod+J while a dialog turns off modifier hotkeys', async () => {- renderWithLogsFeatureFlag(true);+ renderLogConsole();act(() => {jotaiStore.set(focusStackState.atom, [SETTINGS_PAGE_FOCUS_STACK_ITEM,@@ -379,8 +368,8 @@ describe('LogConsole', () => {expect(jotaiStore.get(isLogConsoleEnabledState.atom)).toBe(false);});- it('stays hidden when the logs feature flag is off', async () => {- renderWithLogsFeatureFlag(false);+ it('stays hidden without the security permission', async () => {+ renderLogConsole({ hasSecurityPermission: false });await userEvent.click(await screen.findByRole('button', { name: 'Logs' }));diff --git a/packages/twenty-front/src/modules/log-console/hooks/useIsLogConsoleAllowed.ts b/packages/twenty-front/src/modules/log-console/hooks/useIsLogConsoleAllowed.tsindex 4c09320d969..09abd80c62c 100644--- a/packages/twenty-front/src/modules/log-console/hooks/useIsLogConsoleAllowed.ts+++ b/packages/twenty-front/src/modules/log-console/hooks/useIsLogConsoleAllowed.ts@@ -1,19 +1,12 @@import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';-import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';import { useIsMobile } from 'twenty-ui/utilities';-import {- FeatureFlagKey,- PermissionFlagType,-} from '~/generated-metadata/graphql';+import { PermissionFlagType } from '~/generated-metadata/graphql';export const useIsLogConsoleAllowed = () => {- const isLogsSettingsSectionEnabled = useIsFeatureEnabled(- FeatureFlagKey.IS_LOGS_SETTINGS_SECTION_ENABLED,- );const hasSecurityPermission = useHasPermissionFlag(PermissionFlagType.SECURITY,);const isMobile = useIsMobile();- return isLogsSettingsSectionEnabled && hasSecurityPermission && !isMobile;+ return hasSecurityPermission && !isMobile;};diff --git a/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts b/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.tsindex 8c338888736..6f805a4d552 100644--- a/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts+++ b/packages/twenty-front/src/modules/settings/admin-panel/constants/SettingsAdminFeatureFlagMetadata.ts@@ -36,10 +36,6 @@ export const SETTINGS_ADMIN_FEATURE_FLAG_METADATA: Record<label: msg`Record creation form`,description: msg`Use a dedicated form when creating records, and enable validation rules.`,},- [FeatureFlagKey.IS_LOGS_SETTINGS_SECTION_ENABLED]: {- label: msg`Logs console`,- description: msg`Show a logs console at the bottom of the app in Advanced mode.`,- },[FeatureFlagKey.IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED]: {label: msg`Share calendar events across channels`,description: msg`Store a meeting synced by several calendars of the same provider once, instead of once per calendar.`,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.tsindex 6b97eab0979..7ce118a5d8b 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@@ -6,7 +6,6 @@ const tableName = 'featureFlag';const DEFAULT_SEEDED_FEATURE_FLAGS: Partial<Record<FeatureFlagKey, boolean>> = {[FeatureFlagKey.IS_MESSAGE_CAMPAIGN_ENABLED]: true,[FeatureFlagKey.IS_RECORD_CREATION_FORM_ENABLED]: true,- [FeatureFlagKey.IS_LOGS_SETTINGS_SECTION_ENABLED]: true,[FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED]: false,[FeatureFlagKey.IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED]: true,[FeatureFlagKey.IS_AI_CHAT_INBOX_ENABLED]: true,diff --git a/packages/twenty-shared/src/types/FeatureFlagKey.ts b/packages/twenty-shared/src/types/FeatureFlagKey.tsindex 972e24d7ad3..0cdc63f8407 100644--- a/packages/twenty-shared/src/types/FeatureFlagKey.ts+++ b/packages/twenty-shared/src/types/FeatureFlagKey.ts@@ -5,7 +5,6 @@ export enum FeatureFlagKey {IS_REST_METADATA_API_NEW_FORMAT_DIRECT = 'IS_REST_METADATA_API_NEW_FORMAT_DIRECT',IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED = 'IS_DEFERRED_WORKSPACE_MIGRATION_ACTIONS_ENABLED',IS_RECORD_CREATION_FORM_ENABLED = 'IS_RECORD_CREATION_FORM_ENABLED',- IS_LOGS_SETTINGS_SECTION_ENABLED = 'IS_LOGS_SETTINGS_SECTION_ENABLED',IS_RECORD_LEVEL_SHARING_ENABLED = 'IS_RECORD_LEVEL_SHARING_ENABLED',IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED = 'IS_CALENDAR_EVENT_SHARED_ACROSS_CHANNELS_ENABLED',IS_AI_CHAT_INBOX_ENABLED = 'IS_AI_CHAT_INBOX_ENABLED',