Skip to content

Commit a6b944b

Browse files
authored
fix(frontend): fixes optional pipeline inputs. Fixes #11632 (#11657)
Signed-off-by: izuku-sds <[email protected]>
1 parent f7c0616 commit a6b944b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

frontend/src/components/NewRunParametersV2.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ function convertInput(paramStr: string, paramType: ParameterType_ParameterTypeEn
120120
function generateInputValidationErrMsg(
121121
parametersInRealType: any,
122122
paramType: ParameterType_ParameterTypeEnum,
123+
isOptional: boolean = false,
123124
) {
125+
// If the parameter is optional then don't report error on undefined.
126+
if (parametersInRealType === undefined && isOptional) {
127+
return null;
128+
}
124129
let errorMessage;
125130
switch (parametersInRealType) {
126131
case undefined:
@@ -318,6 +323,7 @@ function NewRunParametersV2(props: NewRunParametersProps) {
318323
errorMessages[k] = generateInputValidationErrMsg(
319324
parametersInRealType[k],
320325
specParameters[k].parameterType,
326+
specParameters[k].isOptional,
321327
);
322328
setErrorMessages(errorMessages);
323329

0 commit comments

Comments
 (0)