-
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
Client Reset Key UI #4813
Client Reset Key UI #4813
Conversation
Deploy preview for chef-automate processing. Building with commit b5d5f45 https://app.netlify.com/sites/chef-automate/deploys/6058d8dea5b5b6000771cb52 |
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.
@vivekshankar1 , Error occured just because of API dependency was not added into master, now It's merged and error not coming. Before merged, we build API locally as mentioned in particular API PR and check UI. |
@chaitali-mane , could you please rebase your branch with the latest master so that backend api code if merged to master will be available in this branch ? |
ef9c925
to
c2bfdcc
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.
So far this is working wonderfully for me with no errors in the console. 🎉
From a purely front-end perspective, I see two things that should really be addressed here.
-
Its important that anything interactive can be accomplished purely by using the keyboard. There should also be a visual indicator of what button is in focus.
-
Much of this page is not flexible, and by default we should strive to make every we have flex to any screen. Currently, we aren't concerned with mobile phones, but we should still strive to make the content flex for different browser sizes on a desktop computer.
components/automate-ui/src/app/modules/infra-proxy/client-details/client-details.component.scss
Outdated
Show resolved
Hide resolved
...nts/automate-ui/src/app/modules/infra-proxy/reset-client-key/reset-client-key.component.scss
Outdated
Show resolved
Hide resolved
28d70ea
to
790e4a0
Compare
Thanks @chaitali-mane , the console error is fixed now and is working as expected. |
components/automate-ui/src/app/entities/clients/client-details.reducer.ts
Outdated
Show resolved
Hide resolved
map(({ payload: { name } }: ResetKeyClientSuccess) => { | ||
return new CreateNotification({ | ||
type: Type.info, | ||
message: `Successfully resetting Client key - ${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.
I see there are a couple instances like you have here, but let's move to be consistent with the majority:
message: `Successfully resetting Client key - ${name}.` | |
message: `Reset client key ${name}.` |
- Deleting "Successfully".
- Remove hyphen.
Would be helpful if you could fix the other five occurrences of that pattern in the code base.
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.
This format is suggested by UX team, will go with "Successfully resetting Client key - ${name}."
...nts/automate-ui/src/app/modules/infra-proxy/reset-client-key/reset-client-key.component.html
Outdated
Show resolved
Hide resolved
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { |
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.
Need some real unit tests here, 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.
I have added more tests for reset key modal.
...nents/automate-ui/src/app/modules/infra-proxy/reset-client-key/reset-client-key.component.ts
Outdated
Show resolved
Hide resolved
|
||
ngOnInit() { | ||
this.openEvent.pipe(takeUntil(this.isDestroyed)) | ||
.subscribe(() => { |
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 this block also reset authFailure
?
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.
Code is updated , removed unused code, Please take a look.
|
||
resetKeyClient(): void { | ||
this.reseting = true; | ||
const payload = { |
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.
Please strongly type this constant; avoid the (implicit) any
.
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 have added type for const payload, Please review it.
...nents/automate-ui/src/app/modules/infra-proxy/reset-client-key/reset-client-key.component.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
…t-key/reset-client-key.component.ts Co-authored-by: Michael Sorens <msorens@chef.io>
…t-key/reset-client-key.component.ts Co-authored-by: Michael Sorens <msorens@chef.io>
…t-key/reset-client-key.component.html Co-authored-by: Michael Sorens <msorens@chef.io>
….reducer.ts Co-authored-by: Michael Sorens <msorens@chef.io>
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
e31f3bd
to
c0225c9
Compare
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
Signed-off-by: chaitali-mane <cmane@progress.com>
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; however, should not merge until getting an approval from @SEAjamieD
.../automate-ui/src/app/modules/infra-proxy/reset-client-key/reset-client-key.component.spec.ts
Outdated
Show resolved
Hide resolved
]).pipe( | ||
takeUntil(this.isDestroyed)) | ||
.subscribe(([getStatusSt, resetKeyState, errorSt]) => { | ||
if (getStatusSt === EntityStatus.loadingSuccess && |
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.
Fix indent
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 have updated indentation. Please have a look.
…t-key/reset-client-key.component.spec.ts Co-authored-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.
All the suggested changes are made. The ui highlights are working and are keyboard accessible. Also the content is not overflowing out of the containers now. Looks good to me. Thanks @chaitali-mane
Signed-off-by: chaitali-mane <cmane@progress.com>
chef-button:focus { | ||
outline: 0.5px solid $chef-primary-bright; |
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.
can remove this line, you've got it covered in the ng-deep below
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.
Removed this code from file. Please check.
|
||
::ng-deep { | ||
chef-button button:focus { | ||
outline: 0.5px solid $chef-primary-bright; |
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.
outline: 0.5px solid $chef-primary-bright; | |
outline: -webkit-focus-ring-color auto 1px; |
This will give us our default focus ring
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.
@SEAjamieD As per UX suggestions, added outline with different colour and different width. Focus changed to 0.5px solid #3864F2
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.
according to your comment below, this may be able to stay as is, since now UX is requesting 0.5px 👍
chef-icon:focus { | ||
outline: none; | ||
} | ||
|
||
span:focus { | ||
outline: none; | ||
} |
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 don't see where these are doing anything. Looks to me like they can be removed.
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, good catch, I removed these line.
chef-button { | ||
|
||
&:focus { | ||
outline: 0.5px solid $chef-critical-dark; |
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 noticing that you are using 0.5px for the outlines, is this from the new UX mockups? Currently across our site, all the focus rings are 1px.
I'm asking because I know much of the UX is getting updated, so I want to make sure i'm not missing anything, as 0.5px is used quite a bit in this PR
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.
@SEAjamieD , Yeah it's new design for focus part, UX team suggestions we added 0.5px.
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!
much better flex in the key area now, 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.
I noted a few changes left to make, but all it all, looking good. 🎉
Signed-off-by: chaitali-mane <cmane@progress.com>
🔩 Description: What code changed, and why?
we need to add Client Reset Key functionality on client details page.
⛓️ Related Resources
#4569
👍 Definition of Done
I have added Client Reset Key popup on client details page and make reset Key link active.
👟 How to Build and Test the Change
Steps to reproduce the behavior:
if you have sample data for the infra servers than
go to >> infrastructure tab >> click on Chef server on left side navigation bar >> Organizations >> Clients tab >> click on any Client >> details tab >> click on Reset Key
✅ Checklist
📷 Screenshots, if applicable
Client-Reset-Key.mp4