add ui to enable/disable mailbox sharing
This commit is contained in:
@@ -154,6 +154,48 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
}
|
||||
};
|
||||
|
||||
$scope.mailboxSharing = {
|
||||
busy: false,
|
||||
error: null,
|
||||
size: 0,
|
||||
enable: false,
|
||||
enabled: false,
|
||||
|
||||
refresh: function () {
|
||||
Client.getMailboxSharing(function (error, enabled) {
|
||||
if (error) return console.error('Failed to get mailbox sharing', error);
|
||||
|
||||
$scope.mailboxSharing.enabled = enabled;
|
||||
});
|
||||
},
|
||||
|
||||
show: function() {
|
||||
$scope.mailboxSharing.busy = false;
|
||||
$scope.mailboxSharing.error = null;
|
||||
$scope.mailboxSharing.enable = $scope.mailboxSharing.enabled;
|
||||
|
||||
$scope.mailboxSharingChangeForm.$setUntouched();
|
||||
$scope.mailboxSharingChangeForm.$setPristine();
|
||||
|
||||
$('#mailboxSharingChangeModal').modal('show');
|
||||
},
|
||||
|
||||
submit: function () {
|
||||
$scope.mailboxSharing.busy = true;
|
||||
|
||||
Client.setMailboxSharing($scope.mailboxSharing.enable, function (error) {
|
||||
$scope.mailboxSharing.busy = false;
|
||||
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.mailboxSharing.enabled = $scope.mailboxSharing.enable;
|
||||
|
||||
$('#mailboxSharingChangeModal').modal('hide');
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$scope.solrConfig = {
|
||||
busy: false,
|
||||
error: {},
|
||||
@@ -412,6 +454,7 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
|
||||
if ($scope.user.isAtLeastOwner) {
|
||||
$scope.mailLocation.refresh();
|
||||
$scope.maxEmailSize.refresh();
|
||||
$scope.mailboxSharing.refresh();
|
||||
$scope.spamConfig.refresh();
|
||||
$scope.solrConfig.refresh();
|
||||
$scope.acl.refresh();
|
||||
|
||||
Reference in New Issue
Block a user