Commit 2389de8
authored
fix(topics): clamp default replication factor to broker count (#2420)
* fix(topics): clamp default replication factor to broker count
CreateTopic defaulted replicationFactor to 3 in both the topic-create
modal and the MCP inspector's "create new topic" flow. On single-broker
clusters (local-byoc dev environments, etc.) that rejected the request
with "not enough replicas". Clamp the default to min(3, brokersOnline)
and fall back to 3 while KafkaInfo is loading.
* fix(rp-connect): clamp onboarding topic RF to broker count
The RPCN onboarding Add Topic step spread TOPIC_FORM_DEFAULTS
(replicationFactor: 3) into the form and renders the RF field as
readOnly in AdvancedTopicSettings. On single-broker clusters
(local-byoc dev environments) that meant the user saw RF=3 with no
way to edit, and CreateTopic failed with "not enough replicas".
Override replicationFactor at form init with min(default, brokersOnline)
via useGetKafkaInfoQuery so the readOnly value matches what the broker
can actually satisfy.
* revert(mcp): drop RF clamp from MCP inspector
Scope back to the user-visible topic-create paths only. The MCP
inspector's "create new topic" flow is out of scope for this PR.
* fix(rp-connect): react to late-arriving KafkaInfo via rhf `values`
useForm captures defaultValues at mount; when the KafkaInfo query
resolves after mount the RF field stays at its initial 3. Pass
defaultValues through both `defaultValues` and `values` with
`resetOptions: { keepDirtyValues: true }` so the form reactively
picks up the clamped replicationFactor once brokersOnline is known,
without clobbering fields the user has already edited.
* fix(topics): isolate keepDirtyValues to RPCN form watch only
Address PR review feedback on #2420. The form-level
`resetOptions: { keepDirtyValues: true }` (added so dirty fields
survive the late `kafkaInfo` re-init) was leaking into the
existing-topic-selected reset, where dirty fields should be
overwritten by the selected topic's actual config.
Also tighten the RF clamp comment in `create-topic-modal.tsx` to
cover the all-brokers-offline case, not just the loading case.
Refs UX-1208.1 parent 357c64a commit 2389de8
2 files changed
Lines changed: 34 additions & 3 deletions
File tree
- frontend/src/components/pages
- rp-connect/onboarding
- topics
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
107 | 118 | | |
108 | 119 | | |
109 | 120 | | |
| 121 | + | |
110 | 122 | | |
111 | 123 | | |
112 | | - | |
| 124 | + | |
113 | 125 | | |
114 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
115 | 132 | | |
116 | 133 | | |
117 | 134 | | |
118 | 135 | | |
| 136 | + | |
| 137 | + | |
119 | 138 | | |
120 | 139 | | |
121 | 140 | | |
| |||
147 | 166 | | |
148 | 167 | | |
149 | 168 | | |
150 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
151 | 173 | | |
152 | 174 | | |
153 | 175 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
47 | 56 | | |
48 | 57 | | |
49 | 58 | | |
| |||
57 | 66 | | |
58 | 67 | | |
59 | 68 | | |
60 | | - | |
| 69 | + | |
61 | 70 | | |
62 | 71 | | |
63 | 72 | | |
| |||
0 commit comments