Make robot accounts filter rather than display the dialog when "showRobot" is passed to the manager
This commit is contained in:
parent
ecf1135dcd
commit
72abd80f08
5 changed files with 47 additions and 4 deletions
17
static/css/directives/ui/filter-box.css
Normal file
17
static/css/directives/ui/filter-box.css
Normal file
|
@ -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;
|
||||||
|
}
|
6
static/directives/filter-box.html
Normal file
6
static/directives/filter-box.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<div class="filter-box-element" ng-show="collection.length">
|
||||||
|
<span class="filter-message" ng-if="filterModel">
|
||||||
|
Showing {{ (collection|filter:filterModel).length }} of {{ collection.length }} {{ filterName }}
|
||||||
|
</span>
|
||||||
|
<input class="form-control" type="text" ng-model="filterModel" placeholder="Filter {{ filterName }}...">
|
||||||
|
</div>
|
|
@ -19,9 +19,8 @@
|
||||||
be shared, such as deployment systems.
|
be shared, such as deployment systems.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="co-filter-box" ng-show="robots.length">
|
<div class="filter-box" collection="robots" filter-model="robotFilter"
|
||||||
<input class="form-control" type="text" ng-model="robotFilter" placeholder="Filter Robot Accounts...">
|
filter-name="Robot Accounts"></div>
|
||||||
</span>
|
|
||||||
|
|
||||||
<div class="empty" ng-if="!robots.length">
|
<div class="empty" ng-if="!robots.length">
|
||||||
<div class="empty-primary-msg">No robot accounts defined.</div>
|
<div class="empty-primary-msg">No robot accounts defined.</div>
|
||||||
|
|
21
static/js/directives/ui/filter-box.js
Normal file
21
static/js/directives/ui/filter-box.js
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/**
|
||||||
|
* An element which displays a right-aligned control bar with an <input> 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;
|
||||||
|
});
|
|
@ -118,7 +118,7 @@ angular.module('quay').directive('robotsManager', function () {
|
||||||
if ($routeParams.showRobot) {
|
if ($routeParams.showRobot) {
|
||||||
var index = $scope.findRobotIndexByName($routeParams.showRobot);
|
var index = $scope.findRobotIndexByName($routeParams.showRobot);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
$scope.showRobot($scope.robots[index]);
|
$scope.robotFilter = $routeParams.showRobot;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue