From 5a33544c5da048ee55e8a59ba940c95844a3e967 Mon Sep 17 00:00:00 2001 From: Vasily Strelyaev Date: Mon, 29 Apr 2024 20:06:50 +0300 Subject: [PATCH] fix: remove imports from trial panel (#27286) --- .../core/license/license_validation.test.ts | 5 +++++ .../js/__internal/core/license/trial_panel.ts | 16 +++++++++++++--- .../js/__internal/core/license/types.ts | 10 ---------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/devextreme/js/__internal/core/license/license_validation.test.ts b/packages/devextreme/js/__internal/core/license/license_validation.test.ts index 7063409a3221..ce02c15f0133 100644 --- a/packages/devextreme/js/__internal/core/license/license_validation.test.ts +++ b/packages/devextreme/js/__internal/core/license/license_validation.test.ts @@ -1,5 +1,6 @@ import errors from '@js/core/errors'; +import { base } from '../../../ui/overlay/z_index'; import { parseLicenseKey, setLicenseCheckSkipCondition, @@ -233,6 +234,10 @@ describe('license check', () => { expect(errors.log).toHaveBeenCalledTimes(1); }); + test('Base z-index should match the corresponding setting in DevExtreme', () => { + expect(trialPanel.BASE_Z_INDEX).toEqual(base()); + }); + test('No messages should be logged if setLicenseCheckSkipCondition() used', () => { setLicenseCheckSkipCondition(); validateLicense('', '1.0'); diff --git a/packages/devextreme/js/__internal/core/license/trial_panel.ts b/packages/devextreme/js/__internal/core/license/trial_panel.ts index d7998034fdf6..fe049dd3f5fd 100644 --- a/packages/devextreme/js/__internal/core/license/trial_panel.ts +++ b/packages/devextreme/js/__internal/core/license/trial_panel.ts @@ -1,6 +1,16 @@ /* eslint-disable max-classes-per-file */ -import { base } from '../../../ui/overlay/z_index'; -import type { CustomTrialPanelStyles, StylesMap } from './types'; +/* eslint no-restricted-imports: ["error", { "patterns": ["*"] }] */ +export const BASE_Z_INDEX = 1500; + +export interface StylesMap { + [key: string]: string; +} + +export interface CustomTrialPanelStyles { + containerStyles?: StylesMap; + textStyles?: StylesMap; + linkStyles?: StylesMap; +} const DATA_PERMANENT_ATTRIBUTE = 'data-permanent'; const componentNames = { @@ -21,7 +31,7 @@ const containerStyles = { height: 'auto', lineHeight: 'auto', display: 'block', - 'z-index': `${base()}`, + 'z-index': `${BASE_Z_INDEX}`, position: 'relative', top: '0px', left: '0px', diff --git a/packages/devextreme/js/__internal/core/license/types.ts b/packages/devextreme/js/__internal/core/license/types.ts index a52abb56f65d..f45a1b9b75c7 100644 --- a/packages/devextreme/js/__internal/core/license/types.ts +++ b/packages/devextreme/js/__internal/core/license/types.ts @@ -28,13 +28,3 @@ export interface LicenseCheckParams { internal?: true; error: LicenseVerifyResult | undefined; } - -export interface StylesMap { - [key: string]: string; -} - -export interface CustomTrialPanelStyles { - containerStyles?: StylesMap; - textStyles?: StylesMap; - linkStyles?: StylesMap; -}