Repository navigation
Commit 0aa2f3c
authored
fix(server): Omit null fields in control JSON editor (#157)
## Summary
This updates the control JSON editor so `null` object fields are not
rendered in Full JSON mode.
## What changed
- Added a recursive UI-side normalizer that removes object properties
whose values are `null`
- Used that normalized shape when seeding the edit-control modal state
- Used null-free stringification when switching from form mode to Full
JSON mode
- Added a regression test covering a composite condition tree with
nullable transport fields
## Why
Controls are not persisted with these `null` keys in the database, but
the UI was rendering the nullable transport shape returned by the API.
That made Full JSON mode noisy with entries like `"or": null` and
`"selector": null`.
## Validation
- `pnpm exec eslint
src/core/page-components/agent-detail/modals/edit-control/edit-control-content.tsx
src/core/page-components/agent-detail/modals/edit-control/utils.ts
tests/agent-detail.spec.ts`
## Notes
- Full Playwright verification is currently blocked locally by unrelated
UI environment issues, including a missing `motion/react` module when
starting a fresh dev server.
- `make ui-typecheck` also currently fails elsewhere in the UI for
unrelated type errors.1 parent 439150f commit 0aa2f3c
2 files changed
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1367 | 1367 | | |
1368 | 1368 | | |
1369 | 1369 | | |
| 1370 | + | |
1370 | 1371 | | |
1371 | 1372 | | |
1372 | 1373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
147 | 219 | | |
148 | 220 | | |
149 | 221 | | |
| |||
0 commit comments