From e075fc56ead69ba91bf515a5e193f966f62e1e72 Mon Sep 17 00:00:00 2001 From: "ilya.kharchenko" <14272298+IlyaKhD@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:52:46 +0400 Subject: [PATCH] Update Trial Panel Buy Now Links (#27575) Co-authored-by: Roch Nicolas <89575880+tomodasheesh@users.noreply.github.com> Co-authored-by: Rochmar Nicolas (DevExpress) --- .../devextreme-angular/src/core/component.ts | 6 ++++++ .../src/core/component-base.tsx | 20 +++++++++++------- packages/devextreme-vue/src/core/component.ts | 21 ++++++++++++------- .../core/license/license_validation.ts | 5 +++-- packages/devextreme/js/common.d.ts | 1 + packages/devextreme/ts/dx.all.d.ts | 1 + 6 files changed, 37 insertions(+), 17 deletions(-) diff --git a/packages/devextreme-angular/src/core/component.ts b/packages/devextreme-angular/src/core/component.ts index 6302f4317229..2017b69d755e 100644 --- a/packages/devextreme-angular/src/core/component.ts +++ b/packages/devextreme-angular/src/core/component.ts @@ -22,6 +22,8 @@ import { isPlatformServer } from '@angular/common'; import domAdapter from 'devextreme/core/dom_adapter'; import { triggerHandler } from 'devextreme/events'; +import config from 'devextreme/core/config'; + import { DxTemplateDirective } from './template'; import { IDxTemplateHost, DxTemplateHost } from './template-host'; import { EmitterHelper, NgEventsStrategy } from './events-strategy'; @@ -34,6 +36,10 @@ import { CollectionNestedOptionContainerImpl, } from './nested-option'; +config({ + buyNowLink: 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeAngular.aspx', +}); + let serverStateKey; export const getServerStateKey = () => { if (!serverStateKey) { diff --git a/packages/devextreme-react/src/core/component-base.tsx b/packages/devextreme-react/src/core/component-base.tsx index bfec8577a932..99cb8fded199 100644 --- a/packages/devextreme-react/src/core/component-base.tsx +++ b/packages/devextreme-react/src/core/component-base.tsx @@ -14,6 +14,8 @@ import { import { requestAnimationFrame } from 'devextreme/animation/frame'; import { deferUpdate } from 'devextreme/core/utils/common'; +import config from 'devextreme/core/config'; + import { createPortal } from 'react-dom'; import { RemovalLockerContext, RestoreTreeContext } from './helpers'; @@ -26,6 +28,10 @@ import { ComponentProps } from './component'; const DX_REMOVE_EVENT = 'dxremove'; +config({ + buyNowLink: 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeReact.aspx', +}); + type ComponentBaseProps = ComponentProps & { renderChildren?: () => Record[] | null | undefined; }; @@ -201,14 +207,14 @@ const ComponentBase = forwardRef( el = el || element.current; - const config = getConfig(); + const widgetConfig = getConfig(); let options: any = { templatesRenderAsynchronously: true, - ...optionsManager.current.getInitialOptions(config), + ...optionsManager.current.getInitialOptions(widgetConfig), }; - const templateOptions = optionsManager.current.getTemplateOptions(config); + const templateOptions = optionsManager.current.getTemplateOptions(widgetConfig); const dxTemplates = createDXTemplates.current?.(templateOptions); if (dxTemplates && Object.keys(dxTemplates).length) { @@ -230,7 +236,7 @@ const ComponentBase = forwardRef( ); } - optionsManager.current.setInstance(instance.current, config, subscribableOptions, independentEvents); + optionsManager.current.setInstance(instance.current, widgetConfig, subscribableOptions, independentEvents); instance.current.on('optionChanged', optionsManager.current.onOptionChanged); afterCreateWidget(); @@ -257,12 +263,12 @@ const ComponentBase = forwardRef( updateCssClasses(prevPropsRef.current, props); - const config = getConfig(); + const widgetConfig = getConfig(); - const templateOptions = optionsManager.current.getTemplateOptions(config); + const templateOptions = optionsManager.current.getTemplateOptions(widgetConfig); const dxTemplates = createDXTemplates.current?.(templateOptions) || {}; - optionsManager.current.update(config, dxTemplates); + optionsManager.current.update(widgetConfig, dxTemplates); scheduleTemplatesUpdate(); prevPropsRef.current = props; diff --git a/packages/devextreme-vue/src/core/component.ts b/packages/devextreme-vue/src/core/component.ts index 1c8894bc9ea8..0945cc40b5f5 100644 --- a/packages/devextreme-vue/src/core/component.ts +++ b/packages/devextreme-vue/src/core/component.ts @@ -4,6 +4,7 @@ import { import CreateCallback from 'devextreme/core/utils/callbacks'; import { triggerHandler } from 'devextreme/events'; +import config from 'devextreme/core/config'; import { defaultSlots, getChildren, getComponentProps, getVModelValue, VMODEL_NAME, @@ -44,6 +45,10 @@ export interface IBaseComponent extends ComponentPublicInstance, IWidgetComponen const includeAttrs = ['id', 'class', 'style']; +config({ + buyNowLink: 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeVue.aspx', +}); + function getAttrs(attrs) { const attributes = {}; includeAttrs.forEach((attr) => { @@ -187,26 +192,26 @@ function initBaseComponent() { thisComponent.$_pendingOptions = {}; thisComponent.$_templatesManager = new TemplatesManager(this as ComponentPublicInstance); - const config = thisComponent.$_config; + const widgetConfig = thisComponent.$_config; - if (config.initialValues.hasOwnProperty(VMODEL_NAME)) { - config.initialValues.value = getVModelValue(config.initialValues); + if (widgetConfig.initialValues.hasOwnProperty(VMODEL_NAME)) { + widgetConfig.initialValues.value = getVModelValue(widgetConfig.initialValues); } const options: object = { templatesRenderAsynchronously: thisComponent.$_hasAsyncTemplate, ...getComponentProps(thisComponent), - ...config.initialValues, - ...config.getNestedOptionValues(), + ...widgetConfig.initialValues, + ...widgetConfig.getNestedOptionValues(), ...this.$_getIntegrationOptions(), }; const instance = new thisComponent.$_WidgetClass(element, options); thisComponent.$_instance = instance; - instance.on('optionChanged', (args) => config.onOptionChanged(args)); - setEmitOptionChangedFunc(config, thisComponent, thisComponent.$_innerChanges); - bindOptionWatchers(config, thisComponent, thisComponent.$_innerChanges); + instance.on('optionChanged', (args) => widgetConfig.onOptionChanged(args)); + setEmitOptionChangedFunc(widgetConfig, thisComponent, thisComponent.$_innerChanges); + bindOptionWatchers(widgetConfig, thisComponent, thisComponent.$_innerChanges); this.$_createEmitters(instance); }, diff --git a/packages/devextreme/js/__internal/core/license/license_validation.ts b/packages/devextreme/js/__internal/core/license/license_validation.ts index 6ff342aff827..fd1981bb7ce0 100644 --- a/packages/devextreme/js/__internal/core/license/license_validation.ts +++ b/packages/devextreme/js/__internal/core/license/license_validation.ts @@ -1,3 +1,4 @@ +import config from '@js/core/config'; import errors from '@js/core/errors'; import { fullVersion } from '@js/core/version'; @@ -30,7 +31,7 @@ const FORMAT = 1; const RTM_MIN_PATCH_VERSION = 3; const KEY_SPLITTER = '.'; -const BUY_NOW_LINK = 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtreme.aspx'; +const BUY_NOW_LINK = 'https://go.devexpress.com/Licensing_Installer_Watermark_DevExtremeJQuery.aspx'; const GENERAL_ERROR: Token = { kind: TokenKind.corrupted, error: 'general' }; const VERIFICATION_ERROR: Token = { kind: TokenKind.corrupted, error: 'verification' }; @@ -193,7 +194,7 @@ export function validateLicense(licenseKey: string, versionStr: string = fullVer } if (error && !internal) { - showTrialPanel(BUY_NOW_LINK, fullVersion); + showTrialPanel(config().buyNowLink ?? BUY_NOW_LINK, fullVersion); } const preview = isPreview(version.patch); diff --git a/packages/devextreme/js/common.d.ts b/packages/devextreme/js/common.d.ts index 7d7227b91e2b..7f6c1794e592 100644 --- a/packages/devextreme/js/common.d.ts +++ b/packages/devextreme/js/common.d.ts @@ -387,6 +387,7 @@ export type GlobalConfig = { * @public */ licenseKey?: string; + buyNowLink?: string; }; /** diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index ad1b638e6b40..11e096d667b6 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -1545,6 +1545,7 @@ declare module DevExpress.common { * [descr:GlobalConfig.licenseKey] */ licenseKey?: string; + buyNowLink?: string; }; /** * [descr:GroupItem]