Commit ecdd93b
fix(FR-2773): preserve auto-selected resourcePresetId across applyInitialValues
The Resource Preset row showed '-' on the deployment launcher review step
even though the user had a preset selected on step 3.
Root cause: `applyInitialValues` runs after ResourcePresetSelect's child
`autoSelectDefault` effect on mount, and `setFieldsValue` was writing
`resourcePresetId: undefined` from `merged`, clobbering the value the
child had already auto-selected. ResourcePresetSelect uses
`useControllableState_deprecated` whose `stateRef` retains the
auto-selected value when the antd-injected `value` is undefined, so the
step-3 Select still displayed the preset name (giving the user the
impression it was selected) while `form.getFieldsValue()` returned
undefined — and the review summary's `values.resourcePresetId ? ... : '-'`
fell to the dash branch.
The existing code already handled this race for `resourceGroup` via
`_.omit(merged, 'resourceGroup')`. Generalize that omit list to also cover
`resourcePresetId` so any field whose child component owns autoSelect is
left alone when the merged value is empty.1 parent b6d3266 commit ecdd93b
1 file changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
503 | 516 | | |
504 | | - | |
505 | | - | |
506 | | - | |
| 517 | + | |
507 | 518 | | |
508 | 519 | | |
509 | 520 | | |
| |||
0 commit comments