GUAC-1334: Fix the horribly-broken location chooser (not updated to use updated guacGroupList).

This commit is contained in:
Michael Jumper
2015-09-08 21:33:43 -07:00
parent 7148cc93b8
commit 45c6d1d419
6 changed files with 54 additions and 29 deletions

View File

@@ -33,6 +33,14 @@ angular.module('manage').directive('locationChooser', [function locationChooser(
scope: {
/**
* The identifier of the data source from which the given root
* connection group was retrieved.
*
* @type String
*/
dataSource : '=',
/**
* The root connection group of the connection group hierarchy to
* display.
@@ -105,6 +113,19 @@ angular.module('manage').directive('locationChooser', [function locationChooser(
$scope.menuOpen = !$scope.menuOpen;
};
// Update the root group map when data source or root group change
$scope.$watchGroup(['dataSource', 'rootGroup'], function updateRootGroups() {
// Abort if the root group is not set
if (!$scope.dataSource || !$scope.rootGroup)
return null;
// Wrap root group in map
$scope.rootGroups = {};
$scope.rootGroups[$scope.dataSource] = $scope.rootGroup;
});
// Expose selection function to group list template
$scope.groupListContext = {