Skip to content

Scheduler: Add form customization stories#31634

Merged
aleksei-semikozov merged 4 commits into
DevExpress:25_2from
aleksei-semikozov:customize-form-storybook
Nov 10, 2025
Merged

Scheduler: Add form customization stories#31634
aleksei-semikozov merged 4 commits into
DevExpress:25_2from
aleksei-semikozov:customize-form-storybook

Conversation

@aleksei-semikozov

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 10, 2025 02:32

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

This PR adds new Storybook stories for demonstrating Scheduler form customization capabilities in the React Storybook application.

  • Introduces four new stories showcasing different form customization scenarios for the Scheduler component
  • Adds CSS styling for custom icon buttons used in form customization examples
  • Demonstrates various form manipulation techniques including filtering items, reordering, adding custom fields, and customizing existing fields

Reviewed Changes

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

File Description
apps/react-storybook/stories/scheduler/SchedulerFormCustomization.stories.tsx Adds comprehensive Storybook stories for Scheduler form customization, including default form, item visibility controls, reordering, custom items, and field customization
apps/react-storybook/stories/scheduler/form-customization.css Provides custom CSS styling for icon buttons used in the form customization examples

control: "boolean",
},
},
render: (args: any) => {

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

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

Using explicit any type reduces type safety. Consider defining a proper type for the render function arguments, similar to how StepperRenderArgs is defined in Stepper.stories.tsx. For example:

type ShowItemsRenderArgs = typeof baseConfig & {
  showSubjectGroup: boolean;
  showDateGroup: boolean;
  showRecurrenceGroup: boolean;
  showDescriptionGroup: boolean;
  showResourcesGroup: boolean;
  resources: typeof resources;
};

Then use: render: (args: ShowItemsRenderArgs) => {

Alternatively, allow TypeScript to infer the type by omitting the annotation entirely: render: (args) => {

Copilot uses AI. Check for mistakes.
options: positions,
},
},
render: (args: any) => {

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

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

Using explicit any type reduces type safety. Consider defining a proper type for the render function arguments. For example:

type ReorderItemsRenderArgs = typeof baseConfig & {
  subjectGroupPosition: number;
  dateGroupPosition: number;
  descriptionGroupPosition: number;
  resourcesGroupPosition: number;
  recurrenceGroupPosition: number;
  resources: typeof resources;
};

Then use: render: (args: ReorderItemsRenderArgs) => {

Alternatively, allow TypeScript to infer the type by omitting the annotation entirely: render: (args) => {

Copilot uses AI. Check for mistakes.
.icon-button {
padding: 4px;
width: 18px;
height: 18px;

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The use of !important can make styles harder to maintain and override. Consider whether the CSS specificity can be increased through more specific selectors instead, or if there's a way to modify the component structure to avoid needing !important. If !important is necessary due to overriding DevExtreme's default styles, consider adding a comment explaining why it's required.

Suggested change
height: 18px;
height: 18px;
/* !important is required to override DevExtreme's default border styles */

Copilot uses AI. Check for mistakes.
height: 18px;
border: 0 !important;
}

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The use of !important can make styles harder to maintain and override. Consider whether the CSS specificity can be increased through more specific selectors instead, or if there's a way to modify the component structure to avoid needing !important. If !important is necessary due to overriding DevExtreme's default styles, consider adding a comment explaining why it's required.

Suggested change
/*
* The use of !important here is required to override DevExtreme's default styles,
* which apply padding to icon elements with high specificity and/or inline styles.
* Attempts to increase selector specificity were insufficient.
*/

Copilot uses AI. Check for mistakes.
sjbur
sjbur previously approved these changes Nov 10, 2025
@@ -0,0 +1,10 @@
.icon-button {

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.

question: why do we need these styles?

I ask because I had experience with storybook that styles in different stories affected other stories (because selectors where too broad) which was a problem during the design review.

can you please check this style doesn't affect other stories? Maybe the problem was solved, otherwise we need a more specific selector here

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.

Styles are necessary for customizeItem Story. I add a specific id and a more specific class to avoid the behavior you described before 😊

Copilot AI review requested due to automatic review settings November 10, 2025 12:42

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 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +1 to +8
#customize-subjectIcon,
.scheduler-form-custom-icon-button {
width: 18px;
height: 18px;
border: 0 !important;
}

#customize-subjectIcon *,

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

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

Using an ID selector in CSS can cause maintainability issues in component-based architectures. Since this is a Storybook story where the component might be rendered multiple times on the same page, consider using only the class selector .scheduler-form-custom-icon-button or making the ID selector more specific with a namespace prefix.

Suggested change
#customize-subjectIcon,
.scheduler-form-custom-icon-button {
width: 18px;
height: 18px;
border: 0 !important;
}
#customize-subjectIcon *,
.scheduler-form-custom-icon-button {
width: 18px;
height: 18px;
border: 0 !important;
}

Copilot uses AI. Check for mistakes.
name: "comments",
editorOptions: {
placeholder: "Your comments...",
height: 100

Copilot AI Nov 10, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Missing trailing comma after height: 100. The codebase should maintain consistent comma usage in object literals for better git diffs and easier maintenance.

Suggested change
height: 100
height: 100,

Copilot uses AI. Check for mistakes.
@aleksei-semikozov aleksei-semikozov merged commit 9ed69f7 into DevExpress:25_2 Nov 10, 2025
103 of 106 checks passed
@aleksei-semikozov aleksei-semikozov deleted the customize-form-storybook branch March 20, 2026 17:12
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.

4 participants