File tree 1 file changed +19
-18
lines changed
site/src/pages/CreateWorkspacePage
1 file changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,10 @@ export const CreateWorkspacePageView: FC<
135
135
} )
136
136
137
137
const isLoading = props . loadingTemplateSchema || props . loadingTemplates
138
+ // We only want to show schema that have redisplay_value equals true
139
+ const schemaToBeDisplayed = props . templateSchema ?. filter (
140
+ ( schema ) => schema . redisplay_value ,
141
+ )
138
142
139
143
const getFieldHelpers = getFormHelpers < TypesGen . CreateWorkspaceRequest > (
140
144
form ,
@@ -271,29 +275,26 @@ export const CreateWorkspacePageView: FC<
271
275
) }
272
276
273
277
{ /* Template params */ }
274
- { props . templateSchema && props . templateSchema . length > 0 && (
278
+ { schemaToBeDisplayed && schemaToBeDisplayed . length > 0 && (
275
279
< FormSection
276
280
title = "Template params"
277
281
description = "These values are provided by your template's Terraform configuration."
278
282
>
279
283
< FormFields >
280
- { props . templateSchema
281
- // We only want to show schema that have redisplay_value equals true
282
- . filter ( ( schema ) => schema . redisplay_value )
283
- . map ( ( schema ) => (
284
- < ParameterInput
285
- disabled = { form . isSubmitting }
286
- key = { schema . id }
287
- defaultValue = { parameterValues [ schema . name ] }
288
- onChange = { ( value ) => {
289
- setParameterValues ( {
290
- ...parameterValues ,
291
- [ schema . name ] : value ,
292
- } )
293
- } }
294
- schema = { schema }
295
- />
296
- ) ) }
284
+ { schemaToBeDisplayed . map ( ( schema ) => (
285
+ < ParameterInput
286
+ disabled = { form . isSubmitting }
287
+ key = { schema . id }
288
+ defaultValue = { parameterValues [ schema . name ] }
289
+ onChange = { ( value ) => {
290
+ setParameterValues ( {
291
+ ...parameterValues ,
292
+ [ schema . name ] : value ,
293
+ } )
294
+ } }
295
+ schema = { schema }
296
+ />
297
+ ) ) }
297
298
</ FormFields >
298
299
</ FormSection >
299
300
) }
You can’t perform that action at this time.
0 commit comments