(js) Fix Resource conflict error handling

This commit is contained in:
Francis Lachapelle
2016-10-28 11:47:40 -04:00
parent f25c26b7bd
commit 5208e46d10
4 changed files with 10 additions and 8 deletions

1
NEWS
View File

@@ -19,6 +19,7 @@ Bug fixes
- [web] improved validation of mail account delegators
- [web] fixed auto-completion of list members (#3870)
- [web] added missing options to subscribed addressbooks (#3850)
- [web] fixed resource conflict error handling (403 vs 409 HTTP code)
- [eas] improve handling of email folders without a parent
- [eas] never send IMIP reply when the "initiator" is Outlook 2013/2016
- [core] only consider SMTP addresses for AD's proxyAddresses (#3842)

View File

@@ -51,8 +51,9 @@
}
angular.module('SOGo.SchedulerUI')
.value('CalendarSettings', {
EventDragDayLength: 24 * 4, // hour quarters
EventDragHorizontalOffset: 3 // pixels
EventDragDayLength: 24 * 4, // hour quarters
EventDragHorizontalOffset: 3, // pixels
ConflictHTTPErrorCode: 409
})
.factory('Calendar', Calendar.$factory);

View File

@@ -6,8 +6,8 @@
/**
* @ngInject
*/
CalendarListController.$inject = ['$rootScope', '$scope', '$timeout', '$state', '$mdDialog', 'sgHotkeys', 'sgFocus', 'Dialog', 'Preferences', 'Calendar', 'Component'];
function CalendarListController($rootScope, $scope, $timeout, $state, $mdDialog, sgHotkeys, focus, Dialog, Preferences, Calendar, Component) {
CalendarListController.$inject = ['$rootScope', '$scope', '$timeout', '$state', '$mdDialog', 'sgHotkeys', 'sgFocus', 'Dialog', 'Preferences', 'CalendarSettings', 'Calendar', 'Component'];
function CalendarListController($rootScope, $scope, $timeout, $state, $mdDialog, sgHotkeys, focus, Dialog, Preferences, CalendarSettings, Calendar, Component) {
var vm = this, hotkeys = [];
vm.component = Component;
@@ -291,7 +291,7 @@
}
function onComponentAdjustError(response, component, params) {
if (response.status == 403 &&
if (response.status == CalendarSettings.ConflictHTTPErrorCode &&
response.data && response.data.message && angular.isObject(response.data.message)) {
$mdDialog.show({
parent: angular.element(document.body),

View File

@@ -209,8 +209,8 @@
/**
* @ngInject
*/
ComponentEditorController.$inject = ['$rootScope', '$scope', '$log', '$timeout', '$mdDialog', 'User', 'Calendar', 'Component', 'AddressBook', 'Card', 'Alarm', 'stateComponent'];
function ComponentEditorController($rootScope, $scope, $log, $timeout, $mdDialog, User, Calendar, Component, AddressBook, Card, Alarm, stateComponent) {
ComponentEditorController.$inject = ['$rootScope', '$scope', '$log', '$timeout', '$mdDialog', 'User', 'CalendarSettings', 'Calendar', 'Component', 'AddressBook', 'Card', 'Alarm', 'stateComponent'];
function ComponentEditorController($rootScope, $scope, $log, $timeout, $mdDialog, User, CalendarSettings, Calendar, Component, AddressBook, Card, Alarm, stateComponent) {
var vm = this, component, oldStartDate, oldEndDate, oldDueDate;
vm.service = Calendar;
@@ -306,7 +306,7 @@
$mdDialog.hide();
Alarm.getAlarms();
}, function(response) {
if (response.status == 403 &&
if (response.status == CalendarSettings.ConflictHTTPErrorCode &&
response.data && response.data.message &&
angular.isObject(response.data.message))
vm.attendeeConflictError = response.data.message;