@@ -172,29 +172,26 @@ const ParameterField: FC<ParameterFieldProps> = ({
172
172
< SelectValue placeholder = "Select option" />
173
173
</ SelectTrigger >
174
174
< SelectContent >
175
- { parameter . options
176
- . map ( ( option ) => (
177
- < SelectItem key = { option . value . value } value = { option . value . value } >
178
- < OptionDisplay option = { option } />
179
- </ SelectItem >
180
- ) ) }
175
+ { parameter . options . map ( ( option ) => (
176
+ < SelectItem key = { option . value . value } value = { option . value . value } >
177
+ < OptionDisplay option = { option } />
178
+ </ SelectItem >
179
+ ) ) }
181
180
</ SelectContent >
182
181
</ Select >
183
182
) ;
184
183
185
184
case "multi-select" : {
186
185
// Map parameter options to MultiSelectCombobox options format
187
- const comboboxOptions : Option [ ] = parameter . options
188
- . map ( ( opt ) => ( {
189
- value : opt . value . value ,
190
- label : opt . name ,
191
- disable : false ,
192
- } ) ) ;
186
+ const comboboxOptions : Option [ ] = parameter . options . map ( ( opt ) => ( {
187
+ value : opt . value . value ,
188
+ label : opt . name ,
189
+ disable : false ,
190
+ } ) ) ;
193
191
194
192
const defaultOptions : Option [ ] = JSON . parse ( defaultValue ) . map (
195
193
( val : string ) => {
196
- const option = parameter . options
197
- . find ( ( o ) => o . value . value === val ) ;
194
+ const option = parameter . options . find ( ( o ) => o . value . value === val ) ;
198
195
return {
199
196
value : val ,
200
197
label : option ?. name || val ,
@@ -244,21 +241,20 @@ const ParameterField: FC<ParameterFieldProps> = ({
244
241
disabled = { disabled }
245
242
defaultValue = { defaultValue }
246
243
>
247
- { parameter . options
248
- . map ( ( option ) => (
249
- < div
250
- key = { option . value . value }
251
- className = "flex items-center space-x-2"
252
- >
253
- < RadioGroupItem
254
- id = { option . value . value }
255
- value = { option . value . value }
256
- />
257
- < Label htmlFor = { option . value . value } className = "cursor-pointer" >
258
- < OptionDisplay option = { option } />
259
- </ Label >
260
- </ div >
261
- ) ) }
244
+ { parameter . options . map ( ( option ) => (
245
+ < div
246
+ key = { option . value . value }
247
+ className = "flex items-center space-x-2"
248
+ >
249
+ < RadioGroupItem
250
+ id = { option . value . value }
251
+ value = { option . value . value }
252
+ />
253
+ < Label htmlFor = { option . value . value } className = "cursor-pointer" >
254
+ < OptionDisplay option = { option } />
255
+ </ Label >
256
+ </ div >
257
+ ) ) }
262
258
</ RadioGroup >
263
259
) ;
264
260
@@ -352,20 +348,19 @@ const ParameterDiagnostics: FC<ParameterDiagnosticsProps> = ({
352
348
} ) => {
353
349
return (
354
350
< div className = "flex flex-col gap-2" >
355
- { diagnostics
356
- . map ( ( diagnostic , index ) => (
357
- < div
358
- key = { `diagnostic-${ diagnostic . summary } -${ index } ` }
359
- className = { `text-xs px-1 ${
360
- diagnostic . severity === "error"
361
- ? "text-content-destructive"
362
- : "text-content-warning"
363
- } `}
364
- >
365
- < div className = "font-medium" > { diagnostic . summary } </ div >
366
- { diagnostic . detail && < div > { diagnostic . detail } </ div > }
367
- </ div >
368
- ) ) }
351
+ { diagnostics . map ( ( diagnostic , index ) => (
352
+ < div
353
+ key = { `diagnostic-${ diagnostic . summary } -${ index } ` }
354
+ className = { `text-xs px-1 ${
355
+ diagnostic . severity === "error"
356
+ ? "text-content-destructive"
357
+ : "text-content-warning"
358
+ } `}
359
+ >
360
+ < div className = "font-medium" > { diagnostic . summary } </ div >
361
+ { diagnostic . detail && < div > { diagnostic . detail } </ div > }
362
+ </ div >
363
+ ) ) }
369
364
</ div >
370
365
) ;
371
366
} ;
@@ -439,10 +434,12 @@ export const useValidationSchemaForDynamicParameters = (
439
434
if ( parameter ) {
440
435
switch ( parameter . type ) {
441
436
case "number" : {
442
- const minValidation = parameter . validations
443
- . find ( ( v ) => v . validation_min !== null ) ;
444
- const maxValidation = parameter . validations
445
- . find ( ( v ) => v . validation_max !== null ) ;
437
+ const minValidation = parameter . validations . find (
438
+ ( v ) => v . validation_min !== null ,
439
+ ) ;
440
+ const maxValidation = parameter . validations . find (
441
+ ( v ) => v . validation_max !== null ,
442
+ ) ;
446
443
447
444
if (
448
445
minValidation &&
@@ -551,12 +548,15 @@ const parameterError = (
551
548
parameter : PreviewParameter ,
552
549
value ?: string ,
553
550
) : string | undefined => {
554
- const validation_error = parameter . validations
555
- . find ( ( v ) => v . validation_error !== null ) ;
556
- const minValidation = parameter . validations
557
- . find ( ( v ) => v . validation_min !== null ) ;
558
- const maxValidation = parameter . validations
559
- . find ( ( v ) => v . validation_max !== null ) ;
551
+ const validation_error = parameter . validations . find (
552
+ ( v ) => v . validation_error !== null ,
553
+ ) ;
554
+ const minValidation = parameter . validations . find (
555
+ ( v ) => v . validation_min !== null ,
556
+ ) ;
557
+ const maxValidation = parameter . validations . find (
558
+ ( v ) => v . validation_max !== null ,
559
+ ) ;
560
560
561
561
if ( ! validation_error || ! value ) {
562
562
return ;
0 commit comments