diff --git a/webapp/packages/core-connections/src/locales/en.ts b/webapp/packages/core-connections/src/locales/en.ts index 0055a1e907..f90d027f4b 100644 --- a/webapp/packages/core-connections/src/locales/en.ts +++ b/webapp/packages/core-connections/src/locales/en.ts @@ -39,7 +39,7 @@ export default [ ['connections_connection_access_grant', 'Grant'], ['connections_connection_access_edit', 'Edit'], ['connections_connection_access_cloud_placeholder', 'Cloud connections are visible to all users. Access management can be configured in "AWS Management Console".'], - ['connections_connection_access_empty_table_placeholder', 'There are no items yet. Press edit button to grant role or user.'], + ['connections_connection_access_empty_table_placeholder', 'There are no items yet. Press Edit button to grant role or user.'], ['connections_connection_access_filter_placeholder', 'Search for user or role name'], ['connections_connection_access_filter_no_result', 'No results have been found.'], ['connections_connection_access_admin_info', 'Administators see all connections.'], diff --git a/webapp/packages/plugin-authentication/src/UserInfo.tsx b/webapp/packages/plugin-authentication/src/UserInfo.tsx index 1cda1ef094..990ef573b8 100644 --- a/webapp/packages/plugin-authentication/src/UserInfo.tsx +++ b/webapp/packages/plugin-authentication/src/UserInfo.tsx @@ -6,7 +6,9 @@ * you may not use this file except in compliance with the License. */ +import { computed } from 'mobx'; import { observer } from 'mobx-react-lite'; +import { useMemo } from 'react'; import styled, { css } from 'reshadow'; import { topMenuStyles } from '@cloudbeaver/core-app'; @@ -42,17 +44,41 @@ export const UserInfo = observer(function UserInfo() { const authInfoService = useService(AuthInfoService); const style = useStyles(styles, userMenuStyles); + const { panel, hidden } = useMemo( + () => { + const panel = userMenuService.getMenu(); + const hidden = computed(() => !panel.menuItems.length + || panel.menuItems.every(item => item.isHidden)); + + return { panel, hidden }; + }, + [userMenuService] + ); + if (!authInfoService.userInfo) { return null; } - return styled(style)( - + const userName = authInfoService.userInfo.displayName || authInfoService.userInfo.userId; + + if (hidden.get()) { + return styled(style)( - {authInfoService.userInfo.displayName || authInfoService.userInfo.userId} + {userName} + + ); + } + + return styled(style)( + + + + + + {userName} ); diff --git a/webapp/packages/plugin-authentication/src/UserMenu/userMenuStyles.ts b/webapp/packages/plugin-authentication/src/UserMenu/userMenuStyles.ts index d320ffcada..b8758910c0 100644 --- a/webapp/packages/plugin-authentication/src/UserMenu/userMenuStyles.ts +++ b/webapp/packages/plugin-authentication/src/UserMenu/userMenuStyles.ts @@ -10,7 +10,7 @@ import { css } from 'reshadow'; export const userMenuStyles = css` MenuTrigger { - padding: 0 16px !important; + padding: 0 !important; height: 48px; cursor: pointer; background: none;