Skip to content
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

Merged
merged 20 commits into from
Mar 22, 2021
Merged

Client Reset Key UI #4813

merged 20 commits into from
Mar 22, 2021

Conversation

chaitali-mane
Copy link
Contributor

@chaitali-mane chaitali-mane commented Mar 10, 2021

🔩 Description: What code changed, and why?

we need to add Client Reset Key functionality on client details page.

reset-1

reset2

⛓️ 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

@netlify
Copy link

netlify bot commented Mar 10, 2021

Deploy preview for chef-automate processing.

Building with commit b5d5f45

https://app.netlify.com/sites/chef-automate/deploys/6058d8dea5b5b6000771cb52

@chaitali-mane chaitali-mane self-assigned this Mar 10, 2021
@chaitali-mane chaitali-mane marked this pull request as draft March 11, 2021 07:27
@chaitali-mane chaitali-mane changed the title Client Reset Key UI WIP Client Reset Key UI Mar 11, 2021
@chaitali-mane chaitali-mane changed the title WIP Client Reset Key UI [WIP] Client Reset Key UI Mar 11, 2021
@chaitali-mane chaitali-mane marked this pull request as ready for review March 12, 2021 12:38
@chaitali-mane chaitali-mane changed the title [WIP] Client Reset Key UI Client Reset Key UI Mar 12, 2021
@vivekshankar1 vivekshankar1 self-requested a review March 12, 2021 16:19
Copy link
Collaborator

@vivekshankar1 vivekshankar1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After clicking on reset key the box in the modal where the private key should be, is empty. Also there is an error in console.
I am using progress-chef org in manage.chef.io

Screenshot 2021-03-12 at 9 47 04 PM

@chaitali-mane
Copy link
Contributor Author

After clicking on reset key the box in the modal where the private key should be, is empty. Also there is an error in console.
I am using progress-chef org in manage.chef.io

Screenshot 2021-03-12 at 9 47 04 PM

@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.

@vivekshankar1
Copy link
Collaborator

@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 ?

Copy link
Contributor

@SEAjamieD SEAjamieD left a 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.

  1. 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.

  2. 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.

non-flexing elements example

@vivekshankar1
Copy link
Collaborator

Thanks @chaitali-mane , the console error is fixed now and is working as expected.

map(({ payload: { name } }: ResetKeyClientSuccess) => {
return new CreateNotification({
type: Type.info,
message: `Successfully resetting Client key - ${name}.`
Copy link
Contributor

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:

Suggested change
message: `Successfully resetting Client key - ${name}.`
message: `Reset client key ${name}.`
  1. Deleting "Successfully".
  2. Remove hyphen.

Would be helpful if you could fix the other five occurrences of that pattern in the code base.

Copy link
Contributor Author

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}."

fixture.detectChanges();
});

it('should create', () => {
Copy link
Contributor

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.

Copy link
Contributor Author

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.


ngOnInit() {
this.openEvent.pipe(takeUntil(this.isDestroyed))
.subscribe(() => {
Copy link
Contributor

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 ?

Copy link
Contributor Author

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 = {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

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>
chaitali-mane and others added 6 commits March 19, 2021 15:10
…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>
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>
Copy link
Contributor

@msorens msorens left a 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

]).pipe(
takeUntil(this.isDestroyed))
.subscribe(([getStatusSt, resetKeyState, errorSt]) => {
if (getStatusSt === EntityStatus.loadingSuccess &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indent

Copy link
Contributor Author

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>
Copy link
Collaborator

@vivekshankar1 vivekshankar1 left a 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>
Comment on lines 119 to 120
chef-button:focus {
outline: 0.5px solid $chef-primary-bright;
Copy link
Contributor

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

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
outline: 0.5px solid $chef-primary-bright;
outline: -webkit-focus-ring-color auto 1px;

This will give us our default focus ring

Copy link
Contributor Author

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

Copy link
Contributor

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 👍

Comment on lines 129 to 135
chef-icon:focus {
outline: none;
}

span:focus {
outline: none;
}
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@SEAjamieD
Copy link
Contributor

much better flex in the key area now, thank you!

Copy link
Contributor

@SEAjamieD SEAjamieD left a 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>
@kalroy kalroy merged commit d2dff27 into master Mar 22, 2021
@kalroy kalroy deleted the Chaitali/client-reset-key branch March 22, 2021 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants