From 0d1e1e45808c65f9c986f19e87588952defb5611 Mon Sep 17 00:00:00 2001 From: Roman Semenov Date: Mon, 29 Apr 2024 12:31:22 +0400 Subject: [PATCH] Scheduler - targetElement parameter of the onAppointmentTooltipShowing event has a value of an unexpected type (T1226514) (#27275) --- js/__internal/scheduler/m_scheduler.ts | 9 ++++++--- .../common.methods.tests.js | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/js/__internal/scheduler/m_scheduler.ts b/js/__internal/scheduler/m_scheduler.ts index 62d217c51602..5aa8d633b9d3 100644 --- a/js/__internal/scheduler/m_scheduler.ts +++ b/js/__internal/scheduler/m_scheduler.ts @@ -1,6 +1,8 @@ import registerComponent from '@js/core/component_registrator'; import config from '@js/core/config'; import devices from '@js/core/devices'; +import { getPublicElement } from '@js/core/element'; +import type { dxElementWrapper } from '@js/core/renderer'; import $ from '@js/core/renderer'; import { BindableTemplate } from '@js/core/templates/bindable_template'; import { EmptyTemplate } from '@js/core/templates/empty_template'; @@ -39,6 +41,7 @@ import { validateDayHours, } from '@js/renovation/ui/scheduler/view_model/to_test/views/utils/base'; import { custom as customDialog } from '@js/ui/dialog'; +import type { AppointmentTooltipShowingEvent } from '@js/ui/scheduler'; import { isMaterial } from '@js/ui/themes'; import errors from '@js/ui/widget/ui.errors'; import Widget from '@js/ui/widget/ui.widget'; @@ -2405,8 +2408,8 @@ class Scheduler extends Widget { }; } - showAppointmentTooltipCore(target, data, options?: any) { - const arg = { + showAppointmentTooltipCore(target: dxElementWrapper, data, options?: any) { + const arg: Omit = { cancel: false, appointments: data.map((item) => { const result = { @@ -2424,7 +2427,7 @@ class Scheduler extends Widget { return result; }), - targetElement: target, + targetElement: getPublicElement(target), }; this._createActionByOption('onAppointmentTooltipShowing')(arg); diff --git a/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js b/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js index 877205fe172e..c32e778ed3a0 100644 --- a/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js +++ b/testing/tests/DevExpress.ui.widgets.scheduler/common.methods.tests.js @@ -1,3 +1,4 @@ +import $ from 'jquery'; import fx from 'animation/fx'; import CustomStore from 'data/custom_store'; import { DataSource } from 'data/data_source/data_source'; @@ -671,7 +672,7 @@ QUnit.module('Methods', { scheduler.instance._appointmentTooltip.isAlreadyShown = sinon.stub().returns(false); scheduler.instance._appointmentTooltip.show = sinon.stub(); scheduler.instance._appointmentTooltip.hide = sinon.stub(); - scheduler.instance.showAppointmentTooltipCore('target', [], 'options'); + scheduler.instance.showAppointmentTooltipCore($(), [], 'options'); assert.ok(!scheduler.instance._appointmentTooltip.hide.called, 'hide tooltip is not called'); assert.ok(scheduler.instance._appointmentTooltip.show.called, 'show tooltip is called'); @@ -682,7 +683,7 @@ QUnit.module('Methods', { scheduler.instance._appointmentTooltip.isAlreadyShown = sinon.stub().returns(true); scheduler.instance._appointmentTooltip.show = sinon.stub(); scheduler.instance._appointmentTooltip.hide = sinon.stub(); - scheduler.instance.showAppointmentTooltipCore('target', [], 'options'); + scheduler.instance.showAppointmentTooltipCore($(), [], 'options'); assert.ok(scheduler.instance._appointmentTooltip.hide.called, 'hide tooltip is called'); assert.ok(!scheduler.instance._appointmentTooltip.show.called, 'show tooltip is not called'); @@ -693,7 +694,7 @@ QUnit.module('Methods', { scheduler.instance._appointmentTooltip.isAlreadyShown = sinon.stub().returns(false); scheduler.instance._appointmentTooltip.show = sinon.stub(); scheduler.instance._appointmentTooltip.hide = sinon.stub(); - scheduler.instance.showAppointmentTooltip('appointmentData', 'target', 'currentAppointmentData'); + scheduler.instance.showAppointmentTooltip('appointmentData', $(), 'currentAppointmentData'); assert.ok(!scheduler.instance._appointmentTooltip.hide.called, 'hide tooltip is not called'); assert.ok(scheduler.instance._appointmentTooltip.show.called, 'show tooltip is called'); @@ -704,7 +705,7 @@ QUnit.module('Methods', { scheduler.instance._appointmentTooltip.isAlreadyShown = sinon.stub().returns(true); scheduler.instance._appointmentTooltip.show = sinon.stub(); scheduler.instance._appointmentTooltip.hide = sinon.stub(); - scheduler.instance.showAppointmentTooltip('appointmentData', 'target', 'currentAppointmentData'); + scheduler.instance.showAppointmentTooltip('appointmentData', $(), 'currentAppointmentData'); assert.ok(scheduler.instance._appointmentTooltip.hide.called, 'hide tooltip is called'); assert.ok(!scheduler.instance._appointmentTooltip.show.called, 'show tooltip is not called');