-
Notifications
You must be signed in to change notification settings - Fork 113
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
#2762 guard add users button on team details view #3736
#2762 guard add users button on team details view #3736
Conversation
components/automate-ui/src/app/modules/user/user-table/user-table.component.spec.ts
Outdated
Show resolved
Hide resolved
components/automate-ui/src/app/modules/user/user-table/user-table.component.spec.ts
Outdated
Show resolved
Hide resolved
5732098
to
7d18381
Compare
|
7d18381
to
5c71b3d
Compare
There are several ways to resolve your "no permissions" page issue. I have pushed a commit with what is probably the simplest approach. |
components/automate-ui/src/app/modules/user/user-table/user-table.component.html
Show resolved
Hide resolved
components/automate-ui/src/app/modules/team/team-add-users/team-add-users.component.ts
Show resolved
Hide resolved
Signed-off-by: Stephan Renatus <srenatus@chef.io>
6835196
to
491bdd7
Compare
…eam-details Signed-off-by: Stephan Renatus <srenatus@chef.io>
Signed-off-by: Stephan Renatus <srenatus@chef.io>
Leverage the existing full-page rendering. 1. Setting the confirm button text to empty suppresses the lower buttons. 2. Use the same close handler to return to team details on exit. 3. A bit of a kludge: using the `heading` attribute to trigger the full page settings. Signed-off-by: michael sorens <msorens@chef.io>
Signed-off-by: Stephan Renatus <srenatus@chef.io>
491bdd7
to
0cd1e4a
Compare
@msorens thanks again -- I've updated the preamble, this should be good to go now. |
Signed-off-by: Stephan Renatus <srenatus@chef.io>
Signed-off-by: Stephan Renatus <srenatus@chef.io>
✔️ Verified "add users" request payload (no unknown fields sent) and updated the API docs example payloads. |
Signed-off-by: Stephan Renatus <srenatus@chef.io>
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.
works great, thank you!!
@@ -1,11 +1,11 @@ | |||
<app-authorized [allOf]="getPermissionsPath" [overrideVisible]="overridePermissionsCheck"> | |||
<app-authorized [allOf]="getPermissionsPath"> | |||
<ng-container *ngIf="showEmptyMessage"> | |||
<div class="empty-state"> | |||
<p>Add some users to get started!</p> |
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.
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 catch, we should leverage the similar msg we display on projects. ill add that here later tonight.
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'm looking into this now (Tuesday morning)
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'm not sure I see what "similar msg" you've been referring to, @susanev.
When browsing a project's details as the test user, I find this, no message at all:
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.
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.
the messages look good to me, thank you everyone for the assists!!
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.
@msorens good catches! Let's tackle those separately, please. ;)
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.
[...] but for the purposes of this PR we might want to address why the Users list is blank and is not showing the message (with or without my commit).
👍 I'll look into it.
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.
@msorens can't reproduce. I've created a policy giving my user ALLOW on *
, and DENY on iam:users:create
, and see this:
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.
@sr You exercised a different test case than the one I specified:
...when logged in as a user having no permissions then navigating directly to each page
(No strong preference whether that gets fixed in this PR, though.)
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.
Looks good, although as the test
user, I noticed one weird behavior when I was on a team page that did not already have users. (see comment for screenshot)
Signed-off-by: michael sorens <msorens@chef.io>
It is occasionally "more correct" than the standard test runner Signed-off-by: michael sorens <msorens@chef.io>
Signed-off-by: michael sorens <msorens@chef.io>
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.
Pushed a few minor commits, including "fixes" for unit tests caught by wallaby that were not noticed by the regular test runner.
Also thought I found an odd bug. I was examining the rendered permissions in <app-authorized>
for the two paths to get to the user table. Notice that the first one, for admins team, correctly shows a parameterized call BUT truncates the team id to "ad" in the <app-authorized>
element. Turns out there is no bug in our code--rather it is a "bug" in Chrome DevTools: it truncates all attributes to 30 characters (not just on <app-authorized>
) !!
The message to be shown when the user cannot add users is TBD. Signed-off-by: Stephan Renatus <srenatus@chef.io>
Signed-off-by: Stephan Renatus <srenatus@chef.io>
Signed-off-by: Stephan Renatus <srenatus@chef.io>
Let the body of the `<app-user-table>` provide the text of a "no-users-present-and-no-permissions-to-add-them" message. Signed-off-by: michael sorens <msorens@chef.io>
🔩 Description: What code changed, and why?
Before, the Add Users button on the team details page has always been shown.
With this change, it will only be shown of the user has got sufficient privileges to actually do that.
Definition of done
⛓️ Related Resources
#2762
👟 How to Build and Test the Change
test
user, navigate to https://a2-dev.test/settings/teams/editors/add-users, notice: