mailbox: add checkbox for pop3

This commit is contained in:
Girish Ramakrishnan
2021-10-08 10:20:17 -07:00
parent 355a4df65f
commit 0f4e71d478
4 changed files with 19 additions and 9 deletions
+1 -7
View File
@@ -2570,13 +2570,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.updateMailbox = function (domain, name, ownerId, ownerType, active, callback) {
var data = {
ownerId: ownerId,
ownerType: ownerType,
active: active
};
Client.prototype.updateMailbox = function (domain, name, data, callback) {
post('/api/v1/mail/' + domain + '/mailboxes/' + name, data, null, function (error, data, status) {
if (error) return callback(error);
if (status !== 204) return callback(new ClientError(status, data));
+2 -1
View File
@@ -1180,7 +1180,8 @@
"activeCheckbox": "Mailing list is active"
},
"updateMailboxDialog": {
"activeCheckbox": "Mailbox is active"
"activeCheckbox": "Mailbox is active",
"enablePop3": "Enable POP3 access"
}
},
"app": {
+6
View File
@@ -152,6 +152,12 @@
</div>
</div>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="mailboxes.edit.enablePop3"> {{ 'email.updateMailboxDialog.enablePop3' | tr }}</input>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="mailboxes.edit.active"> {{ 'email.updateMailboxDialog.activeCheckbox' | tr }}</input>
+10 -1
View File
@@ -387,6 +387,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
incomingDomains: [],
aliases: [],
active: true,
enablePop3: false,
addAlias: function (event) {
event.preventDefault();
@@ -407,6 +408,7 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
$scope.mailboxes.edit.owner = mailbox.owner; // this can be null if mailbox had no owner
$scope.mailboxes.edit.aliases = angular.copy(mailbox.aliases, []);
$scope.mailboxes.edit.active = mailbox.active;
$scope.mailboxes.edit.enablePop3 = mailbox.enablePop3;
$('#mailboxEditModal').modal('show');
},
@@ -414,8 +416,15 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
submit: function () {
$scope.mailboxes.edit.busy = true;
var data = {
ownerId: $scope.mailboxes.edit.owner.id,
ownerType: $scope.mailboxes.edit.owner.type,
active: $scope.mailboxes.edit.active,
enablePop3: $scope.mailboxes.edit.enablePop3
};
// $scope.mailboxes.edit.owner is expected to be validated by the UI
Client.updateMailbox($scope.domain.domain, $scope.mailboxes.edit.name, $scope.mailboxes.edit.owner.id, $scope.mailboxes.edit.owner.type, $scope.mailboxes.edit.active, function (error) {
Client.updateMailbox($scope.domain.domain, $scope.mailboxes.edit.name, data, function (error) {
if (error) {
$scope.mailboxes.edit.error = error;
$scope.mailboxes.edit.busy = false;