(js) Enable new calendar subscriptions by default
parent
9e152adc7d
commit
5aa19ebfb7
3
NEWS
3
NEWS
|
@ -43,6 +43,9 @@ Bug fixes
|
||||||
- [web] fixed unseen count retrieval of nested IMAP folders
|
- [web] fixed unseen count retrieval of nested IMAP folders
|
||||||
- [web] properly extract the mail column values from an SQL contacts source (#3544)
|
- [web] properly extract the mail column values from an SQL contacts source (#3544)
|
||||||
- [web] fixed incorrect date formatting when timezone was after UTC+0 (#3481, #3494)
|
- [web] fixed incorrect date formatting when timezone was after UTC+0 (#3481, #3494)
|
||||||
|
- [web] replaced checkboxes in menu by a custom checkmark (#3557)
|
||||||
|
- [web] fixed attachments display when forwarding a message (#3560)
|
||||||
|
- [web] activate new calendar subscriptions by default
|
||||||
- [eas] allow EAS attachments get on 2nd-level mailboxes (#3505)
|
- [eas] allow EAS attachments get on 2nd-level mailboxes (#3505)
|
||||||
- [eas] fix EAS bday shift (#3518)
|
- [eas] fix EAS bday shift (#3518)
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@
|
||||||
Calendar.$subscribe = function(uid, path) {
|
Calendar.$subscribe = function(uid, path) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
return Calendar.$$resource.userResource(uid).fetch(path, 'subscribe').then(function(calendarData) {
|
return Calendar.$$resource.userResource(uid).fetch(path, 'subscribe').then(function(calendarData) {
|
||||||
var calendar = new Calendar(calendarData);
|
var calendar = new Calendar(angular.extend({ active: 1 }, calendarData));
|
||||||
if (!_.find(_this.$subscriptions, function(o) {
|
if (!_.find(_this.$subscriptions, function(o) {
|
||||||
return o.id == calendarData.id;
|
return o.id == calendarData.id;
|
||||||
})) {
|
})) {
|
||||||
|
|
|
@ -48,17 +48,27 @@
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
function(newList, oldList) {
|
function(newList, oldList) {
|
||||||
|
var commonList, ids, promises;
|
||||||
|
|
||||||
// Identify which calendar has changed
|
// Identify which calendar has changed
|
||||||
var ids = _.map(_.filter(newList, function(o, i) { return !_.isEqual(o, oldList[i]); }), 'id');
|
commonList = _.intersectionBy(newList, oldList, 'id');
|
||||||
|
ids = _.map(_.filter(commonList, function(o) {
|
||||||
|
var oldObject = _.find(oldList, { id: o.id });
|
||||||
|
return !_.isEqual(o, oldObject);
|
||||||
|
}), 'id');
|
||||||
|
promises = [];
|
||||||
|
|
||||||
if (ids.length > 0) {
|
if (ids.length > 0) {
|
||||||
$log.debug(ids.join(', ') + ' changed');
|
$log.debug(ids.join(', ') + ' changed');
|
||||||
_.forEach(ids, function(id) {
|
_.forEach(ids, function(id) {
|
||||||
var calendar = Calendar.$get(id);
|
var calendar = Calendar.$get(id);
|
||||||
calendar.$setActivation().then(function() {
|
promises.push(calendar.$setActivation());
|
||||||
$rootScope.$emit('calendars:list');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (commonList.length > 0)
|
||||||
|
Calendar.$q.all(promises).then(function() {
|
||||||
|
$rootScope.$emit('calendars:list');
|
||||||
|
});
|
||||||
},
|
},
|
||||||
true // compare for object equality
|
true // compare for object equality
|
||||||
);
|
);
|
||||||
|
@ -91,9 +101,7 @@
|
||||||
if (folder.isSubscription) {
|
if (folder.isSubscription) {
|
||||||
// Unsubscribe without confirmation
|
// Unsubscribe without confirmation
|
||||||
folder.$delete()
|
folder.$delete()
|
||||||
.then(function() {
|
.catch(function(data, status) {
|
||||||
$rootScope.$emit('calendars:list');
|
|
||||||
}, function(data, status) {
|
|
||||||
Dialog.alert(l('An error occured while deleting the calendar "%{0}".', folder.name),
|
Dialog.alert(l('An error occured while deleting the calendar "%{0}".', folder.name),
|
||||||
l(data.error));
|
l(data.error));
|
||||||
});
|
});
|
||||||
|
@ -103,9 +111,7 @@
|
||||||
{ ok: l('Delete') })
|
{ ok: l('Delete') })
|
||||||
.then(function() {
|
.then(function() {
|
||||||
folder.$delete()
|
folder.$delete()
|
||||||
.then(function() {
|
.catch(function(data, status) {
|
||||||
$rootScope.$emit('calendars:list');
|
|
||||||
}, function(data, status) {
|
|
||||||
Dialog.alert(l('An error occured while deleting the calendar "%{0}".', folder.name),
|
Dialog.alert(l('An error occured while deleting the calendar "%{0}".', folder.name),
|
||||||
l(data.error));
|
l(data.error));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue