Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

* Changes to show all index patterns in index permission panel in role view ([#1303](https://github.com/opensearch-project/security-dashboards-plugin/issues/1303),[#1891](https://github.com/opensearch-project/security-dashboards-plugin/issues/1891))
* Added missing index permissions in the list ([#1969](https://github.com/opensearch-project/security-dashboards-plugin/issues/1969))
* Update account nav button style when nav group home enabled ([#2279](https://github.com/opensearch-project/security-dashboards-plugin/issues/2279))


### Bug Fixes
Expand Down
21 changes: 11 additions & 10 deletions public/apps/account/account-nav-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { LogoutButton } from './log-out-button';
import { resolveTenantName } from '../configuration/utils/tenant-utils';
import { getShouldShowTenantPopup, setShouldShowTenantPopup } from '../../utils/storage-utils';
import { getDashboardsInfo } from '../../utils/dashboards-info-utils';
import { LeftBottomActionButton } from '../../../../../src/core/public';
import './account-nav-button.scss';

export function AccountNavButton(props: {
Expand Down Expand Up @@ -173,15 +174,12 @@ export function AccountNavButton(props: {

// ToDo: Add aria-label and tooltip when isPlacedInLeftNav is true
const innerElement = isPlacedInLeftNav ? (
<EuiButtonEmpty
size="xs"
flush="both"
className="accountNavButton"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we are removing this className in the the new component, should we also remove its scss file - public/apps/account/account-nav-button.scss? Or do we need to apply the same styling to this new component?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for catching that. I think we should remove this scss file if we don't need this className anymore. Let me do some investigation to confirm this.

aria-expanded={isPopoverOpen}
aria-haspopup="true"
>
<EuiAvatar name={username} size="s" />
</EuiButtonEmpty>
<LeftBottomActionButton
title={username}
icon={<EuiAvatar name={username} size="s" />}
isNavDrawerLocked$={props.coreStart.chrome.getIsNavDrawerLocked$()}
isChromeVisible$={props.coreStart.chrome.getIsVisible$()}
/>
) : (
<EuiAvatar name={username} size="m" />
);
Expand All @@ -191,7 +189,6 @@ export function AccountNavButton(props: {
<EuiPopover
data-test-subj="account-popover"
id="actionsMenu"
anchorPosition={isPlacedInLeftNav ? 'rightDown' : undefined}
button={innerElement}
isOpen={isPopoverOpen}
closePopover={() => {
Expand All @@ -201,6 +198,10 @@ export function AccountNavButton(props: {
onClick={() => {
setPopoverOpen((prevState) => !prevState);
}}
// Use buffer 0 to avoid popover move to top center of anchor
{...(isPlacedInLeftNav
? { anchorPosition: 'rightDown', buffer: 0, repositionOnScroll: true }
: {})}
>
<EuiContextMenuPanel>{contextMenuPanel}</EuiContextMenuPanel>
</EuiPopover>
Expand Down
Loading