Skip to content

Commit 35b8228

Browse files
committed
[IMP] Refresh FullCalendar resources.
This ensures that user columns are refreshed any time that calendar events are. This also moves canceled appointments to the footer.
1 parent c88c1e2 commit 35b8228

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

addons/web/static/lib/fullcalendar/timegrid/index.global.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -233,30 +233,6 @@ FullCalendar.TimeGrid = (function (exports, core, internal$1, preact, internal$2
233233
],
234234
});
235235
}
236-
if (allDayContent) {
237-
sections.push({
238-
type: 'body',
239-
key: 'all-day',
240-
syncRowHeights: true,
241-
chunks: [
242-
{
243-
key: 'axis',
244-
rowContent: (contentArg) => (preact.createElement("tr", { role: "presentation" }, this.renderTableRowAxis(contentArg.rowSyncHeights[0]))),
245-
},
246-
{
247-
key: 'cols',
248-
content: allDayContent,
249-
},
250-
],
251-
});
252-
sections.push({
253-
key: 'all-day-divider',
254-
type: 'body',
255-
outerContent: ( // TODO: rename to cellContent so don't need to define <tr>?
256-
preact.createElement("tr", { role: "presentation", className: "fc-scrollgrid-section" },
257-
preact.createElement("td", { colSpan: 2, className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))),
258-
});
259-
}
260236
let isNowIndicator = context.options.nowIndicator;
261237
sections.push({
262238
type: 'body',
@@ -291,6 +267,31 @@ FullCalendar.TimeGrid = (function (exports, core, internal$1, preact, internal$2
291267
},
292268
],
293269
});
270+
// HACK manually moved to footer
271+
if (allDayContent) {
272+
sections.push({
273+
key: 'all-day-divider',
274+
type: 'body',
275+
outerContent: ( // TODO: rename to cellContent so don't need to define <tr>?
276+
preact.createElement("tr", { role: "presentation", className: "fc-scrollgrid-section" },
277+
preact.createElement("td", { colSpan: 2, className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))),
278+
});
279+
sections.push({
280+
type: 'body',
281+
key: 'all-day',
282+
syncRowHeights: true,
283+
chunks: [
284+
{
285+
key: 'axis',
286+
rowContent: (contentArg) => (preact.createElement("tr", { role: "presentation" }, this.renderTableRowAxis(contentArg.rowSyncHeights[0]))),
287+
},
288+
{
289+
key: 'cols',
290+
content: allDayContent,
291+
},
292+
],
293+
});
294+
}
294295
if (stickyFooterScrollbar) {
295296
sections.push({
296297
key: 'footer',

addons/web/static/src/views/calendar/hooks.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ export function useFullCalendar(refName, params) {
100100
});
101101

102102
onPatched(() => {
103+
if (instance.refetchResources) {
104+
instance.refetchResources();
105+
}
103106
instance.refetchEvents();
104107
instance.setOption("weekends", component.props.isWeekendVisible);
105108
if (params.weekNumbers && component.props.model.scale === "year") {

0 commit comments

Comments
 (0)