File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
site/src/pages/CreateWorkspacePage Expand file tree Collapse file tree 2 files changed +8
-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,10 @@ const CreateWorkspacePage: FC = () => {
96
98
)
97
99
}
98
100
101
+ const getName = ( urlSearchParams : URLSearchParams ) : string => {
102
+ return urlSearchParams . get ( "name" ) ?? ""
103
+ }
104
+
99
105
const getDefaultParameterValues = (
100
106
urlSearchParams : URLSearchParams ,
101
107
) : Record < string , string > => {
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ export enum CreateWorkspaceErrors {
38
38
}
39
39
40
40
export interface CreateWorkspacePageViewProps {
41
+ name : string
41
42
loadingTemplates : boolean
42
43
loadingTemplateSchema : boolean
43
44
creatingWorkspace : boolean
@@ -95,7 +96,7 @@ export const CreateWorkspacePageView: FC<
95
96
const form : FormikContextType < TypesGen . CreateWorkspaceRequest > =
96
97
useFormik < TypesGen . CreateWorkspaceRequest > ( {
97
98
initialValues : {
98
- name : "" ,
99
+ name : props . name ,
99
100
template_id : props . selectedTemplate ? props . selectedTemplate . id : "" ,
100
101
rich_parameter_values : initialRichParameterValues ,
101
102
} ,
You can’t perform that action at this time.
0 commit comments