feat: migrate DeleteModal to new component structure and update related tests#26561
feat: migrate DeleteModal to new component structure and update related tests#26561
Conversation
|
|
||
| case FieldTypes.SWITCH_MUI: { | ||
| case FieldTypes.UT_SWITCH: { | ||
| const { isDisabled, onChange, size, ...switchRest } = |
There was a problem hiding this comment.
⚠️ Bug: Spread of switchRest can silently override explicit label prop
In formUtils.tsx:471, label is not destructured out of props as ToggleProps before creating switchRest. Since label is a valid ToggleProps property, if any caller passes label inside props, it will remain in switchRest and the spread {...switchRest} on line 481 will override the explicit label={isString(label) ? label : undefined} set on line 478 (due to JSX spread ordering — later props win).
Currently no callers pass label in props, but this is a latent bug that will silently break when someone does.
Suggested fix:
const { isDisabled, onChange, size, label: propsLabel, ...switchRest } =
props as ToggleProps;
return (
<Form.Item {...formProps} valuePropName="isSelected">
<Toggle
isDisabled={isDisabled}
label={propsLabel ?? (isString(label) ? label : undefined)}
size={size}
onChange={onChange}
{...switchRest}
/>
</Form.Item>
);
Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion
🟡 Playwright Results — all passed (15 flaky)✅ 3389 passed · ❌ 0 failed · 🟡 15 flaky · ⏭️ 183 skipped
🟡 15 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|



Describe your changes:
Fixes
collate PR - https://github.com/open-metadata/openmetadata-collate/pull/3186
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>