Skip to content

Commit 824aed3

Browse files
chore: add subscription name to the trial panel (#30890)
1 parent 52f43b5 commit 824aed3

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ const KEY_SPLITTER = '.';
3333
const BUY_NOW_LINK = 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeJQuery.aspx';
3434
const LICENSING_DOC_LINK = 'https://go.devexpress.com/Licensing_Documentation_DevExtremeJQuery.aspx';
3535

36+
const NBSP = '\u00A0';
37+
const SUBSCRIPTION_NAMES = `Universal, DXperience, ASP.NET${NBSP}and${NBSP}Blazor, DevExtreme${NBSP}Complete`;
38+
3639
const GENERAL_ERROR: Token = { kind: TokenKind.corrupted, error: 'general' };
3740
const VERIFICATION_ERROR: Token = { kind: TokenKind.corrupted, error: 'verification' };
3841
const DECODING_ERROR: Token = { kind: TokenKind.corrupted, error: 'decoding' };
@@ -188,7 +191,7 @@ export function validateLicense(licenseKey: string, versionStr: string = fullVer
188191
if (error && !internal) {
189192
const buyNowLink = config().buyNowLink ?? BUY_NOW_LINK;
190193
const licensingDocLink = config().licensingDocLink ?? LICENSING_DOC_LINK;
191-
showTrialPanel(buyNowLink, licensingDocLink, fullVersion);
194+
showTrialPanel(buyNowLink, licensingDocLink, fullVersion, SUBSCRIPTION_NAMES);
192195
}
193196

194197
const preview = isPreview(version.patch);

packages/devextreme/js/__internal/core/license/trial_panel.client.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const attributeNames = {
3131
buyNow: 'buy-now',
3232
licensingDoc: 'licensing-doc',
3333
version: 'version',
34+
subscriptions: 'subscriptions',
3435
};
3536
const commonStyles = {
3637
opacity: '1',
@@ -185,13 +186,21 @@ class DxLicense extends SafeHTMLElement {
185186
private _createContentContainer(): HTMLElement {
186187
const contentContainer = document.createElement('div');
187188
contentContainer.style.cssText = this._contentStyles;
189+
const subscriptions = this.getAttribute(attributeNames.subscriptions);
188190
contentContainer.append(
189191
this._createSpan('For evaluation purposes only. Redistribution prohibited. Please '),
190192
this._createLink('register', this.getAttribute(attributeNames.licensingDoc) as string),
191193
this._createSpan(' an existing license or '),
192194
this._createLink('purchase a new license', this.getAttribute(attributeNames.buyNow) as string),
193195
this._createSpan(` to continue use of DevExpress product libraries (v${this.getAttribute(attributeNames.version)}).`),
194196
);
197+
198+
if (subscriptions) {
199+
contentContainer.append(
200+
this._createSpan(` Included in Subscriptions: ${subscriptions}.`),
201+
);
202+
}
203+
195204
return contentContainer;
196205
}
197206

@@ -255,20 +264,12 @@ class DxLicenseTrigger extends SafeHTMLElement {
255264
if (!licensePanel.length && !DxLicense.closed) {
256265
const license = document.createElement(componentNames.panel);
257266

258-
license.setAttribute(
259-
attributeNames.version,
260-
this.getAttribute(attributeNames.version) as string,
261-
);
262-
263-
license.setAttribute(
264-
attributeNames.buyNow,
265-
this.getAttribute(attributeNames.buyNow) as string,
266-
);
267-
268-
license.setAttribute(
269-
attributeNames.licensingDoc,
270-
this.getAttribute(attributeNames.licensingDoc) as string,
271-
);
267+
Object.values(attributeNames).forEach((attrName) => {
268+
license.setAttribute(
269+
attrName,
270+
this.getAttribute(attrName) as string,
271+
);
272+
});
272273

273274
license.setAttribute(DATA_PERMANENT_ATTRIBUTE, '');
274275

@@ -295,6 +296,7 @@ export function renderTrialPanel(
295296
buyNowUrl: string,
296297
licensingDocUrl: string,
297298
version: string,
299+
subscriptions = '',
298300
customStyles?: CustomTrialPanelStyles,
299301
): void {
300302
registerCustomComponents(customStyles);
@@ -304,6 +306,7 @@ export function renderTrialPanel(
304306
trialPanelTrigger.setAttribute(attributeNames.buyNow, buyNowUrl);
305307
trialPanelTrigger.setAttribute(attributeNames.licensingDoc, licensingDocUrl);
306308
trialPanelTrigger.setAttribute(attributeNames.version, version);
309+
trialPanelTrigger.setAttribute(attributeNames.subscriptions, subscriptions);
307310

308311
document.body.appendChild(trialPanelTrigger);
309312
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ export function showTrialPanel(
99
buyNowUrl: string,
1010
licensingDocUrl: string,
1111
version: string,
12+
subscriptions?: string,
1213
customStyles?: CustomTrialPanelStyles,
1314
): void {
1415
if (isClient()) {
15-
renderTrialPanel(buyNowUrl, licensingDocUrl, version, customStyles);
16+
renderTrialPanel(buyNowUrl, licensingDocUrl, version, subscriptions, customStyles);
1617
}
1718
}
1819

packages/devextreme/testing/tests/Memory Leaks/elementsOnDispose_bundled.tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $.each(DevExpress.ui, function(componentName) {
3838
if(newDomElements.length === originalDomElements.length) {
3939
assert.ok(true, 'After a component is disposed, additional DOM elements must be removed');
4040
} else {
41-
if(newDomElements.length - originalDomElements.length <= 11) {
41+
if(newDomElements.length - originalDomElements.length <= 12) {
4242
// viz widgets create extra style node that can not be deleted
4343
ignorePatterns = {
4444
'style': /behavior:\surl\(#default#VML\)/gi,
@@ -47,7 +47,7 @@ $.each(DevExpress.ui, function(componentName) {
4747
'svg': /13.4 12.7 8.7 8 13.4 3.4 12.6 2.6 8 7.3 3.4 2.6 2.6 3.4 7.3 8 2.6 12.6 3.4 13.4 8 8.7 12.7 13.4 13.4 12.7/,
4848
'polygon': /$/,
4949
'div': /For evaluation purposes only. Redistribution prohibited.|to continue use of DevExpress product libraries|points="13.4 12.7 8.7 8 13.4 3.4 12.6 2.6 8 7.3 3.4 2.6 2.6 3.4 7.3 8 2.6 12.6 3.4 13.4 8 8.7 12.7 13.4 13.4 12.7/,
50-
'span': /For evaluation purposes only. Redistribution prohibited.|an existing license|to continue use of DevExpress product libraries/,
50+
'span': /For evaluation purposes only. Redistribution prohibited.|an existing license|to continue use of DevExpress product libraries|Included in Subscriptions/,
5151
'a': /purchase a new license|register/,
5252
};
5353
}

0 commit comments

Comments
 (0)