Skip to content

Commit

Permalink
Merge branch 'v4' of github.com:fullcalendar/fullcalendar-scheduler i…
Browse files Browse the repository at this point in the history
…nto v4
  • Loading branch information
arshaw committed Jun 3, 2021
2 parents 0abdc56 + 391d032 commit af79dec
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 6 deletions.
27 changes: 27 additions & 0 deletions __tests__/src/misc/loading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
describe('loading callback', function() {

it('fires when fetching resources', function(callback) {
let loadingArgs = []

initCalendar({
defaultView: 'resourceTimelineDay',
resources(fetchInfo, callback) {
setTimeout(function() {
callback([
{ id: 'a', title: 'Resource A' },
{ id: 'b', title: 'Resource B' },
])
}, 10)
},
loading(arg) {
loadingArgs.push(arg)
}
})

setTimeout(function() {
expect(loadingArgs).toEqual([ true, false ])
callback()
}, 20) // after resources are loaded
})

})
2 changes: 1 addition & 1 deletion resource-common/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@fullcalendar/resource-common",
"version": "4.4.0",
"version": "4.4.2",
"title": "FullCalendar Resources Common Plugin",
"description": "Offers base support for resources. Required for all resource-related plugins.",
"browserGlobal": "FullCalendarResourceCommon",
Expand Down
4 changes: 3 additions & 1 deletion resource-common/src/reducers/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export default function(state: CalendarState, action: ResourceAction, calendar:
let resourceSource = reduceResourceSource(state.resourceSource, action, state.dateProfile, calendar)
let resourceStore = reduceResourceStore(state.resourceStore, action, resourceSource, calendar)
let resourceEntityExpansions = reduceResourceEntityExpansions(state.resourceEntityExpansions, action)
let loadingLevel = state.loadingLevel + ((resourceSource && resourceSource.isFetching) ? 1 : 0)

return {
...state,
resourceSource,
resourceStore,
resourceEntityExpansions
resourceEntityExpansions,
loadingLevel
}
}
2 changes: 1 addition & 1 deletion resource-daygrid/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@fullcalendar/resource-daygrid",
"version": "4.4.0",
"version": "4.4.2",
"title": "FullCalendar Resource Day Grid Plugin",
"description": "Displays events in individual columns for days and resources",
"docs": "https://fullcalendar.io/docs/resource-daygrid-view",
Expand Down
2 changes: 2 additions & 0 deletions resource-daygrid/src/ResourceDayGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export default class ResourceDayGrid extends DateComponent<ResourceDayGridProps>
return this.slicers[resourceId] || new DayGridSlicer()
})

dayGrid.receiveContext(context) // hack because sliceProps expects component to have context

let slicedProps = mapHash(this.slicers, (slicer, resourceId) => {
return slicer.sliceProps(
splitProps[resourceId],
Expand Down
2 changes: 1 addition & 1 deletion resource-timegrid/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@fullcalendar/resource-timegrid",
"version": "4.4.0",
"version": "4.4.2",
"title": "FullCalendar Resource Time Grid Plugin",
"description": "Displays events on a vertical resource view with time slots",
"docs": "https://fullcalendar.io/docs/vertical-resource-view",
Expand Down
2 changes: 2 additions & 0 deletions resource-timegrid/src/ResourceTimeGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export default class ResourceTimeGrid extends DateComponent<ResourceTimeGridProp
return this.slicers[resourceId] || new TimeGridSlicer()
})

timeGrid.receiveContext(context) // hack because sliceProps expects component to have context

let slicedProps = mapHash(this.slicers, (slicer, resourceId) => {
return slicer.sliceProps(
splitProps[resourceId],
Expand Down
2 changes: 1 addition & 1 deletion resource-timeline/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@fullcalendar/resource-timeline",
"version": "4.4.0",
"version": "4.4.2",
"title": "FullCalendar Resource Timeline Plugin",
"description": "Display events and resources on a horizontal time axis",
"docs": "https://fullcalendar.io/docs/timeline-view",
Expand Down
2 changes: 1 addition & 1 deletion timeline/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@fullcalendar/timeline",
"version": "4.4.1",
"version": "4.4.3",
"title": "FullCalendar Timeline Plugin",
"description": "Display events on a horizontal time axis (without resources)",
"docs": "https://fullcalendar.io/docs/timeline-view-no-resources",
Expand Down

0 comments on commit af79dec

Please sign in to comment.