Skip to content

Scheduler - Refactor Appointments Collection - Support appointmentDragging options#34254

Open
bit-byte0 wants to merge 1 commit into
DevExpress:mainfrom
bit-byte0:refactor/scheduler-appointments-dragging-main
Open

Scheduler - Refactor Appointments Collection - Support appointmentDragging options#34254
bit-byte0 wants to merge 1 commit into
DevExpress:mainfrom
bit-byte0:refactor/scheduler-appointments-dragging-main

Conversation

@bit-byte0

@bit-byte0 bit-byte0 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Added appointmentDragging support to the refactored Scheduler appointments (_newAppointments) - its callbacks and options, plus drag and drop between two schedulers and with an external component

How

The new drag controller forwards the appointmentDragging callbacks and options to the draggable and resolves cross-component drops by the drop position

@bit-byte0 bit-byte0 requested a review from a team as a code owner July 9, 2026 16:37
Copilot AI review requested due to automatic review settings July 9, 2026 16:37
@bit-byte0 bit-byte0 added the 26_2 label Jul 9, 2026
@bit-byte0 bit-byte0 self-assigned this Jul 9, 2026

Copilot AI left a comment

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.

Pull request overview

Fixes Scheduler _newAppointments drag-and-drop behavior by wiring appointmentDragging options/callbacks into the refactored appointments drag controller, enabling cross-scheduler and external-component drops.

Changes:

  • Added workspace API to resolve a scheduler cell from screen coordinates (getCellFromPoint) and exposed it through Scheduler’s internal workspace facade.
  • Updated the new AppointmentDragController to forward appointmentDragging callbacks/options to Draggable, handle cross-component drops (onAdd/onRemove), and resolve drop target cells by coordinates.
  • Added Jest coverage for appointmentDragging pass-through options, callback invocation/cancellation, and cross-component drag/drop behaviors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/devextreme/js/__internal/scheduler/workspaces/work_space.ts Exposes getCellFromPoint and reuses it from getCellFromDragTarget to support coordinate-based drop resolution.
packages/devextreme/js/__internal/scheduler/scheduler.ts Extends internal workspace facade and passes appointmentDragging config + helper APIs into the new drag controller.
packages/devextreme/js/__internal/scheduler/appointment_drag_controller.ts Implements appointmentDragging integration, external drag enter/leave highlighting, and cross-component drop resolution.
packages/devextreme/js/__internal/scheduler/tests/appointments_dragging.test.ts Adds tests validating callback forwarding, cancellation, option pass-through, and cross-component drop behavior.

Copilot AI review requested due to automatic review settings July 9, 2026 17:01
@bit-byte0 bit-byte0 force-pushed the refactor/scheduler-appointments-dragging-main branch from 5b7a942 to b0470ab Compare July 9, 2026 17:01

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

packages/devextreme/js/__internal/scheduler/workspaces/work_space.ts:2524

  • getCellFromPoint() currently returns the first date/all-day cell from elementsFromPoint without verifying that the cell belongs to this workspace. When multiple schedulers exist on the page, this can resolve a cell from a different scheduler and lead to highlighting/updating against the wrong workspace on drag.
  public getCellFromPoint(x: number, y: number): dxElementWrapper | null {
    // @ts-expect-error
    const elements = domAdapter.elementsFromPoint(x, y) as Element[];

    const cell = elements.find((element) => element.classList.contains('dx-scheduler-date-table-cell')
      || element.classList.contains('dx-scheduler-all-day-table-cell'));

    return cell ? $(cell) : null;

Comment thread packages/devextreme/js/__internal/scheduler/appointment_drag_controller.ts Outdated
@bit-byte0 bit-byte0 force-pushed the refactor/scheduler-appointments-dragging-main branch from b0470ab to c9172aa Compare July 9, 2026 18:49
Copilot AI review requested due to automatic review settings July 9, 2026 18:49

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread packages/devextreme/js/__internal/scheduler/appointment_drag_controller.ts Outdated
Comment thread packages/devextreme/js/__internal/scheduler/appointment_drag_controller.ts Outdated
@bit-byte0 bit-byte0 force-pushed the refactor/scheduler-appointments-dragging-main branch from c9172aa to 7f64813 Compare July 9, 2026 19:26
Copilot AI review requested due to automatic review settings July 9, 2026 19:26

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread packages/devextreme/js/__internal/scheduler/appointment_drag_controller.ts Outdated
Copilot AI review requested due to automatic review settings July 9, 2026 20:36
@bit-byte0 bit-byte0 force-pushed the refactor/scheduler-appointments-dragging-main branch from 7f64813 to 2a5ca62 Compare July 9, 2026 20:36

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 9, 2026 21:13
@bit-byte0 bit-byte0 force-pushed the refactor/scheduler-appointments-dragging-main branch from 2a5ca62 to 7b567aa Compare July 9, 2026 21:13

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

packages/devextreme/js/__internal/scheduler/appointment_drag_controller.ts:313

  • updateAppointmentOnDrop() currently never rejects (it always resolves), so this catch is dead code and makes the control flow harder to follow.
      .finally(() => { this.removeDraggingClasses($(e.itemElement)); })
      .catch((err) => { throw err; });

Copilot AI review requested due to automatic review settings July 10, 2026 17:15
@bit-byte0 bit-byte0 force-pushed the refactor/scheduler-appointments-dragging-main branch from 7b567aa to fbf3527 Compare July 10, 2026 17:15

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 10, 2026 17:34
@bit-byte0 bit-byte0 force-pushed the refactor/scheduler-appointments-dragging-main branch from fbf3527 to e496e5d Compare July 10, 2026 17:34

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 10, 2026 17:54
@bit-byte0 bit-byte0 force-pushed the refactor/scheduler-appointments-dragging-main branch from e496e5d to acd0372 Compare July 10, 2026 17:54

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

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.

3 participants