Scheduler: Form customization#31399
Conversation
728480d to
1488f76
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds form customization capabilities to the Scheduler's appointment popup by introducing an editing.items configuration option. This allows developers to control which form groups are displayed and customize their visibility and child items.
Key Changes:
- Implemented
handleCustomizeFormItemsmethod to process custom form item configurations - Added
nameproperties to all form groups (subjectGroup, dateRangeGroup, repeatGroup, descriptionGroup, resourcesGroup) to enable identification - Added comprehensive test coverage for form customization scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/devextreme/js/__internal/scheduler/appointment_popup/m_form.ts | Implements form customization logic and adds name properties to form groups |
| packages/devextreme/js/__internal/scheduler/appointment_popup/appointment_popup.test.ts | Adds test suite for form customization feature and skips two existing tests |
0411637 to
3a535de
Compare
02d4a1b to
a4b6259
Compare
a4b6259 to
720101b
Compare
720101b to
52cbb2a
Compare
52cbb2a to
3b61ceb
Compare
3b61ceb to
6955e83
Compare
6955e83 to
de2afa8
Compare
There was a problem hiding this comment.
buildFormItemsMap is called only for defaultItems, which means that we will never have tab items here.
So I suggest:
if(isGroupItem(item)) {
return buildFormItemsMap(item.items ?? [], accumulator)
}
return accumulator;There was a problem hiding this comment.
By the way this will not work if user has tabItem that uses a default item inside. But I suggest to postpone implementing this
There was a problem hiding this comment.
I suggest to use a consistent naming in this file (yes, not only this function), because the same entities may have different names throughout the file which may be very confusing. For example, currently we have:
userConfig, config, configure which represent a custom item from user.
or variable name map doesn't tell anything about the variable except it's type, which I can already see by typescript.
So my suggestion is to rename entities like this:
map -> defaultItemsMap
configure -> customItems or userItems
existingItem -> defaultItem
config -> customItem or userItem
userConfig -> customItemsRoot or userItemsRoot
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
packages/devextreme/js/__internal/scheduler/appointment_popup/m_form.ts:355
- This intermediate group lacks a
nameproperty, which breaks the hierarchical item path resolution used inupdateDateTimeEditorsVisibility()at lines 918-921. The paths likemainGroup.dateGroup.startDateGroup.startDatewon't work because DevExtreme Form'sitemOptionmethod can't traverse unnamed groups. Add a name property (e.g.,name: 'dateGroupContent') and update the paths inupdateDateTimeEditorsVisibility()to include this intermediate group name.
{
colSpan: 1,
itemType: 'group',
items: [
this.createAllDaySwitch(),
this.createStartDateGroup(),
this.createEndDateGroup(),
],
},
67e2744 to
bf07dd9
Compare
No description provided.