Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const KEY_SPLITTER = '.';
const BUY_NOW_LINK = 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeJQuery.aspx';
const LICENSING_DOC_LINK = 'https://go.devexpress.com/Licensing_Documentation_DevExtremeJQuery.aspx';

const NBSP = '\u00A0';
const SUBSCRIPTION_NAMES = `Universal, DXperience, ASP.NET${NBSP}and${NBSP}Blazor, DevExtreme${NBSP}Complete`;

const GENERAL_ERROR: Token = { kind: TokenKind.corrupted, error: 'general' };
const VERIFICATION_ERROR: Token = { kind: TokenKind.corrupted, error: 'verification' };
const DECODING_ERROR: Token = { kind: TokenKind.corrupted, error: 'decoding' };
Expand Down Expand Up @@ -188,7 +191,7 @@ export function validateLicense(licenseKey: string, versionStr: string = fullVer
if (error && !internal) {
const buyNowLink = config().buyNowLink ?? BUY_NOW_LINK;
const licensingDocLink = config().licensingDocLink ?? LICENSING_DOC_LINK;
showTrialPanel(buyNowLink, licensingDocLink, fullVersion);
showTrialPanel(buyNowLink, licensingDocLink, fullVersion, SUBSCRIPTION_NAMES);
}

const preview = isPreview(version.patch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const attributeNames = {
buyNow: 'buy-now',
licensingDoc: 'licensing-doc',
version: 'version',
subscriptions: 'subscriptions',
};
const commonStyles = {
opacity: '1',
Expand Down Expand Up @@ -185,13 +186,21 @@ class DxLicense extends SafeHTMLElement {
private _createContentContainer(): HTMLElement {
const contentContainer = document.createElement('div');
contentContainer.style.cssText = this._contentStyles;
const subscriptions = this.getAttribute(attributeNames.subscriptions);
contentContainer.append(
this._createSpan('For evaluation purposes only. Redistribution prohibited. Please '),
this._createLink('register', this.getAttribute(attributeNames.licensingDoc) as string),
this._createSpan(' an existing license or '),
this._createLink('purchase a new license', this.getAttribute(attributeNames.buyNow) as string),
this._createSpan(` to continue use of DevExpress product libraries (v${this.getAttribute(attributeNames.version)}).`),
);

if (subscriptions) {
contentContainer.append(
this._createSpan(` Included in Subscriptions: ${subscriptions}.`),
);
}

return contentContainer;
}

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

license.setAttribute(
attributeNames.version,
this.getAttribute(attributeNames.version) as string,
);

license.setAttribute(
attributeNames.buyNow,
this.getAttribute(attributeNames.buyNow) as string,
);

license.setAttribute(
attributeNames.licensingDoc,
this.getAttribute(attributeNames.licensingDoc) as string,
);
Object.values(attributeNames).forEach((attrName) => {
license.setAttribute(
attrName,
this.getAttribute(attrName) as string,
);
});

license.setAttribute(DATA_PERMANENT_ATTRIBUTE, '');

Expand All @@ -295,6 +296,7 @@ export function renderTrialPanel(
buyNowUrl: string,
licensingDocUrl: string,
version: string,
subscriptions = '',
customStyles?: CustomTrialPanelStyles,
): void {
registerCustomComponents(customStyles);
Expand All @@ -304,6 +306,7 @@ export function renderTrialPanel(
trialPanelTrigger.setAttribute(attributeNames.buyNow, buyNowUrl);
trialPanelTrigger.setAttribute(attributeNames.licensingDoc, licensingDocUrl);
trialPanelTrigger.setAttribute(attributeNames.version, version);
trialPanelTrigger.setAttribute(attributeNames.subscriptions, subscriptions);

document.body.appendChild(trialPanelTrigger);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ export function showTrialPanel(
buyNowUrl: string,
licensingDocUrl: string,
version: string,
subscriptions?: string,
customStyles?: CustomTrialPanelStyles,
): void {
if (isClient()) {
renderTrialPanel(buyNowUrl, licensingDocUrl, version, customStyles);
renderTrialPanel(buyNowUrl, licensingDocUrl, version, subscriptions, customStyles);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $.each(DevExpress.ui, function(componentName) {
if(newDomElements.length === originalDomElements.length) {
assert.ok(true, 'After a component is disposed, additional DOM elements must be removed');
} else {
if(newDomElements.length - originalDomElements.length <= 11) {
if(newDomElements.length - originalDomElements.length <= 12) {
// viz widgets create extra style node that can not be deleted
ignorePatterns = {
'style': /behavior:\surl\(#default#VML\)/gi,
Expand All @@ -47,7 +47,7 @@ $.each(DevExpress.ui, function(componentName) {
'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/,
'polygon': /$/,
'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/,
'span': /For evaluation purposes only. Redistribution prohibited.|an existing license|to continue use of DevExpress product libraries/,
'span': /For evaluation purposes only. Redistribution prohibited.|an existing license|to continue use of DevExpress product libraries|Included in Subscriptions/,
'a': /purchase a new license|register/,
};
}
Expand Down
Loading