-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disambiguate kinds on other resources by showing group #1478
Disambiguate kinds on other resources by showing group #1478
Conversation
app/views/other-resources.html
Outdated
@@ -14,6 +14,7 @@ | |||
<ui-select-match placeholder="Choose a resource to list...">{{$select.selected.kind | humanizeKind : true}}</ui-select-match> | |||
<ui-select-choices repeat="kind in kinds | filter : {kind: $select.search} : matchKind | orderBy : 'kind'"> | |||
<div ng-bind-html="(kind.kind | humanizeKind : true) | highlight: $select.search"></div> | |||
<small ng-bind-html="kind.group | highlight: $select.search" class="text-muted"></small> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't always show this, most of the time it is unnecessary gorp. I would only show it when it is necessary to distinguish between two Kinds that are the same. Similar to what we do in the projects dropdown when we see two projects have the same display name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, am working on that part now
works for me, clean it up so we can merge it |
@@ -57,6 +58,24 @@ angular.module('openshiftConsole') | |||
}).toString(); | |||
}; | |||
|
|||
var countKinds = function() { | |||
return _.reduce($scope.kinds, function(result, kind) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to use _.countBy
0da1ad6
to
27ddc69
Compare
ok squashed & updated |
var counts; | ||
$scope.isDuplicateKind = function(kind) { | ||
if(!counts) { | ||
counts = countKinds(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cant you just do this as a one-liner here using the short form:
counts = _.countBy($scope.kinds, "kind")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updating
27ddc69
to
5071259
Compare
5071259
to
1a4c66b
Compare
LGTM, just waiting on the bump of origin-web-common |
[merge] |
Evaluated for origin web console merge up to 1a4c66b |
Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/1310/) (Base Commit: 900019b) |
Getting started on this. Most of the work is in this PR in
web-common
.I'm not sure if simply listing the group under the kind is extremely clear, but its what we typically do: