You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2018/04/29 20:58:47 UTC

[05/19] guacamole-client git commit: GUACAMOLE-526: Remove unused (and wrong!) getAllActiveConnections() function. Remove now-unnecessary injection of $q.

GUACAMOLE-526: Remove unused (and wrong!) getAllActiveConnections() function. Remove now-unnecessary injection of $q.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/73eb25f3
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/73eb25f3
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/73eb25f3

Branch: refs/heads/master
Commit: 73eb25f3118d36d4b80f5ac58a01b15b77980e00
Parents: bba01bd
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Apr 24 15:30:58 2018 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Thu Apr 26 18:51:46 2018 -0700

----------------------------------------------------------------------
 .../rest/services/activeConnectionService.js    | 63 --------------------
 1 file changed, 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/73eb25f3/guacamole/src/main/webapp/app/rest/services/activeConnectionService.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/rest/services/activeConnectionService.js b/guacamole/src/main/webapp/app/rest/services/activeConnectionService.js
index b548c86..5354bc1 100644
--- a/guacamole/src/main/webapp/app/rest/services/activeConnectionService.js
+++ b/guacamole/src/main/webapp/app/rest/services/activeConnectionService.js
@@ -25,7 +25,6 @@ angular.module('rest').factory('activeConnectionService', ['$injector',
 
     // Required services
     var requestService        = $injector.get('requestService');
-    var $q                    = $injector.get('$q');
     var authenticationService = $injector.get('authenticationService');
 
     var service = {};
@@ -67,68 +66,6 @@ angular.module('rest').factory('activeConnectionService', ['$injector',
     };
 
     /**
-     * Returns a promise which resolves with all active connections accessible
-     * by the current user, as a map of @link{ActiveConnection} maps, as would
-     * be returned by getActiveConnections(), grouped by the identifier of
-     * their corresponding data source. All given data sources are queried. If
-     * an error occurs while retrieving any ActiveConnection map, the promise
-     * will be rejected.
-     *
-     * @param {String[]} dataSources
-     *     The unique identifier of the data sources containing the active
-     *     connections to be retrieved. These identifiers correspond to
-     *     AuthenticationProviders within the Guacamole web application.
-     *
-     * @param {String[]} [permissionTypes]
-     *     The set of permissions to filter with. A user must have one or more
-     *     of these permissions for an active connection to appear in the
-     *     result.  If null, no filtering will be performed. Valid values are
-     *     listed within PermissionSet.ObjectType.
-     *
-     * @returns {Promise.<Object.<String, Object.<String, ActiveConnection>>>}
-     *     A promise which resolves with all active connections available to
-     *     the current user, as a map of ActiveConnection maps, as would be
-     *     returned by getActiveConnections(), grouped by the identifier of
-     *     their corresponding data source.
-     */
-    service.getAllActiveConnections = function getAllActiveConnections(dataSources, permissionTypes) {
-
-        var deferred = $q.defer();
-
-        var activeConnectionRequests = [];
-        var activeConnectionMaps = {};
-
-        // Retrieve all active connections from all data sources
-        angular.forEach(dataSources, function retrieveActiveConnections(dataSource) {
-            activeConnectionRequests.push(
-                service.getActiveConnections(dataSource, permissionTypes)
-                .then(function activeConnectionsRetrieved(activeConnections) {
-                    activeConnectionMaps[dataSource] = activeConnections;
-                })
-            );
-        });
-
-        // Resolve when all requests are completed
-        $q.all(activeConnectionRequests)
-        .then(
-
-            // All requests completed successfully
-            function allActiveConnectionsRetrieved() {
-                deferred.resolve(userArrays);
-            },
-
-            // At least one request failed
-            function activeConnectionRetrievalFailed(e) {
-                deferred.reject(e);
-            }
-
-        );
-
-        return deferred.promise;
-
-    };
-
-    /**
      * Makes a request to the REST API to delete the active connections having
      * the given identifiers, effectively disconnecting them, returning a
      * promise that can be used for processing the results of the call.