Commit 496ceb9
committed
Resolves #7366 (FR-2824)
## Summary
Migrate the resource-policy lists (Keypair / User / Project) from the legacy `pagination.extraContent` + `TableColumnsSettingModal` column-settings setup to the canonical `BAITable` `tableSettings` prop, so the footer renders the same `[total, pagination, page size, ⚙ column-settings, ⋮ export]` order as the rest of the app (`UserManagement`, `AutoScalingRuleList`, etc.).
## Background
The earlier version of this PR added `exportSettings` to `BAITable` for the CSV-export ⋮ menu, but kept the legacy `pagination.extraContent` button rendering a separate ⚙ column-settings icon. Because `extraContent` is appended after `exportSettings`, the footer ended up as `[..., ⋮ export, ⚙ column-settings]` — opposite of every other table in the app. Reviewer pointed out the inconsistency.
## Changes
For each of `react/src/components/{KeypairResourcePolicyList,UserResourcePolicyList,ProjectResourcePolicyList}.tsx`:
- Removed `useHiddenColumnKeysSetting` + `TableColumnsSettingModal` + the `useToggle()` modal state.
- Removed the `pagination.extraContent` ⚙ button.
- Removed manual `_.filter(columns, …hiddenColumnKeys…)` column filtering.
- Added `useBAISettingUserState('table_column_overrides.<ListName>')` to source `columnOverrides` / `setColumnOverrides`.
- Passed them to `BAITable` via `tableSettings={{ columnOverrides, onColumnOverridesChange }}` (matches `UserManagement.tsx:487` exactly).
- Kept the already-added `exportSettings={{ supportedFields, onExport }}`.
`BAITable` then renders the canonical footer ordering automatically.
## Test plan
- [ ] Open **Resource Policy → Keypair Resource Policy** tab. Footer shows `[total, pagination, page size, ⚙, ⋮]`. Click ⚙ to toggle column visibility — state persists across reloads (BAI user-state). Click ⋮ → ExportCSV — downloads with the visible columns.
- [ ] Repeat for **User Resource Policy** tab.
- [ ] Repeat for **Project Resource Policy** tab.
- [ ] `bash scripts/verify.sh` — Relay / Lint / Format / TypeScript pass for the modified files (pre-existing TS errors in unrelated files remain).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 2ecde6f commit 496ceb9
3 files changed
Lines changed: 125 additions & 250 deletions
File tree
- react/src/components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
27 | | - | |
| 25 | + | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| |||
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | | - | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
| |||
58 | 55 | | |
59 | 56 | | |
60 | 57 | | |
61 | | - | |
62 | | - | |
63 | 58 | | |
64 | 59 | | |
65 | 60 | | |
| |||
263 | 258 | | |
264 | 259 | | |
265 | 260 | | |
266 | | - | |
267 | | - | |
| 261 | + | |
| 262 | + | |
268 | 263 | | |
269 | 264 | | |
270 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
271 | 274 | | |
272 | 275 | | |
273 | 276 | | |
274 | 277 | | |
275 | 278 | | |
276 | | - | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
280 | | - | |
| 282 | + | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
| |||
301 | 303 | | |
302 | 304 | | |
303 | 305 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 306 | + | |
| 307 | + | |
338 | 308 | | |
339 | | - | |
340 | | - | |
| 309 | + | |
| 310 | + | |
341 | 311 | | |
342 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
343 | 315 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
348 | 327 | | |
349 | 328 | | |
350 | 329 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
| 330 | + | |
357 | 331 | | |
358 | 332 | | |
359 | 333 | | |
360 | 334 | | |
361 | 335 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | 336 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
386 | 346 | | |
387 | | - | |
388 | | - | |
389 | 347 | | |
390 | 348 | | |
391 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
| 26 | + | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
41 | | - | |
42 | 39 | | |
43 | 40 | | |
44 | 41 | | |
| |||
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
63 | | - | |
64 | | - | |
65 | 60 | | |
66 | 61 | | |
67 | 62 | | |
| |||
190 | 185 | | |
191 | 186 | | |
192 | 187 | | |
193 | | - | |
194 | | - | |
| 188 | + | |
| 189 | + | |
195 | 190 | | |
196 | 191 | | |
197 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
202 | 205 | | |
203 | | - | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
207 | | - | |
| 209 | + | |
208 | 210 | | |
209 | 211 | | |
210 | 212 | | |
| |||
221 | 223 | | |
222 | 224 | | |
223 | 225 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 226 | + | |
| 227 | + | |
258 | 228 | | |
259 | | - | |
260 | | - | |
| 229 | + | |
| 230 | + | |
261 | 231 | | |
262 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
263 | 235 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
268 | 247 | | |
269 | 248 | | |
270 | 249 | | |
271 | 250 | | |
272 | 251 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
| 252 | + | |
277 | 253 | | |
278 | 254 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
289 | 258 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
302 | 264 | | |
303 | | - | |
304 | | - | |
305 | 265 | | |
306 | 266 | | |
307 | 267 | | |
| |||
0 commit comments