Skip to content

Commit 826bb83

Browse files
Display message when DevExpress .NET key applied (#30325)
1 parent 4d6a434 commit 826bb83

File tree

4 files changed

+43
-1
lines changed

4 files changed

+43
-1
lines changed

packages/devextreme/js/__internal/core/license/license_validation.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,3 +507,31 @@ describe('internal license check', () => {
507507
expect(trialPanelSpy).not.toHaveBeenCalled();
508508
});
509509
});
510+
511+
describe('DevExpress license check', () => {
512+
let trialPanelSpy = jest.spyOn(trialPanel, 'renderTrialPanel');
513+
514+
beforeEach(() => {
515+
jest.spyOn(errors, 'log').mockImplementation(() => {});
516+
trialPanelSpy = jest.spyOn(trialPanel, 'renderTrialPanel');
517+
setLicenseCheckSkipCondition(false);
518+
});
519+
520+
afterEach(() => {
521+
jest.restoreAllMocks();
522+
});
523+
524+
test('DevExpress License Key copied from Download Manager (incorrect)', () => {
525+
const token = 'LCXv1therestofthekey';
526+
validateLicense(token, '25.1.3');
527+
expect(errors.log).toHaveBeenCalled();
528+
expect(trialPanelSpy).toHaveBeenCalled();
529+
});
530+
531+
test('DevExpress License Key generated from LCX key (incorrect)', () => {
532+
const token = 'LCPtherestofthekey';
533+
validateLicense(token, '25.1.3');
534+
expect(errors.log).toHaveBeenCalled();
535+
expect(trialPanelSpy).toHaveBeenCalled();
536+
});
537+
});

packages/devextreme/js/__internal/core/license/license_validation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ function isPreview(patch: number): boolean {
116116
return isNaN(patch) || patch < RTM_MIN_PATCH_VERSION;
117117
}
118118

119+
function isDevExpressLicenseKey(licenseKey: string): boolean {
120+
return licenseKey.startsWith('LCX') || licenseKey.startsWith('LCP');
121+
}
122+
119123
function getLicenseCheckParams({
120124
licenseKey,
121125
version,
@@ -134,6 +138,10 @@ function getLicenseCheckParams({
134138
return { preview, error: 'W0019' };
135139
}
136140

141+
if (isDevExpressLicenseKey(licenseKey)) {
142+
return { preview, error: 'W0024' };
143+
}
144+
137145
const license = parseLicenseKey(licenseKey);
138146

139147
if (license.kind === TokenKind.corrupted) {

packages/devextreme/js/__internal/core/license/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type Token = {
2121
readonly internalUsageId: string;
2222
};
2323

24-
type LicenseVerifyResult = 'W0019' | 'W0020' | 'W0021' | 'W0022';
24+
type LicenseVerifyResult = 'W0019' | 'W0020' | 'W0021' | 'W0022' | 'W0023' | 'W0024';
2525

2626
export interface LicenseCheckParams {
2727
preview: boolean;

packages/devextreme/js/__internal/core/m_errors.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,10 @@ export default errorUtils({
128128
W0023: 'DevExtreme: the following \'devextreme\' package version does not match versions of other DevExpress products used in this application:\n\n'
129129
+ '{0}\n\n'
130130
+ 'Interoperability between different versions of the products listed herein cannot be guaranteed.\n\n',
131+
132+
W0024: 'DevExtreme: Use Your DevExtreme License Key - Not Your DevExpress .NET License Key\n\n'
133+
+ 'Invalid/incorrect license key. You used your DevExpress .NET license key instead of your DevExtreme (React, Angular, Vue, JS) license key. Please copy your DevExtreme license key and try again. \n\n'
134+
+ 'Go to https://www.devexpress.com/ClientCenter/DownloadManager (navigate to the DevExtreme Subscription section) to obtain a valid DevExtreme license key. To validate your license, specify the correct key within GlobalConfig.\n\n'
135+
+ 'For detailed license/registration information, visit https://js.devexpress.com/Documentation/Licensing/.\n\n'
136+
+ 'If you have a valid license and the issue persists, submit a support ticket via the DevExpress Support Center. We will be happy to follow-up: https://supportcenter.devexpress.com/ticket/create.\n\n',
131137
});

0 commit comments

Comments
 (0)