(Calendar) Button to expand invited LDAP groups

Fixes #2506
This commit is contained in:
Francis Lachapelle
2019-08-27 16:33:10 -04:00
parent 9db406a18b
commit 8822c8cd07
9 changed files with 123 additions and 16 deletions
@@ -181,6 +181,12 @@
if (!_.find(this.attendees, function(o) {
return o.email == attendee.email;
})) {
if (card.$isList()) {
// LDAP list -- preload members
card.$members().then(function(members) {
attendee.members = members;
});
}
attendee.image = Attendees.$gravatar(attendee.email, 32);
if (this.component.attendees)
this.component.attendees.push(attendee);
@@ -325,11 +325,26 @@
};
function scrollToStart() {
var dayElement = $element[0].querySelector('#freebusy_day_' + vm.component.start.getDayString());
var scrollLeft = dayElement.offsetLeft - vm.attendeesEditor.containerElement.offsetLeft;
vm.attendeesEditor.containerElement.scrollLeft = scrollLeft;
var dayElement, scrollLeft;
if (!vm.attendeesEditor.containerElement) {
vm.attendeesEditor.containerElement = $element[0].querySelector('#freebusy');
}
if (vm.attendeesEditor.containerElement) {
dayElement = $element[0].querySelector('#freebusy_day_' + vm.component.start.getDayString());
scrollLeft = dayElement.offsetLeft - vm.attendeesEditor.containerElement.offsetLeft;
vm.attendeesEditor.containerElement.scrollLeft = scrollLeft;
}
}
this.expandAttendee = function (attendee) {
if (attendee.members.length > 0) {
this.component.$attendees.remove(attendee);
_.forEach(attendee.members, function (member) {
vm.component.$attendees.add(member);
});
}
};
this.removeAttendee = function (attendee, form) {
this.component.$attendees.remove(attendee);
if (this.component.$attendees.getLength() === 0)
@@ -31,11 +31,15 @@
$scope.$watch(
function() {
return $ctrl.component? [ _.pick($ctrl.component, watchedAttrs) ] : null;
return $ctrl.component? {
start: $ctrl.component.start,
end: $ctrl.component.end,
attendees: _.map($ctrl.component.attendees, 'email')
} : null;
},
function(newId, oldId) {
if ($ctrl.component) {
// Component has changed
function(newAttrs, oldAttrs) {
if (newAttrs.attendees) {
// Attendees have changed
$q.all(_.values($ctrl.component.$attendees.$futureFreebusyData)).then(function() {
$ctrl.onUpdate();
});
@@ -76,7 +76,7 @@
});
this.parentController.onUpdate = function () {
var freebusys = $ctrl.attendee.freebusy[$ctrl.day];
var freebusys = $ctrl.attendee.uid ? $ctrl.attendee.freebusy[$ctrl.day] : null;
if (!$ctrl.attendee.uid) {
_.forEach(hours, function(div) {
@@ -92,7 +92,7 @@
} else {
quarters[index].classList.remove('event');
}
if (freebusys[hour][quarter]) {
if (freebusys && freebusys[hour][quarter]) {
busys[index].classList.remove('ng-hide');
} else {
busys[index].classList.add('ng-hide');