Commit b44ec86
fix(DatasourceModal): replace imperative modal updates with declarative state
Fixes DOM error "Failed to execute 'insertBefore' on 'Node'" by replacing
imperative modal.update() calls with React state management.
Changes:
- Convert syncColumnsRef to syncColumns state variable
- Remove confirmModal state and imperative update calls
- Simplify modal creation to not store instance
- Add tests to verify useModal hook usage and prevent regressions
- Remove unused useRef import
The modal content now updates declaratively through React re-renders
instead of direct DOM manipulation, eliminating insertion conflicts.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 36daa2d commit b44ec86
2 files changed
Lines changed: 120 additions & 31 deletions
File tree
- superset-frontend/src/components/Datasource/DatasourceModal
Lines changed: 112 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
Lines changed: 8 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 19 | + | |
26 | 20 | | |
27 | 21 | | |
28 | 22 | | |
| |||
101 | 95 | | |
102 | 96 | | |
103 | 97 | | |
104 | | - | |
105 | | - | |
| 98 | + | |
106 | 99 | | |
107 | 100 | | |
108 | 101 | | |
| |||
114 | 107 | | |
115 | 108 | | |
116 | 109 | | |
117 | | - | |
118 | 110 | | |
119 | 111 | | |
120 | 112 | | |
| |||
196 | 188 | | |
197 | 189 | | |
198 | 190 | | |
199 | | - | |
| 191 | + | |
200 | 192 | | |
201 | 193 | | |
202 | 194 | | |
| |||
281 | 273 | | |
282 | 274 | | |
283 | 275 | | |
284 | | - | |
| 276 | + | |
285 | 277 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
| 278 | + | |
292 | 279 | | |
293 | 280 | | |
294 | 281 | | |
| |||
303 | 290 | | |
304 | 291 | | |
305 | 292 | | |
306 | | - | |
| 293 | + | |
307 | 294 | | |
308 | 295 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | 296 | | |
318 | 297 | | |
319 | | - | |
| 298 | + | |
320 | 299 | | |
321 | 300 | | |
322 | 301 | | |
323 | 302 | | |
324 | | - | |
| 303 | + | |
325 | 304 | | |
326 | 305 | | |
327 | 306 | | |
328 | 307 | | |
329 | 308 | | |
330 | 309 | | |
331 | 310 | | |
332 | | - | |
333 | | - | |
334 | 311 | | |
335 | 312 | | |
336 | 313 | | |
| |||
0 commit comments