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/05/04 08:27:09 UTC

[15/21] guacamole-client git commit: GUACAMOLE-220: Pull primary connection for new sharing profiles.

GUACAMOLE-220: Pull primary connection for new sharing profiles.


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

Branch: refs/heads/master
Commit: f5f516d82a2ebcee654185acb38f798f71a28c81
Parents: 5028d85
Author: Michael Jumper <mj...@apache.org>
Authored: Thu May 3 23:16:14 2018 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Thu May 3 23:16:14 2018 -0700

----------------------------------------------------------------------
 .../controllers/manageSharingProfileController.js  | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/f5f516d8/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js b/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js
index 8b57182..61bfbe9 100644
--- a/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js
+++ b/guacamole/src/main/webapp/app/manage/controllers/manageSharingProfileController.js
@@ -205,11 +205,15 @@ angular.module('manage').controller('manageSharingProfileController', ['$scope',
      * Loads skeleton sharing profile data, preparing the interface for
      * creating a new sharing profile.
      *
+     * @param {String} dataSource
+     *     The unique identifier of the data source containing the sharing
+     *     profile to be created.
+     *
      * @returns {Promise}
      *     A promise which is resolved when the interface has been prepared for
      *     creating a new sharing profile.
      */
-    var loadSkeletonSharingProfile = function loadSkeletonSharingProfile() {
+    var loadSkeletonSharingProfile = function loadSkeletonSharingProfile(dataSource) {
 
         // Use skeleton sharing profile object with no associated parameters
         $scope.sharingProfile = new SharingProfile({
@@ -217,7 +221,14 @@ angular.module('manage').controller('manageSharingProfileController', ['$scope',
         });
         $scope.parameters = {};
 
-        return $q.resolve();
+        // Load connection object for associated primary connection
+        return connectionService.getConnection(
+            dataSource,
+            $scope.sharingProfile.primaryConnectionIdentifier
+        )
+        .then(function connectionRetrieved(connection) {
+            $scope.primaryConnection = connection;
+        });
 
     };
 
@@ -243,7 +254,7 @@ angular.module('manage').controller('manageSharingProfileController', ['$scope',
 
         // If we are creating a new sharing profile, populate skeleton sharing
         // profile data
-        return loadSkeletonSharingProfile();
+        return loadSkeletonSharingProfile($scope.selectedDataSource);
 
     };