fix(calendar(js)): fix refresh of attendees freebusy information

* refresh template with freebusy information of organizer
* fix event coverage in freebusy timeline when event spans a day

Related to bug #4899
pull/265/head
Francis Lachapelle 2019-12-03 10:34:47 -05:00
parent 3bb40e4024
commit fbdabc9615
3 changed files with 10 additions and 4 deletions

View File

@ -240,7 +240,9 @@
var index = _.findIndex(this.component.attendees, function(currentAttendee) {
return currentAttendee.email == attendee.email;
});
this.component.attendees.splice(index, 1);
if (index > -1)
this.component.attendees.splice(index, 1);
delete this.$futureFreebusyData[attendee.uid];
};
/**
@ -270,7 +272,9 @@
roundedStart.setMinutes(15*startQuarter);
roundedEnd.setMinutes(15*endQuarter);
_.forEach(roundedStart.daysUpTo(roundedEnd), function(date, index) {
_.forEach(roundedStart.beginOfDay().daysUpTo(roundedEnd.beginOfDay()), function(date, index) {
if (date < roundedStart)
date = new Date(roundedStart.getTime());
var currentDay = date.getDate(),
dayKey = date.getDayString(),
hourKey;

View File

@ -358,8 +358,10 @@
this.removeAttendee = function (attendee, form) {
this.component.$attendees.remove(attendee);
if (this.component.$attendees.getLength() === 0)
if (this.component.$attendees.getLength() === 0) {
this.showAttendeesEditor = false;
this.component.$attendees.remove(this.component.organizer);
}
form.$setDirty();
};

View File

@ -34,7 +34,7 @@
return $ctrl.component? {
start: $ctrl.component.start,
end: $ctrl.component.end,
attendees: _.map($ctrl.component.attendees, 'email')
attendees: _.keys($ctrl.component.$attendees.$futureFreebusyData)
} : null;
},
function(newAttrs, oldAttrs) {