Add feature flag for team account deletion
Updated the team account settings page to support a new feature flag for enabling team deletion. Only the primary user can delete the account if this feature is enabled. Also, corrected the required error message in feature-flags.config.ts file for more clarity.
This commit is contained in:
@@ -4,6 +4,7 @@ import { TeamAccountSettingsContainer } from '@kit/team-accounts/components';
|
||||
import { PageBody } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import featuresFlagConfig from '~/config/feature-flags.config';
|
||||
import pathsConfig from '~/config/paths.config';
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
|
||||
@@ -41,6 +42,10 @@ async function TeamAccountSettingsPage(props: Props) {
|
||||
primaryOwnerUserId: data.primary_owner_user_id,
|
||||
};
|
||||
|
||||
const features = {
|
||||
enableTeamDeletion: featuresFlagConfig.enableTeamDeletion,
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<TeamAccountLayoutPageHeader
|
||||
@@ -51,7 +56,11 @@ async function TeamAccountSettingsPage(props: Props) {
|
||||
|
||||
<PageBody>
|
||||
<div className={'flex max-w-2xl flex-1 flex-col'}>
|
||||
<TeamAccountSettingsContainer account={account} paths={paths} />
|
||||
<TeamAccountSettingsContainer
|
||||
account={account}
|
||||
paths={paths}
|
||||
features={features}
|
||||
/>
|
||||
</div>
|
||||
</PageBody>
|
||||
</>
|
||||
|
||||
@@ -14,7 +14,7 @@ const FeatureFlagsSchema = z.object({
|
||||
}),
|
||||
enableTeamDeletion: z.boolean({
|
||||
description: 'Enable team deletion.',
|
||||
required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_TEAM_DELETION',
|
||||
required_error: 'Provide the variable NEXT_PUBLIC_ENABLE_TEAM_ACCOUNTS_DELETION',
|
||||
}),
|
||||
enableTeamAccounts: z.boolean({
|
||||
description: 'Enable team accounts.',
|
||||
|
||||
Reference in New Issue
Block a user