Skip to content

feat(FR-2225): implement role assignment management with assign/revoke#5772

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke
Mar 20, 2026
Merged

feat(FR-2225): implement role assignment management with assign/revoke#5772
graphite-app[bot] merged 1 commit intomainfrom
03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke

Conversation

@ironAiken2
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 commented Mar 6, 2026

Resolves #5764(FR-2225)

Summary

  • Create RoleAssignmentTab with useFragment on Role.users sub-connection
  • Create AssignRoleModal with user search via adminUsersV2 (email search, fullName display)
  • Add adminAssignRole and adminRevokeRole mutations
  • Revoke uses modal.confirm with danger styling
  • Wire assignment tab into RoleDetailDrawerContent replacing placeholder
  • Add i18n keys: Assign, GrantedAt, SelectUser

Note: Bulk assign/revoke (adminBulkAssignRole) is implemented in a separate stacked branch (03-06-feat_add_bulk_role_assignment_mutations) for testing isolation, as it requires backend branch feat/BA-4877-bulk-role-gql.

Test plan

  • Verify Assignments tab shows assigned users with email, name, and granted date
  • Verify Add User button opens user search modal
  • Verify assigning a user shows success toast and refreshes list
  • Verify revoke button shows confirmation and removes assignment

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor Author

ironAiken2 commented Mar 6, 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
7.79% (-0.03% 🔻)
1296/16639
🔴 Branches
6.84% (-0.03% 🔻)
798/11661
🔴 Functions
5.23% (-0.03% 🔻)
244/4667
🔴 Lines
7.56% (-0.03% 🔻)
1225/16209
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / AssignRoleModal.tsx
0% 0% 0% 0%
🔴
... / RoleAssignmentTab.tsx
0% 0% 0% 0%

Test suite run success

685 tests passing in 36 suites.

Report generated by 🧪jest coverage report action from 1a8a39a

@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from 920979a to 863bf54 Compare March 6, 2026 08:24
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch from 44c0fd3 to d8ed05b Compare March 10, 2026 02:58
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from 863bf54 to 9a24eae Compare March 10, 2026 02:58
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from 9a24eae to e54711e Compare March 10, 2026 10:24
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch from d8ed05b to 89a0dbf Compare March 10, 2026 10:24
@ironAiken2 ironAiken2 marked this pull request as ready for review March 10, 2026 10:27
Copilot AI review requested due to automatic review settings March 10, 2026 10:27
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

Implements the RBAC role “Assignments” UI in the WebUI by replacing the placeholder tab content with a working assignment list and assign/revoke flows backed by new GraphQL mutations/queries.

Changes:

  • Added RoleAssignmentTab to list role assignments and revoke assignments via adminRoleAssignments + adminRevokeRole.
  • Added AssignRoleModal to search users (adminUsersV2) and assign a role via adminAssignRole.
  • Wired the new tab into RoleDetailDrawerContent and added new i18n keys (Assign, GrantedAt, SelectUser) in en/ko.

Reviewed changes

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

Show a summary per file
File Description
resources/i18n/en.json Adds new RBAC strings used by the assignment UI.
resources/i18n/ko.json Adds Korean translations for the new RBAC strings.
react/src/components/RoleDetailDrawer.tsx Passes fetchKey into drawer content to support refetch behavior.
react/src/components/RoleDetailDrawerContent.tsx Replaces placeholder Assignments tab with RoleAssignmentTab under Suspense.
react/src/components/RoleAssignmentTab.tsx New assignments table + assign/revoke mutations and confirmation flow.
react/src/components/AssignRoleModal.tsx New modal for searching/selecting a user and triggering assignment.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread react/src/components/RoleAssignmentTab.tsx
Comment thread react/src/components/RoleDetailDrawerContent.tsx
Comment thread react/src/components/RoleDetailDrawerContent.tsx
Comment thread react/src/components/AssignRoleModal.tsx
Comment thread react/src/components/RoleAssignmentTab.tsx
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from 64df86a to d38b634 Compare March 12, 2026 04:29
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch 2 times, most recently from e1c0760 to 654bac2 Compare March 12, 2026 07:24
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch 2 times, most recently from 46f0b87 to dc79fc4 Compare March 12, 2026 09:12
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch from 654bac2 to 982439f Compare March 12, 2026 09:12
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from dc79fc4 to a0b8a45 Compare March 17, 2026 05:36
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch from 982439f to 5c7eb69 Compare March 17, 2026 05:36
Comment thread react/src/components/AssignRoleModal.tsx
Comment thread react/src/components/AssignRoleModal.tsx
Comment thread react/src/components/AssignRoleModal.tsx
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch from 5c7eb69 to efd10c4 Compare March 19, 2026 06:56
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from a0b8a45 to 9c67966 Compare March 19, 2026 06:56
@ironAiken2 ironAiken2 requested a review from agatha197 March 20, 2026 02:12
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch from efd10c4 to ea7ddc9 Compare March 20, 2026 02:14
@ironAiken2 ironAiken2 force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from 9c67966 to b9c0cf2 Compare March 20, 2026 02:14
@graphite-app graphite-app Bot force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch from ea7ddc9 to a1a2768 Compare March 20, 2026 08:51
@graphite-app graphite-app Bot force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from b9c0cf2 to de84651 Compare March 20, 2026 08:52
@yomybaby yomybaby dismissed agatha197’s stale review March 20, 2026 10:00

Review feedback will be addressed collectively in #6034.

Copy link
Copy Markdown
Member

@yomybaby yomybaby left a comment

Choose a reason for hiding this comment

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

Review feedback will be addressed collectively in #6034.

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Mar 20, 2026

Merge activity

#5772)

Resolves #5764(FR-2225)

## Summary
- Create `RoleAssignmentTab` with `useFragment` on `Role.users` sub-connection
- Create `AssignRoleModal` with user search via `adminUsersV2` (email search, fullName display)
- Add `adminAssignRole` and `adminRevokeRole` mutations
- Revoke uses `modal.confirm` with danger styling
- Wire assignment tab into `RoleDetailDrawerContent` replacing placeholder
- Add i18n keys: Assign, GrantedAt, SelectUser

> Note: Bulk assign/revoke (`adminBulkAssignRole`) is implemented in a separate stacked branch (`03-06-feat_add_bulk_role_assignment_mutations`) for testing isolation, as it requires backend branch `feat/BA-4877-bulk-role-gql`.

## Test plan
- [ ] Verify Assignments tab shows assigned users with email, name, and granted date
- [ ] Verify Add User button opens user search modal
- [ ] Verify assigning a user shows success toast and refreshes list
- [ ] Verify revoke button shows confirmation and removes assignment

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app Bot force-pushed the 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs branch from a1a2768 to 35e2efa Compare March 20, 2026 10:08
@graphite-app graphite-app Bot force-pushed the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch from de84651 to 1a8a39a Compare March 20, 2026 10:08
Base automatically changed from 03-06-feat_fr-2224_add_role_delete_and_purge_with_confirmation_dialogs to main March 20, 2026 10:20
@graphite-app graphite-app Bot merged commit 1a8a39a into main Mar 20, 2026
8 checks passed
@graphite-app graphite-app Bot deleted the 03-06-feat_fr-2225_implement_role_assignment_management_with_assign_revoke branch March 20, 2026 10:21
graphite-app Bot pushed a commit that referenced this pull request Mar 24, 2026
## Summary

Resolve review feedback from RBAC stack PRs (#5767 ~ #5891) raised by @nowgnuesLee and @agatha197.

### Round 1 — Resolved Feedback

| Source PR | Reviewer | Issue | Resolution |
|-----------|----------|-------|------------|
| #5767 | @nowgnuesLee | Remove unnecessary Suspense wrapping around RoleNodes | Removed `<Suspense>` — RoleNodes uses `useFragment` only |
| #5767 | @nowgnuesLee | Override actions column pattern | Added `customizeColumns` prop to RoleNodes |
| #5769 | @nowgnuesLee | `onClickEdit` position — should not be managed at Page level | Moved edit modal into `RoleDetailDrawer` |
| #5769 | @nowgnuesLee | Null/missing value handling in RoleDetailDrawerContent | Added null fallbacks for `source` and `status` |
| #5770 | @nowgnuesLee | RoleFormModal(edit) position — should be inside Drawer | RoleFormModal now rendered inside `RoleDetailDrawerInner` |
| #5772 | @agatha197 | Modal closes on outside click | Added `maskClosable={false}` to AssignRoleModal |
| #5772 | @agatha197 | Full Name filter not working in user search | Added client-side `filterOption` |
| #5772 | @agatha197 | Danger button hover shows blue border | Added `danger` prop to bulk revoke button |
| #5773 | @nowgnuesLee | Mutation handling pattern in CreatePermissionModal | Fixed Promise resolve/reject pattern |
| #5773 | @nowgnuesLee | Use BAISelect instead of antd Select | Replaced in CreatePermissionModal |
| #5778 | Copilot | i18n interpolation variables translated | Fixed back to `{{total}}`, `{{name}}` |
| #5778 | Copilot | `rbac.RoleDeleted` key unused | Removed from all 19 language files |
| #5782 | @nowgnuesLee | `onAssign` separate prop pattern | Replaced with `onRequestClose` pattern |
| #5890 | @nowgnuesLee | Select prop passing pattern inconsistent | Unified `{...selectProps}` spread |

### Round 2 — Resolved Feedback

| Source PR | Reviewer | Issue | Resolution |
|-----------|----------|-------|------------|
| #5891 | @agatha197 | "Deleted" vs "Inactive" terminology mismatch | Unified to "Inactive" in `RoleDetailDrawerContent` |
| #5891 | @agatha197 | Search text not clearing on select | Added `setSearch('')` in `onChange` |
| #5891 | @agatha197 | CreatePermissionModal/RoleFormModal close on outside click | Added `maskClosable={false}` |
| #5889 | @nowgnuesLee | BAIDeploymentSelect can't show name when value is pre-set | Added `deployment(id:)` ValueQuery |
| #5767 | @agatha197 | Popconfirm placement="left" | Intentional — right-fixed column |
| #5891 | @agatha197 | Version controlling | Route guard `supports('rbac')` already present |
| #5768 | @nowgnuesLee | Duplicate role names | `isDuplicateError()` implemented; backend constraint TBD |
| #5773 | @nowgnuesLee | Error on RoleDetailDrawer open | Backend error — fix requested |
| #5891 | @agatha197 | Admin role detail panel not working | Backend error — fix requested |

### Round 3 — Resolved Feedback (PR #6034 review)

| # | File | Reviewer | Issue | Resolution |
|---|------|----------|-------|------------|
| 1 | AssignRoleModal.tsx | copilot | `filterOption` won't match full-name (server filters email only) | Removed `filterOption`, set `filterOption={false}` |
| 2 | AssignRoleModal.tsx | @nowgnuesLee | Deprecated props | Removed deprecated `filterOption` callback |
| 3 | AssignRoleModal.tsx | @nowgnuesLee | Use BAISelect | Replaced antd `Select` with `BAISelect` |
| 4 | RoleNodes.tsx | @nowgnuesLee | `order` prop override unnecessary | Removed — inherited from BAITableProps |
| 5 | RoleNodes.tsx | @nowgnuesLee | Control column should be in RBACManagementPage | Moved via `customizeColumns` |
| 6 | RoleNodes.tsx | @nowgnuesLee | Use `fixed: 'left'` | Applied in RBACManagementPage control column |
| 7 | RoleNodes.tsx | @nowgnuesLee | Activate/purge in RBACManagementPage | Moved via `customizeColumns` |
| 8 | RoleDetailDrawer.tsx | @nowgnuesLee | Use `size` instead of deprecated `width` | Changed to `size="large"` |
| 9 | RoleDetailDrawer.tsx | @nowgnuesLee | Show error instead of null when data missing | Shows `Alert` with warning message |
| 10 | RoleAssignmentTab.tsx | @nowgnuesLee | Add `borderColor` to bulk revoke button | Added `borderColor: token.colorBorder` |
| 11 | CreatePermissionModal.tsx | @nowgnuesLee | Why keep Promise pattern? | Explained: bridges Relay callback API with BAIModal Promise-based `onOk` |

### Verification

```
=== Relay: PASS ===
=== Lint: PASS ===
=== Format: PASS ===
=== TypeScript: PASS ===
=== ALL PASS ===
```

## Test plan

- [ ] Role list page loads correctly, control column renders via customizeColumns
- [ ] Deactivate/activate/purge actions work from RBACManagementPage control column
- [ ] Role detail drawer opens with `size="large"`, shows Alert on missing data
- [ ] Edit modal opens correctly inside drawer
- [ ] AssignRoleModal uses BAISelect, search clears on selection, no outside-click close
- [ ] CreatePermissionModal and RoleFormModal don't close on outside click
- [ ] RoleDetailDrawer shows "Inactive" for deactivated roles
- [ ] BAIDeploymentSelect shows deployment name when editing existing permission
- [ ] Bulk revoke button has correct border color

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RBAC UI: Role assignment management (users)

4 participants