Skip to content

Commit

Permalink
[docs] Add section about the new uncovered product watermark (#13568)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Engelen <[email protected]>
Co-authored-by: José Rodolfo Freitas <[email protected]>
  • Loading branch information
michelengelen and joserodolfofreitas authored Jun 21, 2024
1 parent ba3899d commit 84c73ef
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 16 deletions.
16 changes: 14 additions & 2 deletions docs/data/introduction/licensing/licensing.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,27 @@ This happens if you try to use `DataGridPremium` with a license key for the Pro
To solve the issue, you can [upgrade your plan](https://mui.com/r/x-get-license/?scope=premium) from Pro to Premium.
Or if you didn\'t intend to use Premium features, you can replace the import of `@mui/x-data-grid-premium` with `@mui/x-data-grid-pro`.

### 5. Invalid license key
### 5. Component not included in your license

This error indicates that the component you are trying to use is not covered by your current license.
This happens if you try to use `ChartsPro` or `TreeViewPro` with a license that does not cover these products.

To solve the issue, please consider an earlier [renewal](https://mui.com/r/x-get-license/).

You might be eligible for a discount if you have an active Pro license.
Contact [[email protected]](mailto:[email protected]?subject=My%20upgrade%20discount) for additional information.

Or if you didn't intend to use the Pro features, you can replace the import of `@mui/x-charts-pro` or `@mui/x-tree-view-pro` with `@mui/x-charts` or `@mui/x-tree-view` respectively.

### 6. Invalid license key

This error indicates that your MUI X license key format isn't valid.
It could be because the license key is missing a character or has a typo.

To solve the issue, you need to double-check that `setLicenseKey()` is called with the right argument.
Please check the [license key installation](/x/introduction/licensing/#license-key).

### 6. Invalid license key (TypeError: extracting license expiry timestamp)
### 7. Invalid license key (TypeError: extracting license expiry timestamp)

The following JavaScript exception indicates that you may be trying to validate the new license's key format on an older version of the npm package.

Expand Down
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.ProductNotCovered:
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 @@ -126,11 +126,11 @@ describe('useLicenseVerifier', function test() {

expect(() => {
render(<TestComponent packageName={'x-charts-pro'} />);
}).to.toErrorDev(['MUI X: Product not covered by plan.']);
}).to.toErrorDev(['MUI X: Component not included in your license.']);

expect(() => {
render(<TestComponent packageName={'x-tree-view-pro'} />);
}).to.toErrorDev(['MUI X: Product not covered by plan.']);
}).to.toErrorDev(['MUI X: Component not included in your license.']);
});

it('should not throw if the license is covering charts and tree-view', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
showMissingLicenseKeyError,
showLicenseKeyPlanMismatchError,
showExpiredPackageVersionError,
showProductNotCoveredError,
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.ProductNotCovered) {
showProductNotCoveredError();
} 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
8 changes: 5 additions & 3 deletions packages/x-license/src/utils/licenseErrorMessageUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ export function showLicenseKeyPlanMismatchError() {
]);
}

export function showProductNotCoveredError() {
export function showNotAvailableInInitialProPlanError() {
showError([
'MUI X: Product not covered by plan.',
'MUI X: Component not included in your license.',
'',
'The component you are trying to use is not included in the Pro Plan your purchased. You are using a license that is only compatible with the `@mui/x-data-grid-pro` and `@mui/x-date-pickers-pro` commercial packages.',
'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.',
'',
'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',
ProductNotCovered = 'ProductNotCovered',
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.ProductNotCovered);
).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.ProductNotCovered);
).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.ProductNotCovered };
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 @@ -15,7 +15,7 @@
{ "name": "showInvalidLicenseKeyError", "kind": "Function" },
{ "name": "showLicenseKeyPlanMismatchError", "kind": "Function" },
{ "name": "showMissingLicenseKeyError", "kind": "Function" },
{ "name": "showProductNotCoveredError", "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 84c73ef

Please sign in to comment.