GUACAMOLE-220: Hide identifier set editor if there are no identifiers to edit.

This commit is contained in:
Michael Jumper
2018-08-07 12:25:55 -07:00
parent 229b0dee48
commit 0059121716
2 changed files with 15 additions and 1 deletions

View File

@@ -260,6 +260,20 @@ angular.module('manage').directive('identifierSetEditor', ['$injector',
$scope.expanded = false;
};
/**
* Returns whether there are absolutely no identifiers that can be
* managed using this editor. If true, the editor is effectively
* useless, as there is nothing whatsoever to display.
*
* @returns {Boolean}
* true if there are no identifiers that can be managed using this
* editor, false otherwise.
*/
$scope.isEmpty = function isEmpty() {
return _.isEmpty($scope.identifiers)
&& _.isEmpty($scope.identifiersAvailable);
};
}];
return directive;

View File

@@ -1,4 +1,4 @@
<div class="related-objects">
<div class="related-objects" ng-hide="isEmpty()">
<div class="header">
<h2>{{ header | translate }}</h2>
<div class="filter">