Skip to content

Commit bd502db

Browse files
Update Trial Panel texts (#28407) (#28505)
Co-authored-by: Mikhail Preyskurantov <[email protected]>
1 parent cb42040 commit bd502db

File tree

12 files changed

+37
-6
lines changed

12 files changed

+37
-6
lines changed

packages/devextreme-angular/src/core/component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838

3939
config({
4040
buyNowLink: 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeAngular.aspx',
41+
licensingDocLink: 'https://go.devexpress.com/Licensing_Documentation_DevExtremeAngular.aspx',
4142
});
4243

4344
let serverStateKey;

packages/devextreme-angular/tests/src/core/component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ describe('DevExtreme Angular widget', () => {
147147
expect(config().buyNowLink).toBe('https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeAngular.aspx');
148148
});
149149

150+
it('correctly sets the help link', () => {
151+
expect(config().licensingDocLink).toBe('https://go.devexpress.com/Licensing_Documentation_DevExtremeAngular.aspx');
152+
});
153+
150154
it('should be disposed', () => {
151155
let testSpy = spyOn(TestContainerComponent.prototype, 'testMethod');
152156

packages/devextreme-react/src/core/__tests__/component.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ describe('rendering', () => {
124124
it('correctly sets the buy now link', () => {
125125
expect(config().buyNowLink).toBe('https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeReact.aspx');
126126
});
127+
128+
it('correctly sets the help link', () => {
129+
expect(config().licensingDocLink).toBe('https://go.devexpress.com/Licensing_Documentation_DevExtremeReact.aspx');
130+
});
127131
});
128132

129133
describe('nested full components', () => {

packages/devextreme-react/src/core/component-base.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const DX_REMOVE_EVENT = 'dxremove';
3030

3131
config({
3232
buyNowLink: 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeReact.aspx',
33+
licensingDocLink: 'https://go.devexpress.com/Licensing_Documentation_DevExtremeReact.aspx',
3334
});
3435

3536
type ComponentBaseProps = ComponentProps & {

packages/devextreme-vue/src/core/__tests__/component.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ describe('component rendering', () => {
161161
expect(config().buyNowLink).toBe('https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeVue.aspx');
162162
});
163163

164+
it('correctly sets the help link', () => {
165+
expect(config().licensingDocLink).toBe('https://go.devexpress.com/Licensing_Documentation_DevExtremeVue.aspx');
166+
});
167+
164168
describe('options', () => {
165169
it('watch prop changing to undefined', (done) => {
166170
const wrapper = mount(TestComponent, {

packages/devextreme-vue/src/core/component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const includeAttrs = ['id', 'class', 'style'];
4747

4848
config({
4949
buyNowLink: 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeVue.aspx',
50+
licensingDocLink: 'https://go.devexpress.com/Licensing_Documentation_DevExtremeVue.aspx',
5051
});
5152

5253
function getAttrs(attrs, dxClasses: string[]) {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const RTM_MIN_PATCH_VERSION = 3;
3131
const KEY_SPLITTER = '.';
3232

3333
const BUY_NOW_LINK = 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeJQuery.aspx';
34+
const LICENSING_DOC_LINK = 'https://go.devexpress.com/Licensing_Documentation_DevExtremeJQuery.aspx';
3435

3536
const GENERAL_ERROR: Token = { kind: TokenKind.corrupted, error: 'general' };
3637
const VERIFICATION_ERROR: Token = { kind: TokenKind.corrupted, error: 'verification' };
@@ -177,7 +178,9 @@ export function validateLicense(licenseKey: string, versionStr: string = fullVer
177178
}
178179

179180
if (error && !internal) {
180-
showTrialPanel(config().buyNowLink ?? BUY_NOW_LINK, fullVersion);
181+
const buyNowLink = config().buyNowLink ?? BUY_NOW_LINK;
182+
const licensingDocLink = config().licensingDocLink ?? LICENSING_DOC_LINK;
183+
showTrialPanel(buyNowLink, licensingDocLink, fullVersion);
181184
}
182185

183186
const preview = isPreview(version.patch);

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const componentNames = {
2929
};
3030
const attributeNames = {
3131
buyNow: 'buy-now',
32+
licensingDoc: 'licensing-doc',
3233
version: 'version',
3334
};
3435
const commonStyles = {
@@ -186,7 +187,9 @@ class DxLicense extends SafeHTMLElement {
186187
contentContainer.style.cssText = this._contentStyles;
187188
contentContainer.append(
188189
this._createSpan('For evaluation purposes only. Redistribution prohibited. Please '),
189-
this._createLink('purchase a license', this.getAttribute(attributeNames.buyNow) as string),
190+
this._createLink('register', this.getAttribute(attributeNames.licensingDoc) as string),
191+
this._createSpan(' an existing license or '),
192+
this._createLink('purchase a new license', this.getAttribute(attributeNames.buyNow) as string),
190193
this._createSpan(` to continue use of DevExpress product libraries (v${this.getAttribute(attributeNames.version)}).`),
191194
);
192195
return contentContainer;
@@ -254,6 +257,11 @@ class DxLicenseTrigger extends SafeHTMLElement {
254257
this.getAttribute(attributeNames.buyNow) as string,
255258
);
256259

260+
license.setAttribute(
261+
attributeNames.licensingDoc,
262+
this.getAttribute(attributeNames.licensingDoc) as string,
263+
);
264+
257265
license.setAttribute(DATA_PERMANENT_ATTRIBUTE, 'true');
258266

259267
document.body.prepend(license);
@@ -277,6 +285,7 @@ export function registerCustomComponents(customStyles?: CustomTrialPanelStyles):
277285

278286
export function renderTrialPanel(
279287
buyNowUrl: string,
288+
licensingDocUrl: string,
280289
version: string,
281290
customStyles?: CustomTrialPanelStyles,
282291
): void {
@@ -285,6 +294,7 @@ export function renderTrialPanel(
285294
const trialPanelTrigger = document.createElement(componentNames.trigger);
286295

287296
trialPanelTrigger.setAttribute(attributeNames.buyNow, buyNowUrl);
297+
trialPanelTrigger.setAttribute(attributeNames.licensingDoc, licensingDocUrl);
288298
trialPanelTrigger.setAttribute(attributeNames.version, version);
289299

290300
document.body.appendChild(trialPanelTrigger);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import {
77

88
export function showTrialPanel(
99
buyNowUrl: string,
10+
licensingDocUrl: string,
1011
version: string,
1112
customStyles?: CustomTrialPanelStyles,
1213
): void {
1314
if (isClient()) {
14-
renderTrialPanel(buyNowUrl, version, customStyles);
15+
renderTrialPanel(buyNowUrl, licensingDocUrl, version, customStyles);
1516
}
1617
}
1718

packages/devextreme/js/common.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ export type GlobalConfig = {
388388
*/
389389
licenseKey?: string;
390390
buyNowLink?: string;
391+
licensingDocLink?: string;
391392
};
392393

393394
/**

0 commit comments

Comments
 (0)