Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit59e919a

Browse files
feat: add storybook for /deployments/general (#5595)
* refactor: split GeneralSettings page <> View* feat: add story for generalsettingspageview* Update site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.tsxCo-authored-by: Asher <ash@coder.com>Co-authored-by: Asher <ash@coder.com>
1 parent421e529 commit59e919a

File tree

4 files changed

+64
-13
lines changed

4 files changed

+64
-13
lines changed

‎site/src/AppRouter.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ const SettingsGroupPage = lazy(
7171
()=>import("./pages/GroupsPage/SettingsGroupPage"),
7272
)
7373
constGeneralSettingsPage=lazy(
74-
()=>import("./pages/DeploySettingsPage/GeneralSettingsPage"),
74+
()=>
75+
import(
76+
"./pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPage"
77+
),
7578
)
7679
constSecuritySettingsPage=lazy(
7780
()=>import("./pages/DeploySettingsPage/SecuritySettingsPage"),
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import{useDeploySettings}from"components/DeploySettingsLayout/DeploySettingsLayout"
2+
importReactfrom"react"
3+
import{Helmet}from"react-helmet-async"
4+
import{pageTitle}from"util/page"
5+
import{GeneralSettingsPageView}from"./GeneralSettingsPageView"
6+
7+
constGeneralSettingsPage:React.FC=()=>{
8+
const{deploymentConfig:deploymentConfig}=useDeploySettings()
9+
10+
return(
11+
<>
12+
<Helmet>
13+
<title>{pageTitle("General Settings")}</title>
14+
</Helmet>
15+
<GeneralSettingsPageViewdeploymentConfig={deploymentConfig}/>
16+
</>
17+
)
18+
}
19+
20+
exportdefaultGeneralSettingsPage
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import{ComponentMeta,Story}from"@storybook/react"
2+
import{
3+
GeneralSettingsPageView,
4+
GeneralSettingsPageViewProps,
5+
}from"./GeneralSettingsPageView"
6+
7+
exportdefault{
8+
title:"pages/GeneralSettingsPageView",
9+
component:GeneralSettingsPageView,
10+
argTypes:{
11+
deploymentConfig:{
12+
defaultValue:{
13+
access_url:{
14+
name:"Access URL",
15+
usage:
16+
"External URL to access your deployment. This must be accessible by all provisioned workspaces.",
17+
value:"https://dev.coder.com",
18+
},
19+
wildcard_access_url:{
20+
name:"Wildcard Access URL",
21+
usage:
22+
'Specifies the wildcard hostname to use for workspace applications in the form "*.example.com".',
23+
value:"*--apps.dev.coder.com",
24+
},
25+
},
26+
},
27+
},
28+
}asComponentMeta<typeofGeneralSettingsPageView>
29+
30+
constTemplate:Story<GeneralSettingsPageViewProps>=(args)=>(
31+
<GeneralSettingsPageView{...args}/>
32+
)
33+
exportconstPage=Template.bind({})
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
import{useDeploySettings}from"components/DeploySettingsLayout/DeploySettingsLayout"
1+
import{DeploymentConfig}from"api/typesGenerated"
22
import{Header}from"components/DeploySettingsLayout/Header"
33
importOptionsTablefrom"components/DeploySettingsLayout/OptionsTable"
4-
importReactfrom"react"
5-
import{Helmet}from"react-helmet-async"
6-
import{pageTitle}from"util/page"
7-
8-
constGeneralSettingsPage:React.FC=()=>{
9-
const{deploymentConfig:deploymentConfig}=useDeploySettings()
104

5+
exporttypeGeneralSettingsPageViewProps={
6+
deploymentConfig:Pick<DeploymentConfig,"access_url"|"wildcard_access_url">
7+
}
8+
exportconstGeneralSettingsPageView=({
9+
deploymentConfig,
10+
}:GeneralSettingsPageViewProps):JSX.Element=>{
1111
return(
1212
<>
13-
<Helmet>
14-
<title>{pageTitle("General Settings")}</title>
15-
</Helmet>
1613
<Header
1714
title="General"
1815
description="Information about your Coder deployment."
@@ -27,5 +24,3 @@ const GeneralSettingsPage: React.FC = () => {
2724
</>
2825
)
2926
}
30-
31-
exportdefaultGeneralSettingsPage

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp