From b0fe19e73ee3d21a8528406b1bad4085cd85833e Mon Sep 17 00:00:00 2001 From: giancarlo Date: Mon, 15 Apr 2024 17:16:50 +0800 Subject: [PATCH] Update feature flags and related environment variables The code has been adjusted to update the description and requirement error messages of the feature flags. Additionally, the related environment variables used in feature flags have been renamed for better consistency and clarity. This helps in better identification and usage of these feature flags. --- apps/web/.env | 9 ++++++--- apps/web/config/feature-flags.config.ts | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/web/.env b/apps/web/.env index 0d294dc20..0b5cd5895 100644 --- a/apps/web/.env +++ b/apps/web/.env @@ -29,7 +29,10 @@ TEAM_ACCOUNTS_HOME_PATH=/home INVITATION_PAGE_PATH=/join # FEATURE FLAGS -NEXT_PUBLIC_ENABLE_ACCOUNT_DELETION=true +NEXT_PUBLIC_ENABLE_THEME_TOGGLE=true +NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_DELETION=true NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_BILLING=true -NEXT_PUBLIC_ENABLE_ORGANIZATION_DELETION=true -NEXT_PUBLIC_ENABLE_ORGANIZATION_BILLING=true \ No newline at end of file +NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_DELETION=true +NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_BILLING=true +NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS=true +NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_CREATION=true \ No newline at end of file diff --git a/apps/web/config/feature-flags.config.ts b/apps/web/config/feature-flags.config.ts index 544632888..13604b7af 100644 --- a/apps/web/config/feature-flags.config.ts +++ b/apps/web/config/feature-flags.config.ts @@ -6,8 +6,9 @@ const FeatureFlagsSchema = z.object({ required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_THEME_TOGGLE', }), enableAccountDeletion: z.boolean({ - description: 'Enable account deletion.', - required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_ACCOUNT_DELETION', + description: 'Enable personal account deletion.', + required_error: + 'Provide the variable NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_DELETION', }), enableTeamDeletion: z.boolean({ description: 'Enable team deletion.', @@ -15,11 +16,13 @@ const FeatureFlagsSchema = z.object({ }), enableTeamAccounts: z.boolean({ description: 'Enable team accounts.', - required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS', + required_error: + 'Provide the variable NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_DELETION', }), enableTeamCreation: z.boolean({ description: 'Enable team creation.', - required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_TEAMS_CREATION', + required_error: + 'Provide the variable NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_CREATION', }), enablePersonalAccountBilling: z.boolean({ description: 'Enable personal account billing.', @@ -29,7 +32,7 @@ const FeatureFlagsSchema = z.object({ enableTeamAccountBilling: z.boolean({ description: 'Enable team account billing.', required_error: - 'Provide the variable NEXT_PUBLIC_ENABLE_ORGANIZATION_BILLING', + 'Provide the variable NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_BILLING', }), }); @@ -39,11 +42,11 @@ const featuresFlagConfig = FeatureFlagsSchema.parse({ true, ), enableAccountDeletion: getBoolean( - process.env.NEXT_PUBLIC_ENABLE_ACCOUNT_DELETION, + process.env.NEXT_PUBLIC_ENABLE_PERSONAL_ACCOUNT_DELETION, false, ), enableTeamDeletion: getBoolean( - process.env.NEXT_PUBLIC_ENABLE_TEAM_DELETION, + process.env.NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_DELETION, false, ), enableTeamAccounts: getBoolean( @@ -51,7 +54,7 @@ const featuresFlagConfig = FeatureFlagsSchema.parse({ true, ), enableTeamCreation: getBoolean( - process.env.NEXT_PUBLIC_ENABLE_TEAMS_CREATION, + process.env.NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_CREATION, true, ), enablePersonalAccountBilling: getBoolean( @@ -59,7 +62,7 @@ const featuresFlagConfig = FeatureFlagsSchema.parse({ false, ), enableTeamAccountBilling: getBoolean( - process.env.NEXT_PUBLIC_ENABLE_ORGANIZATION_BILLING, + process.env.NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_BILLING, false, ), } satisfies z.infer);