Skip to content

Commit dcf3ef5

Browse files
authored
refactor(console): remove legacy pro plan filtering logic (#7951)
remove legacy pro plan filtering logic
1 parent 336b4af commit dcf3ef5

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

packages/console/src/components/PlanUsage/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
getQuotaByKey,
2020
getToolTipByKey,
2121
shouldHideQuotaNotice,
22-
filterNewUsageKeysForLegacyPro,
2322
} from './utils';
2423

2524
type Props = {
@@ -48,10 +47,6 @@ function PlanUsage({ periodicUsage, usageAddOnSkus }: Props) {
4847
(key) =>
4948
isPaidTenant || (onlyShowPeriodicUsage && (key === 'mauLimit' || key === 'tokenLimit'))
5049
)
51-
// TODO: remove this filter after the pro plan migration is complete.
52-
.filter((key) => {
53-
return filterNewUsageKeysForLegacyPro(key, planId);
54-
})
5550
.map((key) => {
5651
return {
5752
usage: getUsageByKey(key, {

packages/console/src/components/PlanUsage/utils.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { type AdminConsoleKey } from '@logto/phrases';
2-
import { ReservedPlanId } from '@logto/schemas';
32
import { type TFuncKey } from 'i18next';
43

54
import {
@@ -250,27 +249,3 @@ export const shouldHideQuotaNotice = (
250249
// Hide the quota notice if the basic quota is 0;
251250
return basicQuota[key] === 0;
252251
};
253-
254-
/**
255-
* During the pro plan migration,
256-
* we need to hide the new added usage keys for the legacy Pro plan.
257-
* - RBAC enabled
258-
* - thirdPartyApplicationsLimit
259-
*
260-
* TODO: clean up this function after the migration is complete.
261-
*/
262-
export const filterNewUsageKeysForLegacyPro = (key: UsageKey, planId: string) => {
263-
const newUsageKeys = Object.freeze([CustomUsageKey.RbacEnabled, 'thirdPartyApplicationsLimit']);
264-
265-
if (!newUsageKeys.includes(key)) {
266-
return true;
267-
}
268-
269-
const isProPlanId = isProPlan(planId);
270-
271-
if (isProPlanId && planId !== ReservedPlanId.Pro202509) {
272-
return false; // Hide new usage keys for legacy Pro plan
273-
}
274-
275-
return true;
276-
};

0 commit comments

Comments
 (0)