GUACAMOLE-526: Move handling of request error notification to guacNotification, resolving circular dependency.

This commit is contained in:
Michael Jumper
2018-04-26 22:28:18 -07:00
parent 266b445c21
commit ae6b5fc8bb
10 changed files with 26 additions and 41 deletions

View File

@@ -22,6 +22,5 @@
* Guacamole web application.
*/
angular.module('rest', [
'auth',
'notification'
'auth'
]);

View File

@@ -25,9 +25,8 @@ angular.module('rest').factory('requestService', ['$injector',
function requestService($injector) {
// Required services
var $http = $injector.get('$http');
var $log = $injector.get('$log');
var guacNotification = $injector.get('guacNotification');
var $http = $injector.get('$http');
var $log = $injector.get('$log');
// Required types
var Error = $injector.get('Error');
@@ -116,19 +115,6 @@ angular.module('rest').factory('requestService', ['$injector',
$log.warn(error.type, error.message || error.translatableMessage);
});
/**
* Promise error callback which displays a modal notification for all
* rejections due to REST errors. The message displayed to the user within
* the notification is provided by the contents of the @link{Error} object
* within the REST response. All other rejections, such as those due to
* JavaScript errors, are logged to the browser console without displaying
* any notification.
*
* @constant
* @type Function
*/
service.SHOW_NOTIFICATION = service.createErrorCallback(guacNotification.showRequestError);
return service;
}]);