diff --git a/packages/twenty-front/src/generated/graphql.tsx b/packages/twenty-front/src/generated/graphql.tsx index 7b237d0f2..1bd6c5271 100644 --- a/packages/twenty-front/src/generated/graphql.tsx +++ b/packages/twenty-front/src/generated/graphql.tsx @@ -337,6 +337,7 @@ export enum FeatureFlagKey { IsSsoEnabled = 'IsSSOEnabled', IsStripeIntegrationEnabled = 'IsStripeIntegrationEnabled', IsUniqueIndexesEnabled = 'IsUniqueIndexesEnabled', + IsViewGroupsEnabled = 'IsViewGroupsEnabled', IsWorkflowEnabled = 'IsWorkflowEnabled' } diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuContent.tsx index f82627c46..2c9f5a526 100644 --- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuContent.tsx +++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuContent.tsx @@ -30,6 +30,8 @@ import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys'; import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2'; import { useGetCurrentView } from '@/views/hooks/useGetCurrentView'; import { ViewType } from '@/views/types/ViewType'; +import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; +import { FeatureFlagKey } from '~/generated/graphql'; import { isDefined } from '~/utils/isDefined'; export const ObjectOptionsDropdownMenuContent = () => { @@ -41,6 +43,10 @@ export const ObjectOptionsDropdownMenuContent = () => { closeDropdown, } = useOptionsDropdown(); + const isViewGroupEnabled = useIsFeatureEnabled( + FeatureFlagKey.IsViewGroupsEnabled, + ); + const { getIcon } = useIcons(); const { currentViewWithCombinedFiltersAndSorts: currentView } = useGetCurrentView(); @@ -115,19 +121,20 @@ export const ObjectOptionsDropdownMenuContent = () => { contextualText={`${visibleBoardFields.length} shown`} hasSubMenu /> - {currentView?.key !== 'INDEX' && ( - - isDefined(recordGroupFieldMetadata) - ? onContentChange('recordGroups') - : onContentChange('recordGroupFields') - } - LeftIcon={IconLayoutList} - text="Group by" - contextualText={recordGroupFieldMetadata?.label} - hasSubMenu - /> - )} + {(viewType === ViewType.Kanban || isViewGroupEnabled) && + currentView?.key !== 'INDEX' && ( + + isDefined(recordGroupFieldMetadata) + ? onContentChange('recordGroups') + : onContentChange('recordGroupFields') + } + LeftIcon={IconLayoutList} + text="Group by" + contextualText={recordGroupFieldMetadata?.label} + hasSubMenu + /> + )} diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx index e1fab350f..749fd79b6 100644 --- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx +++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx @@ -26,8 +26,14 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM import { useRecoilComponentFamilyValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValueV2'; import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2'; import { useGetCurrentView } from '@/views/hooks/useGetCurrentView'; +import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; +import { FeatureFlagKey } from '~/generated/graphql'; export const ObjectOptionsDropdownRecordGroupsContent = () => { + const isViewGroupEnabled = useIsFeatureEnabled( + FeatureFlagKey.IsViewGroupsEnabled, + ); + const { viewType, currentContentId, @@ -92,7 +98,7 @@ export const ObjectOptionsDropdownRecordGroupsContent = () => { Group by - {currentView?.key !== 'INDEX' && ( + {isViewGroupEnabled && currentView?.key !== 'INDEX' && ( <> onContentChange('recordGroupFields')} 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 f42bcfa6f..703a4fd6a 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 @@ -14,6 +14,7 @@ export enum FeatureFlagKey { IsMicrosoftSyncEnabled = 'IS_MICROSOFT_SYNC_ENABLED', IsAdvancedFiltersEnabled = 'IS_ADVANCED_FILTERS_ENABLED', IsAggregateQueryEnabled = 'IS_AGGREGATE_QUERY_ENABLED', + IsViewGroupsEnabled = 'IS_VIEW_GROUPS_ENABLED', IsPageHeaderV2Enabled = 'IS_PAGE_HEADER_V2_ENABLED', IsCrmMigrationEnabled = 'IS_CRM_MIGRATION_ENABLED', IsJsonFilterEnabled = 'IS_JSON_FILTER_ENABLED',