Skip to content

Commit e56a408

Browse files
authored
Scheduler - Appointment Form Redesign - Improve storybook (#31543)
1 parent dd1dc05 commit e56a408

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

apps/react-storybook/stories/scheduler/SchedulerAppointmentForm.stories.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Meta, StoryObj } from "@storybook/react";
22
import dxScheduler from "devextreme/ui/scheduler";
33
import { wrapDxWithReact } from "../utils";
4-
import { data, resources } from "./data";
4+
import { data, resources, resourcesWithIcons } from "./data";
55

66
const Scheduler = wrapDxWithReact(dxScheduler);
77

@@ -25,12 +25,13 @@ export const Overview: Story = {
2525
'editing.allowDragging': true,
2626
'editing.allowResizing': true,
2727
'editing.allowTimeZoneEditing': false,
28+
'editing.form.iconsShowMode': 'main',
2829
resources,
2930
height: 600,
3031
views: ['day', 'week', 'workWeek', 'month'],
3132
currentView: 'workWeek',
3233
currentDate: new Date(2021, 3, 29),
33-
dataSource: data
34+
dataSource: data,
3435
},
3536
argTypes: {
3637
'editing.allowAdding': {
@@ -42,12 +43,24 @@ export const Overview: Story = {
4243
'editing.allowTimeZoneEditing': {
4344
control: 'boolean',
4445
},
46+
'editing.form.iconsShowMode': {
47+
control: 'radio',
48+
options: ['both', 'main', 'recurrence', 'never'],
49+
},
4550
'showResources': {
4651
control: 'boolean',
4752
},
4853
'resources': {
49-
control: 'boolean',
50-
mapping: { true: resources, false: [] },
54+
control: 'radio',
55+
options: ['enabled', 'enabledWithIcons', 'disabled'],
56+
additionalProps: {
57+
default: 'enabled'
58+
},
59+
mapping: {
60+
enabled: resources,
61+
enabledWithIcons: resourcesWithIcons,
62+
disabled: [],
63+
}
5164
}
5265
},
5366
}

apps/react-storybook/stories/scheduler/data.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,27 @@ export const resources = [
6363
}
6464
];
6565

66+
export const resourcesWithIcons = [
67+
{
68+
fieldExpr: 'roomId',
69+
dataSource: rooms,
70+
label: 'Room',
71+
icon: 'conferenceroomoutline'
72+
}, {
73+
fieldExpr: 'priorityId',
74+
dataSource: priorities,
75+
label: 'Priority',
76+
icon: 'tags',
77+
useColorAsDefault: true,
78+
}, {
79+
fieldExpr: 'assigneeId',
80+
allowMultiple: true,
81+
dataSource: assignees,
82+
label: 'Assignee',
83+
icon: 'user'
84+
}
85+
];
86+
6687
export const data = [
6788
{
6889
text: 'Watercolor Landscape',

0 commit comments

Comments
 (0)