From 72abd80f08df36d71b2a92474f06b5c0d4704e0f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 20 Apr 2015 13:11:21 -0400 Subject: [PATCH] Make robot accounts filter rather than display the dialog when "showRobot" is passed to the manager --- static/css/directives/ui/filter-box.css | 17 +++++++++++++++++ static/directives/filter-box.html | 6 ++++++ static/directives/robots-manager.html | 5 ++--- static/js/directives/ui/filter-box.js | 21 +++++++++++++++++++++ static/js/directives/ui/robots-manager.js | 2 +- 5 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 static/css/directives/ui/filter-box.css create mode 100644 static/directives/filter-box.html create mode 100644 static/js/directives/ui/filter-box.js diff --git a/static/css/directives/ui/filter-box.css b/static/css/directives/ui/filter-box.css new file mode 100644 index 000000000..89ae1eadf --- /dev/null +++ b/static/css/directives/ui/filter-box.css @@ -0,0 +1,17 @@ +.filter-box { + display: block; + text-align: right; + margin-top: 20px; + margin-bottom: 26px; +} + +.filter-box .form-control { + max-width: 300px; + display: inline-block; +} + +.filter-box .filter-message { + display: inline-block; + margin-right: 10px; + color: #ccc; +} \ No newline at end of file diff --git a/static/directives/filter-box.html b/static/directives/filter-box.html new file mode 100644 index 000000000..ff2f4119d --- /dev/null +++ b/static/directives/filter-box.html @@ -0,0 +1,6 @@ +
+ + Showing {{ (collection|filter:filterModel).length }} of {{ collection.length }} {{ filterName }} + + +
\ No newline at end of file diff --git a/static/directives/robots-manager.html b/static/directives/robots-manager.html index 7647d78a3..4337e4f5a 100644 --- a/static/directives/robots-manager.html +++ b/static/directives/robots-manager.html @@ -19,9 +19,8 @@ be shared, such as deployment systems. - - - +
No robot accounts defined.
diff --git a/static/js/directives/ui/filter-box.js b/static/js/directives/ui/filter-box.js new file mode 100644 index 000000000..38b8fbdd5 --- /dev/null +++ b/static/js/directives/ui/filter-box.js @@ -0,0 +1,21 @@ +/** + * An element which displays a right-aligned control bar with an for filtering a collection. + */ +angular.module('quay').directive('filterBox', function () { + var directiveDefinitionObject = { + priority: 0, + templateUrl: '/static/directives/filter-box.html', + replace: false, + transclude: true, + restrict: 'C', + scope: { + 'collection': '=collection', + 'filterModel': '=filterModel', + 'filterName': '@filterName' + }, + controller: function($scope, $element) { + + } + }; + return directiveDefinitionObject; +}); \ No newline at end of file diff --git a/static/js/directives/ui/robots-manager.js b/static/js/directives/ui/robots-manager.js index 970681ea7..122931005 100644 --- a/static/js/directives/ui/robots-manager.js +++ b/static/js/directives/ui/robots-manager.js @@ -118,7 +118,7 @@ angular.module('quay').directive('robotsManager', function () { if ($routeParams.showRobot) { var index = $scope.findRobotIndexByName($routeParams.showRobot); if (index >= 0) { - $scope.showRobot($scope.robots[index]); + $scope.robotFilter = $routeParams.showRobot; } } });