Skip to content

Commit 6ed5fe4

Browse files
committed
ProxyPageView -> ProxyView
1 parent 0d0ed87 commit 6ed5fe4

File tree

3 files changed

+56
-56
lines changed

3 files changed

+56
-56
lines changed

site/src/pages/UserSettingsPage/WorkspaceProxyPage/WorkspaceProxyPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, PropsWithChildren } from "react"
22
import { Section } from "components/SettingsLayout/Section"
3-
import { WorkspaceProxyPageView } from "./WorkspaceProxyView"
3+
import { WorkspaceProxyView } from "./WorkspaceProxyView"
44
import makeStyles from "@material-ui/core/styles/makeStyles"
55
import { Trans } from "react-i18next"
66
import { useWorkspaceProxiesData } from "./hooks"
@@ -41,7 +41,7 @@ export const WorkspaceProxyPage: FC<PropsWithChildren<unknown>> = () => {
4141
description={description}
4242
layout="fluid"
4343
>
44-
<WorkspaceProxyPageView
44+
<WorkspaceProxyView
4545
proxies={response ? response.regions : []}
4646
isLoading={isFetching}
4747
hasLoaded={isFetched}

site/src/pages/UserSettingsPage/WorkspaceProxyPage/WorkspaceProxyView.tsx

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { AlertBanner } from "components/AlertBanner/AlertBanner"
1313
import { Region } from "api/typesGenerated"
1414
import { ProxyRow } from "./WorkspaceProxyRow"
1515

16-
export interface WorkspaceProxyPageViewProps {
16+
export interface WorkspaceProxyViewProps {
1717
proxies?: Region[]
1818
getWorkspaceProxiesError?: Error | unknown
1919
isLoading: boolean
@@ -23,8 +23,8 @@ export interface WorkspaceProxyPageViewProps {
2323
selectProxyError?: Error | unknown
2424
}
2525

26-
export const WorkspaceProxyPageView: FC<
27-
React.PropsWithChildren<WorkspaceProxyPageViewProps>
26+
export const WorkspaceProxyView: FC<
27+
React.PropsWithChildren<WorkspaceProxyViewProps>
2828
> = ({
2929
proxies,
3030
getWorkspaceProxiesError,
@@ -34,47 +34,47 @@ export const WorkspaceProxyPageView: FC<
3434
selectProxyError,
3535
preferredProxy,
3636
}) => {
37-
return (
38-
<Stack>
39-
{Boolean(getWorkspaceProxiesError) && (
40-
<AlertBanner severity="error" error={getWorkspaceProxiesError} />
41-
)}
42-
{Boolean(selectProxyError) && (
43-
<AlertBanner severity="error" error={selectProxyError} />
44-
)}
45-
<TableContainer>
46-
<Table>
47-
<TableHead>
48-
<TableRow>
49-
<TableCell width="40%">Proxy</TableCell>
50-
<TableCell width="30%">URL</TableCell>
51-
<TableCell width="10%">Status</TableCell>
52-
</TableRow>
53-
</TableHead>
54-
<TableBody>
55-
<ChooseOne>
56-
<Cond condition={isLoading}>
57-
<TableLoader />
58-
</Cond>
59-
<Cond condition={hasLoaded && proxies?.length === 0}>
60-
<TableEmpty message="No workspace proxies found" />
61-
</Cond>
62-
<Cond>
63-
{proxies?.map((proxy) => (
64-
<ProxyRow
65-
key={proxy.id}
66-
proxy={proxy}
67-
onSelectRegion={onSelect}
68-
preferred={
69-
preferredProxy ? proxy.id === preferredProxy.id : false
70-
}
71-
/>
72-
))}
73-
</Cond>
74-
</ChooseOne>
75-
</TableBody>
76-
</Table>
77-
</TableContainer>
78-
</Stack>
79-
)
80-
}
37+
return (
38+
<Stack>
39+
{Boolean(getWorkspaceProxiesError) && (
40+
<AlertBanner severity="error" error={getWorkspaceProxiesError} />
41+
)}
42+
{Boolean(selectProxyError) && (
43+
<AlertBanner severity="error" error={selectProxyError} />
44+
)}
45+
<TableContainer>
46+
<Table>
47+
<TableHead>
48+
<TableRow>
49+
<TableCell width="40%">Proxy</TableCell>
50+
<TableCell width="30%">URL</TableCell>
51+
<TableCell width="10%">Status</TableCell>
52+
</TableRow>
53+
</TableHead>
54+
<TableBody>
55+
<ChooseOne>
56+
<Cond condition={isLoading}>
57+
<TableLoader />
58+
</Cond>
59+
<Cond condition={hasLoaded && proxies?.length === 0}>
60+
<TableEmpty message="No workspace proxies found" />
61+
</Cond>
62+
<Cond>
63+
{proxies?.map((proxy) => (
64+
<ProxyRow
65+
key={proxy.id}
66+
proxy={proxy}
67+
onSelectRegion={onSelect}
68+
preferred={
69+
preferredProxy ? proxy.id === preferredProxy.id : false
70+
}
71+
/>
72+
))}
73+
</Cond>
74+
</ChooseOne>
75+
</TableBody>
76+
</Table>
77+
</TableContainer>
78+
</Stack>
79+
)
80+
}

site/src/pages/UserSettingsPage/WorkspaceProxyPage/WorspaceProxyView.stories.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ import {
66
MockHealthyWildRegion,
77
} from "testHelpers/entities"
88
import {
9-
WorkspaceProxyPageView,
10-
WorkspaceProxyPageViewProps,
9+
WorkspaceProxyView,
10+
WorkspaceProxyViewProps,
1111
} from "./WorkspaceProxyView"
1212

1313
export default {
14-
title: "components/WorkspaceProxyPageView",
15-
component: WorkspaceProxyPageView,
14+
title: "components/WorkspaceProxyView",
15+
component: WorkspaceProxyView,
1616
args: {
1717
onRegenerateClick: { action: "Submit" },
1818
},
1919
}
2020

21-
const Template: Story<WorkspaceProxyPageViewProps> = (
22-
args: WorkspaceProxyPageViewProps,
23-
) => <WorkspaceProxyPageView {...args} />
21+
const Template: Story<WorkspaceProxyViewProps> = (
22+
args: WorkspaceProxyViewProps,
23+
) => <WorkspaceProxyView {...args} />
2424

2525
export const PrimarySelected = Template.bind({})
2626
PrimarySelected.args = {

0 commit comments

Comments
 (0)