mirror of https://github.com/apache/superset.git
feat: allow user to view their profile again (#11816)
This commit is contained in:
parent
07288789e2
commit
f2d9f00013
|
@ -46,6 +46,7 @@ interface NavBarProps {
|
|||
user_info_url: string;
|
||||
user_login_url: string;
|
||||
user_logout_url: string;
|
||||
user_profile_url: string | null;
|
||||
locale: string;
|
||||
}
|
||||
|
||||
|
@ -195,8 +196,15 @@ export function Menu({
|
|||
{!navbarRight.user_is_anonymous && [
|
||||
<DropdownMenu.Divider key="user-divider" />,
|
||||
<DropdownMenu.ItemGroup key="user-section" title={t('User')}>
|
||||
<DropdownMenu.Item key="profile">
|
||||
<a href={navbarRight.user_info_url}>{t('Profile')}</a>
|
||||
{navbarRight.user_profile_url && (
|
||||
<DropdownMenu.Item key="profile">
|
||||
<a href={navbarRight.user_profile_url}>
|
||||
{t('Profile')}
|
||||
</a>
|
||||
</DropdownMenu.Item>
|
||||
)}
|
||||
<DropdownMenu.Item key="info">
|
||||
<a href={navbarRight.user_info_url}>{t('Info')}</a>
|
||||
</DropdownMenu.Item>
|
||||
<DropdownMenu.Item key="logout">
|
||||
<a href={navbarRight.user_logout_url}>{t('Logout')}</a>
|
||||
|
|
|
@ -106,7 +106,8 @@
|
|||
<i class="fa fa-user"></i> <b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{appbuilder.get_url_for_userinfo}}"><span class="fa fa-fw fa-user"></span>{{_("Profile")}}</a></li>
|
||||
<li><a href="/superset/profile/{{g.user.username}}"><span class="fa fa-fw fa-user"></span>{{_("Profile")}}</a></li>
|
||||
<li><a href="{{appbuilder.get_url_for_userinfo}}"><span class="fa fa-fw fa-user"></span>{{_("Info")}}</a></li>
|
||||
<li><a href="{{appbuilder.get_url_for_logout}}"><span class="fa fa-fw fa-sign-out"></span>{{_("Logout")}}</a></li>
|
||||
{% if version_string or version_sha %}
|
||||
<li class="fineprint">
|
||||
|
|
|
@ -297,6 +297,9 @@ def menu_data() -> Dict[str, Any]:
|
|||
"user_info_url": appbuilder.get_url_for_userinfo,
|
||||
"user_logout_url": appbuilder.get_url_for_logout,
|
||||
"user_login_url": appbuilder.get_url_for_login,
|
||||
"user_profile_url": None
|
||||
if g.user.is_anonymous
|
||||
else f"/superset/profile/{g.user.username}",
|
||||
"locale": session.get("locale", "en"),
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue