Skip to content
/ bud Public

Commit b47f0e9

Browse files
authored
🩹 fix(patch): fix casing in dashboard of Dev (#2398)
- `dev` should be `Dev` (to match `Proxy`). ## Type of change **PATCH: backwards compatible change**
1 parent 1219923 commit b47f0e9

File tree

2 files changed

+43
-30
lines changed

2 files changed

+43
-30
lines changed

sources/@roots/bud-dashboard/src/views/server.tsx

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ export const Server = ({
3232
)
3333
return null
3434

35-
const ipv4 = externalNetworkInterface.ipv4Url(devUrl.protocol)
36-
ipv4.port = devUrl.port
37-
3835
return (
3936
<Box flexDirection="column">
4037
<Text color="blue">Network</Text>
@@ -46,31 +43,7 @@ export const Server = ({
4643
publicProxyUrl={publicProxyUrl}
4744
/>
4845

49-
{devUrl?.href && (
50-
<Box flexDirection="row" gap={2} paddingLeft={1}>
51-
<Box minWidth={7}>
52-
<Text color="white">{figures.pointerSmall} dev</Text>
53-
</Box>
54-
55-
<Box flexDirection="column">
56-
<Text dimColor wrap="truncate-end">
57-
{figures.lineDashed0} {devUrl.href}
58-
</Text>
59-
60-
{ipv4.href !== devUrl.href && (
61-
<Text dimColor wrap="truncate-end">
62-
{figures.lineDashed0} {ipv4.href}
63-
</Text>
64-
)}
65-
66-
{publicDevUrl && publicDevUrl?.href !== devUrl.href && (
67-
<Text dimColor wrap="truncate-end">
68-
{figures.lineDashed0} {publicDevUrl.href}
69-
</Text>
70-
)}
71-
</Box>
72-
</Box>
73-
)}
46+
<Dev devUrl={devUrl} publicDevUrl={publicDevUrl} />
7447
</Box>
7548
)
7649
}
@@ -108,4 +81,44 @@ const Proxy = ({
10881
)
10982
}
11083

84+
const Dev = ({
85+
devUrl,
86+
publicDevUrl,
87+
}: {
88+
devUrl: Props[`devUrl`]
89+
publicDevUrl: Props[`publicDevUrl`]
90+
}) => {
91+
if (!devUrl?.href) return null
92+
93+
const ipv4 = externalNetworkInterface.ipv4Url(devUrl.protocol)
94+
ipv4.port = devUrl.port
95+
96+
return (
97+
<Box flexDirection="row" gap={2} paddingLeft={1}>
98+
<Box minWidth={7}>
99+
<Text color="white">{figures.pointerSmall} Dev</Text>
100+
</Box>
101+
102+
<Box flexDirection="column">
103+
<Text dimColor wrap="truncate-end">
104+
{figures.lineDashed0} {devUrl.href}
105+
</Text>
106+
107+
{ipv4.href !== devUrl.href && (
108+
<Text dimColor wrap="truncate-end">
109+
{figures.lineDashed0} {ipv4.href}
110+
</Text>
111+
)}
112+
113+
{publicDevUrl && publicDevUrl?.href !== devUrl.href && (
114+
<Text dimColor wrap="truncate-end">
115+
{figures.lineDashed0} {publicDevUrl.href}
116+
</Text>
117+
)}
118+
</Box>
119+
</Box>
120+
)
121+
}
122+
123+
111124
export {Server as default}

sources/@roots/bud-dashboard/test/app.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ describe(`@roots/bud-dashboard app component`, () => {
425425
expect(lines[14]).toMatch(/ Proxy http:\/\/.+:\d+\//)
426426
expect(lines[15]).toBe(Char.Empty)
427427
expect(lines[16]).toMatch(/ http:\/\/.+/)
428-
expect(lines[17]).toMatch(/ dev http:\/\/.+\//)
428+
expect(lines[17]).toMatch(/ Dev http:\/\/.+\//)
429429
expect(lines[18]).toMatch(
430430
/ http:\/\/\d+\.\d+\.\d+\.\d+:\d+\//,
431431
)
@@ -450,7 +450,7 @@ describe(`@roots/bud-dashboard app component`, () => {
450450
/>,
451451
)
452452
const lines = stripAnsi(frames.pop()).split(Char.NewLine)
453-
expect(lines[14]).toMatch(/ dev http:\/\/.+:\d+\//)
453+
expect(lines[14]).toMatch(/ Dev http:\/\/.+:\d+\//)
454454
})
455455

456456
it(`should not throw when crazy input happens`, () => {

0 commit comments

Comments
 (0)