|
|
@ -140,11 +140,20 @@ const WorkWeekView = ({ events }) => {
|
|
|
|
const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourses }) => {
|
|
|
|
const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourses }) => {
|
|
|
|
const selectionSet = new Set(selection)
|
|
|
|
const selectionSet = new Set(selection)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const base = {
|
|
|
|
|
|
|
|
// 1: [],
|
|
|
|
|
|
|
|
// 2: [],
|
|
|
|
|
|
|
|
// 3: [],
|
|
|
|
|
|
|
|
// 4: [],
|
|
|
|
|
|
|
|
// 5: [],
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
const eventsByWeekday = _.groupBy(
|
|
|
|
const eventsByWeekday = _.groupBy(
|
|
|
|
!hideOtherCourses ? events : events.filter(e => selectionSet.has(e.name)),
|
|
|
|
!hideOtherCourses ? events : events.filter(e => selectionSet.has(e.name)),
|
|
|
|
event => event.start.getDay()
|
|
|
|
event => event.start.getDay()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const dayIntervalLayout = _.mapValues(Object.assign(base, eventsByWeekday), events =>
|
|
|
|
const dayIntervalLayout = _.mapValues(eventsByWeekday, events =>
|
|
|
|
const dayIntervalLayout = _.mapValues(eventsByWeekday, events =>
|
|
|
|
layoutIntervals(
|
|
|
|
layoutIntervals(
|
|
|
|
events.map(e => ({
|
|
|
|
events.map(e => ({
|
|
|
@ -222,9 +231,9 @@ const WorkWeekVerticalView = ({ events, selection, setSelection, hideOtherCourse
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{Object.values(dayIntervalLayout).map((layout, index) => (
|
|
|
|
{Object.entries(dayIntervalLayout).map(([index, layout]) => (
|
|
|
|
<div class="day" style={{ '--size': layout.length }}>
|
|
|
|
<div class="day" style={{ '--size': Math.max(1, layout.length) }}>
|
|
|
|
<div class="top-header">{WEEK_DAYS[index + 1]}</div>
|
|
|
|
<div class="top-header">{WEEK_DAYS[parseInt(index)]}</div>
|
|
|
|
<div class="events">
|
|
|
|
<div class="events">
|
|
|
|
{layout.map((events, stackIndex) => (
|
|
|
|
{layout.map((events, stackIndex) => (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|