mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-30 20:27:55 +00:00 
			
		
		
		
	Added feature flag for advanced filter (#8194)
Added feature flag for advanced filter
This commit is contained in:
		| @@ -19,6 +19,7 @@ import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectab | |||||||
| import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2'; | import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2'; | ||||||
| import { useGetCurrentView } from '@/views/hooks/useGetCurrentView'; | import { useGetCurrentView } from '@/views/hooks/useGetCurrentView'; | ||||||
| import { availableFilterDefinitionsComponentState } from '@/views/states/availableFilterDefinitionsComponentState'; | import { availableFilterDefinitionsComponentState } from '@/views/states/availableFilterDefinitionsComponentState'; | ||||||
|  | import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; | ||||||
| import { useRecoilValue } from 'recoil'; | import { useRecoilValue } from 'recoil'; | ||||||
| import { isDefined } from 'twenty-ui'; | import { isDefined } from 'twenty-ui'; | ||||||
|  |  | ||||||
| @@ -139,10 +140,15 @@ export const ObjectFilterDropdownFilterSelect = ({ | |||||||
|   const { currentViewId, currentViewWithCombinedFiltersAndSorts } = |   const { currentViewId, currentViewWithCombinedFiltersAndSorts } = | ||||||
|     useGetCurrentView(); |     useGetCurrentView(); | ||||||
|  |  | ||||||
|  |   const isAdvancedFiltersEnabled = useIsFeatureEnabled( | ||||||
|  |     'IS_ADVANCED_FILTERS_ENABLED', | ||||||
|  |   ); | ||||||
|  |  | ||||||
|   const shouldShowAdvancedFilterButton = |   const shouldShowAdvancedFilterButton = | ||||||
|     isDefined(currentViewId) && |     isDefined(currentViewId) && | ||||||
|     isDefined(currentViewWithCombinedFiltersAndSorts?.objectMetadataId) && |     isDefined(currentViewWithCombinedFiltersAndSorts?.objectMetadataId) && | ||||||
|     isAdvancedFilterButtonVisible; |     isAdvancedFilterButtonVisible && | ||||||
|  |     isAdvancedFiltersEnabled; | ||||||
|  |  | ||||||
|   return ( |   return ( | ||||||
|     <> |     <> | ||||||
|   | |||||||
| @@ -15,4 +15,5 @@ export type FeatureFlagKey = | |||||||
|   | 'IS_ANALYTICS_V2_ENABLED' |   | 'IS_ANALYTICS_V2_ENABLED' | ||||||
|   | 'IS_SSO_ENABLED' |   | 'IS_SSO_ENABLED' | ||||||
|   | 'IS_UNIQUE_INDEXES_ENABLED' |   | 'IS_UNIQUE_INDEXES_ENABLED' | ||||||
|   | 'IS_ARRAY_AND_JSON_FILTER_ENABLED'; |   | 'IS_ARRAY_AND_JSON_FILTER_ENABLED' | ||||||
|  |   | 'IS_ADVANCED_FILTERS_ENABLED'; | ||||||
|   | |||||||
| @@ -75,6 +75,11 @@ export const seedFeatureFlags = async ( | |||||||
|         workspaceId: workspaceId, |         workspaceId: workspaceId, | ||||||
|         value: false, |         value: false, | ||||||
|       }, |       }, | ||||||
|  |       { | ||||||
|  |         key: FeatureFlagKey.IsAdvancedFiltersEnabled, | ||||||
|  |         workspaceId: workspaceId, | ||||||
|  |         value: false, | ||||||
|  |       }, | ||||||
|     ]) |     ]) | ||||||
|     .execute(); |     .execute(); | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -14,4 +14,5 @@ export enum FeatureFlagKey { | |||||||
|   IsGmailSendEmailScopeEnabled = 'IS_GMAIL_SEND_EMAIL_SCOPE_ENABLED', |   IsGmailSendEmailScopeEnabled = 'IS_GMAIL_SEND_EMAIL_SCOPE_ENABLED', | ||||||
|   IsAnalyticsV2Enabled = 'IS_ANALYTICS_V2_ENABLED', |   IsAnalyticsV2Enabled = 'IS_ANALYTICS_V2_ENABLED', | ||||||
|   IsUniqueIndexesEnabled = 'IS_UNIQUE_INDEXES_ENABLED', |   IsUniqueIndexesEnabled = 'IS_UNIQUE_INDEXES_ENABLED', | ||||||
|  |   IsAdvancedFiltersEnabled = 'IS_ADVANCED_FILTERS_ENABLED', | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Lucas Bordeau
					Lucas Bordeau