-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
Deploy preview: https://deploy-preview-13619--material-ui-x.netlify.app/ |
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.
Nice catch, thank you!
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') { |
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.
Suggestion to be more robust to upcomming changes. Otherwise each new product will have to be added in this condition
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)) { |
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.
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.
edc81cc
to
43e8d5b
Compare
43e8d5b
to
f8c3dca
Compare
} | ||
|
||
if (!acceptedScopes.includes(license.scope)) { | ||
return { status: LICENSE_STATUS.OutOfScope }; | ||
// 'charts-pro' or 'tree-view-pro' can only be used with a newer Pro license |
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.
The order change is here to make sure that a pro license used on a premium package always have the OutOfScope
status and not the NotAvailableInInitialProPlan
…ium licenses (mui#13619) Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com> Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com>
…ium licenses (mui#13619) Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com> Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com>
A follow-up on #13459.