Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-scheduler): add horizontal grouping by resources #2576

Merged
merged 157 commits into from
Dec 30, 2019
Merged
Show file tree
Hide file tree
Changes from 155 commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
d2e05f3
Add GroupingState
AryamnovEugeniy Nov 8, 2019
739c977
Add GroupingState docs
AryamnovEugeniy Nov 8, 2019
4b08969
Resolve conflicts
AryamnovEugeniy Nov 18, 2019
f7a4fc6
Add GroupingPanel
AryamnovEugeniy Nov 19, 2019
1d120ab
Show group names
AryamnovEugeniy Nov 19, 2019
829e0c3
Add group info to cells
AryamnovEugeniy Nov 20, 2019
27f142e
Refactor
AryamnovEugeniy Nov 21, 2019
52eb244
Resolve conflicts
AryamnovEugeniy Nov 22, 2019
369d456
Add grouping
AryamnovEugeniy Nov 25, 2019
1d25474
Add IntegratedGrouping
AryamnovEugeniy Nov 25, 2019
257d1eb
Fix demos
AryamnovEugeniy Nov 25, 2019
30ea6d1
Add drag-drop support
AryamnovEugeniy Nov 25, 2019
e77c832
Add multiple resources to monthview
AryamnovEugeniy Nov 26, 2019
2bc956d
Fix all-day panel
AryamnovEugeniy Nov 26, 2019
6a9b617
Add grouping drag-drop to allday panel
AryamnovEugeniy Nov 26, 2019
7f56101
Refactor
AryamnovEugeniy Nov 26, 2019
d441b53
Refactor
AryamnovEugeniy Nov 26, 2019
caa92a0
Test expandGroupedAppointment
AryamnovEugeniy Nov 26, 2019
1fd5160
Refactor
AryamnovEugeniy Nov 26, 2019
3a3d116
Test calculateAppointmentGroups
AryamnovEugeniy Nov 26, 2019
d32e240
Refaqctor updateMultipleResourceInfo
AryamnovEugeniy Nov 26, 2019
020a9ac
Fix tests
AryamnovEugeniy Nov 26, 2019
ec98a51
Fix several types
AryamnovEugeniy Nov 26, 2019
56c88a1
Test IntegratedGrouping computeds
AryamnovEugeniy Nov 26, 2019
646741c
Test IntegratedGrouping
AryamnovEugeniy Nov 26, 2019
03c9fe6
Refactor
AryamnovEugeniy Nov 26, 2019
8cd159c
Display appointments of the same dates correctly
AryamnovEugeniy Nov 27, 2019
18ad7e8
Refactor
AryamnovEugeniy Nov 27, 2019
538af2d
Fix appointments colors with multiple resources
AryamnovEugeniy Nov 28, 2019
896d432
Fix types
AryamnovEugeniy Nov 28, 2019
77d31a8
Fix ordinary demos without grouping
AryamnovEugeniy Nov 28, 2019
a85e00a
Add horizontal layout
AryamnovEugeniy Nov 28, 2019
5794c49
Add types to panel and integrated grouping
AryamnovEugeniy Nov 28, 2019
f783f38
Add borders to group
AryamnovEugeniy Nov 28, 2019
1171971
Fix panel borders
AryamnovEugeniy Nov 28, 2019
72a5e95
Grouping panel
AryamnovEugeniy Nov 29, 2019
4908762
Fix
AryamnovEugeniy Dec 2, 2019
cce494d
Use DayScale to render GroupingPanel
AryamnovEugeniy Dec 2, 2019
6f00d12
Fix min width
AryamnovEugeniy Dec 2, 2019
8cc4cbb
Fix layouts
AryamnovEugeniy Dec 2, 2019
1d82631
Fix full-width layouts
AryamnovEugeniy Dec 2, 2019
5f766ba
Add horizontal scroll
AryamnovEugeniy Dec 2, 2019
1c652c4
Make TimeScale sticky
AryamnovEugeniy Dec 2, 2019
81a82df
Fix horizontal scrolling
AryamnovEugeniy Dec 3, 2019
2e0a1cb
Test GroupingPanel
AryamnovEugeniy Dec 3, 2019
c0e3bf4
Test MUI
AryamnovEugeniy Dec 3, 2019
427945b
Test react-scheduler components
AryamnovEugeniy Dec 3, 2019
0ff43c2
Test and refactor
AryamnovEugeniy Dec 3, 2019
67f6293
Test and refactor
AryamnovEugeniy Dec 3, 2019
8fca316
Refactor
AryamnovEugeniy Dec 3, 2019
f5eba08
Test and refactor
AryamnovEugeniy Dec 3, 2019
ef81023
Refactor SortedResources
AryamnovEugeniy Dec 3, 2019
ad7812b
Fix core tests
AryamnovEugeniy Dec 3, 2019
8da69b0
Refactor
AryamnovEugeniy Dec 3, 2019
6bb2383
Revert tasks
AryamnovEugeniy Dec 3, 2019
9d2a11e
Refactor, bug fix
AryamnovEugeniy Dec 4, 2019
914cbba
Mobile layout, refactor
AryamnovEugeniy Dec 4, 2019
6fe6f8b
Add key to panel's cells
AryamnovEugeniy Dec 4, 2019
8fcf458
Fix lint
AryamnovEugeniy Dec 4, 2019
9039527
Refactor
AryamnovEugeniy Dec 4, 2019
761bbac
Fix drag drop with resources
AryamnovEugeniy Dec 4, 2019
040e08f
Refactor utils
AryamnovEugeniy Dec 5, 2019
0c1b25a
Resolve conflicts
AryamnovEugeniy Dec 5, 2019
95e60eb
Refactor
AryamnovEugeniy Dec 5, 2019
dd0cd86
Refactor
AryamnovEugeniy Dec 5, 2019
53dd464
Refactor
AryamnovEugeniy Dec 5, 2019
79851da
Fix types
AryamnovEugeniy Dec 5, 2019
aa28a67
Refactor
AryamnovEugeniy Dec 5, 2019
8cf8e09
Refactor
AryamnovEugeniy Dec 5, 2019
5cae163
Fix MonthView type
AryamnovEugeniy Dec 5, 2019
8400979
Add basic grouping demo
AryamnovEugeniy Dec 5, 2019
ac96715
Add demos
AryamnovEugeniy Dec 6, 2019
2f38595
Resolve conflicts
AryamnovEugeniy Dec 6, 2019
31cfaa7
Fix
AryamnovEugeniy Dec 6, 2019
1028690
Fix lint
AryamnovEugeniy Dec 6, 2019
6fc2a08
Fix cell keys
AryamnovEugeniy Dec 6, 2019
25a342a
Add docs
AryamnovEugeniy Dec 6, 2019
db99ba6
Reverts husky
AryamnovEugeniy Dec 6, 2019
a28c7eb
Update API
AryamnovEugeniy Dec 6, 2019
95c1fe1
Fix
AryamnovEugeniy Dec 6, 2019
f55c8f6
Refactor
AryamnovEugeniy Dec 6, 2019
d270424
Update Api
AryamnovEugeniy Dec 6, 2019
c603f29
Main resource as default for grouping
AryamnovEugeniy Dec 6, 2019
5eeebf3
Add dependencies
AryamnovEugeniy Dec 6, 2019
2f64845
Refactor
AryamnovEugeniy Dec 6, 2019
b1242a9
Fix TimeScale
AryamnovEugeniy Dec 11, 2019
4c46fba
Fix grouping panel
AryamnovEugeniy Dec 11, 2019
cf08414
Fix appointment vertical scroll
AryamnovEugeniy Dec 11, 2019
aacb443
Fix tests
AryamnovEugeniy Dec 11, 2019
66da8e8
Apply suggestions from review
AryamnovEugeniy Dec 11, 2019
26abde9
Apply suggestions
AryamnovEugeniy Dec 11, 2019
1cd3f0a
Fix vertical layout
AryamnovEugeniy Dec 11, 2019
f8433ef
Apply suggestions from code review
AryamnovEugeniy Dec 11, 2019
0e70e3b
Update API
AryamnovEugeniy Dec 11, 2019
ff4ded7
Fix vertical layout
AryamnovEugeniy Dec 11, 2019
2a9c7ed
Sticky panel cells
AryamnovEugeniy Dec 11, 2019
17740a4
Update API
AryamnovEugeniy Dec 11, 2019
8b0d640
Add icons to custom demo
AryamnovEugeniy Dec 11, 2019
6421666
Update editing demo
AryamnovEugeniy Dec 11, 2019
5d3a6b2
Update guide
AryamnovEugeniy Dec 12, 2019
56317db
Refactor
AryamnovEugeniy Dec 12, 2019
2b452b8
Refactor
AryamnovEugeniy Dec 12, 2019
c1f8b5b
Merge branch 'master' into grouping-by-resources
AryamnovEugeniy Dec 12, 2019
5d6e724
Fix layouts
AryamnovEugeniy Dec 12, 2019
83186fd
Fix tests
AryamnovEugeniy Dec 12, 2019
b08da0f
Refactor
AryamnovEugeniy Dec 13, 2019
cfe6417
Merge branch 'master' into grouping-by-resources
AryamnovEugeniy Dec 13, 2019
02767df
Fix
AryamnovEugeniy Dec 13, 2019
6c01bec
Refactor
AryamnovEugeniy Dec 13, 2019
6e82a90
Apply suggestions from code review
AryamnovEugeniy Dec 13, 2019
b881263
Apply suggestion from code review
AryamnovEugeniy Dec 16, 2019
831497a
Update API
AryamnovEugeniy Dec 16, 2019
1432798
Merge branch 'master' into grouping-by-resources
AryamnovEugeniy Dec 16, 2019
f3a7bf1
Apply suggestions
AryamnovEugeniy Dec 16, 2019
d8d75a5
Refactor
AryamnovEugeniy Dec 16, 2019
aa4adf8
Merge branch 'master' of https://github.com/DevExpress/devextreme-rea…
AryamnovEugeniy Dec 16, 2019
e68c104
Merge branch 'grouping-by-resources' of https://github.com/AryamnovEu…
AryamnovEugeniy Dec 16, 2019
4af6aa4
Apply suggestions from code review
AryamnovEugeniy Dec 18, 2019
aa3b1a7
Merge branch 'master' of https://github.com/DevExpress/devextreme-rea…
AryamnovEugeniy Dec 19, 2019
f824150
Apply suggestions
AryamnovEugeniy Dec 19, 2019
246ff44
Fix dnd
AryamnovEugeniy Dec 20, 2019
ee8cb81
Refactor
AryamnovEugeniy Dec 20, 2019
18eb5dc
Refactor
AryamnovEugeniy Dec 20, 2019
8180823
Fix arrays check
AryamnovEugeniy Dec 20, 2019
c945e62
Fix lint
AryamnovEugeniy Dec 23, 2019
6e1c9f2
Merge branch 'master' into grouping-by-resources
MaximKudriavtsev Dec 23, 2019
3ba4b8f
Refactor
AryamnovEugeniy Dec 23, 2019
f90e13b
Merge branch 'grouping-by-resources' of https://github.com/AryamnovEu…
AryamnovEugeniy Dec 23, 2019
dd46e85
Fix
AryamnovEugeniy Dec 24, 2019
bd377be
Resolve conflicts
AryamnovEugeniy Dec 24, 2019
04d471a
Fix after conflicts
AryamnovEugeniy Dec 24, 2019
3f0de55
Fix tests in react-scheduler
AryamnovEugeniy Dec 24, 2019
33a6635
Fix tests
AryamnovEugeniy Dec 24, 2019
7695532
Refactor
AryamnovEugeniy Dec 24, 2019
0d22c95
Fix import
AryamnovEugeniy Dec 24, 2019
c32e111
Fix lint
AryamnovEugeniy Dec 24, 2019
4fba0f7
Fix multiple resources
AryamnovEugeniy Dec 24, 2019
1d906e5
Fix flickering appointments
AryamnovEugeniy Dec 27, 2019
77fcf56
Add Edge note
AryamnovEugeniy Dec 27, 2019
4ac2ec8
Add comment
AryamnovEugeniy Dec 27, 2019
b2c703d
Apply suggestions
AryamnovEugeniy Dec 27, 2019
504f7df
Update basic demo
AryamnovEugeniy Dec 27, 2019
9af2887
Update
AryamnovEugeniy Dec 27, 2019
e12ad89
Merge branch 'master' into grouping-by-resources
AryamnovEugeniy Dec 27, 2019
554e303
width -> length
AryamnovEugeniy Dec 27, 2019
4a91df8
Fix docs
AryamnovEugeniy Dec 27, 2019
1f65675
Update API
AryamnovEugeniy Dec 27, 2019
2ba704a
Merge branch 'grouping-by-resources' of https://github.com/AryamnovEu…
AryamnovEugeniy Dec 27, 2019
dc1a259
Rename groupingItem to group
AryamnovEugeniy Dec 27, 2019
0520aad
Fix links
AryamnovEugeniy Dec 27, 2019
9ffe08f
Update API
AryamnovEugeniy Dec 27, 2019
c34ebcb
Apply suggestions from code review
AryamnovEugeniy Dec 30, 2019
5512950
Apply suggestions from code review
AryamnovEugeniy Dec 30, 2019
90a3f7f
Fix ts descriptions
AryamnovEugeniy Dec 30, 2019
33b4188
Fix links
AryamnovEugeniy Dec 30, 2019
ee86b16
Merge branch 'master' into grouping-by-resources
AryamnovEugeniy Dec 30, 2019
f1b2969
Apply suggestions from code review
AryamnovEugeniy Dec 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/dx-react-grid/docs/guides/fixed-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ The Grid allows you to fix one or more first and last columns. Fixed columns rem
- WebView for Android before 5.0
- Internet Explorer

- Currently, there are issues with fixed columns support in Microsoft Edge:
- [sticky elements flicker on scroll](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18769340/)
- [nested sticky positioning element will not stick](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18940617/)
- [sticky causes border to dissapear on table elements](https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/16792336/)
Scrolling issues have also been noticed in Microsoft Edge. They are caused by the browser's implementation of sticky positioning.

## Related Plugins

Expand Down
181 changes: 181 additions & 0 deletions packages/dx-react-scheduler-demos/src/demo-data/grouping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
export const data = [
{
title: 'Website Re-Design Plan',
priorityId: 2,
startDate: new Date(2018, 4, 21, 9, 30),
endDate: new Date(2018, 4, 21, 11, 30),
id: 0,
}, {
title: 'Book Flights to San Fran for Sales Trip',
priorityId: 1,
startDate: new Date(2018, 4, 24, 10, 0),
endDate: new Date(2018, 4, 24, 12, 0),
id: 1,
}, {
title: 'Install New Router in Dev Room',
priorityId: 1,
startDate: new Date(2018, 4, 21, 13),
endDate: new Date(2018, 4, 21, 15, 30),
id: 2,
}, {
title: 'Approve Personal Computer Upgrade Plan',
priorityId: 2,
startDate: new Date(2018, 4, 22, 10, 0),
endDate: new Date(2018, 4, 22, 11, 0),
id: 3,
}, {
title: 'Final Budget Review',
priorityId: 2,
startDate: new Date(2018, 4, 22, 12, 0),
endDate: new Date(2018, 4, 22, 13, 35),
id: 4,
}, {
title: 'New Brochures',
priorityId: 2,
startDate: new Date(2018, 4, 21, 13, 0),
endDate: new Date(2018, 4, 21, 15, 15),
id: 5,
}, {
title: 'Install New Database',
priorityId: 1,
startDate: new Date(2018, 4, 22, 9),
endDate: new Date(2018, 4, 22, 12, 15),
id: 6,
}, {
title: 'Approve New Online Marketing Strategy',
priorityId: 2,
startDate: new Date(2018, 4, 23, 12, 0),
endDate: new Date(2018, 4, 23, 14, 0),
id: 7,
}, {
title: 'Upgrade Personal Computers',
priorityId: 1,
startDate: new Date(2018, 4, 21, 9),
endDate: new Date(2018, 4, 21, 11, 30),
id: 8,
}, {
title: 'Prepare 2018 Marketing Plan',
priorityId: 2,
startDate: new Date(2018, 4, 24, 11, 0),
endDate: new Date(2018, 4, 24, 13, 30),
id: 9,
}, {
title: 'Brochure Design Review',
priorityId: 1,
startDate: new Date(2018, 4, 23, 11, 0),
endDate: new Date(2018, 4, 23, 13, 30),
id: 10,
}, {
title: 'Create Icons for Website',
priorityId: 2,
startDate: new Date(2018, 4, 25, 10, 0),
endDate: new Date(2018, 4, 25, 11, 30),
id: 0,
}, {
title: 'Upgrade Server Hardware',
priorityId: 1,
startDate: new Date(2018, 4, 25, 9, 0),
endDate: new Date(2018, 4, 25, 15, 0),
id: 11,
}, {
title: 'Submit New Website Design',
priorityId: 2,
startDate: new Date(2018, 4, 25, 16, 30),
endDate: new Date(2018, 4, 25, 18, 0),
id: 12,
}, {
title: 'Launch New Website',
priorityId: 2,
startDate: new Date(2018, 4, 25, 12, 20),
endDate: new Date(2018, 4, 25, 14, 0),
id: 13,
}, {
title: 'Google AdWords Strategy',
priorityId: 1,
startDate: new Date(2018, 4, 28, 9, 0, 0),
endDate: new Date(2018, 4, 28, 12, 0, 0),
id: 14,
}, {
title: 'Rollout of New Website and Marketing Brochures',
priorityId: 1,
startDate: new Date(2018, 4, 28, 13, 0, 0),
endDate: new Date(2018, 4, 28, 15, 30, 0),
id: 15,
}, {
title: 'Non-Compete Agreements',
priorityId: 2,
startDate: new Date(2018, 4, 29, 13, 0, 0),
endDate: new Date(2018, 4, 29, 15, 45, 0),
id: 16,
}, {
title: 'Approve Hiring of John Jeffers',
priorityId: 2,
startDate: new Date(2018, 4, 29, 9, 0, 0),
endDate: new Date(2018, 4, 29, 12, 0, 0),
id: 17,
}, {
title: 'Update NDA Agreement',
priorityId: 1,
startDate: new Date(2018, 4, 29, 11, 0, 0),
endDate: new Date(2018, 4, 29, 14, 15, 0),
id: 18,
}, {
title: 'Update Employee Files with New NDA',
priorityId: 1,
startDate: new Date(2018, 5, 1, 9, 0, 0),
endDate: new Date(2018, 5, 1, 11, 45, 0),
id: 19,
}, {
title: 'Submit Questions Regarding New NDA',
priorityId: 1,
startDate: new Date(2018, 4, 30, 10, 0, 0),
endDate: new Date(2018, 4, 30, 11, 30, 0),
id: 20,
}, {
title: 'Submit Signed NDA',
priorityId: 1,
startDate: new Date(2018, 4, 30, 13, 0, 0),
endDate: new Date(2018, 4, 30, 15, 0, 0),
id: 21,
}, {
title: 'Review Revenue Projections',
priorityId: 2,
startDate: new Date(2018, 4, 30, 11, 0, 0),
endDate: new Date(2018, 4, 30, 14, 0, 0),
id: 22,
}, {
title: 'Comment on Revenue Projections',
priorityId: 2,
startDate: new Date(2018, 4, 28, 10, 0, 0),
endDate: new Date(2018, 4, 28, 13, 0, 0),
id: 23,
}, {
title: 'Provide New Health Insurance Docs',
priorityId: 2,
startDate: new Date(2018, 5, 1, 12, 0, 0),
endDate: new Date(2018, 5, 1, 15, 0, 0),
id: 24,
}, {
title: 'Review Changes to Health Insurance Coverage',
priorityId: 2,
startDate: new Date(2018, 4, 31, 9, 0, 0),
endDate: new Date(2018, 4, 31, 13, 0, 0),
id: 25,
}, {
title: 'Review Training Course for any Ommissions',
priorityId: 1,
startDate: new Date(2018, 4, 31, 11, 0, 0),
endDate: new Date(2018, 4, 31, 14, 0, 0),
id: 26,
},
];

export const priorityData = [
{
text: 'Low Priority',
id: 1,
}, {
text: 'High Priority',
id: 2,
},
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import * as React from 'react';
import Paper from '@material-ui/core/Paper';
import {
ViewState, GroupingState, IntegratedGrouping, IntegratedEditing, EditingState,
} from '@devexpress/dx-react-scheduler';
import {
Scheduler,
Resources,
Appointments,
AppointmentTooltip,
GroupingPanel,
DayView,
DragDropProvider,
AppointmentForm,
} from '@devexpress/dx-react-scheduler-material-ui';
import {
teal, indigo,
} from '@material-ui/core/colors';

const appointments = [{
id: 0,
title: 'Watercolor Landscape',
members: [1, 2],
roomId: 1,
startDate: new Date(2017, 4, 28, 9, 30),
endDate: new Date(2017, 4, 28, 12, 0),
}, {
id: 1,
title: 'Oil Painting for Beginners',
members: [1],
roomId: 2,
startDate: new Date(2017, 4, 28, 12, 30),
endDate: new Date(2017, 4, 28, 14, 30),
}, {
id: 2,
title: 'Testing',
members: [1, 2],
roomId: 1,
startDate: new Date(2017, 4, 29, 12, 30),
endDate: new Date(2017, 4, 29, 14, 30),
}, {
id: 3,
title: 'Final exams',
members: [1, 2],
roomId: 2,
startDate: new Date(2017, 4, 29, 9, 30),
endDate: new Date(2017, 4, 29, 12, 0),
}];

const owners = [{
text: 'Andrew Glover',
id: 1,
color: indigo,
}, {
text: 'Arnie Schwartz',
id: 2,
color: teal,
}];

const locations = [
{ text: 'Room 1', id: 1 },
{ text: 'Room 2', id: 2 },
];

export default class Demo extends React.PureComponent {
constructor(props) {
super(props);
this.state = {
data: appointments,
resources: [{
fieldName: 'members',
title: 'Members',
instances: owners,
allowMultiple: true,
}, {
fieldName: 'roomId',
title: 'Location',
instances: locations,
}],
grouping: [{
resourceName: 'roomId',
}, {
resourceName: 'members',
}],
};

this.commitChanges = this.commitChanges.bind(this);
}

commitChanges({ added, changed, deleted }) {
this.setState((state) => {
let { data } = state;
if (added) {
const startingAddedId = data.length > 0 ? data[data.length - 1].id + 1 : 0;
data = [...data, { id: startingAddedId, ...added }];
}
if (changed) {
data = data.map(appointment => (
changed[appointment.id] ? { ...appointment, ...changed[appointment.id] } : appointment));
}
if (deleted !== undefined) {
data = data.filter(appointment => appointment.id !== deleted);
}
return { data };
});
}

render() {
const { data, resources, grouping } = this.state;

return (
<Paper>
<Scheduler
data={data}
>
<ViewState
defaultCurrentDate="2017-05-28"
/>
<EditingState
onCommitChanges={this.commitChanges}
/>
<GroupingState
grouping={grouping}
/>

<DayView
startDayHour={9}
endDayHour={15}
intervalCount={2}
/>
<Appointments />
<Resources
data={resources}
mainResourceName="members"
/>

<IntegratedGrouping />
<IntegratedEditing />
AryamnovEugeniy marked this conversation as resolved.
Show resolved Hide resolved

<AppointmentTooltip showOpenButton />
<AppointmentForm />
<GroupingPanel />
<DragDropProvider />
</Scheduler>
</Paper>
);
}
}
Loading