Skip to content

fix(FR-2824): move CSV export to BAITable bottom-right in resource policy lists#7366

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-12-fix_fr-2824_move_csv_export_to_baitable_bottom-right_in_resource_policy_lists
May 15, 2026
Merged

fix(FR-2824): move CSV export to BAITable bottom-right in resource policy lists#7366
graphite-app[bot] merged 1 commit into
mainfrom
05-12-fix_fr-2824_move_csv_export_to_baitable_bottom-right_in_resource_policy_lists

Conversation

@ironAiken2
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 commented May 12, 2026

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

Copilot AI review requested due to automatic review settings May 12, 2026 07:03
Copy link
Copy Markdown
Contributor Author

ironAiken2 commented May 12, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 12, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.45% 1783 / 27632
🔵 Statements 5.3% 1978 / 37266
🔵 Functions 5.19% 296 / 5702
🔵 Branches 3.71% 1293 / 34795
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/KeypairResourcePolicyList.tsx 0% 0% 0% 0% 50-417
react/src/components/ProjectResourcePolicyList.tsx 0% 0% 0% 0% 53-320
react/src/components/UserResourcePolicyList.tsx 0% 0% 0% 0% 50-321
Generated in workflow #752 for commit 496ceb9 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the three “resource policy list” table components to use BAITable’s built-in CSV export UI (bottom-right, next to pagination controls) instead of a separate top-right “ellipsis” dropdown export button.

Changes:

  • Removed the top-right Dropdown/ellipsis export button in the resource policy list headers.
  • Added exportSettings to each BAITable instance and routed export actions through the BAITable CSV export modal.
  • Updated CSV export handlers to accept a selectedExportKeys list (from the export modal) and export only the chosen fields.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
react/src/components/UserResourcePolicyList.tsx Switches CSV export trigger to BAITable exportSettings and exports selected fields.
react/src/components/ProjectResourcePolicyList.tsx Same migration to BAITable export UI with selected-field export.
react/src/components/KeypairResourcePolicyList.tsx Same migration to BAITable export UI with selected-field export.

Comment thread react/src/components/UserResourcePolicyList.tsx
Comment thread react/src/components/ProjectResourcePolicyList.tsx
Comment thread react/src/components/KeypairResourcePolicyList.tsx
@ironAiken2 ironAiken2 force-pushed the 05-12-fix_fr-2824_move_csv_export_to_baitable_bottom-right_in_resource_policy_lists branch 2 times, most recently from da35478 to 70c7151 Compare May 14, 2026 06:55
Copy link
Copy Markdown
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 15, 2026

Merge activity

…licy lists (#7366)

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)
@graphite-app graphite-app Bot force-pushed the 05-12-fix_fr-2824_move_csv_export_to_baitable_bottom-right_in_resource_policy_lists branch from 70c7151 to 496ceb9 Compare May 15, 2026 05:54
@graphite-app graphite-app Bot closed this in 496ceb9 May 15, 2026
@graphite-app graphite-app Bot merged commit 496ceb9 into main May 15, 2026
12 checks passed
@graphite-app graphite-app Bot deleted the 05-12-fix_fr-2824_move_csv_export_to_baitable_bottom-right_in_resource_policy_lists branch May 15, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants