Skip to content

Commit

Permalink
changed naming to be more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
michelengelen committed Jun 21, 2024
1 parent 381db7b commit fba2ffc
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/x-license/src/Watermark/Watermark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function getLicenseErrorMessage(licenseStatus: LicenseStatus) {
return 'MUI X Invalid license key';
case LICENSE_STATUS.OutOfScope:
return 'MUI X License key plan mismatch';
case LICENSE_STATUS.ComponentNotIncluded:
case LICENSE_STATUS.NotAvailableInInitialProPlan:
return 'MUI X Product not covered by plan';
case LICENSE_STATUS.NotFound:
return 'MUI X Missing license key';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
showMissingLicenseKeyError,
showLicenseKeyPlanMismatchError,
showExpiredPackageVersionError,
showComponentNotIncludedError,
showNotAvailableInInitialProPlanError,
} from '../utils/licenseErrorMessageUtils';
import { LICENSE_STATUS, LicenseStatus } from '../utils/licenseStatus';
import { extractAcceptedScopes, extractProductScope } from '../utils/licenseScope';
Expand Down Expand Up @@ -65,8 +65,8 @@ export function useLicenseVerifier(
// Skip
} else if (licenseStatus.status === LICENSE_STATUS.Invalid) {
showInvalidLicenseKeyError();
} else if (licenseStatus.status === LICENSE_STATUS.ComponentNotIncluded) {
showComponentNotIncludedError();
} else if (licenseStatus.status === LICENSE_STATUS.NotAvailableInInitialProPlan) {
showNotAvailableInInitialProPlanError();
} else if (licenseStatus.status === LICENSE_STATUS.OutOfScope) {
showLicenseKeyPlanMismatchError();
} else if (licenseStatus.status === LICENSE_STATUS.NotFound) {
Expand Down
6 changes: 3 additions & 3 deletions packages/x-license/src/utils/licenseErrorMessageUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export function showLicenseKeyPlanMismatchError() {
]);
}

export function showComponentNotIncludedError() {
export function showNotAvailableInInitialProPlanError() {
showError([
'MUI X: Component not included in your license.',
'',
'The component you are trying to use is not included in the Pro Plan your purchased.',
'The component you are trying to use is not included in the Pro Plan you purchased.',
'',
'Your license is from an old version of the pro plan that is only compatible with the `@mui/x-data-grid-pro` and `@mui/x-date-pickers-pro` commercial packages.',
'Your license is from an old version of the Pro Plan that is only compatible with the `@mui/x-data-grid-pro` and `@mui/x-date-pickers-pro` commercial packages.',
'',
'To start using another Pro package, please consider reaching to our sales team to upgrade your license or visit https://mui.com/r/x-get-license to get a new license key.',
]);
Expand Down
2 changes: 1 addition & 1 deletion packages/x-license/src/utils/licenseStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export enum LICENSE_STATUS {
ExpiredVersion = 'ExpiredVersion',
Valid = 'Valid',
OutOfScope = 'OutOfScope',
ComponentNotIncluded = 'ComponentNotIncluded',
NotAvailableInInitialProPlan = 'NotAvailableInInitialProPlan',
}

export type LicenseStatus = keyof typeof LICENSE_STATUS;
4 changes: 2 additions & 2 deletions packages/x-license/src/verifyLicense/verifyLicense.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ describe('License: verifyLicense', () => {
acceptedScopes: ['pro', 'premium'],
productScope: 'charts',
}).status,
).to.equal(LICENSE_STATUS.ComponentNotIncluded);
).to.equal(LICENSE_STATUS.NotAvailableInInitialProPlan);
});

it('PlanVersion "initial" should not accept tree-view', () => {
Expand All @@ -304,7 +304,7 @@ describe('License: verifyLicense', () => {
acceptedScopes: ['pro', 'premium'],
productScope: 'tree-view',
}).status,
).to.equal(LICENSE_STATUS.ComponentNotIncluded);
).to.equal(LICENSE_STATUS.NotAvailableInInitialProPlan);
});

it('PlanVersion "Q3-2024" should accept charts', () => {
Expand Down
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 @@ -181,7 +181,7 @@ export function verifyLicense({
if (license.planVersion === 'initial') {
// 'charts-pro' or 'tree-view-pro' can only be used with a newer license
if (productScope === 'charts' || productScope === 'tree-view') {
return { status: LICENSE_STATUS.ComponentNotIncluded };
return { status: LICENSE_STATUS.NotAvailableInInitialProPlan };
}
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/x-license.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
{ "name": "LicensingModel", "kind": "TypeAlias" },
{ "name": "MuiCommercialPackageName", "kind": "TypeAlias" },
{ "name": "MuiLicenseInfo", "kind": "Interface" },
{ "name": "showComponentNotIncludedError", "kind": "Function" },
{ "name": "showExpiredAnnualGraceLicenseKeyError", "kind": "Function" },
{ "name": "showExpiredAnnualLicenseKeyError", "kind": "Function" },
{ "name": "showExpiredPackageVersionError", "kind": "Function" },
{ "name": "showInvalidLicenseKeyError", "kind": "Function" },
{ "name": "showLicenseKeyPlanMismatchError", "kind": "Function" },
{ "name": "showMissingLicenseKeyError", "kind": "Function" },
{ "name": "showNotAvailableInInitialProPlanError", "kind": "Function" },
{ "name": "Unstable_LicenseInfoProvider", "kind": "Function" },
{ "name": "Unstable_LicenseInfoProviderProps", "kind": "Interface" },
{ "name": "useLicenseVerifier", "kind": "Function" },
Expand Down

0 comments on commit fba2ffc

Please sign in to comment.