-
Notifications
You must be signed in to change notification settings - Fork 357
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
refactor: [M3-6258] - React Query for SSH Keys #8892
refactor: [M3-6258] - React Query for SSH Keys #8892
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.
Going to take a deeper look later today or sometime tomorrow but left a couple of small comments
packages/manager/src/components/AccessPanel/UserSSHKeyPanel.tsx
Outdated
Show resolved
Hide resolved
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 tried rebuilding with an Image & SSH key and with a StackScript & SSH key but ran into a
Service unavailable [1.10]
API error earlier, so I will circle back around to testing that. -
If you edit an SSH key, clear out the label, and click "Save", the error persists if you close the drawer and go back to edit it. It also persists across different SSH keys (i.e., if you get up to the error on one, then you exit that drawer and go to edit another key, the error will show up there 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.
@@ -0,0 +1,75 @@ | |||
import * as React from 'react'; |
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 adding test coverage!
actions={ | ||
<ActionsPanel> | ||
<Button | ||
buttonType="secondary" | ||
onClick={onClose} | ||
data-qa-cancel-delete | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
buttonType="primary" | ||
onClick={onDelete} | ||
loading={isLoading} | ||
data-qa-confirm-delete | ||
> | ||
Delete | ||
</Button> | ||
</ActionsPanel> | ||
} |
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.
nit-picky: We could decouple this ActionsPanel and define it upper level.
Note: For naming convention, we could follow existing pattern.
const Actions = (
<ActionsPanel>
<Button buttonType="secondary" onClick={onClose} data-qa-cancel-delete>
Cancel
</Button>
<Button
buttonType="primary"
onClick={onDelete}
loading={isLoading}
data-qa-confirm-delete
>
Delete
</Button>
</ActionsPanel>
);
return (
<ConfirmationDialog
open={open}
onClose={onClose}
title="Delete SSH Key"
error={error?.[0].reason}
actions={Actions}
>
<Typography>Are you sure you want to delete SSH key {label}?</Typography>
</ConfirmationDialog>
);
};
@cpathipa You may need to run |
@bnussman-akamai FYI - A few files have conflicts that should be resolved. |
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 edit --> empty label interaction is still a bit off from what I'd expect; in this clip, I clear the label, try to save, get the error, and close the drawer. But when I re-open the drawer, although the error is cleared, the label field itself is still empty (instead of having the current label):
Edit "Label" field interaction
Screen.Recording.2023-03-24.at.3.12.55.PM.mov
Aside from that, looks like something odd is going on for restricted users in the "SSH Keys" table in the Linode Create and Rebuild flows?
packages/manager/src/components/AccessPanel/UserSSHKeyPanel.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/Profile/SSHKeys/CreateSSHKeyDrawer.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/Profile/SSHKeys/EditSSHKeyDrawer.tsx
Outdated
Show resolved
Hide resolved
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.
Really great clean-up/refactoring; unit tests are a plus
Very helpful feedback, thank you @dwiley-akamai. Should all be addressed in 5d25bf3 |
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, thanks for addressing that feedback! 🚀
Description 📝
http://localhost:3000/profile/keys
label
of their ssh keysHow to test 🧪
http://localhost:3000/profile/keys