Skip to content

Commit

Permalink
Merge pull request #2265 from spadgett/improve-role-dropdown
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue.

Improve role select when editing membership

* Only match role names to avoid false positives
* Remove unnecessary sort since it's sorted in the controller
* Add a `track by` to the repeat
* Highlight search matches in the dropdown

![openshift web console 2017-10-13 12-06-07](https://user-images.githubusercontent.com/1167259/31555415-eefc47f2-b00e-11e7-8b1d-c0af8e95ccc0.png)

Fixes #2260
  • Loading branch information
openshift-merge-robot authored Oct 13, 2017
2 parents 613956a + 5f0e71a commit 4c16ab5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/views/membership.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ <h3>
<span ng-bind="subject.newRole.metadata.name"></span>
</ui-select-match>
<ui-select-choices
repeat="role as role in filteredRoles | filter: excludeExistingRoles(subject.roles) | filter: $select.search | orderBy: 'metadata.name'">
<div>{{ role.metadata.name }}</div>
repeat="role as role in filteredRoles | filter: excludeExistingRoles(subject.roles) | filter: { metadata: { name: $select.search } } track by (role | uid)">
<div ng-bind-html="role.metadata.name | highlight: $select.search"></div>
<div ng-if="role | annotation : 'description'">
<small>{{role | annotation : 'description'}}</small>
</div>
Expand Down Expand Up @@ -251,8 +251,8 @@ <h3>
<span ng-bind="newBinding.newRole.metadata.name"></span>
</ui-select-match>
<ui-select-choices
repeat="role as role in filteredRoles | filter: $select.search | orderBy: 'metadata.name'">
<div>{{ role.metadata.name }}</div>
repeat="role as role in filteredRoles | filter: { metadata: { name: $select.search } } track by (role | uid)">
<div ng-bind-html="role.metadata.name | highlight: $select.search"></div>
<div ng-if="role | annotation : 'description'">
<small>{{role | annotation : 'description'}}</small>
</div>
Expand Down
8 changes: 4 additions & 4 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -10514,8 +10514,8 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<ui-select-match placeholder=\"Select a role\">\n" +
"<span ng-bind=\"subject.newRole.metadata.name\"></span>\n" +
"</ui-select-match>\n" +
"<ui-select-choices repeat=\"role as role in filteredRoles | filter: excludeExistingRoles(subject.roles) | filter: $select.search | orderBy: 'metadata.name'\">\n" +
"<div>{{ role.metadata.name }}</div>\n" +
"<ui-select-choices repeat=\"role as role in filteredRoles | filter: excludeExistingRoles(subject.roles) | filter: { metadata: { name: $select.search } } track by (role | uid)\">\n" +
"<div ng-bind-html=\"role.metadata.name | highlight: $select.search\"></div>\n" +
"<div ng-if=\"role | annotation : 'description'\">\n" +
"<small>{{role | annotation : 'description'}}</small>\n" +
"</div>\n" +
Expand Down Expand Up @@ -10568,8 +10568,8 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<ui-select-match placeholder=\"Select a role\">\n" +
"<span ng-bind=\"newBinding.newRole.metadata.name\"></span>\n" +
"</ui-select-match>\n" +
"<ui-select-choices repeat=\"role as role in filteredRoles | filter: $select.search | orderBy: 'metadata.name'\">\n" +
"<div>{{ role.metadata.name }}</div>\n" +
"<ui-select-choices repeat=\"role as role in filteredRoles | filter: { metadata: { name: $select.search } } track by (role | uid)\">\n" +
"<div ng-bind-html=\"role.metadata.name | highlight: $select.search\"></div>\n" +
"<div ng-if=\"role | annotation : 'description'\">\n" +
"<small>{{role | annotation : 'description'}}</small>\n" +
"</div>\n" +
Expand Down

0 comments on commit 4c16ab5

Please sign in to comment.