fix(calendar(js)): don't handle attendees for tasks

pull/285/head
Francis Lachapelle 2020-07-17 13:58:32 -04:00
parent ed300409b7
commit ff3e83fd43
2 changed files with 15 additions and 9 deletions

View File

@ -210,19 +210,21 @@
var vm = this, component, oldStartDate, oldEndDate, oldDueDate, dayStartTime, dayEndTime;
this.$onInit = function () {
stateComponent.initAttendees();
this.service = Calendar;
this.component = stateComponent;
this.categories = {};
this.showRecurrenceEditor = this.component.$hasCustomRepeat;
this.showAttendeesEditor = this.component.attendees && this.component.attendees.length;
//this.searchText = null;
this.attendeeConflictError = false;
this.attendeesEditor = {
days: this.component.$attendees.$days,
hours: getHours(),
containerElement: $element[0].querySelector('#freebusy')
};
if (this.component.type == 'appointment') {
this.component.initAttendees();
this.attendeeConflictError = false;
this.attendeesEditor = {
days: this.component.$attendees.$days,
hours: getHours(),
containerElement: $element[0].querySelector('#freebusy')
};
}
if (this.component.start) {
oldStartDate = new Date(this.component.start.getTime());
@ -398,7 +400,11 @@
};
function findSlot(direction) {
vm.adjustStartTime();
vm.adjustEndTime();
vm.component.$attendees.findSlot(direction).then(function () {
vm.startTime = new Date(vm.component.start.getTime());
vm.endTime = new Date(vm.component.end.getTime());
}).catch(function (err) {
vm.component.start = new Date(vm.component.start.getTime() + 1); // trigger update in sgFreeBusy
$timeout(scrollToStart);

View File

@ -38,7 +38,7 @@
} : null;
},
function(newAttrs, oldAttrs) {
if (newAttrs && newAttrs.attendees) {
if (newAttrs && newAttrs.attendees && newAttrs.attendees.length) {
// Attendees have changed
$q.all(_.values($ctrl.component.$attendees.$futureFreebusyData)).then(function() {
$ctrl.onUpdate();