From f7614056d41bf2a673bbb843ea422343512497a8 Mon Sep 17 00:00:00 2001 From: David Crespo Date: Fri, 13 Dec 2024 09:58:03 -0600 Subject: [PATCH] use EmptyCell for zero routes, copy tweak --- app/pages/project/vpcs/VpcPage/tabs/VpcGatewaysTab.tsx | 3 ++- app/pages/project/vpcs/internet-gateway-edit.tsx | 4 ++-- test/e2e/vpcs.e2e.ts | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/pages/project/vpcs/VpcPage/tabs/VpcGatewaysTab.tsx b/app/pages/project/vpcs/VpcPage/tabs/VpcGatewaysTab.tsx index e7b8f8363..0fd50179d 100644 --- a/app/pages/project/vpcs/VpcPage/tabs/VpcGatewaysTab.tsx +++ b/app/pages/project/vpcs/VpcPage/tabs/VpcGatewaysTab.tsx @@ -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 {matchingRoutes?.length || 0} + if (!matchingRoutes?.length) return + return {matchingRoutes.length} } const colHelper = createColumnHelper() diff --git a/app/pages/project/vpcs/internet-gateway-edit.tsx b/app/pages/project/vpcs/internet-gateway-edit.tsx index a93b10da2..7a3ad0c1c 100644 --- a/app/pages/project/vpcs/internet-gateway-edit.tsx +++ b/app/pages/project/vpcs/internet-gateway-edit.tsx @@ -164,10 +164,10 @@ export function EditInternetGatewayForm() { )) ) : (
- {'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.'}
)} diff --git a/test/e2e/vpcs.e2e.ts b/test/e2e/vpcs.e2e.ts index ffa43dbfc..f2e9ef10e 100644 --- a/test/e2e/vpcs.e2e.ts +++ b/test/e2e/vpcs.e2e.ts @@ -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()