-
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
Add namespace picker to service account tab on membership page #1213
Add namespace picker to service account tab on membership page #1213
Conversation
Is it necessary to watch service accounts rather than list? I don't know how common it is to manipulate them. |
871d64c
to
21d7698
Compare
Suggest making the selects
mirroring how we display them above. We do something similar with image streams. Should be able to take up two columns since there will be no assigned roles, right? |
.then(function(resp) { | ||
var serviceAccounts = _.map(resp.by('metadata.name'), function(sa) { | ||
return sa.metadata.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.
Maybe
var serviceAccountNames = _.keys(resp.by('metadata.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.
Should we remove service accounts from the list that already have roles above?
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.
Doesn't matter to me, the update will put the 2nd role on the SA either way. Prefer to eliminate it from the dropdown?
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.
Prefer to eliminate it from the dropdown?
I think so to avoid confusion. Probably want to sort as well.
var serviceAccountNames = _.keys(resp.by('metadata.name')).sort();
|
||
|
||
DataService | ||
.list('serviceaccounts', requestContext) |
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.
Don't we need to be getting service accounts from the selected namespace? Won't this only get the service accounts from the current namespace?
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.
Yeah thats helpful. I have the ability to enter an unlisted, but should def request & update whenever the namespace changes.
app/views/membership.html
Outdated
<div | ||
ng-if="newBinding.kind === 'ServiceAccount'" | ||
class="service-account-namespace hidden-sm hidden-md hidden-lg" | ||
class="service-account-name pad-bottom-sm" | ||
aria-hidden="true"> |
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.
Why is this aria-hidden?
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.
Good catch, I need to remove that tag now as I previously had 2 <ui-select>
for namespace, but now only have 1.
app/views/membership.html
Outdated
</ui-select-choices> | ||
</ui-select> | ||
</div> | ||
|
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.
Why the non-breaking space? If we need whitespace, we should use CSS
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.
Yeah, to keep the flex from collapsing completely, habit, I think its irrelevant, I'll remove & the extra axis stuff.
this is looking way better to me
…On Thu, Feb 2, 2017 at 5:16 PM, Ben Petersen ***@***.***> wrote:
WIP, updated to refresh the service accounts list to match the selected
project:
[image: screen shot 2017-02-02 at 5 12 47 pm]
<https://cloud.githubusercontent.com/assets/280512/22570877/3fd831c4-e96b-11e6-9372-ecb3e1d26475.png>
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#1213 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABZk7bJDT3gDJ3rm6S1mngGi8SLtwO4Cks5rYlW6gaJpZM4L0RCP>
.
|
4a45b7d
to
310723c
Compare
There is a spot between tablet & larger screens where multiple roles added to a user/SA can cause some layout wobble. Is unrelated to this change, so I'll create an issue & get to work on tweaking that. @spadgett ready for another pass |
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.
A few small comments.
I noticed that I won't be able to add a service account from a namespace I don't have access to. That can be a follow-on if not a new limitation, although I don't see a reason to block it.
DataService | ||
.list('serviceaccounts', ctx) | ||
.then(function(resp) { | ||
var serviceAccounts = _.keys(resp.by('metadata.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.
Maybe
_.keys(resp.by('metadata.name')).sort();
so the list is sorted?
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.
yeah sounds good.
var projects = _.map(resp.by('metadata.name'), function(project) { | ||
return project.metadata.name; | ||
}); | ||
var projects = _.keys(resp.by('metadata.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.
var projects = _.keys(resp.by('metadata.name')).sort();
?
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.
good catch, will update!
app/views/membership.html
Outdated
repeat="saName in serviceAccounts | filter: $select.search" | ||
refresh="refreshServiceAccounts($select.search)" | ||
refresh-delay="200"> | ||
<div>{{saName}}</div> |
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.
<div ng-bind-html="saName | highlight : $select.search"></div>
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.
Probably should add this to the project select above, too.
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.
nice, ill add.
app/views/membership.html
Outdated
type="text" | ||
class="form-control input-name" | ||
placeholder="Name" | ||
ng-model="newBinding.name" | ||
autocorrect="off" | ||
autocapitalize="off" | ||
spellcheck="false"> | ||
<!-- namespace entry/picker for service accounts --> |
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.
indentation
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.
got it.
app/views/membership.html
Outdated
class="select-role"> | ||
<ui-select-match | ||
placeholder="Service account"> | ||
<span ng-bind="newBinding.name"></span> |
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.
Any reason to prefer ng-bind
instead of just using the curly braces for expressions?
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.
I think I have that because it was part of ui-select
docs when i first dropped them in, I'll swap to the {{}}
.
Nit: In the very last screenshot, the project/sa selects should probably fill the width like the role select. |
310723c
to
e46dcaf
Compare
updated & rebased. |
I noticed when I select a service account then immediately switch back to the users tab, it pre-fills the service account name in the user input. Same if I enter a user and switch to service accounts. |
Hmm. Also a bit of a flicker going back and forth between the SA tab & others as the input appears/disappears. |
e46dcaf
to
35980fa
Compare
- Refresh service accounts list when project/namespace select changes
9217e9c
to
f65cab0
Compare
Updated to clear the name when tabs are changed |
Thanks @benjaminapetersen [merge] |
Evaluated for origin web console merge up to f65cab0 |
Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/1008/) (Base Commit: 16ebed8) |
Fix #1191
Fix #850
@jwforres @spadgett
mobile: