File tree 2 files changed +10
-1
lines changed
site/src/pages/CreateWorkspacePage
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,15 @@ const CreateWorkspacePage: FC = () => {
44
44
} = createWorkspaceState . context
45
45
const [ searchParams ] = useSearchParams ( )
46
46
const defaultParameterValues = getDefaultParameterValues ( searchParams )
47
+ const name = getName ( searchParams )
47
48
48
49
return (
49
50
< >
50
51
< Helmet >
51
52
< title > { pageTitle ( "Create Workspace" ) } </ title >
52
53
</ Helmet >
53
54
< CreateWorkspacePageView
55
+ name = { name }
54
56
defaultParameterValues = { defaultParameterValues }
55
57
loadingTemplates = { createWorkspaceState . matches ( "gettingTemplates" ) }
56
58
loadingTemplateSchema = { createWorkspaceState . matches (
@@ -96,6 +98,12 @@ const CreateWorkspacePage: FC = () => {
96
98
)
97
99
}
98
100
101
+ const getName = (
102
+ urlSearchParams : URLSearchParams ,
103
+ ) : string => {
104
+ return urlSearchParams . get ( "name" ) ?? ""
105
+ }
106
+
99
107
const getDefaultParameterValues = (
100
108
urlSearchParams : URLSearchParams ,
101
109
) : Record < string , string > => {
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export enum CreateWorkspaceErrors {
35
35
}
36
36
37
37
export interface CreateWorkspacePageViewProps {
38
+ name : string
38
39
loadingTemplates : boolean
39
40
loadingTemplateSchema : boolean
40
41
creatingWorkspace : boolean
@@ -92,7 +93,7 @@ export const CreateWorkspacePageView: FC<
92
93
const form : FormikContextType < TypesGen . CreateWorkspaceRequest > =
93
94
useFormik < TypesGen . CreateWorkspaceRequest > ( {
94
95
initialValues : {
95
- name : "" ,
96
+ name : props . name ,
96
97
template_id : props . selectedTemplate ? props . selectedTemplate . id : "" ,
97
98
rich_parameter_values : initialRichParameterValues ,
98
99
} ,
You can’t perform that action at this time.
0 commit comments