fix(ui): render guardrail optional_params bool defaults in Select

The bool branch of the guardrail optional params renderer was using
string values ("true"/"false") for Select.Option, so when the backend
declared a real JS boolean as default_value (e.g. Pillar
include_scanners/include_evidence, IBM block_on_detection), antd's
Form.Item initialValue did not match any Option and the Select
rendered empty. Switching to real boolean Option values lets defaults
flow through unchanged. This matches the sibling fix already applied
in guardrail_provider_fields.tsx for Noma use_v2.
This commit is contained in:
Ryan Crabbe 2026-04-15 11:55:51 -07:00
parent 72a461ba4a
commit f04a5e7113
No known key found for this signature in database

View file

@ -192,8 +192,8 @@ const GuardrailOptionalParams: React.FC<GuardrailOptionalParamsProps> = ({
</Select>
) : field.type === "bool" || field.type === "boolean" ? (
<Select placeholder={field.description}>
<Select.Option value="true">True</Select.Option>
<Select.Option value="false">False</Select.Option>
<Select.Option value={true}>True</Select.Option>
<Select.Option value={false}>False</Select.Option>
</Select>
) : field.type === "number" ? (
<NumericalInput step={1} width={400} placeholder={field.description} />