Loading css/freebusy.scss +5 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,11 @@ opacity: .8; opacity: .8; } } .blocking-slot-free-busy { background: repeating-linear-gradient( 45deg, #606dbc, #606dbc 10px, #465298 10px, #465298 20px ); z-index: 2; } .blocking-event-free-busy { .blocking-event-free-busy { border-color: red; border-color: red; border-style: solid; border-style: solid; Loading src/components/Editor/FreeBusy/FreeBusy.vue +2 −1 Original line number Original line Diff line number Diff line Loading @@ -142,7 +142,8 @@ export default { freeBusyEventSource( freeBusyEventSource( this._uid, this._uid, this.organizer.attendeeProperty, this.organizer.attendeeProperty, this.attendees.map((a) => a.attendeeProperty) this.attendees.map((a) => a.attendeeProperty), this.resources.map((resource) => resource.id) ), ), freeBusyFakeBlockingEventSource( freeBusyFakeBlockingEventSource( this._uid, this._uid, Loading src/fullcalendar/eventSources/freeBusyEventSource.js +3 −2 Original line number Original line Diff line number Diff line Loading @@ -33,9 +33,10 @@ import logger from '../../utils/logger.js' * @param {String} id Identification for this source * @param {String} id Identification for this source * @param {AttendeeProperty} organizer The organizer of the event * @param {AttendeeProperty} organizer The organizer of the event * @param {AttendeeProperty[]} attendees Array of the event's attendees * @param {AttendeeProperty[]} attendees Array of the event's attendees * @param {string[]} resourceIds all resource IDs for the current free/busy data * @returns {{startEditable: boolean, resourceEditable: boolean, editable: boolean, id: string, durationEditable: boolean, events: events}} * @returns {{startEditable: boolean, resourceEditable: boolean, editable: boolean, id: string, durationEditable: boolean, events: events}} */ */ export default function(id, organizer, attendees) { export default function(id, organizer, attendees, resourceIds) { return { return { id: 'free-busy-event-source-' + id, id: 'free-busy-event-source-' + id, editable: false, editable: false, Loading Loading @@ -75,7 +76,7 @@ export default function(id, organizer, attendees) { } } const events = [] const events = [] for (const [uri, data] of Object.entries(freeBusyData)) { for (const [uri, data] of Object.entries(freeBusyData)) { events.push(...freeBusyEventSourceFunction(uri, data.calendarData, data.success, startDateTime, endDateTime, timezoneObject)) events.push(...freeBusyEventSourceFunction(uri, data.calendarData, data.success, startDateTime, endDateTime, timezoneObject, resourceIds)) } } console.debug(events) console.debug(events) Loading src/fullcalendar/eventSources/freeBusyEventSourceFunction.js +19 −2 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import { getColorForFBType } from '../../utils/freebusy.js' import { getColorForFBType } from '../../utils/freebusy.js' import { getParserManager } from 'calendar-js' import { getParserManager } from 'calendar-js' import logger from '../../utils/logger' /** /** * Converts the response * Converts the response Loading @@ -32,10 +33,12 @@ import { getParserManager } from 'calendar-js' * @param {DateTimeValue} start The start of the fetched time-range * @param {DateTimeValue} start The start of the fetched time-range * @param {DateTimeValue} end The end of the fetched time-range * @param {DateTimeValue} end The end of the fetched time-range * @param {Timezone} timezone Timezone of user viewing data * @param {Timezone} timezone Timezone of user viewing data * @param {string[]} resourceIds all resource IDs for the current free/busy data * @returns {Object[]} * @returns {Object[]} */ */ export default function(uri, calendarData, success, start, end, timezone) { export default function(uri, calendarData, success, start, end, timezone, resourceIds) { if (!success) { if (!success) { logger.info('no free/busy info for URI ' + uri + ', falling back to unknown state') return [{ return [{ id: Math.random().toString(36).substring(7), id: Math.random().toString(36).substring(7), start: start.getInTimezone(timezone).jsDate.toISOString(), start: start.getInTimezone(timezone).jsDate.toISOString(), Loading @@ -56,6 +59,7 @@ export default function(uri, calendarData, success, start, end, timezone) { const calendarComponent = parser._calendarComponent const calendarComponent = parser._calendarComponent const freeBusyComponent = calendarComponent.getFirstComponent('VFREEBUSY') const freeBusyComponent = calendarComponent.getFirstComponent('VFREEBUSY') if (!freeBusyComponent) { if (!freeBusyComponent) { logger.warn('no VFREEBUSY component found for URI ' + uri) return [] return [] } } Loading @@ -68,7 +72,20 @@ export default function(uri, calendarData, success, start, end, timezone) { end: freeBusyProperty.getFirstValue().end.getInTimezone(timezone).jsDate.toISOString(), end: freeBusyProperty.getFirstValue().end.getInTimezone(timezone).jsDate.toISOString(), resourceId: uri, resourceId: uri, display: 'background', display: 'background', backgroundColor: getColorForFBType(freeBusyProperty.type), // backgroundColor: getColorForFBType(freeBusyProperty.type), }) // Add an overlay for blocked slots events.push({ groupId: 'blocked-for-all', start: freeBusyProperty.getFirstValue().start.getInTimezone(timezone).jsDate.toISOString(), end: freeBusyProperty.getFirstValue().end.getInTimezone(timezone).jsDate.toISOString(), resourceIds, display: 'background', classNames: [ 'blocking-slot-free-busy' ] // backgroundColor: getColorForFBType('BUSY'), }) }) } } Loading Loading
css/freebusy.scss +5 −0 Original line number Original line Diff line number Diff line Loading @@ -27,6 +27,11 @@ opacity: .8; opacity: .8; } } .blocking-slot-free-busy { background: repeating-linear-gradient( 45deg, #606dbc, #606dbc 10px, #465298 10px, #465298 20px ); z-index: 2; } .blocking-event-free-busy { .blocking-event-free-busy { border-color: red; border-color: red; border-style: solid; border-style: solid; Loading
src/components/Editor/FreeBusy/FreeBusy.vue +2 −1 Original line number Original line Diff line number Diff line Loading @@ -142,7 +142,8 @@ export default { freeBusyEventSource( freeBusyEventSource( this._uid, this._uid, this.organizer.attendeeProperty, this.organizer.attendeeProperty, this.attendees.map((a) => a.attendeeProperty) this.attendees.map((a) => a.attendeeProperty), this.resources.map((resource) => resource.id) ), ), freeBusyFakeBlockingEventSource( freeBusyFakeBlockingEventSource( this._uid, this._uid, Loading
src/fullcalendar/eventSources/freeBusyEventSource.js +3 −2 Original line number Original line Diff line number Diff line Loading @@ -33,9 +33,10 @@ import logger from '../../utils/logger.js' * @param {String} id Identification for this source * @param {String} id Identification for this source * @param {AttendeeProperty} organizer The organizer of the event * @param {AttendeeProperty} organizer The organizer of the event * @param {AttendeeProperty[]} attendees Array of the event's attendees * @param {AttendeeProperty[]} attendees Array of the event's attendees * @param {string[]} resourceIds all resource IDs for the current free/busy data * @returns {{startEditable: boolean, resourceEditable: boolean, editable: boolean, id: string, durationEditable: boolean, events: events}} * @returns {{startEditable: boolean, resourceEditable: boolean, editable: boolean, id: string, durationEditable: boolean, events: events}} */ */ export default function(id, organizer, attendees) { export default function(id, organizer, attendees, resourceIds) { return { return { id: 'free-busy-event-source-' + id, id: 'free-busy-event-source-' + id, editable: false, editable: false, Loading Loading @@ -75,7 +76,7 @@ export default function(id, organizer, attendees) { } } const events = [] const events = [] for (const [uri, data] of Object.entries(freeBusyData)) { for (const [uri, data] of Object.entries(freeBusyData)) { events.push(...freeBusyEventSourceFunction(uri, data.calendarData, data.success, startDateTime, endDateTime, timezoneObject)) events.push(...freeBusyEventSourceFunction(uri, data.calendarData, data.success, startDateTime, endDateTime, timezoneObject, resourceIds)) } } console.debug(events) console.debug(events) Loading
src/fullcalendar/eventSources/freeBusyEventSourceFunction.js +19 −2 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import { getColorForFBType } from '../../utils/freebusy.js' import { getColorForFBType } from '../../utils/freebusy.js' import { getParserManager } from 'calendar-js' import { getParserManager } from 'calendar-js' import logger from '../../utils/logger' /** /** * Converts the response * Converts the response Loading @@ -32,10 +33,12 @@ import { getParserManager } from 'calendar-js' * @param {DateTimeValue} start The start of the fetched time-range * @param {DateTimeValue} start The start of the fetched time-range * @param {DateTimeValue} end The end of the fetched time-range * @param {DateTimeValue} end The end of the fetched time-range * @param {Timezone} timezone Timezone of user viewing data * @param {Timezone} timezone Timezone of user viewing data * @param {string[]} resourceIds all resource IDs for the current free/busy data * @returns {Object[]} * @returns {Object[]} */ */ export default function(uri, calendarData, success, start, end, timezone) { export default function(uri, calendarData, success, start, end, timezone, resourceIds) { if (!success) { if (!success) { logger.info('no free/busy info for URI ' + uri + ', falling back to unknown state') return [{ return [{ id: Math.random().toString(36).substring(7), id: Math.random().toString(36).substring(7), start: start.getInTimezone(timezone).jsDate.toISOString(), start: start.getInTimezone(timezone).jsDate.toISOString(), Loading @@ -56,6 +59,7 @@ export default function(uri, calendarData, success, start, end, timezone) { const calendarComponent = parser._calendarComponent const calendarComponent = parser._calendarComponent const freeBusyComponent = calendarComponent.getFirstComponent('VFREEBUSY') const freeBusyComponent = calendarComponent.getFirstComponent('VFREEBUSY') if (!freeBusyComponent) { if (!freeBusyComponent) { logger.warn('no VFREEBUSY component found for URI ' + uri) return [] return [] } } Loading @@ -68,7 +72,20 @@ export default function(uri, calendarData, success, start, end, timezone) { end: freeBusyProperty.getFirstValue().end.getInTimezone(timezone).jsDate.toISOString(), end: freeBusyProperty.getFirstValue().end.getInTimezone(timezone).jsDate.toISOString(), resourceId: uri, resourceId: uri, display: 'background', display: 'background', backgroundColor: getColorForFBType(freeBusyProperty.type), // backgroundColor: getColorForFBType(freeBusyProperty.type), }) // Add an overlay for blocked slots events.push({ groupId: 'blocked-for-all', start: freeBusyProperty.getFirstValue().start.getInTimezone(timezone).jsDate.toISOString(), end: freeBusyProperty.getFirstValue().end.getInTimezone(timezone).jsDate.toISOString(), resourceIds, display: 'background', classNames: [ 'blocking-slot-free-busy' ] // backgroundColor: getColorForFBType('BUSY'), }) }) } } Loading