GUACAMOLE-220: Select from multiple datasources deterministically.

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

Branch: refs/heads/master
Commit: 6aaef7685f8b455bc4b7854d8aef8617a3d7b4f1
Parents: 8ad3f25
Author: Michael Jumper <mjum...@apache.org>
Authored: Wed Aug 8 22:56:07 2018 -0700
Committer: Michael Jumper <mjum...@apache.org>
Committed: Thu Aug 9 10:46:06 2018 -0700

----------------------------------------------------------------------
 .../src/main/webapp/app/manage/directives/dataSourceTabs.js     | 5 ++++-
 .../webapp/app/settings/directives/guacSettingsUserGroups.js    | 4 +++-
 .../main/webapp/app/settings/directives/guacSettingsUsers.js    | 4 +++-
 3 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/6aaef768/guacamole/src/main/webapp/app/manage/directives/dataSourceTabs.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/manage/directives/dataSourceTabs.js 
b/guacamole/src/main/webapp/app/manage/directives/dataSourceTabs.js
index cf7068f..627197b 100644
--- a/guacamole/src/main/webapp/app/manage/directives/dataSourceTabs.js
+++ b/guacamole/src/main/webapp/app/manage/directives/dataSourceTabs.js
@@ -76,9 +76,12 @@ angular.module('manage').directive('dataSourceTabs', 
['$injector',
         $scope.$watch('permissions', function permissionsChanged(permissions) {
 
             $scope.pages = [];
-            angular.forEach(permissions, function 
addDataSourcePage(managementPermissions, dataSource) {
+
+            var dataSources = _.keys($scope.permissions).sort();
+            angular.forEach(dataSources, function 
addDataSourcePage(dataSource) {
 
                 // Determine whether data source contains this object
+                var managementPermissions = permissions[dataSource];
                 var exists = !!managementPermissions.identifier;
 
                 // Data source is not relevant if the associated object does 
not

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/6aaef768/guacamole/src/main/webapp/app/settings/directives/guacSettingsUserGroups.js
----------------------------------------------------------------------
diff --git 
a/guacamole/src/main/webapp/app/settings/directives/guacSettingsUserGroups.js 
b/guacamole/src/main/webapp/app/settings/directives/guacSettingsUserGroups.js
index 5d45bc1..a8f2dd3 100644
--- 
a/guacamole/src/main/webapp/app/settings/directives/guacSettingsUserGroups.js
+++ 
b/guacamole/src/main/webapp/app/settings/directives/guacSettingsUserGroups.js
@@ -119,9 +119,11 @@ 
angular.module('settings').directive('guacSettingsUserGroups', ['$injector',
                 return null;
 
             // For each data source
-            for (var dataSource in permissions) {
+            var dataSources = _.keys(permissions).sort();
+            for (var i = 0; i < dataSources.length; i++) {
 
                 // Retrieve corresponding permission set
+                var dataSource = dataSources[i];
                 var permissionSet = permissions[dataSource];
 
                 // Can create user groups if adminstrator or have explicit 
permission

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/6aaef768/guacamole/src/main/webapp/app/settings/directives/guacSettingsUsers.js
----------------------------------------------------------------------
diff --git 
a/guacamole/src/main/webapp/app/settings/directives/guacSettingsUsers.js 
b/guacamole/src/main/webapp/app/settings/directives/guacSettingsUsers.js
index 870a862..4adf04e 100644
--- a/guacamole/src/main/webapp/app/settings/directives/guacSettingsUsers.js
+++ b/guacamole/src/main/webapp/app/settings/directives/guacSettingsUsers.js
@@ -150,9 +150,11 @@ angular.module('settings').directive('guacSettingsUsers', 
[function guacSettings
                     return null;
 
                 // For each data source
-                for (var dataSource in $scope.permissions) {
+                var dataSources = _.keys($scope.permissions).sort();
+                for (var i = 0; i < dataSources.length; i++) {
 
                     // Retrieve corresponding permission set
+                    var dataSource = dataSources[i];
                     var permissionSet = $scope.permissions[dataSource];
 
                     // Can create users if adminstrator or have explicit 
permission

Reply via email to