Skip to content

Refactor identity management components#1139

Open
rasika2012 wants to merge 2 commits into
wso2:mainfrom
rasika2012:fix-relseae
Open

Refactor identity management components#1139
rasika2012 wants to merge 2 commits into
wso2:mainfrom
rasika2012:fix-relseae

Conversation

@rasika2012

@rasika2012 rasika2012 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Purpose

Issue: #1045

image

This pull request introduces significant UI and usability improvements to the group and role management pages within the identities section. The main changes focus on enhancing the user experience by adopting card-based layouts, improving visual feedback, and refactoring form sections for clarity and accessibility. Additionally, some code clean-up and formatting improvements have been made for better maintainability.

UI/UX Improvements to Group Management:

  • The group listing page (GroupsPage.tsx) now uses a card-based layout with avatars and improved hover/focus interactions, making it more visually appealing and easier to use. Action buttons (edit/delete) are only visible on hover or focus for a cleaner interface. ([[1]](https://github.com/wso2/agent-manager/pull/1139/files#diff-9ad98f6f7f423f90679f0abb6474c96df026da0951dc404bbf5b52ff9c6028c2R21-R28), [[2]](https://github.com/wso2/agent-manager/pull/1139/files#diff-9ad98f6f7f423f90679f0abb6474c96df026da0951dc404bbf5b52ff9c6028c2L35-R37), [[3]](https://github.com/wso2/agent-manager/pull/1139/files#diff-9ad98f6f7f423f90679f0abb6474c96df026da0951dc404bbf5b52ff9c6028c2R47), [[4]](https://github.com/wso2/agent-manager/pull/1139/files#diff-9ad98f6f7f423f90679f0abb6474c96df026da0951dc404bbf5b52ff9c6028c2L107-R178))
  • The group edit page (GroupEditPage.tsx) has been refactored to use Form.Section and Form.Header components, providing clearer separation of concerns and better accessibility. The "Users" and "Roles" tabs now have improved layouts, and user/role listing tables have enhanced formatting for better readability. ([[1]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L25-R25), [[2]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L206-R265), [[3]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L255-R293), [[4]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L289-R332), [[5]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L316-R367), [[6]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L353-R417))

Code Quality and Maintainability:

  • Various code formatting improvements were made for readability, such as multi-line function arguments, destructuring, and consistent use of hooks. ([[1]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L73-R74), [[2]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L100-R106), [[3]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L112-R121), [[4]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L137-R147), [[5]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L164-R182), [[6]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L185-R208))
  • Unused or redundant variables and dependencies were removed or consolidated, streamlining the logic in several components. ([[1]](https://github.com/wso2/agent-manager/pull/1139/files#diff-e9da2b26349364adfc6691a6b5e1e27597976c1c8f417763611b1e327899eba9L110-R110), [[2]](https://github.com/wso2/agent-manager/pull/1139/files#diff-e9da2b26349364adfc6691a6b5e1e27597976c1c8f417763611b1e327899eba9L144-R145), [[3]](https://github.com/wso2/agent-manager/pull/1139/files#diff-e9da2b26349364adfc6691a6b5e1e27597976c1c8f417763611b1e327899eba9L157-R159))

Consistency and Theming:

  • The use of the new Form components and removal of unnecessary Divider elements ensures a more consistent look and feel across the identities pages. ([[1]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L25-R25), [[2]](https://github.com/wso2/agent-manager/pull/1139/files#diff-d4cfff5662069ea3f58ddc76609c36fd1cdefc8406387696e35265506149e7f0L28-R28))
  • Typography and spacing have been standardized for better alignment with the overall design system. ([[1]](https://github.com/wso2/agent-manager/pull/1139/files#diff-9ad98f6f7f423f90679f0abb6474c96df026da0951dc404bbf5b52ff9c6028c2L107-R178), [[2]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L206-R265), [[3]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L255-R293), [[4]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L289-R332), [[5]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L316-R367), [[6]](https://github.com/wso2/agent-manager/pull/1139/files#diff-46ed2ffe6f156ff7881b7c621402ce259751ce3f6a1a724b6754384acd21c975L353-R417))

Minor Improvements and Refactoring:

  • Helper functions and constants related to permissions in RoleEditPage.tsx were reformatted for readability. ([console/workspaces/pages/identities/src/RoleEditPage.tsxL62-R65](https://github.com/wso2/agent-manager/pull/1139/files#diff-d4cfff5662069ea3f58ddc76609c36fd1cdefc8406387696e35265506149e7f0L62-R65))

These changes collectively provide a more modern, accessible, and maintainable experience for managing groups and roles in the application.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter �N/A� plus brief explanation of why there�s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type �Sent� when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type �N/A� and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

Summary by CodeRabbit

  • Style

    • Redesigned identity management pages with consistent, modern form layouts using Form sections/headers.
    • Switched users, groups, and roles tables to card-based layouts with avatar-first-character visuals.
    • Updated skeleton loaders to align with the new card/table presentation.
  • UI/UX

    • Improved row-level Edit/Delete action visibility: buttons now appear only on hover/focus with fade transitions.
    • Refined empty/placeholder text to use an em dash where applicable.
    • In environment cards, inactive-environment actions now show only when a successful build exists.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Two independent areas are updated: (1) PromoteAgentDrawer refactors its hook calls, renames the target-config success flag to targetConfigLoaded, and updates pre-fill dependencies; EnvironmentCard adjusts inactive-environment action display and alert structure. (2) Identities pages adopt card-variant tables with per-row Avatar and hover-triggered FadeIn action buttons; edit pages replace Box/Divider layouts with Form.Section/Header/ElementWrapper; RoleEditPage expands data fetching and introduces controlled permission selection.

Changes

Deployment UI fixes

Layer / File(s) Summary
PromoteAgentDrawer pre-fill and hook refactoring
console/workspaces/pages/deploy/src/subComponent/PromoteAgentDrawer.tsx
Hook calls and destructuring are reformatted; useGetAgentConfigurations isSuccess alias is renamed to targetConfigLoaded; the pre-fill useEffect updates its guard and dependency list to explicitly use targetConfigLoaded, targetConfigs, and filledForTarget. JSX formatting is updated across the configuration switch, environment variables section, editors, and footer button.
EnvironmentCard inactive status and alert refactoring
console/workspaces/libs/shared-component/src/components/EnvironmentCard/EnvironmentCard.tsx
Wrench icon import is removed; latestKindVersion selection is reformatted; error-state status rendering passes deployment status directly to EnvStatus; inactive-environment action switches from a ternary to conditional render, removing the "Go to Build" button when hasSuccessfulBuild is false; the "Deployment failed" alert is refactored to multiline structure.

Identities UI card variant and Form refactor

Layer / File(s) Summary
Listing pages: card variant, Avatar, and hover-driven actions
console/workspaces/pages/identities/src/UsersPage.tsx, GroupsPage.tsx, RolesPage.tsx, components/ListingSkeletonRows.tsx
Each listing page adds hoveredId state, switches ListingTable to variant="card" inside disablePaper containers, renders per-row Avatars with the first character of the name, and replaces always-visible action buttons with hover/focus-event-driven FadeIn-wrapped conditional buttons. ListingSkeletonRows row variant and cell layout are updated to match, replacing circular skeleton placeholders with a horizontal avatar/text skeleton stack.
Edit pages: Form.Section/Header/ElementWrapper adoption
console/workspaces/pages/identities/src/UserEditPage.tsx, GroupEditPage.tsx, RoleEditPage.tsx
Tab content layouts replace Box/Divider/Typography patterns with Form.Section, Form.Header, Form.Stack, and Form.ElementWrapper. RoleEditPage additionally expands hook usage to separately fetch all users, all groups, and the permission catalog; adds a catalogGroups memo; and initializes selectedPermissions from server data on first load. Hook declarations, memos, and path-generation calls are reformatted for clarity across all edit pages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~28 minutes

Possibly related PRs

  • wso2/agent-manager#1097: Both PRs modify ListingSkeletonRows.tsx and the users/groups/roles listing page skeleton rendering to align with table presentation changes.
  • wso2/agent-manager#1134: Also modifies PromoteAgentDrawer.tsx's target-environment configuration fetching and pre-fill state tracking with targetConfigs and filledForTarget.

Suggested reviewers

  • RAVEENSR
  • lashinijay

Poem

🐇 A rabbit hopped through listing rows,
Hiding buttons till a hover shows,
With Avatar ears and cards so neat,
Form.Section makes the layout sweet,
targetConfigs pre-fills with care —
No isSuccess flags left anywhere! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description provides a detailed Purpose section with issue reference and screenshot, explaining the UI/UX improvements comprehensively. However, most required template sections (Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, and Learning) are left as unfilled template placeholders or marked with '>'. Only Purpose is substantively completed. Complete the remaining required sections of the description template, particularly Goals, Release note, Documentation, Automation tests (with test coverage details), Security checks, and Test environment to provide comprehensive PR documentation.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Refactor identity management components' accurately summarizes the main objective of the PR, which focuses on refactoring group and role management pages. However, it is somewhat generic and does not convey the specific UI/UX improvements (card-based layouts, hover interactions) that are central to the changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@console/workspaces/pages/deploy/src/subComponent/PromoteAgentDrawer.tsx`:
- Around line 143-145: The early return on line 144 when !cfg is true (target
has no existing configuration) prevents state from being updated, causing stale
env and files from a previous target to remain in the form. Instead of just
returning when !cfg is true in this conditional check, you must reset the form
state (specifically the env and files fields) to empty/default values before
returning or conditionally updating them. This ensures that when users switch to
a target with no configuration, the form properly reflects the empty state
rather than carrying over data from the previously selected target. The same fix
applies to the additional locations mentioned around lines 156-159.

In `@console/workspaces/pages/identities/src/GroupsPage.tsx`:
- Around line 133-137: The onBlur handler in the row container is immediately
clearing the hovered state when focus moves between child elements, which causes
row actions to disappear during keyboard navigation. Modify the onBlur handler
to check whether focus is moving to another element within the same row group
using event.relatedTarget. Only clear the hovered ID if the focus is moving
completely outside the row container. This will keep the row actions visible
while keyboard users tab through the child controls within that row.

In `@console/workspaces/pages/identities/src/RolesPage.tsx`:
- Around line 129-133: The row's onBlur handler clears hoveredId whenever focus
leaves the row element itself, even if focus moves to child action elements
within the same row, causing the actions to unmount during keyboard navigation.
To fix this, use a ref on the row container and modify the onBlur handler to
check if the relatedTarget (the element receiving focus) is still within the
row's DOM tree using contains() method. Only clear hoveredId if the
relatedTarget is null or outside the row container, allowing focus to move
between action buttons within the row without unmounting them.

In `@console/workspaces/pages/identities/src/UsersPage.tsx`:
- Around line 151-155: The row's onBlur handler clears hoveredId immediately
when focus leaves the row element, even if focus is moving to action buttons
within that row, which unmounts the actions and breaks keyboard navigation.
Modify the onBlur handler (and the similar one mentioned at lines 181-196) to
check whether the newly focused element is a child of the row's action button
container before clearing hoveredId. If the new focus target is within the row's
actions, do not clear hoveredId so that keyboard users can continue navigating
between action buttons without the actions disappearing mid-traversal.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9dbaaeed-42a8-47f1-9965-60bdb6dcb3d7

📥 Commits

Reviewing files that changed from the base of the PR and between 6cf2ac1 and 504973d.

📒 Files selected for processing (8)
  • console/workspaces/pages/deploy/src/subComponent/PromoteAgentDrawer.tsx
  • console/workspaces/pages/identities/src/GroupEditPage.tsx
  • console/workspaces/pages/identities/src/GroupsPage.tsx
  • console/workspaces/pages/identities/src/RoleEditPage.tsx
  • console/workspaces/pages/identities/src/RolesPage.tsx
  • console/workspaces/pages/identities/src/UserEditPage.tsx
  • console/workspaces/pages/identities/src/UsersPage.tsx
  • console/workspaces/pages/identities/src/components/ListingSkeletonRows.tsx

Comment thread console/workspaces/pages/deploy/src/subComponent/PromoteAgentDrawer.tsx Outdated
Comment thread console/workspaces/pages/identities/src/GroupsPage.tsx Outdated
Comment thread console/workspaces/pages/identities/src/RolesPage.tsx Outdated
Comment thread console/workspaces/pages/identities/src/UsersPage.tsx Outdated

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
console/workspaces/libs/shared-component/src/components/EnvironmentCard/EnvironmentCard.tsx (1)

377-392: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Migrate changed action/alert components to Oxygen UI in this console module.

These updated sections still use MUI component surface (Button/Alert) in a console/** file. Please switch these usages (and their imports) to @wso2/oxygen-ui to keep design-system consistency.

As per coding guidelines, console/**/*.{ts,tsx,js,jsx} must import components from @wso2/oxygen-ui, never directly from @mui/material.

Also applies to: 400-420

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@console/workspaces/libs/shared-component/src/components/EnvironmentCard/EnvironmentCard.tsx`
around lines 377 - 392, Replace the MUI Button component with the Oxygen UI
Button component in the EnvironmentCard.tsx file. Update the import statement to
import Button from `@wso2/oxygen-ui` instead of `@mui/material`, and verify that the
Button component used in the conditional block around line 377-392 (and the
additional instances mentioned in lines 400-420) are now using the imported
Oxygen UI Button. Ensure all Button usages throughout the file follow the
console module coding guideline of importing components from `@wso2/oxygen-ui`
rather than directly from MUI.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@console/workspaces/libs/shared-component/src/components/EnvironmentCard/EnvironmentCard.tsx`:
- Around line 377-392: Replace the MUI Button component with the Oxygen UI
Button component in the EnvironmentCard.tsx file. Update the import statement to
import Button from `@wso2/oxygen-ui` instead of `@mui/material`, and verify that the
Button component used in the conditional block around line 377-392 (and the
additional instances mentioned in lines 400-420) are now using the imported
Oxygen UI Button. Ensure all Button usages throughout the file follow the
console module coding guideline of importing components from `@wso2/oxygen-ui`
rather than directly from MUI.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 162eae59-b1a9-4d62-af9a-e5d9d40bd1b1

📥 Commits

Reviewing files that changed from the base of the PR and between 504973d and 746cfab.

📒 Files selected for processing (9)
  • console/workspaces/libs/shared-component/src/components/EnvironmentCard/EnvironmentCard.tsx
  • console/workspaces/pages/deploy/src/subComponent/PromoteAgentDrawer.tsx
  • console/workspaces/pages/identities/src/GroupEditPage.tsx
  • console/workspaces/pages/identities/src/GroupsPage.tsx
  • console/workspaces/pages/identities/src/RoleEditPage.tsx
  • console/workspaces/pages/identities/src/RolesPage.tsx
  • console/workspaces/pages/identities/src/UserEditPage.tsx
  • console/workspaces/pages/identities/src/UsersPage.tsx
  • console/workspaces/pages/identities/src/components/ListingSkeletonRows.tsx
🚧 Files skipped from review as they are similar to previous changes (7)
  • console/workspaces/pages/identities/src/components/ListingSkeletonRows.tsx
  • console/workspaces/pages/identities/src/GroupsPage.tsx
  • console/workspaces/pages/identities/src/UsersPage.tsx
  • console/workspaces/pages/identities/src/UserEditPage.tsx
  • console/workspaces/pages/identities/src/GroupEditPage.tsx
  • console/workspaces/pages/identities/src/RoleEditPage.tsx
  • console/workspaces/pages/identities/src/RolesPage.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant