Skip to content

Commit

Permalink
use EmptyCell for zero routes, copy tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Dec 13, 2024
1 parent 64a7bbe commit f761405
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/pages/project/vpcs/VpcPage/tabs/VpcGatewaysTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ const GatewayIpPoolCell = (gatewaySelector: PP.VpcInternetGateway) => {
const GatewayRoutes = ({ project, vpc, gateway }: PP.VpcInternetGateway) => {
const matchingRoutes = useGatewayRoutes({ project, vpc, gateway })
const to = pb.vpcInternetGateway({ project, vpc, gateway })
return <LinkCell to={to}>{matchingRoutes?.length || 0}</LinkCell>
if (!matchingRoutes?.length) return <EmptyCell />
return <LinkCell to={to}>{matchingRoutes.length}</LinkCell>
}

const colHelper = createColumnHelper<InternetGateway>()
Expand Down
4 changes: 2 additions & 2 deletions app/pages/project/vpcs/internet-gateway-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ export function EditInternetGatewayForm() {
))
) : (
<div className="mt-2">
{'This internet gateway does not have any specific IP addresses attached. '}
{'This internet gateway does not have any IP addresses attached. '}
{hasAttachedPool
? 'It will use an address from the attached IP pool.'
: 'Use the CLI to attach an IP Pool or specify an IP address to use with this gateway.'}
: 'Use the CLI to attach an IP pool or IP address to this gateway.'}
</div>
)}
</div>
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/vpcs.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ test('can view internet gateways', async ({ page }) => {
description: 'internet gateway 1',
'Attached IP Address': '123.4.56.3',
'Attached IP Pool': 'ip-pool-1',
Routes: '1',
})
await expectRowVisible(table, {
name: 'internet-gateway-2',
description: 'internet gateway 2',
'Attached IP Address': '—',
'Attached IP Pool': 'ip-pool-2',
Routes: '—',
})

await page.getByRole('link', { name: 'internet-gateway-1' }).click()
Expand Down

0 comments on commit f761405

Please sign in to comment.