Skip to content
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

[license] Allow usage of charts an tree view pro package for old premium licenses #13619

Merged
merged 7 commits into from
Jun 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/x-license/src/verifyLicense/verifyLicense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function verifyLicense({
return { status: LICENSE_STATUS.Invalid };
}

if (license.planVersion === 'initial') {
if (license.planVersion === 'initial' && license.scope === 'pro') {
// 'charts-pro' or 'tree-view-pro' can only be used with a newer license
if (productScope === 'charts' || productScope === 'tree-view') {
Copy link
Member

@alexfauquette alexfauquette Jun 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to be more robust to upcomming changes. Otherwise each new product will have to be added in this condition

Suggested change
if (license.planVersion === 'initial' && license.scope === 'pro') {
// 'charts-pro' or 'tree-view-pro' can only be used with a newer license
if (productScope === 'charts' || productScope === 'tree-view') {
const initialProductScopes = ['data-grid', 'date-pickers'];
if (license.planVersion === 'initial' && license.scope === 'pro') {
// Other pro packages can only be used with a newer license
if (!initialProScopes.includes(productScope)) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some changes to rely on the package name instead of creating the licenseScope and productScope abstractions that don't bring a lot of value and add a lot of complexity to the code.

I'd be curious to have your opinion.

return { status: LICENSE_STATUS.NotAvailableInInitialProPlan };
Expand Down
Loading