Skip to content

Move user profile menu items to navbar classbase#28431

Open
karanh37 wants to merge 1 commit into
mainfrom
user-profile-icon-classbase-menus
Open

Move user profile menu items to navbar classbase#28431
karanh37 wants to merge 1 commit into
mainfrom
user-profile-icon-classbase-menus

Conversation

@karanh37
Copy link
Copy Markdown
Contributor

Description

  • Move UserProfileIcon dropdown menu item construction into NavbarUtilClassBase
  • Add a dedicated UserProfileIcon.interface.ts for menu item prop types
  • Keep UserProfileIcon responsible for state and JSX render fragments only

Tests

  • PATH="/Users/deuex/.nvm/versions/node/v22.17.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/Users/deuex/.codex/tmp/arg0/codex-arg0lDw3Zx:/Users/deuex/.antigravity/antigravity/bin:/Users/deuex/.nvm/versions/node/v22.22.2/bin:/Users/deuex/Library/Application Support/com.conductor.app/./bin" yarn test src/components/Settings/Users/UserProfileIcon/UserProfileIcon.test.tsx src/utils/NavbarUtilClassBase.test.tsx --runInBand
  • organize-imports-cli, eslint --fix, prettier --write on touched UI files

Copilot AI review requested due to automatic review settings May 26, 2026 08:24
@karanh37 karanh37 requested a review from a team as a code owner May 26, 2026 08:24
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels May 26, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 26, 2026

Code Review ✅ Approved

Refactors UserProfileIcon to delegate menu item construction to NavbarUtilClassBase, improving separation of concerns. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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 refactors the User Profile dropdown menu construction by moving menu item generation into NavbarUtilClassBase, leaving UserProfileIcon focused on state management and rendering.

Changes:

  • Added NavbarUtilClassBase.getUserProfileIconMenuItems() and getUserProfileIconDefaultOpenKeys() to centralize User Profile dropdown menu configuration.
  • Introduced UserProfileIcon.interface.ts to hold shared prop/type definitions for menu item construction.
  • Simplified UserProfileIcon.component.tsx by delegating menu item creation to NavbarUtilClassBase.

Reviewed changes

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

File Description
openmetadata-ui/src/main/resources/ui/src/utils/NavbarUtilClassBase.ts Adds centralized helpers for building the User Profile dropdown menu items and default open keys.
openmetadata-ui/src/main/resources/ui/src/components/Settings/Users/UserProfileIcon/UserProfileIcon.interface.ts Introduces shared typings for menu item construction inputs.
openmetadata-ui/src/main/resources/ui/src/components/Settings/Users/UserProfileIcon/UserProfileIcon.component.tsx Removes inline menu construction and delegates menu item creation to NavbarUtilClassBase.

readMoreLabelRenderer: (count: number) => ReactNode;
readMoreKey: string;
sizeLimit?: number;
itemKey: string;
Comment on lines +142 to +147
{
type: 'divider',
},
{
type: 'divider',
},
@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.16% (66470/105228) 44.07% (36464/82730) 46.24% (10809/23375)

@sonarqubecloud
Copy link
Copy Markdown

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

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants