0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(console): display mfa feature item in downgrade plan modal (#4922)

This commit is contained in:
Xiao Yijun 2023-11-20 16:57:35 +08:00 committed by GitHub
parent 15fd06fb4b
commit 27fc7b9a3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 22 deletions

View file

@ -3,7 +3,6 @@ import { useMemo } from 'react';
import { Trans, useTranslation } from 'react-i18next';
import PlanName from '@/components/PlanName';
import { isDevFeaturesEnabled } from '@/consts/env';
import { type SubscriptionPlan } from '@/types/subscriptions';
import PlanQuotaDiffCard from './PlanQuotaDiffCard';
@ -17,19 +16,9 @@ type Props = {
function DowngradeConfirmModalContent({ currentPlan, targetPlan }: Props) {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const {
quota: currentFullQuota,
quota: { mfaEnabled: currentMfaEnabled, ...currentQuotaWithoutMfa },
name: currentPlanName,
} = currentPlan;
const currentQuota = isDevFeaturesEnabled ? currentFullQuota : currentQuotaWithoutMfa;
const { quota: currentQuota, name: currentPlanName } = currentPlan;
const {
quota: targetFullQuota,
quota: { mfaEnabled: targetMfaEnabled, ...targetQuotaWithoutMfa },
name: targetPlanName,
} = targetPlan;
const targetQuota = isDevFeaturesEnabled ? targetFullQuota : targetQuotaWithoutMfa;
const { quota: targetQuota, name: targetPlanName } = targetPlan;
const currentQuotaDiff = useMemo(
() => diff(targetQuota, currentQuota),

View file

@ -5,7 +5,6 @@ import { Trans, useTranslation } from 'react-i18next';
import ContactUsPhraseLink from '@/components/ContactUsPhraseLink';
import PlanName from '@/components/PlanName';
import { isDevFeaturesEnabled } from '@/consts/env';
import { planQuotaItemOrder } from '@/consts/plan-quotas';
import {
quotaItemLimitedPhrasesMap,
@ -33,14 +32,7 @@ function NotEligibleSwitchPlanModalContent({ targetPlan, isDowngrade = false }:
keyPrefix: 'admin_console.subscription.not_eligible_modal',
});
const {
id,
name,
quota: fullQuota,
quota: { mfaEnabled, ...quotaWithoutMfa },
} = targetPlan;
const quota = isDevFeaturesEnabled ? fullQuota : quotaWithoutMfa;
const { id, name, quota } = targetPlan;
const orderedEntries = useMemo(() => {
// eslint-disable-next-line no-restricted-syntax