refactor(admin-panel): standardize FeatureFlagKey usage (#9548)

Replaced string-based feature flag keys with the typed FeatureFlagKey
enum across the admin panel module and related front-end hooks. This
ensures stronger type safety, reduces potential errors, and improves
consistency in handling feature flags.
This commit is contained in:
Antoine Moreaux
2025-01-10 18:38:50 +01:00
committed by GitHub
parent ed51bff2f4
commit b40f58a512
5 changed files with 20 additions and 13 deletions

View File

@ -4,6 +4,7 @@ import { isDefined } from 'twenty-ui';
import {
useUpdateWorkspaceFeatureFlagMutation,
useUserLookupAdminPanelMutation,
FeatureFlagKey,
} from '~/generated/graphql';
export const useFeatureFlagsManagement = () => {
@ -42,7 +43,7 @@ export const useFeatureFlagsManagement = () => {
const handleFeatureFlagUpdate = async (
workspaceId: string,
featureFlag: string,
featureFlag: FeatureFlagKey,
value: boolean,
) => {
setError(null);

View File

@ -1,4 +1,6 @@
import { FeatureFlagKey } from '~/generated/graphql';
export type FeatureFlag = {
key: string;
key: FeatureFlagKey;
value: boolean;
};