Skip to content

Commit 87c4948

Browse files
authored
fix: do not block form control rendering for dynamic parameters on parsing error (#18185)
Defer to backend diagnostics when the values cannot be parsed and allow the form control to render so the user can select a different option.
1 parent 2a0a268 commit 87c4948

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

site/src/modules/workspaces/DynamicParameter/DynamicParameter.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,9 @@ const ParameterField: FC<ParameterFieldProps> = ({
387387
const parsedValues = parseStringArrayValue(value ?? "");
388388

389389
if (parsedValues.error) {
390-
return (
391-
<p className="text-sm text-content-destructive">
392-
{parsedValues.error}
393-
</p>
394-
);
390+
// Diagnostics on parameter already handle this case, do not duplicate error message
391+
// Reset user's values to an empty array. This would overwrite any default values
392+
parsedValues.values = [];
395393
}
396394

397395
// Map parameter options to MultiSelectCombobox options format
@@ -440,11 +438,9 @@ const ParameterField: FC<ParameterFieldProps> = ({
440438
const parsedValues = parseStringArrayValue(value ?? "");
441439

442440
if (parsedValues.error) {
443-
return (
444-
<p className="text-sm text-content-destructive">
445-
{parsedValues.error}
446-
</p>
447-
);
441+
// Diagnostics on parameter already handle this case, do not duplicate error message
442+
// Reset user's values to an empty array. This would overwrite any default values
443+
parsedValues.values = [];
448444
}
449445

450446
return (

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy