-
-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(schemas, console): remove deprecated ReservedPlanIds #6820
base: master
Are you sure you want to change the base?
Conversation
remove deprecated ReservedPlanIds and refactor the skuId usage in console
COMPARE TO
|
Name | Diff |
---|---|
packages/console/src/components/ApplicationCreation/CreateForm/Footer/index.tsx | 📉 -36 Bytes |
packages/console/src/components/CreateConnectorForm/Footer/index.tsx | 📉 -36 Bytes |
packages/console/src/components/CreateTenantModal/SelectTenantPlanModal/SkuCardItem/index.tsx | 📉 -15 Bytes |
packages/console/src/components/MauExceededModal/index.tsx | 📉 -70 Bytes |
packages/console/src/components/PlanDescription/index.tsx | 📉 -86 Bytes |
packages/console/src/components/SkuName/index.tsx | 📉 -94 Bytes |
packages/console/src/components/Topbar/TenantSelector/TenantDropdownItem/index.tsx | 📉 -62 Bytes |
packages/console/src/pages/ApiResourceDetails/ApiResourcePermissions/components/CreatePermissionModal/index.tsx | 📉 -36 Bytes |
packages/console/src/pages/ApiResources/components/CreateForm/Footer.tsx | 📉 -36 Bytes |
packages/console/src/pages/Applications/components/ProtectedAppForm/index.tsx | 📉 -36 Bytes |
packages/console/src/pages/RoleDetails/RolePermissions/components/AssignPermissionsModal/index.tsx | 📉 -36 Bytes |
packages/console/src/pages/Roles/components/CreateRoleForm/Footer.tsx | 📉 -36 Bytes |
packages/console/src/pages/TenantSettings/BillingHistory/index.tsx | 📉 -709 Bytes |
packages/console/src/pages/TenantSettings/Subscription/CurrentPlan/index.tsx | 📉 -150 Bytes |
packages/console/src/pages/TenantSettings/Subscription/SwitchPlanActionBar/index.tsx | 📉 -12 Bytes |
packages/console/src/pages/Webhooks/CreateFormModal/CreateForm.tsx | 📉 -36 Bytes |
packages/console/src/types/subscriptions.ts | 📉 -248 Bytes |
packages/schemas/src/consts/subscriptions.ts | 📉 -669 Bytes |
const description = | ||
conditional(skuId && registeredPlanDescriptionPhrasesMap[skuId]) ?? | ||
registeredPlanDescriptionPhrasesMap[planId]; | ||
function PlanDescription({ skuId, isEnterprisePlan = false }: Props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to double check the usage scenarios of the component <PlanDescription />
, if this component is used NOT only when displaying the "current plan description," the passed parameters might be problematic: isEnterprisePlan
indicates whether "the current plan" is an enterprise plan. If the component is used to display "past plan descriptions," this parameter could lead to incorrect display content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is used in two places: SelectTenantPlanModel
and CurrentPlan
.
The isEnterprisePla
n parameter doesn’t inherently indicate whether it applies to the current plan. Regardless of whether the provided skuId represents the current plan or a past plan, it should still be able to indicate if it’s an enterprise plan with isEnterprisePlan
.
@@ -52,7 +52,7 @@ function SkuCardItem({ sku, onSelect, buttonProps }: Props) { | |||
</div> | |||
</div> | |||
<div className={styles.description}> | |||
<PlanDescription skuId={skuId} planId={skuId} /> | |||
<PlanDescription skuId={skuId} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the component is intended to display comparisons of quota for three different plans: dev, free, and pro. From the definition of the component, it appears that the isEnterprisePlan
input parameter might influence the displayed content. We may need to determine within the component whether the tenant is an enterprise plan based on the skuId.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always rely on isEnterprisePlan
as the single source of truth to determine whether the provided skuId corresponds to an enterprise plan in the frontend.
For example, legacy plans may not be included in the currently publicly available SKUs, but they should not be treated as enterprise plans either.
Pro = 'pro', | ||
Development = 'dev', | ||
Admin = 'admin', | ||
Enterprise = 'enterprise', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ReservedSkuId
since is was not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
Summary
Remove deprecated
ReservedPlanIds
and refactor the skuId usage in the console.Enterprise
is not a validskuId
in the Logto system, and should not define aReservedPlanIds.Enterprise
.Testing
Checklist
.changeset