Skip to content

Commit 5768e1e

Browse files
authored
'subnets' -> 'VPC subnets' in most spots, other casing (#3147)
Suggestion from @charliepark in #3039 (review). Decided to make it a separate PR because it came out to 70 lines of changes.
1 parent c0d92b9 commit 5768e1e

File tree

12 files changed

+62
-74
lines changed

12 files changed

+62
-74
lines changed

app/components/form/fields/SubnetListbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function SubnetListbox<
5555
items={subnets.map(({ name }) => ({ value: name, label: name }))}
5656
disabled={!vpcExists}
5757
control={control}
58-
placeholder="Select a subnet"
58+
placeholder="Select a VPC subnet"
5959
noItemsPlaceholder={vpcName ? 'No subnets found' : 'Select a VPC to see subnets'}
6060
/>
6161
)

app/forms/network-interface-create.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function CreateNetworkInterfaceForm({
136136
/>
137137
<SubnetListbox
138138
name="subnetName"
139-
label="Subnet"
139+
label="VPC subnet"
140140
vpcNameField="vpcName"
141141
required
142142
control={form.control}
@@ -166,7 +166,7 @@ export function CreateNetworkInterfaceForm({
166166
{(ipStackType === 'v4' || ipStackType === 'dual_stack') && (
167167
<TextField
168168
name="ipv4"
169-
label="IPv4 Address"
169+
label="IPv4 address"
170170
control={form.control}
171171
placeholder="Leave blank for auto-assignment"
172172
/>
@@ -175,7 +175,7 @@ export function CreateNetworkInterfaceForm({
175175
{(ipStackType === 'v6' || ipStackType === 'dual_stack') && (
176176
<TextField
177177
name="ipv6"
178-
label="IPv6 Address"
178+
label="IPv6 address"
179179
control={form.control}
180180
placeholder="Leave blank for auto-assignment"
181181
/>

app/forms/subnet-create.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default function CreateSubnetForm() {
6464
<SideModalForm
6565
form={form}
6666
formType="create"
67-
resourceName="subnet"
67+
resourceName="VPC subnet"
6868
onDismiss={onDismiss}
6969
onSubmit={({ name, description, ipv4Block, ipv6Block, customRouter }) =>
7070
createSubnet.mutate({

app/forms/subnet-edit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default function EditSubnetForm() {
7979
<SideModalForm
8080
form={form}
8181
formType="edit"
82-
resourceName="subnet"
82+
resourceName="VPC subnet"
8383
onDismiss={onDismiss}
8484
onSubmit={(body) => {
8585
updateSubnet.mutate({

app/forms/vpc-router-route-common.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const targetTypes: Record<Exclude<RouteTarget['type'], 'subnet' | 'vpc'>, string
6666
const destinationValuePlaceholder: Record<RouteDestination['type'], string | undefined> = {
6767
ip: 'Enter an IP',
6868
ip_net: 'Enter an IP network',
69-
subnet: 'Select a subnet',
69+
subnet: 'Select a VPC subnet',
7070
vpc: undefined,
7171
}
7272

app/pages/project/vpcs/VpcPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export default function VpcPage() {
7575

7676
<RouteTabs fullWidth>
7777
<Tab to={pb.vpcFirewallRules(vpcSelector)}>Firewall Rules</Tab>
78-
<Tab to={pb.vpcSubnets(vpcSelector)}>Subnets</Tab>
78+
<Tab to={pb.vpcSubnets(vpcSelector)}>VPC Subnets</Tab>
7979
<Tab to={pb.vpcRouters(vpcSelector)}>Routers</Tab>
8080
<Tab to={pb.vpcInternetGateways(vpcSelector)}>Internet Gateways</Tab>
8181
</RouteTabs>

app/pages/project/vpcs/VpcSubnetsTab.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function clientLoader({ params }: LoaderFunctionArgs) {
3535
return null
3636
}
3737

38-
export const handle = { crumb: 'Subnets' }
38+
export const handle = { crumb: 'VPC Subnets' }
3939

4040
export default function VpcSubnetsTab() {
4141
const vpcSelector = useVpcSelector()
@@ -44,7 +44,7 @@ export default function VpcSubnetsTab() {
4444
onSuccess() {
4545
queryClient.invalidateEndpoint('vpcSubnetList')
4646
// We only have the ID, so will show a generic confirmation message
47-
addToast({ content: 'Subnet deleted' })
47+
addToast({ content: 'VPC subnet deleted' })
4848
},
4949
})
5050

@@ -90,8 +90,8 @@ export default function VpcSubnetsTab() {
9090
const emptyState = (
9191
<EmptyMessage
9292
title="No VPC subnets"
93-
body="Create a subnet to see it here"
94-
buttonText="New subnet"
93+
body="Create a VPC subnet to see it here"
94+
buttonText="New VPC subnet"
9595
buttonTo={pb.vpcSubnetsNew(vpcSelector)}
9696
/>
9797
)
@@ -106,7 +106,7 @@ export default function VpcSubnetsTab() {
106106
return (
107107
<>
108108
<div className="mb-3 flex justify-end space-x-2">
109-
<CreateLink to={pb.vpcSubnetsNew(vpcSelector)}>New subnet</CreateLink>
109+
<CreateLink to={pb.vpcSubnetsNew(vpcSelector)}>New VPC subnet</CreateLink>
110110
</div>
111111
{table}
112112
<Outlet />

app/util/__snapshots__/path-builder.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ exports[`breadcrumbs 2`] = `
11951195
"path": "/projects/p/vpcs/v/firewall-rules",
11961196
},
11971197
{
1198-
"label": "Subnets",
1198+
"label": "VPC Subnets",
11991199
"path": "/projects/p/vpcs/v/",
12001200
},
12011201
],
@@ -1217,7 +1217,7 @@ exports[`breadcrumbs 2`] = `
12171217
"path": "/projects/p/vpcs/v/firewall-rules",
12181218
},
12191219
{
1220-
"label": "Subnets",
1220+
"label": "VPC Subnets",
12211221
"path": "/projects/p/vpcs/v/",
12221222
},
12231223
],
@@ -1239,7 +1239,7 @@ exports[`breadcrumbs 2`] = `
12391239
"path": "/projects/p/vpcs/v/firewall-rules",
12401240
},
12411241
{
1242-
"label": "Subnets",
1242+
"label": "VPC Subnets",
12431243
"path": "/projects/p/vpcs/v/",
12441244
},
12451245
],

test/e2e/instance-networking.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ test('Instance networking tab — NIC table', async ({ page }) => {
5858
await expectVisible(page, [
5959
'role=heading[name="Add network interface"]',
6060
'role=textbox[name="Description"]',
61-
'role=textbox[name="IPv4 Address"]',
62-
'role=textbox[name="IPv6 Address"]',
61+
'role=textbox[name="IPv4 address"]',
62+
'role=textbox[name="IPv6 address"]',
6363
])
6464

6565
await page.getByRole('textbox', { name: 'Name' }).fill('nic-2')

test/e2e/network-interface-create.e2e.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ test('can create a NIC with a specified IP address', async ({ page }) => {
2222
await page.getByLabel('Name').fill('nic-1')
2323
await page.getByLabel('VPC', { exact: true }).click()
2424
await page.getByRole('option', { name: 'mock-vpc' }).click()
25-
await page.getByRole('dialog').getByRole('button', { name: 'Subnet' }).click()
25+
await page.getByRole('dialog').getByRole('button', { name: 'VPC subnet' }).click()
2626
await page.getByRole('option', { name: 'mock-subnet', exact: true }).click()
2727

2828
// Select IPv4 only
2929
await page.getByRole('radio', { name: 'IPv4', exact: true }).click()
30-
await page.getByLabel('IPv4 Address').fill('1.2.3.4')
30+
await page.getByLabel('IPv4 address').fill('1.2.3.4')
3131

3232
const sidebar = page.getByRole('dialog', { name: 'Add network interface' })
3333

@@ -52,12 +52,12 @@ test('can create a NIC with a blank IP address', async ({ page }) => {
5252
await page.getByLabel('Name').fill('nic-2')
5353
await page.getByLabel('VPC', { exact: true }).click()
5454
await page.getByRole('option', { name: 'mock-vpc' }).click()
55-
await page.getByRole('dialog').getByRole('button', { name: 'Subnet' }).click()
55+
await page.getByRole('dialog').getByRole('button', { name: 'VPC subnet' }).click()
5656
await page.getByRole('option', { name: 'mock-subnet', exact: true }).click()
5757

5858
// Dual-stack is selected by default, so both fields should be visible
5959
// make sure the IPv4 address field has a non-conforming bit of text in it
60-
await page.getByLabel('IPv4 Address').fill('x')
60+
await page.getByLabel('IPv4 address').fill('x')
6161

6262
// try to submit it
6363
const sidebar = page.getByRole('dialog', { name: 'Add network interface' })
@@ -67,8 +67,8 @@ test('can create a NIC with a blank IP address', async ({ page }) => {
6767
await expect(sidebar.getByText('Zod error for body')).toBeVisible()
6868

6969
// make sure both IP address fields have spaces in them
70-
await page.getByLabel('IPv4 Address').fill(' ')
71-
await page.getByLabel('IPv6 Address').fill(' ')
70+
await page.getByLabel('IPv4 address').fill(' ')
71+
await page.getByLabel('IPv6 address').fill(' ')
7272

7373
// test that the form can be submitted and a new network interface is created
7474
await sidebar.getByRole('button', { name: 'Add network interface' }).click()
@@ -92,12 +92,12 @@ test('can create a NIC with IPv6 only', async ({ page }) => {
9292
await page.getByLabel('Name').fill('nic-3')
9393
await page.getByLabel('VPC', { exact: true }).click()
9494
await page.getByRole('option', { name: 'mock-vpc' }).click()
95-
await page.getByRole('dialog').getByRole('button', { name: 'Subnet' }).click()
95+
await page.getByRole('dialog').getByRole('button', { name: 'VPC subnet' }).click()
9696
await page.getByRole('option', { name: 'mock-subnet', exact: true }).click()
9797

9898
// Select IPv6 only
9999
await page.getByRole('radio', { name: 'IPv6', exact: true }).click()
100-
await page.getByLabel('IPv6 Address').fill('::1')
100+
await page.getByLabel('IPv6 address').fill('::1')
101101

102102
const sidebar = page.getByRole('dialog', { name: 'Add network interface' })
103103
await sidebar.getByRole('button', { name: 'Add network interface' }).click()
@@ -117,12 +117,12 @@ test('can create a NIC with dual-stack and explicit IPs', async ({ page }) => {
117117
await page.getByLabel('Name').fill('nic-4')
118118
await page.getByLabel('VPC', { exact: true }).click()
119119
await page.getByRole('option', { name: 'mock-vpc' }).click()
120-
await page.getByRole('dialog').getByRole('button', { name: 'Subnet' }).click()
120+
await page.getByRole('dialog').getByRole('button', { name: 'VPC subnet' }).click()
121121
await page.getByRole('option', { name: 'mock-subnet', exact: true }).click()
122122

123123
// Dual-stack is selected by default
124-
await page.getByLabel('IPv4 Address').fill('10.0.0.5')
125-
await page.getByLabel('IPv6 Address').fill('fd00::5')
124+
await page.getByLabel('IPv4 address').fill('10.0.0.5')
125+
await page.getByLabel('IPv6 address').fill('fd00::5')
126126

127127
const sidebar = page.getByRole('dialog', { name: 'Add network interface' })
128128
await sidebar.getByRole('button', { name: 'Add network interface' }).click()

0 commit comments

Comments
 (0)