@@ -30,12 +30,14 @@ import {
30
30
import { CreateWSPermissions } from "xServices/createWorkspace/createWorkspaceXService" ;
31
31
import { GitAuth } from "./GitAuth" ;
32
32
import { ErrorAlert } from "components/Alert/ErrorAlert" ;
33
+ import { Stack } from "components/Stack/Stack" ;
33
34
34
35
export interface CreateWorkspacePageViewProps {
35
36
error : unknown ;
36
37
defaultName : string ;
37
38
defaultOwner : TypesGen . User ;
38
39
template : TypesGen . Template ;
40
+ versionId ?: string ;
39
41
gitAuth : TypesGen . TemplateVersionGitAuth [ ] ;
40
42
parameters : TypesGen . TemplateVersionParameter [ ] ;
41
43
defaultBuildParameters : TypesGen . WorkspaceBuildParameter [ ] ;
@@ -53,6 +55,7 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
53
55
defaultName,
54
56
defaultOwner,
55
57
template,
58
+ versionId,
56
59
gitAuth,
57
60
parameters,
58
61
defaultBuildParameters,
@@ -115,6 +118,19 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
115
118
>
116
119
< FormFields >
117
120
< SelectedTemplate template = { template } />
121
+ { versionId && (
122
+ < Stack spacing = { 1 } className = { styles . hasDescription } >
123
+ < TextField
124
+ disabled
125
+ fullWidth
126
+ value = { versionId }
127
+ label = { t ( "versionLabel" ) }
128
+ />
129
+ < span className = { styles . description } >
130
+ This parameter has been preset, and cannot be modified.
131
+ </ span >
132
+ </ Stack >
133
+ ) }
118
134
< TextField
119
135
{ ...getFieldHelpers ( "name" ) }
120
136
disabled = { form . isSubmitting }
@@ -252,6 +268,13 @@ const useGitAuthVerification = (gitAuth: TypesGen.TemplateVersionGitAuth[]) => {
252
268
} ;
253
269
254
270
const useStyles = makeStyles ( ( theme ) => ( {
271
+ hasDescription : {
272
+ paddingBottom : theme . spacing ( 2 ) ,
273
+ } ,
274
+ description : {
275
+ fontSize : 13 ,
276
+ color : theme . palette . text . secondary ,
277
+ } ,
255
278
warningText : {
256
279
color : theme . palette . warning . light ,
257
280
} ,
0 commit comments