-
Notifications
You must be signed in to change notification settings - Fork 114
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
added UI changes for API tokens page empty state #308
added UI changes for API tokens page empty state #308
Conversation
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.
Thank you!!
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.
Thank you! 🎉
</app-authorized> | ||
</chef-toolbar> | ||
<app-authorized [anyOf]="[['/iam/v2beta/tokens', 'get'], ['/auth/tokens', 'get']]"> | ||
<chef-table> | ||
<chef-thead> | ||
<chef-tr> | ||
<chef-tr *ngIf="(sortedApiTokens$ | async)?.length > 0"> |
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 wonder why we'd put this on chef-tr
and not one of the parent tags? app-authorized
or chef-table
or chef-thead
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.
Tested and added a few suggestions based on @srenatus's comments.
</div> | ||
<div *ngIf="(sortedApiTokens$ | async)?.length > 0"> | ||
<chef-button id="create-button" primary (click)="openCreateModal()">Create Token</chef-button> | ||
</div> | ||
</app-authorized> | ||
</chef-toolbar> | ||
<app-authorized [anyOf]="[['/iam/v2beta/tokens', 'get'], ['/auth/tokens', 'get']]"> | ||
<chef-table> |
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.
<chef-table> | |
<chef-table *ngIf="(sortedApiTokens$ | async)?.length > 0"> |
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.
Thanks for the review and suggestions, I will make these changes and update the PR by today itself.
</app-authorized> | ||
</chef-toolbar> | ||
<app-authorized [anyOf]="[['/iam/v2beta/tokens', 'get'], ['/auth/tokens', 'get']]"> | ||
<chef-table> | ||
<chef-thead> | ||
<chef-tr> | ||
<chef-tr *ngIf="(sortedApiTokens$ | async)?.length > 0"> |
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.
<chef-tr *ngIf="(sortedApiTokens$ | async)?.length > 0"> | |
<chef-tr> |
73a5f5b
to
9e98fee
Compare
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.
LGTM but I'm no CSS expert
CSS is only added for showing button in the center if there is no token available. |
9e98fee
to
e51a736
Compare
Note that for the failing integration test you will need to mock the
You can see that in use in components/automate-ui/src/app/page-components/navbar/navbar.component.spec.ts |
Thanks for the suggestion, I will check and update the PR. |
@msorens I just checked
|
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.
Ah, yes, you are correct... and then I notice it was a protractor test failing, not a unit test.
Reviewing the test case in question more closely, I did not see any reason for it to fail so I ran it locally, and it passed for me. So you could just do "retry" on the buildkite item, but before you do...
Take a look at my other comment I just posted for a slight optimization. If you make that change, it will of course, redo the buildkite item as well.
@@ -29,11 +29,16 @@ | |||
<div class="page-body"> | |||
<chef-toolbar> | |||
<app-authorized [anyOf]="[['/iam/v2beta/tokens', 'post'], ['/auth/tokens', 'post']]"> | |||
<chef-button id="create-button" primary (click)="openCreateModal()">Create Token</chef-button> | |||
<div *ngIf="(sortedApiTokens$ | async)?.length === 0" class="token-empty-state"> |
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 *ngIf="(sortedApiTokens$ | async)?.length === 0" class="token-empty-state"> | |
<div *ngIf="(apiTokenCount$ | async) === 0" class="token-empty-state"> |
Same change in all 3 places where the original expression occurred.
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 I added these changes.
Signed-off-by: vinay033 <[email protected]>
Signed-off-by: vinay033 <[email protected]>
Signed-off-by: vinay033 <[email protected]>
Signed-off-by: vinay033 <[email protected]>
e51a736
to
035d0f2
Compare
Signed-off-by: vinay033 [email protected]
🔩 Description
Currently, when there are no api tokens on the API Tokens page we show an empty table, instead, we would like to follow the empty state pattern.
👟 Demo Script / Repro Steps
Existing UI

New changes

⛓️ Related Resources
#303