Repository: guacamole-client Updated Branches: refs/heads/staging/1.0.0 c36d33321 -> 402ddb577
GUACAMOLE-220: Hide identifier set editor if there are no identifiers to edit. Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/00591217 Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/00591217 Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/00591217 Branch: refs/heads/staging/1.0.0 Commit: 0059121716c869e34a8089ada3069ad67ffb6ee7 Parents: 229b0de Author: Michael Jumper <mjum...@apache.org> Authored: Tue Aug 7 12:25:55 2018 -0700 Committer: Michael Jumper <mjum...@apache.org> Committed: Wed Aug 8 09:00:06 2018 -0700 ---------------------------------------------------------------------- .../app/manage/directives/identifierSetEditor.js | 14 ++++++++++++++ .../app/manage/templates/identifierSetEditor.html | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/00591217/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js ---------------------------------------------------------------------- diff --git a/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js b/guacamole/src/main/webapp/app/manage/directives/identifierSetEditor.js index 82f1109..4240901 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; http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/00591217/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html ---------------------------------------------------------------------- diff --git a/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html b/guacamole/src/main/webapp/app/manage/templates/identifierSetEditor.html index 838decf..7f66088 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 @@ -<div class="related-objects"> +<div class="related-objects" ng-hide="isEmpty()"> <div class="header"> <h2>{{ header | translate }}</h2> <div class="filter">