Skip to content

feat(FR-3357): surface failed users via bulk-error modal in RBAC user assignment#8363

Open
ironAiken2 wants to merge 1 commit into
07-23-feat_fr-3355_show_no_changes_made_message_on_no-op_rbac_permission_savefrom
07-23-feat_fr-3357_surface_failed_users_via_bulk-error_modal_in_rbac_user_assignment
Open

feat(FR-3357): surface failed users via bulk-error modal in RBAC user assignment#8363
ironAiken2 wants to merge 1 commit into
07-23-feat_fr-3355_show_no_changes_made_message_on_no-op_rbac_permission_savefrom
07-23-feat_fr-3357_surface_failed_users_via_bulk-error_modal_in_rbac_user_assignment

Conversation

@ironAiken2

@ironAiken2 ironAiken2 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Resolves #8362 (FR-3357)

Stacked on #8360 (FR-3355) → #8302 (FR-3334).

Summary

RBAC role user assignment reported partial failures of adminBulkAssignRole as a warning toast plus one persistent notification per failed user, and closed the assign modal unconditionally — the user lost the context of which users failed. This aligns the assignment flow with FR-3334's partial-failure UX.

AssignRoleModal

  • Owns the bulk-assign mutation now (moved from RoleAssignmentTab), reporting back via onRequestClose(success) — the same contract as RoleScopePermissionEditModal. The parent only opens/closes the modal and refetches on success.
  • On partial failure the modal stays open. Successfully assigned users are deselected; only the failed users remain in the select, so pressing Assign again retries exactly what failed.
  • The select shows an error border via an empty-string field error (form.setFields with errors: ['']) — error status without a printed message. Changing the selection revalidates the required rule and clears the border.
  • The shared BAIBulkErrorModal lists each failure (user email + server error message) on top of the assign modal. A wholly-rejected request counts every requested user as failed, with the message unwrapped by the shared reasonMessage helper.
  • Cancel after a partial success reports success=true so the parent still refetches — some assignments reached the backend.
  • Failed-user labels are resolved from an accumulated map of every option selected so far (the options list only holds the current search results, so failed users may no longer be in it when the failure arrives).

Supporting changes

  • reasonMessage moved from RoleScopePermissionEditModal to react/src/helper/mutationError.ts and is now shared by both modals.
  • The bulk-assign mutation, handleBulkAssign, and its per-user upsertNotification fallout removed from RoleAssignmentTab (the revoke flow is unchanged and out of scope).
  • New i18n key rbac.UserAssignmentsPartialFailureDescription ("Some user assignments failed. Please check the items.") added to all 21 languages, mirroring FR-3334's PermissionsPartialFailureDescription copy. rbac.BulkAssignPartialFailure is kept — still used by ProjectAdminSettingModal.

How to test

The test server 10.82.0.151 is configured so that bulk RBAC requests always fail — use it to reproduce the partial-failure UX:

  1. Point the WebUI at 10.82.0.151, open RBAC management → a role's detail drawer → Assignments tab → Assign User.
  2. Select several users and click Assign → the modal stays open, the select keeps the failed users with a red border, and the bulk-error modal lists one row per failed user with the server message.
  3. Close the error modal and change the selection → the red border clears. Assign again → only the remaining users are re-submitted.
  4. On a normal backend, full success behaves as before: success message, modal closes, table refetches.

Verification

bash scripts/verify.sh → === ALL PASS === (Relay / Lint / Format / TypeScript / Vite warmup)

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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.

@ironAiken2
ironAiken2 marked this pull request as ready for review July 23, 2026 09:29
Copilot AI review requested due to automatic review settings July 23, 2026 09:29
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 7.06% 2140 / 30304
🔵 Statements 5.8% 2443 / 42113
🔵 Functions 6.09% 355 / 5820
🔵 Branches 3.83% 1517 / 39571
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/AssignRoleModal.tsx 0% 0% 0% 0% 46-302
react/src/components/RoleAssignmentTab.tsx 0% 0% 0% 0% 48-369
react/src/components/RoleScopePermissionEditModal.tsx 0% 0% 0% 0% 52-877
react/src/helper/mutationError.ts 0% 0% 0% 0% 11-27
Generated in workflow #3142 for commit 032bb76 by the Vitest Coverage Report Action

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves RBAC bulk user assignment by preserving failed users for retry and displaying per-user errors.

Changes:

  • Moves assignment mutation handling into AssignRoleModal.
  • Adds retry-preserving partial-failure UX and shared error formatting.
  • Adds localized partial-failure descriptions across 21 locales.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
react/src/components/AssignRoleModal.tsx Implements assignment and partial-failure handling.
react/src/components/RoleAssignmentTab.tsx Delegates assignment ownership to the modal.
react/src/components/RoleScopePermissionEditModal.tsx Uses the shared mutation error helper.
react/src/helper/mutationError.ts Extracts mutation rejection message formatting.
react/src/__generated__/AssignRoleModalBulkAssignMutation.graphql.ts Renames the generated Relay mutation artifact.
resources/i18n/de.json Adds German failure guidance.
resources/i18n/el.json Adds Greek failure guidance.
resources/i18n/en.json Adds English failure guidance.
resources/i18n/es.json Adds Spanish failure guidance.
resources/i18n/fi.json Adds Finnish failure guidance.
resources/i18n/fr.json Adds French failure guidance.
resources/i18n/id.json Adds Indonesian failure guidance.
resources/i18n/it.json Adds Italian failure guidance.
resources/i18n/ja.json Adds Japanese failure guidance.
resources/i18n/ko.json Adds Korean failure guidance.
resources/i18n/mn.json Adds Mongolian failure guidance.
resources/i18n/ms.json Adds Malay failure guidance.
resources/i18n/pl.json Adds Polish failure guidance.
resources/i18n/pt-BR.json Adds Brazilian Portuguese failure guidance.
resources/i18n/pt.json Adds Portuguese failure guidance.
resources/i18n/ru.json Adds Russian failure guidance.
resources/i18n/th.json Adds Thai failure guidance.
resources/i18n/tr.json Adds Turkish failure guidance.
resources/i18n/vi.json Adds Vietnamese failure guidance.
resources/i18n/zh-CN.json Adds Simplified Chinese failure guidance.
resources/i18n/zh-TW.json Adds Traditional Chinese failure guidance.

Comment thread react/src/components/AssignRoleModal.tsx
… assignment

Move the bulk-assign mutation into AssignRoleModal: on partial failure the
modal stays open, successfully assigned users are deselected so only the
failed users remain (select marked with an error border via a field error),
and the shared BAIBulkErrorModal lists each failure for retry. Cancel after
a partial success still reports success=true so the parent refetches.
reasonMessage moves to helper/mutationError for reuse.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ironAiken2
ironAiken2 force-pushed the 07-23-feat_fr-3357_surface_failed_users_via_bulk-error_modal_in_rbac_user_assignment branch from 43810b3 to 032bb76 Compare July 23, 2026 10:56
@ironAiken2
ironAiken2 force-pushed the 07-23-feat_fr-3355_show_no_changes_made_message_on_no-op_rbac_permission_save branch from 0220dbd to 2880152 Compare July 23, 2026 10:56
@ironAiken2
ironAiken2 requested a review from nowgnuesLee July 23, 2026 11:06
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.

2 participants