Skip to content

Scheduler: refactor Tooltip Strategies module (TS)#33482

Open
sjbur wants to merge 3 commits intoDevExpress:26_1from
sjbur:issue-3403_26_1
Open

Scheduler: refactor Tooltip Strategies module (TS)#33482
sjbur wants to merge 3 commits intoDevExpress:26_1from
sjbur:issue-3403_26_1

Conversation

@sjbur
Copy link
Copy Markdown
Contributor

@sjbur sjbur commented May 4, 2026

No description provided.

@sjbur sjbur self-assigned this May 4, 2026
@sjbur sjbur added the 26_1 label May 4, 2026
@sjbur sjbur marked this pull request as ready for review May 4, 2026 11:38
@sjbur sjbur requested a review from a team as a code owner May 4, 2026 11:38
const { editing } = this.extraOptions ?? {};
const disabled = this._options.getAppointmentDisabled(appointment);
const isDeletingAllowed = editing === true || editing?.allowDeleting === true;
const isDeletingAllowed = editing === true
Copy link
Copy Markdown
Contributor

@Tucchhaa Tucchhaa May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor:

const isDeletingAllowed =Boolean(editing ?? editing?.allowDeleting);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that we can do this. editing could be either a boolean or an object. So we need to check if its an object before checking allowDeleting value

this.list.registerKeyHandler?.('escape', (): void => {
this.hide();
this.tooltip.option('target').focus();
const target = this.tooltip?.option('target') as { focus?: () => void } | undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to cast target to dxElementWrapper

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

private createItemListContent(appointment, targetedAppointment, color) {
private createItemListContent(
appointment: Appointment,
targetedAppointment: Appointment | TargetedAppointment | undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use this type?:

targetedAppointmewnt?: TargetedAppointment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure. In scheduler api we use showAppointmentTooltip, which passes targetedAppointment?: SafeAppointment

So the targetedAppointment could be undefined and SafeAppointment (Appointment) type is not exactly the same as TargetedAppointment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use this type?:

dataList:  AppointmentTooltipItem[]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Applied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants