Skip to content

Commit

Permalink
rename form to "View SSH key"
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Dec 6, 2024
1 parent eafdb46 commit b24533f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions app/forms/ssh-key-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export function EditSSHKeySideModalForm() {
const navigate = useNavigate()
const { sshKey } = useSshKeySelector()

const onDismiss = () => navigate(pb.sshKeys())

const { data } = usePrefetchedApiQuery('currentUserSshKeyView', {
path: { sshKey },
})
Expand All @@ -46,7 +44,8 @@ export function EditSSHKeySideModalForm() {
form={form}
formType="edit"
resourceName="SSH key"
onDismiss={onDismiss}
title="View SSH key"
onDismiss={() => navigate(pb.sshKeys())}
subtitle={
<ResourceLabel>
<Key16Icon /> {data.name}
Expand Down
2 changes: 1 addition & 1 deletion app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const routes = createRoutesFromElements(
path=":sshKey/edit"
loader={EditSSHKeySideModalForm.loader}
element={<EditSSHKeySideModalForm />}
handle={titleCrumb('Edit SSH Key')}
handle={titleCrumb('View SSH Key')}
/>
</Route>
<Route path="ssh-keys-new" {...SSHKeyCreate} handle={titleCrumb('New SSH key')} />
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/ssh-keys.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ test('SSH keys', async ({ page }) => {
await page.getByRole('link', { name: 'm1-macbook-pro' }).click()

// verify side modal content
const modal = page.getByRole('dialog')
const modal = page.getByRole('dialog', { name: 'View SSH key' })
await expect(modal).toBeVisible()
await expect(modal.getByText('Edit SSH key')).toBeVisible()
await expect(modal.getByRole('heading', { name: 'm1-macbook-pro' })).toBeVisible()

const propertiesTable = modal.locator('.properties-table')
Expand Down

0 comments on commit b24533f

Please sign in to comment.