Scheduler - Replace action enum with onDone/onCancel callbacks in AppointmentPopup#33047
Merged
aleksei-semikozov merged 7 commits intoDevExpress:26_1from Apr 3, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Scheduler’s AppointmentPopup integration to remove action-enum–driven behavior and instead delegate save behavior to a provided callback (plus new config-driven title/readOnly behavior).
Changes:
- Replaced
ACTION_TO_APPOINTMENT-based save branching inAppointmentPopupwith a singleconfig.onDone(...)callback. - Updated
Schedulerpopup invocations to passonDone,title, andreadOnly(while keeping legacy-form behavior on the legacy popup). - Refactored/expanded Jest tests and the popup test harness mock to validate callback invocation, title rendering, and read-only behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
packages/devextreme/js/__internal/scheduler/m_scheduler.ts |
Switches non-legacy popup usage to callback-based onDone flows and sets popup title/readOnly from scheduler context. |
packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts |
Introduces AppointmentPopupConfig and replaces action-based save logic with config.onDone; uses config.title and config.readOnly. |
packages/devextreme/js/__internal/scheduler/appointment_popup/appointment_popup.test.ts |
Updates tests to validate onDone, title rendering, and Save visibility under readOnly. |
packages/devextreme/js/__internal/scheduler/__tests__/__mock__/create_appointment_popup.ts |
Updates the test factory to pass the new config shape (onDone/title/readOnly) into popup.show. |
packages/devextreme/js/__internal/scheduler/__tests__/__mock__/create_appointment_popup.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts
Outdated
Show resolved
Hide resolved
5c8b946 to
9c52ce8
Compare
…adOnly in exclude-from-series, fix mock types
packages/devextreme/js/__internal/scheduler/appointment_popup/m_popup.ts
Outdated
Show resolved
Hide resolved
Tucchhaa
reviewed
Apr 3, 2026
| const formData = this.createFormData(appointmentAdapter); | ||
|
|
||
| this.form.readOnly = this.isReadOnly(appointmentAdapter); | ||
| this.form.readOnly = this.isReadOnly(); |
Contributor
There was a problem hiding this comment.
minor: let's remove isReadOnly method and directly use the variable:
this.form.readOnly = this.config.readOnly;
Tucchhaa
reviewed
Apr 3, 2026
| EXCLUDE_FROM_SERIES: 2, | ||
| }; | ||
| export interface AppointmentPopupConfig { | ||
| onDone: (appointment: Record<string, unknown>) => PromiseLike<unknown>; |
Contributor
There was a problem hiding this comment.
small sugestion: let's rename onDone to onSave, so it will be more obvious when this callback is called
Tucchhaa
approved these changes
Apr 3, 2026
aleksei-semikozov
added a commit
to aleksei-semikozov/DevExtreme
that referenced
this pull request
Apr 3, 2026
aleksei-semikozov
added a commit
to aleksei-semikozov/DevExtreme
that referenced
this pull request
Apr 3, 2026
aleksei-semikozov
added a commit
to aleksei-semikozov/DevExtreme
that referenced
this pull request
Apr 3, 2026
aleksei-semikozov
added a commit
to aleksei-semikozov/DevExtreme
that referenced
this pull request
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.