From 0059121716c869e34a8089ada3069ad67ffb6ee7 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 7 Aug 2018 12:25:55 -0700 Subject: [PATCH] GUACAMOLE-220: Hide identifier set editor if there are no identifiers to edit. --- .../app/manage/directives/identifierSetEditor.js | 14 ++++++++++++++ .../app/manage/templates/identifierSetEditor.html | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js b/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js index 82f110915..4240901b9 100644 --- a/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js +++ b/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js @@ -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; diff --git a/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html b/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html index 838decf03..7f660883d 100644 --- a/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html +++ b/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html @@ -1,4 +1,4 @@ -