Enable conditional password update card in settings page
Added a conditional check for displaying the password update card in the account settings page based on the new `enablePasswordUpdate` feature flag. This ensures the card is shown only if the password update feature is supported.
This commit is contained in:
@@ -3,6 +3,7 @@ import { use } from 'react';
|
|||||||
import { PersonalAccountSettingsContainer } from '@kit/accounts/personal-account-settings';
|
import { PersonalAccountSettingsContainer } from '@kit/accounts/personal-account-settings';
|
||||||
import { PageBody } from '@kit/ui/page';
|
import { PageBody } from '@kit/ui/page';
|
||||||
|
|
||||||
|
import authConfig from '~/config/auth.config';
|
||||||
import featureFlagsConfig from '~/config/feature-flags.config';
|
import featureFlagsConfig from '~/config/feature-flags.config';
|
||||||
import pathsConfig from '~/config/paths.config';
|
import pathsConfig from '~/config/paths.config';
|
||||||
import { loadUserWorkspace } from '~/home/(user)/_lib/server/load-user-workspace';
|
import { loadUserWorkspace } from '~/home/(user)/_lib/server/load-user-workspace';
|
||||||
@@ -11,6 +12,7 @@ import { withI18n } from '~/lib/i18n/with-i18n';
|
|||||||
|
|
||||||
const features = {
|
const features = {
|
||||||
enableAccountDeletion: featureFlagsConfig.enableAccountDeletion,
|
enableAccountDeletion: featureFlagsConfig.enableAccountDeletion,
|
||||||
|
enablePasswordUpdate: authConfig.providers.password,
|
||||||
};
|
};
|
||||||
|
|
||||||
const paths = {
|
const paths = {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export function PersonalAccountSettingsContainer(
|
|||||||
|
|
||||||
features: {
|
features: {
|
||||||
enableAccountDeletion: boolean;
|
enableAccountDeletion: boolean;
|
||||||
|
enablePasswordUpdate: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
paths: {
|
paths: {
|
||||||
@@ -115,21 +116,23 @@ export function PersonalAccountSettingsContainer(
|
|||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card>
|
<If condition={props.features.enablePasswordUpdate}>
|
||||||
<CardHeader>
|
<Card>
|
||||||
<CardTitle>
|
<CardHeader>
|
||||||
<Trans i18nKey={'account:updatePasswordCardTitle'} />
|
<CardTitle>
|
||||||
</CardTitle>
|
<Trans i18nKey={'account:updatePasswordCardTitle'} />
|
||||||
|
</CardTitle>
|
||||||
|
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
<Trans i18nKey={'account:updatePasswordCardDescription'} />
|
<Trans i18nKey={'account:updatePasswordCardDescription'} />
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<UpdatePasswordFormContainer callbackPath={props.paths.callback} />
|
<UpdatePasswordFormContainer callbackPath={props.paths.callback} />
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
</If>
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
|
|||||||
Reference in New Issue
Block a user